@nordhealth/components 1.0.0-alpha.55 → 1.0.0-alpha.58
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/custom-elements.json +883 -883
- package/lib/Icon.js +1 -1
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.js.map +1 -1
- package/lib/bundle.js +105 -0
- package/lib/bundle.js.map +1 -0
- package/package.json +5 -5
package/custom-elements.json
CHANGED
|
@@ -1167,411 +1167,277 @@
|
|
|
1167
1167
|
},
|
|
1168
1168
|
{
|
|
1169
1169
|
"kind": "javascript-module",
|
|
1170
|
-
"path": "src/
|
|
1170
|
+
"path": "src/command-menu/CommandMenu.ts",
|
|
1171
1171
|
"declarations": [
|
|
1172
1172
|
{
|
|
1173
1173
|
"kind": "class",
|
|
1174
|
-
"description": "
|
|
1175
|
-
"name": "
|
|
1174
|
+
"description": "Command Menu allows users to navigate and use an app without\ntouching the mouse and helps them transform into “power users”\nwho can harness more advanced features far faster.",
|
|
1175
|
+
"name": "CommandMenu",
|
|
1176
1176
|
"slots": [
|
|
1177
1177
|
{
|
|
1178
|
-
"description": "
|
|
1179
|
-
"name": "
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
"description": "Optional slot that holds hint text for the input.",
|
|
1183
|
-
"name": "hint"
|
|
1184
|
-
},
|
|
1185
|
-
{
|
|
1186
|
-
"description": "Optional slot that holds error text for the input.",
|
|
1187
|
-
"name": "error"
|
|
1178
|
+
"description": "Used to replace the default footer contents.",
|
|
1179
|
+
"name": "footer"
|
|
1188
1180
|
}
|
|
1189
1181
|
],
|
|
1190
1182
|
"members": [
|
|
1191
1183
|
{
|
|
1192
1184
|
"kind": "field",
|
|
1193
|
-
"name": "
|
|
1194
|
-
"privacy": "
|
|
1195
|
-
"inheritedFrom": {
|
|
1196
|
-
"name": "FormAssociatedMixin",
|
|
1197
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1198
|
-
}
|
|
1199
|
-
},
|
|
1200
|
-
{
|
|
1201
|
-
"kind": "field",
|
|
1202
|
-
"name": "checked",
|
|
1203
|
-
"type": {
|
|
1204
|
-
"text": "boolean"
|
|
1205
|
-
},
|
|
1206
|
-
"default": "false",
|
|
1207
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
1208
|
-
"attribute": "checked"
|
|
1209
|
-
},
|
|
1210
|
-
{
|
|
1211
|
-
"kind": "method",
|
|
1212
|
-
"name": "handleChange",
|
|
1213
|
-
"privacy": "protected",
|
|
1214
|
-
"return": {
|
|
1215
|
-
"type": {
|
|
1216
|
-
"text": "void"
|
|
1217
|
-
}
|
|
1218
|
-
},
|
|
1219
|
-
"parameters": [
|
|
1220
|
-
{
|
|
1221
|
-
"name": "e",
|
|
1222
|
-
"type": {
|
|
1223
|
-
"text": "Event"
|
|
1224
|
-
}
|
|
1225
|
-
}
|
|
1226
|
-
],
|
|
1227
|
-
"inheritedFrom": {
|
|
1228
|
-
"name": "FormAssociatedMixin",
|
|
1229
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1230
|
-
}
|
|
1231
|
-
},
|
|
1232
|
-
{
|
|
1233
|
-
"kind": "field",
|
|
1234
|
-
"name": "labelSlot",
|
|
1235
|
-
"privacy": "protected",
|
|
1236
|
-
"default": "new SlotController(this, \"label\")",
|
|
1237
|
-
"inheritedFrom": {
|
|
1238
|
-
"name": "FormAssociatedMixin",
|
|
1239
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1240
|
-
}
|
|
1185
|
+
"name": "inputRef",
|
|
1186
|
+
"privacy": "private"
|
|
1241
1187
|
},
|
|
1242
1188
|
{
|
|
1243
1189
|
"kind": "field",
|
|
1244
|
-
"name": "
|
|
1245
|
-
"privacy": "
|
|
1246
|
-
"default": "new SlotController(this, \"error\")",
|
|
1247
|
-
"inheritedFrom": {
|
|
1248
|
-
"name": "FormAssociatedMixin",
|
|
1249
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1250
|
-
}
|
|
1190
|
+
"name": "listRef",
|
|
1191
|
+
"privacy": "private"
|
|
1251
1192
|
},
|
|
1252
1193
|
{
|
|
1253
1194
|
"kind": "field",
|
|
1254
|
-
"name": "
|
|
1255
|
-
"
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1260
|
-
}
|
|
1195
|
+
"name": "previousFocus",
|
|
1196
|
+
"type": {
|
|
1197
|
+
"text": "HTMLElement | undefined"
|
|
1198
|
+
},
|
|
1199
|
+
"privacy": "private"
|
|
1261
1200
|
},
|
|
1262
1201
|
{
|
|
1263
1202
|
"kind": "field",
|
|
1264
|
-
"name": "
|
|
1265
|
-
"privacy": "
|
|
1266
|
-
"default": "new
|
|
1267
|
-
"inheritedFrom": {
|
|
1268
|
-
"name": "FormAssociatedMixin",
|
|
1269
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1270
|
-
}
|
|
1203
|
+
"name": "dismissController",
|
|
1204
|
+
"privacy": "private",
|
|
1205
|
+
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
|
|
1271
1206
|
},
|
|
1272
1207
|
{
|
|
1273
1208
|
"kind": "field",
|
|
1274
|
-
"name": "
|
|
1275
|
-
"
|
|
1276
|
-
|
|
1277
|
-
},
|
|
1278
|
-
"privacy": "protected",
|
|
1279
|
-
"default": "\"input\"",
|
|
1280
|
-
"inheritedFrom": {
|
|
1281
|
-
"name": "FormAssociatedMixin",
|
|
1282
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1283
|
-
}
|
|
1209
|
+
"name": "keyboardController",
|
|
1210
|
+
"privacy": "private",
|
|
1211
|
+
"default": "new KeyboardController(this, {\n trigger: () => this.select(),\n goBack: () => this.goBack(),\n end: () => this.end(),\n start: () => this.start(),\n next: () => this.next(),\n previous: () => this.previous(),\n toggleOpen: () => this.toggleOpen(),\n })"
|
|
1284
1212
|
},
|
|
1285
1213
|
{
|
|
1286
1214
|
"kind": "field",
|
|
1287
|
-
"name": "
|
|
1215
|
+
"name": "open",
|
|
1288
1216
|
"type": {
|
|
1289
|
-
"text": "
|
|
1217
|
+
"text": "boolean"
|
|
1290
1218
|
},
|
|
1291
|
-
"
|
|
1292
|
-
"
|
|
1293
|
-
"
|
|
1294
|
-
"name": "FormAssociatedMixin",
|
|
1295
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1296
|
-
}
|
|
1219
|
+
"default": "false",
|
|
1220
|
+
"description": "Show or hide the command menu.",
|
|
1221
|
+
"attribute": "open"
|
|
1297
1222
|
},
|
|
1298
1223
|
{
|
|
1299
1224
|
"kind": "field",
|
|
1300
|
-
"name": "
|
|
1225
|
+
"name": "placeholder",
|
|
1301
1226
|
"type": {
|
|
1302
1227
|
"text": "string"
|
|
1303
1228
|
},
|
|
1304
|
-
"
|
|
1305
|
-
"
|
|
1306
|
-
"
|
|
1307
|
-
"name": "FormAssociatedMixin",
|
|
1308
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1309
|
-
}
|
|
1229
|
+
"default": "\"Type a command or search...\"",
|
|
1230
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
1231
|
+
"attribute": "placeholder"
|
|
1310
1232
|
},
|
|
1311
1233
|
{
|
|
1312
1234
|
"kind": "field",
|
|
1313
|
-
"name": "
|
|
1235
|
+
"name": "commands",
|
|
1314
1236
|
"type": {
|
|
1315
|
-
"text": "
|
|
1237
|
+
"text": "Array<ICommandMenuAction>"
|
|
1316
1238
|
},
|
|
1317
|
-
"default": "
|
|
1318
|
-
"description": "
|
|
1319
|
-
"attribute": "label",
|
|
1320
|
-
"inheritedFrom": {
|
|
1321
|
-
"name": "FormAssociatedMixin",
|
|
1322
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1323
|
-
}
|
|
1239
|
+
"default": "[]",
|
|
1240
|
+
"description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
|
|
1324
1241
|
},
|
|
1325
1242
|
{
|
|
1326
1243
|
"kind": "field",
|
|
1327
|
-
"name": "
|
|
1244
|
+
"name": "parent",
|
|
1328
1245
|
"type": {
|
|
1329
1246
|
"text": "string | undefined"
|
|
1330
1247
|
},
|
|
1331
|
-
"
|
|
1332
|
-
"attribute": "hint",
|
|
1333
|
-
"inheritedFrom": {
|
|
1334
|
-
"name": "FormAssociatedMixin",
|
|
1335
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1336
|
-
}
|
|
1248
|
+
"privacy": "private"
|
|
1337
1249
|
},
|
|
1338
1250
|
{
|
|
1339
1251
|
"kind": "field",
|
|
1340
|
-
"name": "
|
|
1252
|
+
"name": "search",
|
|
1341
1253
|
"type": {
|
|
1342
|
-
"text": "
|
|
1254
|
+
"text": "string"
|
|
1343
1255
|
},
|
|
1344
|
-
"
|
|
1345
|
-
"
|
|
1346
|
-
"attribute": "hide-label",
|
|
1347
|
-
"inheritedFrom": {
|
|
1348
|
-
"name": "FormAssociatedMixin",
|
|
1349
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1350
|
-
}
|
|
1256
|
+
"privacy": "private",
|
|
1257
|
+
"default": "\"\""
|
|
1351
1258
|
},
|
|
1352
1259
|
{
|
|
1353
1260
|
"kind": "field",
|
|
1354
|
-
"name": "
|
|
1261
|
+
"name": "bump",
|
|
1355
1262
|
"type": {
|
|
1356
|
-
"text": "
|
|
1263
|
+
"text": "boolean"
|
|
1357
1264
|
},
|
|
1358
|
-
"
|
|
1359
|
-
"
|
|
1360
|
-
"inheritedFrom": {
|
|
1361
|
-
"name": "FormAssociatedMixin",
|
|
1362
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1363
|
-
}
|
|
1265
|
+
"privacy": "private",
|
|
1266
|
+
"default": "true"
|
|
1364
1267
|
},
|
|
1365
1268
|
{
|
|
1366
1269
|
"kind": "field",
|
|
1367
|
-
"name": "
|
|
1270
|
+
"name": "selectedIndex",
|
|
1368
1271
|
"type": {
|
|
1369
|
-
"text": "
|
|
1272
|
+
"text": "number"
|
|
1370
1273
|
},
|
|
1371
|
-
"
|
|
1372
|
-
"
|
|
1373
|
-
"inheritedFrom": {
|
|
1374
|
-
"name": "FormAssociatedMixin",
|
|
1375
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1376
|
-
}
|
|
1274
|
+
"privacy": "private",
|
|
1275
|
+
"default": "0"
|
|
1377
1276
|
},
|
|
1378
1277
|
{
|
|
1379
1278
|
"kind": "field",
|
|
1380
|
-
"name": "
|
|
1279
|
+
"name": "filteredCommands",
|
|
1381
1280
|
"type": {
|
|
1382
|
-
"text": "
|
|
1281
|
+
"text": "Array<ICommandMenuAction>"
|
|
1383
1282
|
},
|
|
1384
|
-
"
|
|
1385
|
-
"
|
|
1386
|
-
"attribute": "required",
|
|
1387
|
-
"inheritedFrom": {
|
|
1388
|
-
"name": "FormAssociatedMixin",
|
|
1389
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1390
|
-
}
|
|
1283
|
+
"privacy": "private",
|
|
1284
|
+
"default": "[]"
|
|
1391
1285
|
},
|
|
1392
1286
|
{
|
|
1393
1287
|
"kind": "field",
|
|
1394
|
-
"name": "
|
|
1288
|
+
"name": "selected",
|
|
1395
1289
|
"type": {
|
|
1396
|
-
"text": "
|
|
1290
|
+
"text": "ICommandMenuAction"
|
|
1397
1291
|
},
|
|
1398
|
-
"
|
|
1399
|
-
"description": "Controls whether the input expands to fill the width of its container.",
|
|
1400
|
-
"attribute": "expand",
|
|
1401
|
-
"reflects": true,
|
|
1402
|
-
"inheritedFrom": {
|
|
1403
|
-
"name": "FormAssociatedMixin",
|
|
1404
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1405
|
-
}
|
|
1292
|
+
"privacy": "private"
|
|
1406
1293
|
},
|
|
1407
1294
|
{
|
|
1408
1295
|
"kind": "method",
|
|
1409
|
-
"name": "
|
|
1410
|
-
"privacy": "protected",
|
|
1296
|
+
"name": "show",
|
|
1411
1297
|
"parameters": [
|
|
1412
1298
|
{
|
|
1413
|
-
"name": "
|
|
1299
|
+
"name": "options",
|
|
1300
|
+
"default": "{}",
|
|
1414
1301
|
"type": {
|
|
1415
|
-
"text": "
|
|
1416
|
-
}
|
|
1302
|
+
"text": "{ parent?: string }"
|
|
1303
|
+
},
|
|
1304
|
+
"description": "allows you to open the menu filtered to a specific parent command."
|
|
1417
1305
|
}
|
|
1418
1306
|
],
|
|
1419
|
-
"
|
|
1420
|
-
"name": "FormAssociatedMixin",
|
|
1421
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1422
|
-
}
|
|
1307
|
+
"description": "Show the command menu programmatically."
|
|
1423
1308
|
},
|
|
1424
1309
|
{
|
|
1425
1310
|
"kind": "method",
|
|
1426
|
-
"name": "
|
|
1427
|
-
"
|
|
1428
|
-
"inheritedFrom": {
|
|
1429
|
-
"name": "FormAssociatedMixin",
|
|
1430
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1431
|
-
}
|
|
1311
|
+
"name": "close",
|
|
1312
|
+
"description": "Close the command menu programmatically."
|
|
1432
1313
|
},
|
|
1433
1314
|
{
|
|
1434
1315
|
"kind": "method",
|
|
1435
|
-
"name": "
|
|
1436
|
-
"
|
|
1437
|
-
"inheritedFrom": {
|
|
1438
|
-
"name": "FormAssociatedMixin",
|
|
1439
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1440
|
-
}
|
|
1316
|
+
"name": "toggleOpen",
|
|
1317
|
+
"description": "Toggle the open state programmatically."
|
|
1441
1318
|
},
|
|
1442
1319
|
{
|
|
1443
1320
|
"kind": "method",
|
|
1444
|
-
"name": "
|
|
1445
|
-
"
|
|
1446
|
-
"inheritedFrom": {
|
|
1447
|
-
"name": "FormAssociatedMixin",
|
|
1448
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1449
|
-
}
|
|
1321
|
+
"name": "focus",
|
|
1322
|
+
"description": "Focus the command menu's input."
|
|
1450
1323
|
},
|
|
1451
1324
|
{
|
|
1452
1325
|
"kind": "method",
|
|
1453
|
-
"name": "
|
|
1454
|
-
"privacy": "
|
|
1455
|
-
"inheritedFrom": {
|
|
1456
|
-
"name": "FormAssociatedMixin",
|
|
1457
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1458
|
-
}
|
|
1326
|
+
"name": "renderNoResults",
|
|
1327
|
+
"privacy": "private"
|
|
1459
1328
|
},
|
|
1460
1329
|
{
|
|
1461
|
-
"kind": "
|
|
1462
|
-
"name": "
|
|
1463
|
-
"privacy": "
|
|
1464
|
-
"
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1330
|
+
"kind": "method",
|
|
1331
|
+
"name": "renderSection",
|
|
1332
|
+
"privacy": "private",
|
|
1333
|
+
"parameters": [
|
|
1334
|
+
{
|
|
1335
|
+
"name": "section",
|
|
1336
|
+
"type": {
|
|
1337
|
+
"text": "string | undefined"
|
|
1338
|
+
}
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
"name": "commands",
|
|
1342
|
+
"type": {
|
|
1343
|
+
"text": "ICommandMenuAction[]"
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
]
|
|
1468
1347
|
},
|
|
1469
1348
|
{
|
|
1470
|
-
"kind": "
|
|
1471
|
-
"name": "
|
|
1472
|
-
"privacy": "
|
|
1473
|
-
"inheritedFrom": {
|
|
1474
|
-
"name": "FormAssociatedMixin",
|
|
1475
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1476
|
-
}
|
|
1349
|
+
"kind": "method",
|
|
1350
|
+
"name": "handleAnimationEnd",
|
|
1351
|
+
"privacy": "private"
|
|
1477
1352
|
},
|
|
1478
1353
|
{
|
|
1479
|
-
"kind": "
|
|
1480
|
-
"name": "
|
|
1481
|
-
"
|
|
1482
|
-
"text": "boolean"
|
|
1483
|
-
},
|
|
1484
|
-
"default": "false",
|
|
1485
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1486
|
-
"attribute": "disabled",
|
|
1487
|
-
"reflects": true,
|
|
1488
|
-
"inheritedFrom": {
|
|
1489
|
-
"name": "InputMixin",
|
|
1490
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1491
|
-
}
|
|
1354
|
+
"kind": "method",
|
|
1355
|
+
"name": "handleBlur",
|
|
1356
|
+
"privacy": "private"
|
|
1492
1357
|
},
|
|
1493
1358
|
{
|
|
1494
|
-
"kind": "
|
|
1495
|
-
"name": "
|
|
1496
|
-
"
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1359
|
+
"kind": "method",
|
|
1360
|
+
"name": "handleInput",
|
|
1361
|
+
"privacy": "private",
|
|
1362
|
+
"parameters": [
|
|
1363
|
+
{
|
|
1364
|
+
"name": "event",
|
|
1365
|
+
"type": {
|
|
1366
|
+
"text": "KeyboardEvent"
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
]
|
|
1505
1370
|
},
|
|
1506
1371
|
{
|
|
1507
|
-
"kind": "
|
|
1508
|
-
"name": "
|
|
1509
|
-
"
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1372
|
+
"kind": "method",
|
|
1373
|
+
"name": "select",
|
|
1374
|
+
"privacy": "private",
|
|
1375
|
+
"parameters": [
|
|
1376
|
+
{
|
|
1377
|
+
"name": "command",
|
|
1378
|
+
"default": "this.selected",
|
|
1379
|
+
"type": {
|
|
1380
|
+
"text": "ICommandMenuAction"
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
]
|
|
1519
1384
|
},
|
|
1520
1385
|
{
|
|
1521
|
-
"kind": "
|
|
1522
|
-
"name": "
|
|
1523
|
-
"privacy": "
|
|
1524
|
-
"description": "Gets the form, if any, associated with the form element.",
|
|
1525
|
-
"inheritedFrom": {
|
|
1526
|
-
"name": "InputMixin",
|
|
1527
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1528
|
-
}
|
|
1386
|
+
"kind": "method",
|
|
1387
|
+
"name": "start",
|
|
1388
|
+
"privacy": "private"
|
|
1529
1389
|
},
|
|
1530
1390
|
{
|
|
1531
|
-
"kind": "
|
|
1532
|
-
"name": "
|
|
1533
|
-
"privacy": "
|
|
1534
|
-
"inheritedFrom": {
|
|
1535
|
-
"name": "FocusableMixin",
|
|
1536
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1537
|
-
}
|
|
1391
|
+
"kind": "method",
|
|
1392
|
+
"name": "end",
|
|
1393
|
+
"privacy": "private"
|
|
1538
1394
|
},
|
|
1539
1395
|
{
|
|
1540
1396
|
"kind": "method",
|
|
1541
|
-
"name": "
|
|
1397
|
+
"name": "next",
|
|
1398
|
+
"privacy": "private"
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
"kind": "method",
|
|
1402
|
+
"name": "previous",
|
|
1403
|
+
"privacy": "private"
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
"kind": "method",
|
|
1407
|
+
"name": "goBack",
|
|
1408
|
+
"privacy": "private"
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
"kind": "method",
|
|
1412
|
+
"name": "setParent",
|
|
1413
|
+
"privacy": "private",
|
|
1542
1414
|
"parameters": [
|
|
1543
1415
|
{
|
|
1544
|
-
"name": "
|
|
1416
|
+
"name": "parent",
|
|
1545
1417
|
"optional": true,
|
|
1546
1418
|
"type": {
|
|
1547
|
-
"text": "
|
|
1548
|
-
}
|
|
1549
|
-
"description": "An object which controls aspects of the focusing process."
|
|
1419
|
+
"text": "string"
|
|
1420
|
+
}
|
|
1550
1421
|
}
|
|
1551
|
-
]
|
|
1552
|
-
"description": "Programmatically move focus to the component.",
|
|
1553
|
-
"inheritedFrom": {
|
|
1554
|
-
"name": "FocusableMixin",
|
|
1555
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1556
|
-
}
|
|
1422
|
+
]
|
|
1557
1423
|
},
|
|
1558
1424
|
{
|
|
1559
1425
|
"kind": "method",
|
|
1560
|
-
"name": "
|
|
1561
|
-
"
|
|
1562
|
-
"
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1426
|
+
"name": "setSearch",
|
|
1427
|
+
"privacy": "private",
|
|
1428
|
+
"parameters": [
|
|
1429
|
+
{
|
|
1430
|
+
"name": "str",
|
|
1431
|
+
"type": {
|
|
1432
|
+
"text": "string"
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
]
|
|
1566
1436
|
},
|
|
1567
1437
|
{
|
|
1568
1438
|
"kind": "method",
|
|
1569
|
-
"name": "
|
|
1570
|
-
"
|
|
1571
|
-
"inheritedFrom": {
|
|
1572
|
-
"name": "FocusableMixin",
|
|
1573
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1574
|
-
}
|
|
1439
|
+
"name": "filterCommands",
|
|
1440
|
+
"privacy": "private"
|
|
1575
1441
|
},
|
|
1576
1442
|
{
|
|
1577
1443
|
"kind": "field",
|
|
@@ -1588,193 +1454,148 @@
|
|
|
1588
1454
|
}
|
|
1589
1455
|
}
|
|
1590
1456
|
],
|
|
1591
|
-
"
|
|
1457
|
+
"events": [
|
|
1592
1458
|
{
|
|
1593
|
-
"name": "
|
|
1459
|
+
"name": "open",
|
|
1594
1460
|
"type": {
|
|
1595
|
-
"text": "
|
|
1461
|
+
"text": "NordEvent"
|
|
1596
1462
|
},
|
|
1597
|
-
"
|
|
1598
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
1599
|
-
"fieldName": "checked"
|
|
1463
|
+
"description": "The command menu was opened."
|
|
1600
1464
|
},
|
|
1601
1465
|
{
|
|
1602
|
-
"name": "
|
|
1466
|
+
"name": "close",
|
|
1603
1467
|
"type": {
|
|
1604
|
-
"text": "
|
|
1468
|
+
"text": "NordEvent"
|
|
1605
1469
|
},
|
|
1606
|
-
"
|
|
1607
|
-
"description": "Label for the input.",
|
|
1608
|
-
"fieldName": "label",
|
|
1609
|
-
"inheritedFrom": {
|
|
1610
|
-
"name": "FormAssociatedMixin",
|
|
1611
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1612
|
-
}
|
|
1470
|
+
"description": "The command menu was closed."
|
|
1613
1471
|
},
|
|
1614
1472
|
{
|
|
1615
|
-
"name": "hint",
|
|
1616
1473
|
"type": {
|
|
1617
|
-
"text": "
|
|
1474
|
+
"text": "SelectEvent"
|
|
1618
1475
|
},
|
|
1619
|
-
"description": "
|
|
1620
|
-
"
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
}
|
|
1625
|
-
},
|
|
1476
|
+
"description": "User selected a command from the menu.",
|
|
1477
|
+
"name": "nord-select"
|
|
1478
|
+
}
|
|
1479
|
+
],
|
|
1480
|
+
"attributes": [
|
|
1626
1481
|
{
|
|
1627
|
-
"name": "
|
|
1482
|
+
"name": "open",
|
|
1628
1483
|
"type": {
|
|
1629
1484
|
"text": "boolean"
|
|
1630
1485
|
},
|
|
1631
1486
|
"default": "false",
|
|
1632
|
-
"description": "
|
|
1633
|
-
"fieldName": "
|
|
1634
|
-
"inheritedFrom": {
|
|
1635
|
-
"name": "FormAssociatedMixin",
|
|
1636
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1637
|
-
}
|
|
1487
|
+
"description": "Show or hide the command menu.",
|
|
1488
|
+
"fieldName": "open"
|
|
1638
1489
|
},
|
|
1639
1490
|
{
|
|
1640
1491
|
"name": "placeholder",
|
|
1641
1492
|
"type": {
|
|
1642
|
-
"text": "string
|
|
1493
|
+
"text": "string"
|
|
1643
1494
|
},
|
|
1644
|
-
"
|
|
1645
|
-
"
|
|
1646
|
-
"
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
},
|
|
1495
|
+
"default": "\"Type a command or search...\"",
|
|
1496
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
1497
|
+
"fieldName": "placeholder"
|
|
1498
|
+
}
|
|
1499
|
+
],
|
|
1500
|
+
"mixins": [
|
|
1651
1501
|
{
|
|
1652
|
-
"name": "
|
|
1653
|
-
"
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1502
|
+
"name": "DraftComponentMixin",
|
|
1503
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
1504
|
+
}
|
|
1505
|
+
],
|
|
1506
|
+
"superclass": {
|
|
1507
|
+
"name": "LitElement",
|
|
1508
|
+
"package": "lit"
|
|
1509
|
+
},
|
|
1510
|
+
"status": "draft",
|
|
1511
|
+
"category": "action",
|
|
1512
|
+
"tagName": "nord-command-menu",
|
|
1513
|
+
"customElement": true
|
|
1514
|
+
}
|
|
1515
|
+
],
|
|
1516
|
+
"exports": [
|
|
1517
|
+
{
|
|
1518
|
+
"kind": "js",
|
|
1519
|
+
"name": "default",
|
|
1520
|
+
"declaration": {
|
|
1521
|
+
"name": "CommandMenu",
|
|
1522
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
"kind": "custom-element-definition",
|
|
1527
|
+
"name": "nord-command-menu",
|
|
1528
|
+
"declaration": {
|
|
1529
|
+
"name": "CommandMenu",
|
|
1530
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
],
|
|
1534
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
"kind": "javascript-module",
|
|
1538
|
+
"path": "src/command-menu/CommandMenuAction.ts",
|
|
1539
|
+
"declarations": [
|
|
1540
|
+
{
|
|
1541
|
+
"kind": "class",
|
|
1542
|
+
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
1543
|
+
"name": "CommandMenuAction",
|
|
1544
|
+
"members": [
|
|
1663
1545
|
{
|
|
1664
|
-
"
|
|
1546
|
+
"kind": "field",
|
|
1547
|
+
"name": "command",
|
|
1665
1548
|
"type": {
|
|
1666
|
-
"text": "
|
|
1549
|
+
"text": "ICommandMenuAction"
|
|
1667
1550
|
},
|
|
1668
|
-
"
|
|
1669
|
-
"description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
|
|
1670
|
-
"fieldName": "required",
|
|
1671
|
-
"inheritedFrom": {
|
|
1672
|
-
"name": "FormAssociatedMixin",
|
|
1673
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1674
|
-
}
|
|
1551
|
+
"attribute": "command"
|
|
1675
1552
|
},
|
|
1676
1553
|
{
|
|
1677
|
-
"
|
|
1554
|
+
"kind": "field",
|
|
1555
|
+
"name": "selected",
|
|
1678
1556
|
"type": {
|
|
1679
1557
|
"text": "boolean"
|
|
1680
1558
|
},
|
|
1681
1559
|
"default": "false",
|
|
1682
|
-
"
|
|
1683
|
-
"fieldName": "expand",
|
|
1684
|
-
"inheritedFrom": {
|
|
1685
|
-
"name": "FormAssociatedMixin",
|
|
1686
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1687
|
-
}
|
|
1560
|
+
"attribute": "selected"
|
|
1688
1561
|
},
|
|
1689
1562
|
{
|
|
1690
|
-
"
|
|
1691
|
-
"
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
"default": "false",
|
|
1695
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1696
|
-
"fieldName": "disabled",
|
|
1697
|
-
"inheritedFrom": {
|
|
1698
|
-
"name": "InputMixin",
|
|
1699
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1700
|
-
}
|
|
1563
|
+
"kind": "method",
|
|
1564
|
+
"name": "ensureInView",
|
|
1565
|
+
"privacy": "private",
|
|
1566
|
+
"description": "Scroll to show element"
|
|
1701
1567
|
},
|
|
1702
1568
|
{
|
|
1703
|
-
"
|
|
1569
|
+
"kind": "method",
|
|
1570
|
+
"name": "renderShortcut",
|
|
1571
|
+
"privacy": "private"
|
|
1572
|
+
}
|
|
1573
|
+
],
|
|
1574
|
+
"attributes": [
|
|
1575
|
+
{
|
|
1576
|
+
"name": "command",
|
|
1704
1577
|
"type": {
|
|
1705
|
-
"text": "
|
|
1578
|
+
"text": "ICommandMenuAction"
|
|
1706
1579
|
},
|
|
1707
|
-
"
|
|
1708
|
-
"fieldName": "name",
|
|
1709
|
-
"inheritedFrom": {
|
|
1710
|
-
"name": "InputMixin",
|
|
1711
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1712
|
-
}
|
|
1580
|
+
"fieldName": "command"
|
|
1713
1581
|
},
|
|
1714
1582
|
{
|
|
1715
|
-
"name": "
|
|
1583
|
+
"name": "selected",
|
|
1716
1584
|
"type": {
|
|
1717
|
-
"text": "
|
|
1585
|
+
"text": "boolean"
|
|
1718
1586
|
},
|
|
1719
|
-
"default": "
|
|
1720
|
-
"
|
|
1721
|
-
"fieldName": "value",
|
|
1722
|
-
"inheritedFrom": {
|
|
1723
|
-
"name": "InputMixin",
|
|
1724
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1725
|
-
}
|
|
1726
|
-
}
|
|
1727
|
-
],
|
|
1728
|
-
"mixins": [
|
|
1729
|
-
{
|
|
1730
|
-
"name": "FormAssociatedMixin",
|
|
1731
|
-
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
1732
|
-
},
|
|
1733
|
-
{
|
|
1734
|
-
"name": "InputMixin",
|
|
1735
|
-
"module": "/src/common/mixins/InputMixin.js"
|
|
1736
|
-
},
|
|
1737
|
-
{
|
|
1738
|
-
"name": "FocusableMixin",
|
|
1739
|
-
"module": "/src/common/mixins/FocusableMixin.js"
|
|
1740
|
-
},
|
|
1741
|
-
{
|
|
1742
|
-
"name": "DraftComponentMixin",
|
|
1743
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
1587
|
+
"default": "false",
|
|
1588
|
+
"fieldName": "selected"
|
|
1744
1589
|
}
|
|
1745
1590
|
],
|
|
1746
1591
|
"superclass": {
|
|
1747
1592
|
"name": "LitElement",
|
|
1748
1593
|
"package": "lit"
|
|
1749
1594
|
},
|
|
1750
|
-
"status": "
|
|
1751
|
-
"category":
|
|
1752
|
-
"tagName": "nord-
|
|
1753
|
-
"customElement": true
|
|
1754
|
-
"events": [
|
|
1755
|
-
{
|
|
1756
|
-
"name": "input",
|
|
1757
|
-
"type": {
|
|
1758
|
-
"text": "NordEvent"
|
|
1759
|
-
},
|
|
1760
|
-
"description": "Fired as the user types into the input.",
|
|
1761
|
-
"inheritedFrom": {
|
|
1762
|
-
"name": "FormAssociatedMixin",
|
|
1763
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1764
|
-
}
|
|
1765
|
-
},
|
|
1766
|
-
{
|
|
1767
|
-
"name": "change",
|
|
1768
|
-
"type": {
|
|
1769
|
-
"text": "NordEvent"
|
|
1770
|
-
},
|
|
1771
|
-
"description": "Fired whenever the input's value is changed via user interaction.",
|
|
1772
|
-
"inheritedFrom": {
|
|
1773
|
-
"name": "FormAssociatedMixin",
|
|
1774
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
]
|
|
1595
|
+
"status": "internal",
|
|
1596
|
+
"category": null,
|
|
1597
|
+
"tagName": "nord-command-menu-action",
|
|
1598
|
+
"customElement": true
|
|
1778
1599
|
}
|
|
1779
1600
|
],
|
|
1780
1601
|
"exports": [
|
|
@@ -1782,294 +1603,544 @@
|
|
|
1782
1603
|
"kind": "js",
|
|
1783
1604
|
"name": "default",
|
|
1784
1605
|
"declaration": {
|
|
1785
|
-
"name": "
|
|
1786
|
-
"module": "src/
|
|
1606
|
+
"name": "CommandMenuAction",
|
|
1607
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
1787
1608
|
}
|
|
1788
1609
|
},
|
|
1789
1610
|
{
|
|
1790
1611
|
"kind": "custom-element-definition",
|
|
1791
|
-
"name": "nord-
|
|
1612
|
+
"name": "nord-command-menu-action",
|
|
1792
1613
|
"declaration": {
|
|
1793
|
-
"name": "
|
|
1794
|
-
"module": "src/
|
|
1614
|
+
"name": "CommandMenuAction",
|
|
1615
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
1795
1616
|
}
|
|
1796
1617
|
}
|
|
1797
1618
|
],
|
|
1798
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
|
|
1619
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1799
1620
|
},
|
|
1800
1621
|
{
|
|
1801
1622
|
"kind": "javascript-module",
|
|
1802
|
-
"path": "src/command-menu/
|
|
1623
|
+
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
1624
|
+
"declarations": [],
|
|
1625
|
+
"exports": [],
|
|
1626
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
"kind": "javascript-module",
|
|
1630
|
+
"path": "src/command-menu/KeyboardController.ts",
|
|
1803
1631
|
"declarations": [
|
|
1804
1632
|
{
|
|
1805
1633
|
"kind": "class",
|
|
1806
|
-
"description": "
|
|
1807
|
-
"name": "
|
|
1808
|
-
"slots": [
|
|
1809
|
-
{
|
|
1810
|
-
"description": "Used to replace the default footer contents.",
|
|
1811
|
-
"name": "footer"
|
|
1812
|
-
}
|
|
1813
|
-
],
|
|
1634
|
+
"description": "",
|
|
1635
|
+
"name": "KeyboardController",
|
|
1814
1636
|
"members": [
|
|
1815
1637
|
{
|
|
1816
1638
|
"kind": "field",
|
|
1817
|
-
"name": "
|
|
1818
|
-
"privacy": "private"
|
|
1819
|
-
},
|
|
1820
|
-
{
|
|
1821
|
-
"kind": "field",
|
|
1822
|
-
"name": "listRef",
|
|
1823
|
-
"privacy": "private"
|
|
1824
|
-
},
|
|
1825
|
-
{
|
|
1826
|
-
"kind": "field",
|
|
1827
|
-
"name": "previousFocus",
|
|
1639
|
+
"name": "host",
|
|
1828
1640
|
"type": {
|
|
1829
|
-
"text": "
|
|
1641
|
+
"text": "CommandMenu"
|
|
1830
1642
|
},
|
|
1831
|
-
"privacy": "private"
|
|
1832
|
-
},
|
|
1833
|
-
{
|
|
1834
|
-
"kind": "field",
|
|
1835
|
-
"name": "dismissController",
|
|
1836
|
-
"privacy": "private",
|
|
1837
|
-
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
|
|
1838
|
-
},
|
|
1839
|
-
{
|
|
1840
|
-
"kind": "field",
|
|
1841
|
-
"name": "keyboardController",
|
|
1842
1643
|
"privacy": "private",
|
|
1843
|
-
"default": "
|
|
1644
|
+
"default": "host"
|
|
1844
1645
|
},
|
|
1845
1646
|
{
|
|
1846
1647
|
"kind": "field",
|
|
1847
|
-
"name": "
|
|
1648
|
+
"name": "globalShortcuts",
|
|
1848
1649
|
"type": {
|
|
1849
|
-
"text": "
|
|
1650
|
+
"text": "ShortcutController"
|
|
1850
1651
|
},
|
|
1851
|
-
"
|
|
1852
|
-
"
|
|
1853
|
-
"attribute": "open"
|
|
1652
|
+
"privacy": "private",
|
|
1653
|
+
"default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
|
|
1854
1654
|
},
|
|
1855
1655
|
{
|
|
1856
1656
|
"kind": "field",
|
|
1857
|
-
"name": "
|
|
1657
|
+
"name": "navigationShortcuts",
|
|
1858
1658
|
"type": {
|
|
1859
|
-
"text": "
|
|
1659
|
+
"text": "ShortcutController"
|
|
1860
1660
|
},
|
|
1861
|
-
"
|
|
1862
|
-
"
|
|
1863
|
-
"attribute": "placeholder"
|
|
1661
|
+
"privacy": "private",
|
|
1662
|
+
"default": "new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host\n )"
|
|
1864
1663
|
},
|
|
1865
1664
|
{
|
|
1866
1665
|
"kind": "field",
|
|
1867
|
-
"name": "
|
|
1666
|
+
"name": "commandShortcuts",
|
|
1868
1667
|
"type": {
|
|
1869
|
-
"text": "
|
|
1668
|
+
"text": "ShortcutController"
|
|
1870
1669
|
},
|
|
1871
|
-
"
|
|
1872
|
-
"
|
|
1670
|
+
"privacy": "private",
|
|
1671
|
+
"default": "new ShortcutController(host)"
|
|
1873
1672
|
},
|
|
1874
1673
|
{
|
|
1875
|
-
"kind": "
|
|
1876
|
-
"name": "
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1674
|
+
"kind": "method",
|
|
1675
|
+
"name": "registerCommandShortcuts"
|
|
1676
|
+
}
|
|
1677
|
+
]
|
|
1678
|
+
}
|
|
1679
|
+
],
|
|
1680
|
+
"exports": [
|
|
1681
|
+
{
|
|
1682
|
+
"kind": "js",
|
|
1683
|
+
"name": "KeyboardController",
|
|
1684
|
+
"declaration": {
|
|
1685
|
+
"name": "KeyboardController",
|
|
1686
|
+
"module": "src/command-menu/KeyboardController.ts"
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
],
|
|
1690
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1691
|
+
},
|
|
1692
|
+
{
|
|
1693
|
+
"kind": "javascript-module",
|
|
1694
|
+
"path": "src/command-menu/SelectEvent.ts",
|
|
1695
|
+
"declarations": [
|
|
1696
|
+
{
|
|
1697
|
+
"kind": "class",
|
|
1698
|
+
"description": "",
|
|
1699
|
+
"name": "SelectEvent",
|
|
1700
|
+
"members": [
|
|
1882
1701
|
{
|
|
1883
1702
|
"kind": "field",
|
|
1884
|
-
"name": "
|
|
1703
|
+
"name": "eventName",
|
|
1885
1704
|
"type": {
|
|
1886
1705
|
"text": "string"
|
|
1887
1706
|
},
|
|
1888
|
-
"
|
|
1889
|
-
"default": "\"\""
|
|
1707
|
+
"static": true,
|
|
1708
|
+
"default": "\"nord-select\""
|
|
1890
1709
|
},
|
|
1891
1710
|
{
|
|
1892
1711
|
"kind": "field",
|
|
1893
|
-
"name": "
|
|
1712
|
+
"name": "command",
|
|
1894
1713
|
"type": {
|
|
1895
|
-
"text": "
|
|
1714
|
+
"text": "ICommandMenuAction"
|
|
1896
1715
|
},
|
|
1897
|
-
"
|
|
1898
|
-
|
|
1716
|
+
"default": "command"
|
|
1717
|
+
}
|
|
1718
|
+
],
|
|
1719
|
+
"superclass": {
|
|
1720
|
+
"name": "NordEvent",
|
|
1721
|
+
"module": "/src/common/events.js"
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
],
|
|
1725
|
+
"exports": [
|
|
1726
|
+
{
|
|
1727
|
+
"kind": "js",
|
|
1728
|
+
"name": "SelectEvent",
|
|
1729
|
+
"declaration": {
|
|
1730
|
+
"name": "SelectEvent",
|
|
1731
|
+
"module": "src/command-menu/SelectEvent.ts"
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
],
|
|
1735
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
1736
|
+
},
|
|
1737
|
+
{
|
|
1738
|
+
"kind": "javascript-module",
|
|
1739
|
+
"path": "src/checkbox/Checkbox.ts",
|
|
1740
|
+
"declarations": [
|
|
1741
|
+
{
|
|
1742
|
+
"kind": "class",
|
|
1743
|
+
"description": "Checkboxes allow user to choose one or more options from a limited set of options.\nIf you have more than 10 options, please use Select component instead.",
|
|
1744
|
+
"name": "Checkbox",
|
|
1745
|
+
"slots": [
|
|
1746
|
+
{
|
|
1747
|
+
"description": "Use when a label requires more than plain text.",
|
|
1748
|
+
"name": "label"
|
|
1899
1749
|
},
|
|
1900
1750
|
{
|
|
1901
|
-
"
|
|
1902
|
-
"name": "
|
|
1903
|
-
"type": {
|
|
1904
|
-
"text": "number"
|
|
1905
|
-
},
|
|
1906
|
-
"privacy": "private",
|
|
1907
|
-
"default": "0"
|
|
1751
|
+
"description": "Optional slot that holds hint text for the input.",
|
|
1752
|
+
"name": "hint"
|
|
1908
1753
|
},
|
|
1754
|
+
{
|
|
1755
|
+
"description": "Optional slot that holds error text for the input.",
|
|
1756
|
+
"name": "error"
|
|
1757
|
+
}
|
|
1758
|
+
],
|
|
1759
|
+
"members": [
|
|
1909
1760
|
{
|
|
1910
1761
|
"kind": "field",
|
|
1911
|
-
"name": "
|
|
1912
|
-
"
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1762
|
+
"name": "formValue",
|
|
1763
|
+
"privacy": "protected",
|
|
1764
|
+
"inheritedFrom": {
|
|
1765
|
+
"name": "FormAssociatedMixin",
|
|
1766
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1767
|
+
}
|
|
1917
1768
|
},
|
|
1918
1769
|
{
|
|
1919
1770
|
"kind": "field",
|
|
1920
|
-
"name": "
|
|
1771
|
+
"name": "checked",
|
|
1921
1772
|
"type": {
|
|
1922
|
-
"text": "
|
|
1773
|
+
"text": "boolean"
|
|
1923
1774
|
},
|
|
1924
|
-
"
|
|
1775
|
+
"default": "false",
|
|
1776
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
1777
|
+
"attribute": "checked"
|
|
1925
1778
|
},
|
|
1926
1779
|
{
|
|
1927
1780
|
"kind": "method",
|
|
1928
|
-
"name": "
|
|
1781
|
+
"name": "handleChange",
|
|
1782
|
+
"privacy": "protected",
|
|
1783
|
+
"return": {
|
|
1784
|
+
"type": {
|
|
1785
|
+
"text": "void"
|
|
1786
|
+
}
|
|
1787
|
+
},
|
|
1929
1788
|
"parameters": [
|
|
1930
1789
|
{
|
|
1931
|
-
"name": "
|
|
1932
|
-
"default": "{}",
|
|
1790
|
+
"name": "e",
|
|
1933
1791
|
"type": {
|
|
1934
|
-
"text": "
|
|
1935
|
-
}
|
|
1936
|
-
"description": "allows you to open the menu filtered to a specific parent command."
|
|
1792
|
+
"text": "Event"
|
|
1793
|
+
}
|
|
1937
1794
|
}
|
|
1938
1795
|
],
|
|
1939
|
-
"
|
|
1796
|
+
"inheritedFrom": {
|
|
1797
|
+
"name": "FormAssociatedMixin",
|
|
1798
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1799
|
+
}
|
|
1940
1800
|
},
|
|
1941
1801
|
{
|
|
1942
|
-
"kind": "
|
|
1943
|
-
"name": "
|
|
1944
|
-
"
|
|
1802
|
+
"kind": "field",
|
|
1803
|
+
"name": "labelSlot",
|
|
1804
|
+
"privacy": "protected",
|
|
1805
|
+
"default": "new SlotController(this, \"label\")",
|
|
1806
|
+
"inheritedFrom": {
|
|
1807
|
+
"name": "FormAssociatedMixin",
|
|
1808
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1809
|
+
}
|
|
1945
1810
|
},
|
|
1946
1811
|
{
|
|
1947
|
-
"kind": "
|
|
1948
|
-
"name": "
|
|
1949
|
-
"
|
|
1812
|
+
"kind": "field",
|
|
1813
|
+
"name": "errorSlot",
|
|
1814
|
+
"privacy": "protected",
|
|
1815
|
+
"default": "new SlotController(this, \"error\")",
|
|
1816
|
+
"inheritedFrom": {
|
|
1817
|
+
"name": "FormAssociatedMixin",
|
|
1818
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1819
|
+
}
|
|
1950
1820
|
},
|
|
1951
1821
|
{
|
|
1952
|
-
"kind": "
|
|
1953
|
-
"name": "
|
|
1954
|
-
"
|
|
1822
|
+
"kind": "field",
|
|
1823
|
+
"name": "hintSlot",
|
|
1824
|
+
"privacy": "protected",
|
|
1825
|
+
"default": "new SlotController(this, \"hint\")",
|
|
1826
|
+
"inheritedFrom": {
|
|
1827
|
+
"name": "FormAssociatedMixin",
|
|
1828
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1829
|
+
}
|
|
1955
1830
|
},
|
|
1956
1831
|
{
|
|
1957
|
-
"kind": "
|
|
1958
|
-
"name": "
|
|
1959
|
-
"privacy": "
|
|
1832
|
+
"kind": "field",
|
|
1833
|
+
"name": "formData",
|
|
1834
|
+
"privacy": "protected",
|
|
1835
|
+
"default": "new FormDataController(this, { value: () => this.formValue })",
|
|
1836
|
+
"inheritedFrom": {
|
|
1837
|
+
"name": "FormAssociatedMixin",
|
|
1838
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1839
|
+
}
|
|
1960
1840
|
},
|
|
1961
1841
|
{
|
|
1962
|
-
"kind": "
|
|
1963
|
-
"name": "
|
|
1964
|
-
"
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
"name": "commands",
|
|
1974
|
-
"type": {
|
|
1975
|
-
"text": "ICommandMenuAction[]"
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
]
|
|
1842
|
+
"kind": "field",
|
|
1843
|
+
"name": "inputId",
|
|
1844
|
+
"type": {
|
|
1845
|
+
"text": "string"
|
|
1846
|
+
},
|
|
1847
|
+
"privacy": "protected",
|
|
1848
|
+
"default": "\"input\"",
|
|
1849
|
+
"inheritedFrom": {
|
|
1850
|
+
"name": "FormAssociatedMixin",
|
|
1851
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1852
|
+
}
|
|
1979
1853
|
},
|
|
1980
1854
|
{
|
|
1981
|
-
"kind": "
|
|
1982
|
-
"name": "
|
|
1983
|
-
"
|
|
1855
|
+
"kind": "field",
|
|
1856
|
+
"name": "errorId",
|
|
1857
|
+
"type": {
|
|
1858
|
+
"text": "string"
|
|
1859
|
+
},
|
|
1860
|
+
"privacy": "protected",
|
|
1861
|
+
"default": "\"error\"",
|
|
1862
|
+
"inheritedFrom": {
|
|
1863
|
+
"name": "FormAssociatedMixin",
|
|
1864
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1865
|
+
}
|
|
1984
1866
|
},
|
|
1985
1867
|
{
|
|
1986
|
-
"kind": "
|
|
1987
|
-
"name": "
|
|
1988
|
-
"
|
|
1868
|
+
"kind": "field",
|
|
1869
|
+
"name": "hintId",
|
|
1870
|
+
"type": {
|
|
1871
|
+
"text": "string"
|
|
1872
|
+
},
|
|
1873
|
+
"privacy": "protected",
|
|
1874
|
+
"default": "\"hint\"",
|
|
1875
|
+
"inheritedFrom": {
|
|
1876
|
+
"name": "FormAssociatedMixin",
|
|
1877
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
{
|
|
1881
|
+
"kind": "field",
|
|
1882
|
+
"name": "label",
|
|
1883
|
+
"type": {
|
|
1884
|
+
"text": "string"
|
|
1885
|
+
},
|
|
1886
|
+
"default": "\"\"",
|
|
1887
|
+
"description": "Label for the input.",
|
|
1888
|
+
"attribute": "label",
|
|
1889
|
+
"inheritedFrom": {
|
|
1890
|
+
"name": "FormAssociatedMixin",
|
|
1891
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1892
|
+
}
|
|
1893
|
+
},
|
|
1894
|
+
{
|
|
1895
|
+
"kind": "field",
|
|
1896
|
+
"name": "hint",
|
|
1897
|
+
"type": {
|
|
1898
|
+
"text": "string | undefined"
|
|
1899
|
+
},
|
|
1900
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
1901
|
+
"attribute": "hint",
|
|
1902
|
+
"inheritedFrom": {
|
|
1903
|
+
"name": "FormAssociatedMixin",
|
|
1904
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1905
|
+
}
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
"kind": "field",
|
|
1909
|
+
"name": "hideLabel",
|
|
1910
|
+
"type": {
|
|
1911
|
+
"text": "boolean"
|
|
1912
|
+
},
|
|
1913
|
+
"default": "false",
|
|
1914
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
1915
|
+
"attribute": "hide-label",
|
|
1916
|
+
"inheritedFrom": {
|
|
1917
|
+
"name": "FormAssociatedMixin",
|
|
1918
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1919
|
+
}
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
"kind": "field",
|
|
1923
|
+
"name": "placeholder",
|
|
1924
|
+
"type": {
|
|
1925
|
+
"text": "string | undefined"
|
|
1926
|
+
},
|
|
1927
|
+
"description": "Placeholder text to display within the input.",
|
|
1928
|
+
"attribute": "placeholder",
|
|
1929
|
+
"inheritedFrom": {
|
|
1930
|
+
"name": "FormAssociatedMixin",
|
|
1931
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1932
|
+
}
|
|
1933
|
+
},
|
|
1934
|
+
{
|
|
1935
|
+
"kind": "field",
|
|
1936
|
+
"name": "error",
|
|
1937
|
+
"type": {
|
|
1938
|
+
"text": "string | undefined"
|
|
1939
|
+
},
|
|
1940
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
1941
|
+
"attribute": "error",
|
|
1942
|
+
"inheritedFrom": {
|
|
1943
|
+
"name": "FormAssociatedMixin",
|
|
1944
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1945
|
+
}
|
|
1946
|
+
},
|
|
1947
|
+
{
|
|
1948
|
+
"kind": "field",
|
|
1949
|
+
"name": "required",
|
|
1950
|
+
"type": {
|
|
1951
|
+
"text": "boolean"
|
|
1952
|
+
},
|
|
1953
|
+
"default": "false",
|
|
1954
|
+
"description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
|
|
1955
|
+
"attribute": "required",
|
|
1956
|
+
"inheritedFrom": {
|
|
1957
|
+
"name": "FormAssociatedMixin",
|
|
1958
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1959
|
+
}
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
"kind": "field",
|
|
1963
|
+
"name": "expand",
|
|
1964
|
+
"type": {
|
|
1965
|
+
"text": "boolean"
|
|
1966
|
+
},
|
|
1967
|
+
"default": "false",
|
|
1968
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
1969
|
+
"attribute": "expand",
|
|
1970
|
+
"reflects": true,
|
|
1971
|
+
"inheritedFrom": {
|
|
1972
|
+
"name": "FormAssociatedMixin",
|
|
1973
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1974
|
+
}
|
|
1989
1975
|
},
|
|
1990
1976
|
{
|
|
1991
1977
|
"kind": "method",
|
|
1992
1978
|
"name": "handleInput",
|
|
1993
|
-
"privacy": "
|
|
1979
|
+
"privacy": "protected",
|
|
1994
1980
|
"parameters": [
|
|
1995
1981
|
{
|
|
1996
|
-
"name": "
|
|
1982
|
+
"name": "e",
|
|
1997
1983
|
"type": {
|
|
1998
|
-
"text": "
|
|
1984
|
+
"text": "Event"
|
|
1999
1985
|
}
|
|
2000
1986
|
}
|
|
2001
|
-
]
|
|
1987
|
+
],
|
|
1988
|
+
"inheritedFrom": {
|
|
1989
|
+
"name": "FormAssociatedMixin",
|
|
1990
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1991
|
+
}
|
|
2002
1992
|
},
|
|
2003
1993
|
{
|
|
2004
1994
|
"kind": "method",
|
|
2005
|
-
"name": "
|
|
2006
|
-
"privacy": "
|
|
2007
|
-
"
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
"type": {
|
|
2012
|
-
"text": "ICommandMenuAction"
|
|
2013
|
-
}
|
|
2014
|
-
}
|
|
2015
|
-
]
|
|
1995
|
+
"name": "renderLabel",
|
|
1996
|
+
"privacy": "protected",
|
|
1997
|
+
"inheritedFrom": {
|
|
1998
|
+
"name": "FormAssociatedMixin",
|
|
1999
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2000
|
+
}
|
|
2016
2001
|
},
|
|
2017
2002
|
{
|
|
2018
2003
|
"kind": "method",
|
|
2019
|
-
"name": "
|
|
2020
|
-
"privacy": "
|
|
2004
|
+
"name": "renderError",
|
|
2005
|
+
"privacy": "protected",
|
|
2006
|
+
"inheritedFrom": {
|
|
2007
|
+
"name": "FormAssociatedMixin",
|
|
2008
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2009
|
+
}
|
|
2021
2010
|
},
|
|
2022
2011
|
{
|
|
2023
2012
|
"kind": "method",
|
|
2024
|
-
"name": "
|
|
2025
|
-
"privacy": "
|
|
2013
|
+
"name": "getDescribedBy",
|
|
2014
|
+
"privacy": "protected",
|
|
2015
|
+
"inheritedFrom": {
|
|
2016
|
+
"name": "FormAssociatedMixin",
|
|
2017
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2018
|
+
}
|
|
2026
2019
|
},
|
|
2027
2020
|
{
|
|
2028
2021
|
"kind": "method",
|
|
2029
|
-
"name": "
|
|
2030
|
-
"privacy": "
|
|
2022
|
+
"name": "getInvalid",
|
|
2023
|
+
"privacy": "protected",
|
|
2024
|
+
"inheritedFrom": {
|
|
2025
|
+
"name": "FormAssociatedMixin",
|
|
2026
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2027
|
+
}
|
|
2031
2028
|
},
|
|
2032
2029
|
{
|
|
2033
|
-
"kind": "
|
|
2034
|
-
"name": "
|
|
2035
|
-
"privacy": "
|
|
2030
|
+
"kind": "field",
|
|
2031
|
+
"name": "hasHint",
|
|
2032
|
+
"privacy": "protected",
|
|
2033
|
+
"inheritedFrom": {
|
|
2034
|
+
"name": "FormAssociatedMixin",
|
|
2035
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2036
|
+
}
|
|
2036
2037
|
},
|
|
2037
2038
|
{
|
|
2038
|
-
"kind": "
|
|
2039
|
-
"name": "
|
|
2040
|
-
"privacy": "
|
|
2039
|
+
"kind": "field",
|
|
2040
|
+
"name": "hasError",
|
|
2041
|
+
"privacy": "protected",
|
|
2042
|
+
"inheritedFrom": {
|
|
2043
|
+
"name": "FormAssociatedMixin",
|
|
2044
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2045
|
+
}
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
"kind": "field",
|
|
2049
|
+
"name": "disabled",
|
|
2050
|
+
"type": {
|
|
2051
|
+
"text": "boolean"
|
|
2052
|
+
},
|
|
2053
|
+
"default": "false",
|
|
2054
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2055
|
+
"attribute": "disabled",
|
|
2056
|
+
"reflects": true,
|
|
2057
|
+
"inheritedFrom": {
|
|
2058
|
+
"name": "InputMixin",
|
|
2059
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2060
|
+
}
|
|
2061
|
+
},
|
|
2062
|
+
{
|
|
2063
|
+
"kind": "field",
|
|
2064
|
+
"name": "name",
|
|
2065
|
+
"type": {
|
|
2066
|
+
"text": "string | undefined"
|
|
2067
|
+
},
|
|
2068
|
+
"description": "The name of the form component.",
|
|
2069
|
+
"attribute": "name",
|
|
2070
|
+
"inheritedFrom": {
|
|
2071
|
+
"name": "InputMixin",
|
|
2072
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2073
|
+
}
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
"kind": "field",
|
|
2077
|
+
"name": "value",
|
|
2078
|
+
"type": {
|
|
2079
|
+
"text": "string"
|
|
2080
|
+
},
|
|
2081
|
+
"default": "\"\"",
|
|
2082
|
+
"description": "The value of the form component.",
|
|
2083
|
+
"attribute": "value",
|
|
2084
|
+
"inheritedFrom": {
|
|
2085
|
+
"name": "InputMixin",
|
|
2086
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2087
|
+
}
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
"kind": "field",
|
|
2091
|
+
"name": "form",
|
|
2092
|
+
"privacy": "protected",
|
|
2093
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
2094
|
+
"inheritedFrom": {
|
|
2095
|
+
"name": "InputMixin",
|
|
2096
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2097
|
+
}
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
"kind": "field",
|
|
2101
|
+
"name": "focusableRef",
|
|
2102
|
+
"privacy": "protected",
|
|
2103
|
+
"inheritedFrom": {
|
|
2104
|
+
"name": "FocusableMixin",
|
|
2105
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2106
|
+
}
|
|
2041
2107
|
},
|
|
2042
2108
|
{
|
|
2043
2109
|
"kind": "method",
|
|
2044
|
-
"name": "
|
|
2045
|
-
"privacy": "private",
|
|
2110
|
+
"name": "focus",
|
|
2046
2111
|
"parameters": [
|
|
2047
2112
|
{
|
|
2048
|
-
"name": "
|
|
2113
|
+
"name": "options",
|
|
2049
2114
|
"optional": true,
|
|
2050
2115
|
"type": {
|
|
2051
|
-
"text": "
|
|
2052
|
-
}
|
|
2116
|
+
"text": "FocusOptions"
|
|
2117
|
+
},
|
|
2118
|
+
"description": "An object which controls aspects of the focusing process."
|
|
2053
2119
|
}
|
|
2054
|
-
]
|
|
2120
|
+
],
|
|
2121
|
+
"description": "Programmatically move focus to the component.",
|
|
2122
|
+
"inheritedFrom": {
|
|
2123
|
+
"name": "FocusableMixin",
|
|
2124
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2125
|
+
}
|
|
2055
2126
|
},
|
|
2056
2127
|
{
|
|
2057
|
-
"kind": "method",
|
|
2058
|
-
"name": "
|
|
2059
|
-
"
|
|
2060
|
-
"
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
"text": "string"
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
]
|
|
2128
|
+
"kind": "method",
|
|
2129
|
+
"name": "blur",
|
|
2130
|
+
"description": "Programmatically remove focus from the component.",
|
|
2131
|
+
"inheritedFrom": {
|
|
2132
|
+
"name": "FocusableMixin",
|
|
2133
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2134
|
+
}
|
|
2068
2135
|
},
|
|
2069
2136
|
{
|
|
2070
2137
|
"kind": "method",
|
|
2071
|
-
"name": "
|
|
2072
|
-
"
|
|
2138
|
+
"name": "click",
|
|
2139
|
+
"description": "Programmatically simulates a click on the component.",
|
|
2140
|
+
"inheritedFrom": {
|
|
2141
|
+
"name": "FocusableMixin",
|
|
2142
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2143
|
+
}
|
|
2073
2144
|
},
|
|
2074
2145
|
{
|
|
2075
2146
|
"kind": "field",
|
|
@@ -2086,285 +2157,214 @@
|
|
|
2086
2157
|
}
|
|
2087
2158
|
}
|
|
2088
2159
|
],
|
|
2089
|
-
"
|
|
2160
|
+
"attributes": [
|
|
2090
2161
|
{
|
|
2091
|
-
"name": "
|
|
2162
|
+
"name": "checked",
|
|
2092
2163
|
"type": {
|
|
2093
|
-
"text": "
|
|
2164
|
+
"text": "boolean"
|
|
2094
2165
|
},
|
|
2095
|
-
"
|
|
2166
|
+
"default": "false",
|
|
2167
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
2168
|
+
"fieldName": "checked"
|
|
2096
2169
|
},
|
|
2097
2170
|
{
|
|
2098
|
-
"name": "
|
|
2171
|
+
"name": "label",
|
|
2099
2172
|
"type": {
|
|
2100
|
-
"text": "
|
|
2173
|
+
"text": "string"
|
|
2101
2174
|
},
|
|
2102
|
-
"
|
|
2175
|
+
"default": "\"\"",
|
|
2176
|
+
"description": "Label for the input.",
|
|
2177
|
+
"fieldName": "label",
|
|
2178
|
+
"inheritedFrom": {
|
|
2179
|
+
"name": "FormAssociatedMixin",
|
|
2180
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2181
|
+
}
|
|
2103
2182
|
},
|
|
2104
2183
|
{
|
|
2184
|
+
"name": "hint",
|
|
2105
2185
|
"type": {
|
|
2106
|
-
"text": "
|
|
2186
|
+
"text": "string | undefined"
|
|
2107
2187
|
},
|
|
2108
|
-
"description": "
|
|
2109
|
-
"
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2188
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
2189
|
+
"fieldName": "hint",
|
|
2190
|
+
"inheritedFrom": {
|
|
2191
|
+
"name": "FormAssociatedMixin",
|
|
2192
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2193
|
+
}
|
|
2194
|
+
},
|
|
2113
2195
|
{
|
|
2114
|
-
"name": "
|
|
2196
|
+
"name": "hide-label",
|
|
2115
2197
|
"type": {
|
|
2116
2198
|
"text": "boolean"
|
|
2117
2199
|
},
|
|
2118
2200
|
"default": "false",
|
|
2119
|
-
"description": "
|
|
2120
|
-
"fieldName": "
|
|
2201
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
2202
|
+
"fieldName": "hideLabel",
|
|
2203
|
+
"inheritedFrom": {
|
|
2204
|
+
"name": "FormAssociatedMixin",
|
|
2205
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2206
|
+
}
|
|
2121
2207
|
},
|
|
2122
2208
|
{
|
|
2123
2209
|
"name": "placeholder",
|
|
2124
2210
|
"type": {
|
|
2125
|
-
"text": "string"
|
|
2211
|
+
"text": "string | undefined"
|
|
2126
2212
|
},
|
|
2127
|
-
"
|
|
2128
|
-
"
|
|
2129
|
-
"
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
"name": "DraftComponentMixin",
|
|
2135
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
2136
|
-
}
|
|
2137
|
-
],
|
|
2138
|
-
"superclass": {
|
|
2139
|
-
"name": "LitElement",
|
|
2140
|
-
"package": "lit"
|
|
2141
|
-
},
|
|
2142
|
-
"status": "draft",
|
|
2143
|
-
"category": "action",
|
|
2144
|
-
"tagName": "nord-command-menu",
|
|
2145
|
-
"customElement": true
|
|
2146
|
-
}
|
|
2147
|
-
],
|
|
2148
|
-
"exports": [
|
|
2149
|
-
{
|
|
2150
|
-
"kind": "js",
|
|
2151
|
-
"name": "default",
|
|
2152
|
-
"declaration": {
|
|
2153
|
-
"name": "CommandMenu",
|
|
2154
|
-
"module": "src/command-menu/CommandMenu.ts"
|
|
2155
|
-
}
|
|
2156
|
-
},
|
|
2157
|
-
{
|
|
2158
|
-
"kind": "custom-element-definition",
|
|
2159
|
-
"name": "nord-command-menu",
|
|
2160
|
-
"declaration": {
|
|
2161
|
-
"name": "CommandMenu",
|
|
2162
|
-
"module": "src/command-menu/CommandMenu.ts"
|
|
2163
|
-
}
|
|
2164
|
-
}
|
|
2165
|
-
],
|
|
2166
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2167
|
-
},
|
|
2168
|
-
{
|
|
2169
|
-
"kind": "javascript-module",
|
|
2170
|
-
"path": "src/command-menu/CommandMenuAction.ts",
|
|
2171
|
-
"declarations": [
|
|
2172
|
-
{
|
|
2173
|
-
"kind": "class",
|
|
2174
|
-
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
2175
|
-
"name": "CommandMenuAction",
|
|
2176
|
-
"members": [
|
|
2213
|
+
"description": "Placeholder text to display within the input.",
|
|
2214
|
+
"fieldName": "placeholder",
|
|
2215
|
+
"inheritedFrom": {
|
|
2216
|
+
"name": "FormAssociatedMixin",
|
|
2217
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2218
|
+
}
|
|
2219
|
+
},
|
|
2177
2220
|
{
|
|
2178
|
-
"
|
|
2179
|
-
"name": "command",
|
|
2221
|
+
"name": "error",
|
|
2180
2222
|
"type": {
|
|
2181
|
-
"text": "
|
|
2223
|
+
"text": "string | undefined"
|
|
2182
2224
|
},
|
|
2183
|
-
"
|
|
2225
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
2226
|
+
"fieldName": "error",
|
|
2227
|
+
"inheritedFrom": {
|
|
2228
|
+
"name": "FormAssociatedMixin",
|
|
2229
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2230
|
+
}
|
|
2184
2231
|
},
|
|
2185
2232
|
{
|
|
2186
|
-
"
|
|
2187
|
-
"name": "selected",
|
|
2233
|
+
"name": "required",
|
|
2188
2234
|
"type": {
|
|
2189
2235
|
"text": "boolean"
|
|
2190
2236
|
},
|
|
2191
2237
|
"default": "false",
|
|
2192
|
-
"
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
"description": "Scroll to show element"
|
|
2238
|
+
"description": "Determines whether the input is required or not.\nAn input marked as required will be announced as such to users of assistive technology.\nWhen using this property you need to also set “novalidate” attribute on a form element to prevent browser from displaying its own validation errors.",
|
|
2239
|
+
"fieldName": "required",
|
|
2240
|
+
"inheritedFrom": {
|
|
2241
|
+
"name": "FormAssociatedMixin",
|
|
2242
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2243
|
+
}
|
|
2199
2244
|
},
|
|
2200
2245
|
{
|
|
2201
|
-
"
|
|
2202
|
-
"name": "renderShortcut",
|
|
2203
|
-
"privacy": "private"
|
|
2204
|
-
}
|
|
2205
|
-
],
|
|
2206
|
-
"attributes": [
|
|
2207
|
-
{
|
|
2208
|
-
"name": "command",
|
|
2246
|
+
"name": "expand",
|
|
2209
2247
|
"type": {
|
|
2210
|
-
"text": "
|
|
2248
|
+
"text": "boolean"
|
|
2211
2249
|
},
|
|
2212
|
-
"
|
|
2250
|
+
"default": "false",
|
|
2251
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2252
|
+
"fieldName": "expand",
|
|
2253
|
+
"inheritedFrom": {
|
|
2254
|
+
"name": "FormAssociatedMixin",
|
|
2255
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2256
|
+
}
|
|
2213
2257
|
},
|
|
2214
2258
|
{
|
|
2215
|
-
"name": "
|
|
2259
|
+
"name": "disabled",
|
|
2216
2260
|
"type": {
|
|
2217
2261
|
"text": "boolean"
|
|
2218
2262
|
},
|
|
2219
2263
|
"default": "false",
|
|
2220
|
-
"
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
"status": "internal",
|
|
2228
|
-
"category": null,
|
|
2229
|
-
"tagName": "nord-command-menu-action",
|
|
2230
|
-
"customElement": true
|
|
2231
|
-
}
|
|
2232
|
-
],
|
|
2233
|
-
"exports": [
|
|
2234
|
-
{
|
|
2235
|
-
"kind": "js",
|
|
2236
|
-
"name": "default",
|
|
2237
|
-
"declaration": {
|
|
2238
|
-
"name": "CommandMenuAction",
|
|
2239
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2240
|
-
}
|
|
2241
|
-
},
|
|
2242
|
-
{
|
|
2243
|
-
"kind": "custom-element-definition",
|
|
2244
|
-
"name": "nord-command-menu-action",
|
|
2245
|
-
"declaration": {
|
|
2246
|
-
"name": "CommandMenuAction",
|
|
2247
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2250
|
-
],
|
|
2251
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2252
|
-
},
|
|
2253
|
-
{
|
|
2254
|
-
"kind": "javascript-module",
|
|
2255
|
-
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
2256
|
-
"declarations": [],
|
|
2257
|
-
"exports": [],
|
|
2258
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2259
|
-
},
|
|
2260
|
-
{
|
|
2261
|
-
"kind": "javascript-module",
|
|
2262
|
-
"path": "src/command-menu/KeyboardController.ts",
|
|
2263
|
-
"declarations": [
|
|
2264
|
-
{
|
|
2265
|
-
"kind": "class",
|
|
2266
|
-
"description": "",
|
|
2267
|
-
"name": "KeyboardController",
|
|
2268
|
-
"members": [
|
|
2264
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2265
|
+
"fieldName": "disabled",
|
|
2266
|
+
"inheritedFrom": {
|
|
2267
|
+
"name": "InputMixin",
|
|
2268
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2269
|
+
}
|
|
2270
|
+
},
|
|
2269
2271
|
{
|
|
2270
|
-
"
|
|
2271
|
-
"name": "host",
|
|
2272
|
+
"name": "name",
|
|
2272
2273
|
"type": {
|
|
2273
|
-
"text": "
|
|
2274
|
+
"text": "string | undefined"
|
|
2274
2275
|
},
|
|
2275
|
-
"
|
|
2276
|
-
"
|
|
2276
|
+
"description": "The name of the form component.",
|
|
2277
|
+
"fieldName": "name",
|
|
2278
|
+
"inheritedFrom": {
|
|
2279
|
+
"name": "InputMixin",
|
|
2280
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2281
|
+
}
|
|
2277
2282
|
},
|
|
2278
2283
|
{
|
|
2279
|
-
"
|
|
2280
|
-
"name": "globalShortcuts",
|
|
2284
|
+
"name": "value",
|
|
2281
2285
|
"type": {
|
|
2282
|
-
"text": "
|
|
2286
|
+
"text": "string"
|
|
2283
2287
|
},
|
|
2284
|
-
"
|
|
2285
|
-
"
|
|
2288
|
+
"default": "\"\"",
|
|
2289
|
+
"description": "The value of the form component.",
|
|
2290
|
+
"fieldName": "value",
|
|
2291
|
+
"inheritedFrom": {
|
|
2292
|
+
"name": "InputMixin",
|
|
2293
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
],
|
|
2297
|
+
"mixins": [
|
|
2298
|
+
{
|
|
2299
|
+
"name": "FormAssociatedMixin",
|
|
2300
|
+
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
2286
2301
|
},
|
|
2287
2302
|
{
|
|
2288
|
-
"
|
|
2289
|
-
"
|
|
2290
|
-
"type": {
|
|
2291
|
-
"text": "ShortcutController"
|
|
2292
|
-
},
|
|
2293
|
-
"privacy": "private",
|
|
2294
|
-
"default": "new ShortcutController(\n host,\n {\n Enter: preventDefault(actions.trigger),\n Backspace: actions.goBack, // we don't want to prevent default, since that would stop backspace deleting chars\n End: preventDefault(actions.end),\n Home: preventDefault(actions.start),\n ArrowDown: preventDefault(actions.next),\n ArrowUp: preventDefault(actions.previous),\n },\n host\n )"
|
|
2303
|
+
"name": "InputMixin",
|
|
2304
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
2295
2305
|
},
|
|
2296
2306
|
{
|
|
2297
|
-
"
|
|
2298
|
-
"
|
|
2299
|
-
"type": {
|
|
2300
|
-
"text": "ShortcutController"
|
|
2301
|
-
},
|
|
2302
|
-
"privacy": "private",
|
|
2303
|
-
"default": "new ShortcutController(host)"
|
|
2307
|
+
"name": "FocusableMixin",
|
|
2308
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
2304
2309
|
},
|
|
2305
2310
|
{
|
|
2306
|
-
"
|
|
2307
|
-
"
|
|
2311
|
+
"name": "DraftComponentMixin",
|
|
2312
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
2308
2313
|
}
|
|
2309
|
-
]
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
"
|
|
2315
|
-
"
|
|
2316
|
-
"
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
}
|
|
2320
|
-
}
|
|
2321
|
-
],
|
|
2322
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2323
|
-
},
|
|
2324
|
-
{
|
|
2325
|
-
"kind": "javascript-module",
|
|
2326
|
-
"path": "src/command-menu/SelectEvent.ts",
|
|
2327
|
-
"declarations": [
|
|
2328
|
-
{
|
|
2329
|
-
"kind": "class",
|
|
2330
|
-
"description": "",
|
|
2331
|
-
"name": "SelectEvent",
|
|
2332
|
-
"members": [
|
|
2314
|
+
],
|
|
2315
|
+
"superclass": {
|
|
2316
|
+
"name": "LitElement",
|
|
2317
|
+
"package": "lit"
|
|
2318
|
+
},
|
|
2319
|
+
"status": "draft",
|
|
2320
|
+
"category": "form",
|
|
2321
|
+
"tagName": "nord-checkbox",
|
|
2322
|
+
"customElement": true,
|
|
2323
|
+
"events": [
|
|
2333
2324
|
{
|
|
2334
|
-
"
|
|
2335
|
-
"name": "eventName",
|
|
2325
|
+
"name": "input",
|
|
2336
2326
|
"type": {
|
|
2337
|
-
"text": "
|
|
2327
|
+
"text": "NordEvent"
|
|
2338
2328
|
},
|
|
2339
|
-
"
|
|
2340
|
-
"
|
|
2329
|
+
"description": "Fired as the user types into the input.",
|
|
2330
|
+
"inheritedFrom": {
|
|
2331
|
+
"name": "FormAssociatedMixin",
|
|
2332
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2333
|
+
}
|
|
2341
2334
|
},
|
|
2342
2335
|
{
|
|
2343
|
-
"
|
|
2344
|
-
"name": "command",
|
|
2336
|
+
"name": "change",
|
|
2345
2337
|
"type": {
|
|
2346
|
-
"text": "
|
|
2338
|
+
"text": "NordEvent"
|
|
2347
2339
|
},
|
|
2348
|
-
"
|
|
2340
|
+
"description": "Fired whenever the input's value is changed via user interaction.",
|
|
2341
|
+
"inheritedFrom": {
|
|
2342
|
+
"name": "FormAssociatedMixin",
|
|
2343
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2344
|
+
}
|
|
2349
2345
|
}
|
|
2350
|
-
]
|
|
2351
|
-
"superclass": {
|
|
2352
|
-
"name": "NordEvent",
|
|
2353
|
-
"module": "/src/common/events.js"
|
|
2354
|
-
}
|
|
2346
|
+
]
|
|
2355
2347
|
}
|
|
2356
2348
|
],
|
|
2357
2349
|
"exports": [
|
|
2358
2350
|
{
|
|
2359
2351
|
"kind": "js",
|
|
2360
|
-
"name": "
|
|
2352
|
+
"name": "default",
|
|
2361
2353
|
"declaration": {
|
|
2362
|
-
"name": "
|
|
2363
|
-
"module": "src/
|
|
2354
|
+
"name": "Checkbox",
|
|
2355
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
2356
|
+
}
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
"kind": "custom-element-definition",
|
|
2360
|
+
"name": "nord-checkbox",
|
|
2361
|
+
"declaration": {
|
|
2362
|
+
"name": "Checkbox",
|
|
2363
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
2364
2364
|
}
|
|
2365
2365
|
}
|
|
2366
2366
|
],
|
|
2367
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide global and contextual keyboard shortcuts for users.\n- Make command menu available everywhere. Users must be able to bring up the command menu easily.\n- Make command menu central. Users should be able to find global shortcuts from one location.\n- Make command menu omnipotent. Give users access to every possible action.\n- Group related commands logically under sections with the section setting.\n- Use `Alt` key as the modifier, since this is less likely to clash with existing shortcuts.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make command menu available only in certain views of the application.\n- Don’t define shortcuts such as `Ctrl+C`, since this will clash with the native \"Copy\" shortcut.\n- Don't create complex shortcuts, as users will struggle to remember them.\n- Avoid using `KeyboardEvent.key` for defining the shortcut keys.\n- Don’t use as a search field only.\n\n</div>\n\n---\n\n## Content guidelines\n\nCommand titles should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they execute a command:\n\n<div class=\"n-usage n-usage-do\">Start consultation</div>\n<div class=\"n-usage n-usage-dont\">Consultation</div>\n\nAlways lead with a strong verb that encourages action. To provide enough context to user, use the {verb} + {noun} content formula:\n\n<div class=\"n-usage n-usage-do\">Open dashboard</div>\n<div class=\"n-usage n-usage-dont\">Dashboard</div>\n\nWhen writing command titles, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">New appointment</div>\n<div class=\"n-usage n-usage-dont\">New Appointment</div>\n\nAvoid unnecessary words and articles in command titles, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Change theme</div>\n<div class=\"n-usage n-usage-dont\">Change the theme</div>\n\nAvoid ending in punctuation:\n\n<div class=\"n-usage n-usage-do\">Switch user</div>\n<div class=\"n-usage n-usage-dont\">Switch user.</div>\n\nUse ellipsis in the title when describing sections that have commands grouped inside of them:\n\n<div class=\"n-usage n-usage-do\">Change theme…</div>\n<div class=\"n-usage n-usage-dont\">Change theme</div>\n\n---\n\n## Commands data\n\nEach command in the `commands` data array must include at least an `id` and `title`. A command may also include properties for `section`, `icon`, `handler`, `shortcut` , `parent`, and `keywords`:\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `id` | An identifier for each command, must be unique. Example: `id: \"user\"`. |\n| `title` | The title shown to users. This is used when searching for a command. Example: `title: \"Change theme...\"`. |\n| `keywords` | Not visible in the user interface, but can make it easier to discover commands through search. Example: `keywords: \"command change log sign out in\"`. |\n| `shortcut` | The keyboard shortcut. Example: `shortcut: \"Alt+KeyU\"`. See the sections [Defining Shortcuts](#defining-shortcuts) and [Choosing shortcuts](#choosing-shortcuts) below for more information. |\n| `section` | Used for grouping many commands under a common header. Example: `section: \"Commands\"`. |\n| `icon` | A name of an icon form Nordicons to show beside the title. If not specified, default command icon will be used instead. Example: `icon: \"file-picture\"`. |\n| `parent` | The `id` of a parent command. This is used for nesting commands. Example: `parent: \"theme\"`. |\n| `handler` | A function to execute when an user triggers a command. Example: `handler: () => { alert(\"Change to light theme\") }`. In cases where a command is only used as a parent command e.g. \"Change theme\", this is not required. |\n\n---\n\n## Defining shortcuts\n\nShortcuts in the Command Menu have the following form: `[modifier]+[key]`. Shortcuts are made up of a sequence of presses. A press can be as simple as a single key which matches against [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values):\n\n```js\n// Matches: event.code:\n\"KeyD\"\n```\n\nPresses can optionally be prefixed with **_modifiers_** which match against any valid value to [`KeyboardEvent.getModifierState()`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/getModifierState).\n\n```js\n\"Control+KeyD\"\n\"Meta+KeyD\"\n\"Shift+KeyD\"\n\"Alt+KeyD\"\n\"Meta+Shift+KeyD\"\n```\n\nThere is also a special `$mod` modifier that makes it easy to support cross platform keybindings:\n\n- Mac: `$mod` = `Meta` (⌘)\n- Windows/Linux: `$mod` = `Control`\n\n```js\n\"$mod+KeyD\" // ⌘/Ctrl + D\n\"$mod+Shift+KeyD\" // ⌘/Ctrl + Shift + D\n```\n\nThe Command Menu itself can be opened using `⌘+k` (or `Ctrl+k` on Windows) and closed by hitting `Esc`. These are both non-configurable shortcuts in order to unify the experience across our platforms.\n\n---\n\n## Choosing shortcuts\n\nWhen choosing shortcuts, it is very important that they do not clash with native operating system or browser shortcuts.\n\nFor example, you _should not_ define a shortcut like `$mod+KeyC`, since this will clash with the native “Copy” shortcut, and will be triggered every time a user copies text in the app. Nor should you use shortcuts like `Shift+KeyA` since this will get triggered whenever a user types an uppercase “A” character. Therefore, special care and attention must be given to _each and every_ shortcut choice.\n\nIn general, we recommend using the `Alt` modifier, since this is less likely to clash with existing shortcuts. However, be aware, the `Alt` key is also used for accented characters e.g. `Alt+KeyA` produces the letter “å”. Again, it is crucial that you choose shortcuts carefully.\n\nYou should strive to choose shortcuts that are intuitive and easy to remember. The more complex a shortcut, the less likely a user is to remember it. Of course, a user can still find a command by searching the command menu, and for some users this may be their preferred way of triggering commands.\n\n---\n\n## Common keybindings\n\nKeybindings will be matched against [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) and [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values) which may have some names you don’t expect. Please note that we recommend always using `KeyboardEvent.code` for defining the keys and only using `KeyboardEvent.key` for defining modifiers.\n\n| Windows | macOS | key | code |\n| ------------- | --------------- | ------------- | ------------------------------ |\n| N/A | `Command` / `⌘` | `Meta` | `MetaLeft` / `MetaRight` |\n| `Alt` | `Option` / `⌥` | `Alt` | `AltLeft` / `AltRight` |\n| `Control` | `Control` / `^` | `Control` | `ControlLeft` / `ControlRight` |\n| `Shift` | `Shift` | `Shift` | `ShiftLeft` / `ShiftRight` |\n| `Space` | `Space` | N/A | `Space` |\n| `Enter` | `Return` | `Enter` | `Enter` |\n| `Esc` | `Esc` | `Escape` | `Escape` |\n| `1`, `2`, etc | `1`, `2`, etc | `1`, `2`, etc | `Digit1`, `Digit2`, etc |\n| `a`, `b`, etc | `a`, `b`, etc | `a`, `b`, etc | `KeyA`, `KeyB`, etc |\n| `-` | `-` | `-` | `Minus` |\n| `=` | `=` | `=` | `Equal` |\n| `+` | `+` | `+` | `Equal`\\* |\n\nIn addition to the above table, you can use [https://keycode.info/](https://keycode.info/) for checking the specific values needed. Note that some keys will have the same code as others because they appear on the same key on the keyboard. Keep in mind how this is affected by international keyboards which may have different layouts.\n\n---\n\n## Navigating with the command menu\n\n1. Use `Ctrl+K` (Windows/Linux) or `Cmd+K` (Mac) to open the command menu.\n2. Start typing the command you want to execute. The suggestions in the command menu change to match your text.\n3. Finish entering the name, or use the arrow keys to highlight the command you want from the list of suggestions.\n4. Use `Enter` to execute the chosen command.\n5. If you chose a command that has nested commands, you can use `Backspace` to return to the previous menu.\n6. When the command menu is active, you can use one of the following keyboard shortcuts to close it: `Esc`, `Ctrl+K` (Windows and Linux) or `Cmd+K` (Mac).\n"
|
|
2367
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use for making it possible to choose one or more options from a limited number of options.\n- Use for “accepting terms of service” and similar functionality.\n- Use in forms to toggle something on or off.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you have more than 10 options to choose from.\n- Don’t change the selection of another checkbox when another one is clicked. Only exception is when a checkbox is used to make a bulk selection of multiple items.\n\n</div>\n\n---\n\n## Content guidelines\n\nCheckbox labels should be clear, accurate and predictable. It should be possible for the user to understand what they are selecting:\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">Option 1</div>\n\nWhen writing checkbox labels, always write them in sentence case, not title case. The first word should be capitalized and the rest lowercase (unless a proper noun):\n\n<div class=\"n-usage n-usage-do\">User settings</div>\n<div class=\"n-usage n-usage-dont\">User Settings</div>\n\nAvoid ending in punctuation if it’s a single sentence, word, or a fragment:\n\n<div class=\"n-usage n-usage-do\">Show dashboard</div>\n<div class=\"n-usage n-usage-dont\">Show dashboard.</div>\n\nDo not use commas or semicolons at the end of each line\n\n<div class=\"n-usage n-usage-do\">Patients</div>\n<div class=\"n-usage n-usage-dont\">Patients;</div>\n"
|
|
2368
2368
|
},
|
|
2369
2369
|
{
|
|
2370
2370
|
"kind": "javascript-module",
|
|
@@ -4342,82 +4342,6 @@
|
|
|
4342
4342
|
],
|
|
4343
4343
|
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use to choose a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nDate picker is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Choose date button\n\n- `Space, Enter`: Opens the date picker dialog and moves focus to the first select menu in the dialog.\n\n### Date picker dialog\n\n- `Esc`: Closes the date picker dialog and moves focus back to the “choose date” button.\n- `Tab`: Moves focus to the next element in the dialog. Please note since the calendar uses `role=\"grid\"`, only one button in the calendar grid is in the tab sequence. Additionally, if focus is on the last focusable element, focus is next moved back to the first focusable element inside the date picker dialog.\n- `Shift + Tab`: Same as above, but in reverse order.\n\n### Date picker dialog: Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Date picker dialog: Date grid\n\n- `Space, Enter`: Selects a date, closes the dialog, and moves focus back to the “Choose Date” button. Additionally updates the value of the date picker input with the selected date, and adds selected date to “Choose Date” button label.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n\n#### Date picker dialog: Close button\n\n- `Space, Enter`: Closes the dialog, moves focus to “choose date” button, but does not update the date in input.\n"
|
|
4344
4344
|
},
|
|
4345
|
-
{
|
|
4346
|
-
"kind": "javascript-module",
|
|
4347
|
-
"path": "src/header/Header.ts",
|
|
4348
|
-
"declarations": [
|
|
4349
|
-
{
|
|
4350
|
-
"kind": "class",
|
|
4351
|
-
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4352
|
-
"name": "Header",
|
|
4353
|
-
"slots": [
|
|
4354
|
-
{
|
|
4355
|
-
"description": "The header content.",
|
|
4356
|
-
"name": ""
|
|
4357
|
-
},
|
|
4358
|
-
{
|
|
4359
|
-
"description": "Optional slot for buttons, toggles, etc.",
|
|
4360
|
-
"name": "action"
|
|
4361
|
-
}
|
|
4362
|
-
],
|
|
4363
|
-
"members": [
|
|
4364
|
-
{
|
|
4365
|
-
"kind": "field",
|
|
4366
|
-
"name": "actionSlot",
|
|
4367
|
-
"privacy": "private",
|
|
4368
|
-
"default": "new SlotController(this, \"action\")"
|
|
4369
|
-
},
|
|
4370
|
-
{
|
|
4371
|
-
"kind": "field",
|
|
4372
|
-
"name": "_warningLogged",
|
|
4373
|
-
"type": {
|
|
4374
|
-
"text": "boolean"
|
|
4375
|
-
},
|
|
4376
|
-
"privacy": "private",
|
|
4377
|
-
"static": true,
|
|
4378
|
-
"default": "false",
|
|
4379
|
-
"inheritedFrom": {
|
|
4380
|
-
"name": "DraftComponentMixin",
|
|
4381
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4382
|
-
}
|
|
4383
|
-
}
|
|
4384
|
-
],
|
|
4385
|
-
"mixins": [
|
|
4386
|
-
{
|
|
4387
|
-
"name": "DraftComponentMixin",
|
|
4388
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4389
|
-
}
|
|
4390
|
-
],
|
|
4391
|
-
"superclass": {
|
|
4392
|
-
"name": "LitElement",
|
|
4393
|
-
"package": "lit"
|
|
4394
|
-
},
|
|
4395
|
-
"status": "draft",
|
|
4396
|
-
"category": "structure",
|
|
4397
|
-
"tagName": "nord-header",
|
|
4398
|
-
"customElement": true
|
|
4399
|
-
}
|
|
4400
|
-
],
|
|
4401
|
-
"exports": [
|
|
4402
|
-
{
|
|
4403
|
-
"kind": "js",
|
|
4404
|
-
"name": "default",
|
|
4405
|
-
"declaration": {
|
|
4406
|
-
"name": "Header",
|
|
4407
|
-
"module": "src/header/Header.ts"
|
|
4408
|
-
}
|
|
4409
|
-
},
|
|
4410
|
-
{
|
|
4411
|
-
"kind": "custom-element-definition",
|
|
4412
|
-
"name": "nord-header",
|
|
4413
|
-
"declaration": {
|
|
4414
|
-
"name": "Header",
|
|
4415
|
-
"module": "src/header/Header.ts"
|
|
4416
|
-
}
|
|
4417
|
-
}
|
|
4418
|
-
],
|
|
4419
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n\n</div>\n\n-------\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n"
|
|
4420
|
-
},
|
|
4421
4345
|
{
|
|
4422
4346
|
"kind": "javascript-module",
|
|
4423
4347
|
"path": "src/fieldset/Fieldset.ts",
|
|
@@ -4824,6 +4748,82 @@
|
|
|
4824
4748
|
],
|
|
4825
4749
|
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use to provide additional meaning in addition to a text label.\n- Use to help users who have difficulties with reading and attention.\n- Use in places where text label doesn’t fit (remember to add an accessible label for the icon).\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for decorative purposes alone.\n- Don’t use when a button’s action is already clear based on the text label.\n- Don’t use the same icon for differing purposes, as users will come to associate icons with specific types of actions.\n\n</div>\n\n---\n\n## Additional considerations\n\n- Icon components are hidden from assistive technologies by default.\n- Use `label` property to give an accessible label for the icon and to make it visible to assistive technologies.\n"
|
|
4826
4750
|
},
|
|
4751
|
+
{
|
|
4752
|
+
"kind": "javascript-module",
|
|
4753
|
+
"path": "src/header/Header.ts",
|
|
4754
|
+
"declarations": [
|
|
4755
|
+
{
|
|
4756
|
+
"kind": "class",
|
|
4757
|
+
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4758
|
+
"name": "Header",
|
|
4759
|
+
"slots": [
|
|
4760
|
+
{
|
|
4761
|
+
"description": "The header content.",
|
|
4762
|
+
"name": ""
|
|
4763
|
+
},
|
|
4764
|
+
{
|
|
4765
|
+
"description": "Optional slot for buttons, toggles, etc.",
|
|
4766
|
+
"name": "action"
|
|
4767
|
+
}
|
|
4768
|
+
],
|
|
4769
|
+
"members": [
|
|
4770
|
+
{
|
|
4771
|
+
"kind": "field",
|
|
4772
|
+
"name": "actionSlot",
|
|
4773
|
+
"privacy": "private",
|
|
4774
|
+
"default": "new SlotController(this, \"action\")"
|
|
4775
|
+
},
|
|
4776
|
+
{
|
|
4777
|
+
"kind": "field",
|
|
4778
|
+
"name": "_warningLogged",
|
|
4779
|
+
"type": {
|
|
4780
|
+
"text": "boolean"
|
|
4781
|
+
},
|
|
4782
|
+
"privacy": "private",
|
|
4783
|
+
"static": true,
|
|
4784
|
+
"default": "false",
|
|
4785
|
+
"inheritedFrom": {
|
|
4786
|
+
"name": "DraftComponentMixin",
|
|
4787
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4788
|
+
}
|
|
4789
|
+
}
|
|
4790
|
+
],
|
|
4791
|
+
"mixins": [
|
|
4792
|
+
{
|
|
4793
|
+
"name": "DraftComponentMixin",
|
|
4794
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4795
|
+
}
|
|
4796
|
+
],
|
|
4797
|
+
"superclass": {
|
|
4798
|
+
"name": "LitElement",
|
|
4799
|
+
"package": "lit"
|
|
4800
|
+
},
|
|
4801
|
+
"status": "draft",
|
|
4802
|
+
"category": "structure",
|
|
4803
|
+
"tagName": "nord-header",
|
|
4804
|
+
"customElement": true
|
|
4805
|
+
}
|
|
4806
|
+
],
|
|
4807
|
+
"exports": [
|
|
4808
|
+
{
|
|
4809
|
+
"kind": "js",
|
|
4810
|
+
"name": "default",
|
|
4811
|
+
"declaration": {
|
|
4812
|
+
"name": "Header",
|
|
4813
|
+
"module": "src/header/Header.ts"
|
|
4814
|
+
}
|
|
4815
|
+
},
|
|
4816
|
+
{
|
|
4817
|
+
"kind": "custom-element-definition",
|
|
4818
|
+
"name": "nord-header",
|
|
4819
|
+
"declaration": {
|
|
4820
|
+
"name": "Header",
|
|
4821
|
+
"module": "src/header/Header.ts"
|
|
4822
|
+
}
|
|
4823
|
+
}
|
|
4824
|
+
],
|
|
4825
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use the header component to show a heading to describe the current view.\n- Use the header component to hold primary actions.\n- Use the header component at a visual high position at full width.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t overcrowd the header component with too many actions or information.\n- Don’t nest the header component too deeply and restrict its available space.\n\n</div>\n\n-------\n\n## Content guidelines\n\nThe header component should be a containing element placed high on the page to present high level controls and to describe the page itself. It shouldn’t be overcrowded with controls or information.\n\n<div class=\"n-usage n-usage-do\">[Menu] Dashboard [Account] [Log out]</div>\n<div class=\"n-usage n-usage-dont\">[Menu] Use the cards below to view various information [Export] [Save] [Edit Profile] [Log out] [Preferences]</div>\n"
|
|
4826
|
+
},
|
|
4827
4827
|
{
|
|
4828
4828
|
"kind": "javascript-module",
|
|
4829
4829
|
"path": "src/input/Input.ts",
|