@nordhealth/components 1.0.0-beta.0 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1112 -1030
- package/lib/Card.js +1 -1
- package/lib/Card.js.map +1 -1
- package/lib/Header.js +1 -1
- package/lib/Header.js.map +1 -1
- package/lib/Layout.js +2 -0
- package/lib/Layout.js.map +1 -0
- package/lib/bundle.js +2 -2
- package/lib/bundle.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/layout/Layout.d.ts +23 -0
- package/lib/src/layout/Layout.test.d.ts +12 -0
- package/package.json +3 -3
package/custom-elements.json
CHANGED
|
@@ -190,6 +190,14 @@
|
|
|
190
190
|
"name": "default",
|
|
191
191
|
"module": "\"./navigation/Navigation.js\""
|
|
192
192
|
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"kind": "js",
|
|
196
|
+
"name": "Layout",
|
|
197
|
+
"declaration": {
|
|
198
|
+
"name": "default",
|
|
199
|
+
"module": "\"./layout/Layout.js\""
|
|
200
|
+
}
|
|
193
201
|
}
|
|
194
202
|
]
|
|
195
203
|
},
|
|
@@ -686,114 +694,6 @@
|
|
|
686
694
|
],
|
|
687
695
|
"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 clear and accurate labels.\n- Use established button colors appropriately. For example, only use a danger button style for an action that’s difficult or impossible to undo.\n- Prioritize the most important actions. Too many buttons will cause confusion.\n- Be consistent with positioning of buttons in the user interface.\n- Use strong, actionable verbs in labels such as “Add”, “Close”, “Cancel”, or “Save”.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use buttons to link to other pages. Use regular link or a plain style instead where necessary.\n- Don’t use buttons for navigation where the link appears within or following a sentence.\n- Don’t use labels such as “Read more”, “Click here” or “More”.\n\n</div>\n\n---\n\n## Content guidelines\n\nButton labels should be clear, accurate and predictable. It should be possible for the user to understand what will happen when they click a button:\n\n<div class=\"n-usage n-usage-do\">View user settings</div>\n<div class=\"n-usage n-usage-dont\">Click here</div>\n\nWhen writing button 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\">My tasks</div>\n<div class=\"n-usage n-usage-dont\">My Tasks</div>\n\nAvoid unnecessary words and articles in button labels, such as “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Add item</div>\n<div class=\"n-usage n-usage-dont\">Add an item</div>\n\n---\n\n## Variants\n\nThis section describes the different component variants, their purpose, and when to use each variant.\n\n| Name | Purpose |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `default` | Default style is the most common button variant. Only switch to another variant if you need to adjust the visual weight of the element. |\n| `primary` | Primary style is reserved for main call-to-actions. Should be used only once per content area or panel, e.g. for a “Save” action. |\n| `dashed` | Dashed style should be used for actions that trigger filtering. |\n| `danger` | Danger style should be used for actions that delete data or otherwise make it hard to undo the action. |\n| `plain` | Used for less important or less common actions. Can be also used for linking to other pages. |\n| `disabled` | Used for actions that aren’t currently available or not available anymore. Also prevents users from being able to interact with the component, and conveys its inactive state to assistive technologies. |\n\n---\n\n## Additional considerations\n\n- Users of assistive technology expect a button to submit data or do an action. If you need the button to navigate into another view, use the `href` property which will output `<a>` tag instead of a `<button>`.\n- When you need to disable a button, use `disabled` property as it conveys this information correctly to assistive technologies like screen readers.\n- Button component provides 3 size variants; small, medium and large. The large size should only be used for marketing purposes or on areas such as an empty space/content notice.\n"
|
|
688
696
|
},
|
|
689
|
-
{
|
|
690
|
-
"kind": "javascript-module",
|
|
691
|
-
"path": "src/card/Card.ts",
|
|
692
|
-
"declarations": [
|
|
693
|
-
{
|
|
694
|
-
"kind": "class",
|
|
695
|
-
"description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
|
|
696
|
-
"name": "Card",
|
|
697
|
-
"slots": [
|
|
698
|
-
{
|
|
699
|
-
"description": "The card content.",
|
|
700
|
-
"name": ""
|
|
701
|
-
},
|
|
702
|
-
{
|
|
703
|
-
"description": "Optional slot that holds a header for the card.",
|
|
704
|
-
"name": "header"
|
|
705
|
-
},
|
|
706
|
-
{
|
|
707
|
-
"description": "Optional slot that holds footer content for the card.",
|
|
708
|
-
"name": "footer"
|
|
709
|
-
}
|
|
710
|
-
],
|
|
711
|
-
"members": [
|
|
712
|
-
{
|
|
713
|
-
"kind": "field",
|
|
714
|
-
"name": "headerSlot",
|
|
715
|
-
"privacy": "private",
|
|
716
|
-
"default": "new SlotController(this, \"header\")"
|
|
717
|
-
},
|
|
718
|
-
{
|
|
719
|
-
"kind": "field",
|
|
720
|
-
"name": "footerSlot",
|
|
721
|
-
"privacy": "private",
|
|
722
|
-
"default": "new SlotController(this, \"footer\")"
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
"kind": "field",
|
|
726
|
-
"name": "padding",
|
|
727
|
-
"type": {
|
|
728
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
729
|
-
},
|
|
730
|
-
"default": "\"m\"",
|
|
731
|
-
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
732
|
-
"attribute": "padding",
|
|
733
|
-
"reflects": true
|
|
734
|
-
},
|
|
735
|
-
{
|
|
736
|
-
"kind": "field",
|
|
737
|
-
"name": "_warningLogged",
|
|
738
|
-
"type": {
|
|
739
|
-
"text": "boolean"
|
|
740
|
-
},
|
|
741
|
-
"privacy": "private",
|
|
742
|
-
"static": true,
|
|
743
|
-
"default": "false",
|
|
744
|
-
"inheritedFrom": {
|
|
745
|
-
"name": "DraftComponentMixin",
|
|
746
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
],
|
|
750
|
-
"attributes": [
|
|
751
|
-
{
|
|
752
|
-
"name": "padding",
|
|
753
|
-
"type": {
|
|
754
|
-
"text": "\"m\" | \"l\" | \"none\""
|
|
755
|
-
},
|
|
756
|
-
"default": "\"m\"",
|
|
757
|
-
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
758
|
-
"fieldName": "padding"
|
|
759
|
-
}
|
|
760
|
-
],
|
|
761
|
-
"mixins": [
|
|
762
|
-
{
|
|
763
|
-
"name": "DraftComponentMixin",
|
|
764
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
765
|
-
}
|
|
766
|
-
],
|
|
767
|
-
"superclass": {
|
|
768
|
-
"name": "LitElement",
|
|
769
|
-
"package": "lit"
|
|
770
|
-
},
|
|
771
|
-
"status": "draft",
|
|
772
|
-
"category": "structure",
|
|
773
|
-
"tagName": "nord-card",
|
|
774
|
-
"customElement": true
|
|
775
|
-
}
|
|
776
|
-
],
|
|
777
|
-
"exports": [
|
|
778
|
-
{
|
|
779
|
-
"kind": "js",
|
|
780
|
-
"name": "default",
|
|
781
|
-
"declaration": {
|
|
782
|
-
"name": "Card",
|
|
783
|
-
"module": "src/card/Card.ts"
|
|
784
|
-
}
|
|
785
|
-
},
|
|
786
|
-
{
|
|
787
|
-
"kind": "custom-element-definition",
|
|
788
|
-
"name": "nord-card",
|
|
789
|
-
"declaration": {
|
|
790
|
-
"name": "Card",
|
|
791
|
-
"module": "src/card/Card.ts"
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
],
|
|
795
|
-
"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 display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
796
|
-
},
|
|
797
697
|
{
|
|
798
698
|
"kind": "javascript-module",
|
|
799
699
|
"path": "src/calendar/Calendar.ts",
|
|
@@ -1275,411 +1175,385 @@
|
|
|
1275
1175
|
},
|
|
1276
1176
|
{
|
|
1277
1177
|
"kind": "javascript-module",
|
|
1278
|
-
"path": "src/
|
|
1178
|
+
"path": "src/card/Card.ts",
|
|
1279
1179
|
"declarations": [
|
|
1280
1180
|
{
|
|
1281
1181
|
"kind": "class",
|
|
1282
|
-
"description": "
|
|
1283
|
-
"name": "
|
|
1182
|
+
"description": "Cards are shadowed surfaces that display content and actions on a\nsingle topic. They should be easy to scan for relevant and\nactionable information.",
|
|
1183
|
+
"name": "Card",
|
|
1284
1184
|
"slots": [
|
|
1285
1185
|
{
|
|
1286
|
-
"description": "
|
|
1287
|
-
"name": "
|
|
1186
|
+
"description": "The card content.",
|
|
1187
|
+
"name": ""
|
|
1288
1188
|
},
|
|
1289
1189
|
{
|
|
1290
|
-
"description": "Optional slot that holds
|
|
1291
|
-
"name": "
|
|
1190
|
+
"description": "Optional slot that holds a header for the card.",
|
|
1191
|
+
"name": "header"
|
|
1292
1192
|
},
|
|
1293
1193
|
{
|
|
1294
|
-
"description": "Optional slot that holds
|
|
1295
|
-
"name": "
|
|
1194
|
+
"description": "Optional slot that holds footer content for the card.",
|
|
1195
|
+
"name": "footer"
|
|
1296
1196
|
}
|
|
1297
1197
|
],
|
|
1298
1198
|
"members": [
|
|
1299
1199
|
{
|
|
1300
1200
|
"kind": "field",
|
|
1301
|
-
"name": "
|
|
1302
|
-
"privacy": "
|
|
1303
|
-
"
|
|
1304
|
-
"name": "FormAssociatedMixin",
|
|
1305
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1306
|
-
}
|
|
1307
|
-
},
|
|
1308
|
-
{
|
|
1309
|
-
"kind": "field",
|
|
1310
|
-
"name": "checked",
|
|
1311
|
-
"type": {
|
|
1312
|
-
"text": "boolean"
|
|
1313
|
-
},
|
|
1314
|
-
"default": "false",
|
|
1315
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
1316
|
-
"attribute": "checked"
|
|
1317
|
-
},
|
|
1318
|
-
{
|
|
1319
|
-
"kind": "method",
|
|
1320
|
-
"name": "handleChange",
|
|
1321
|
-
"privacy": "protected",
|
|
1322
|
-
"return": {
|
|
1323
|
-
"type": {
|
|
1324
|
-
"text": "void"
|
|
1325
|
-
}
|
|
1326
|
-
},
|
|
1327
|
-
"parameters": [
|
|
1328
|
-
{
|
|
1329
|
-
"name": "e",
|
|
1330
|
-
"type": {
|
|
1331
|
-
"text": "Event"
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
],
|
|
1335
|
-
"inheritedFrom": {
|
|
1336
|
-
"name": "FormAssociatedMixin",
|
|
1337
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1338
|
-
}
|
|
1339
|
-
},
|
|
1340
|
-
{
|
|
1341
|
-
"kind": "field",
|
|
1342
|
-
"name": "labelSlot",
|
|
1343
|
-
"privacy": "protected",
|
|
1344
|
-
"default": "new SlotController(this, \"label\")",
|
|
1345
|
-
"inheritedFrom": {
|
|
1346
|
-
"name": "FormAssociatedMixin",
|
|
1347
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1348
|
-
}
|
|
1349
|
-
},
|
|
1350
|
-
{
|
|
1351
|
-
"kind": "field",
|
|
1352
|
-
"name": "errorSlot",
|
|
1353
|
-
"privacy": "protected",
|
|
1354
|
-
"default": "new SlotController(this, \"error\")",
|
|
1355
|
-
"inheritedFrom": {
|
|
1356
|
-
"name": "FormAssociatedMixin",
|
|
1357
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1358
|
-
}
|
|
1359
|
-
},
|
|
1360
|
-
{
|
|
1361
|
-
"kind": "field",
|
|
1362
|
-
"name": "hintSlot",
|
|
1363
|
-
"privacy": "protected",
|
|
1364
|
-
"default": "new SlotController(this, \"hint\")",
|
|
1365
|
-
"inheritedFrom": {
|
|
1366
|
-
"name": "FormAssociatedMixin",
|
|
1367
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1368
|
-
}
|
|
1201
|
+
"name": "headerSlot",
|
|
1202
|
+
"privacy": "private",
|
|
1203
|
+
"default": "new SlotController(this, \"header\")"
|
|
1369
1204
|
},
|
|
1370
1205
|
{
|
|
1371
1206
|
"kind": "field",
|
|
1372
|
-
"name": "
|
|
1373
|
-
"privacy": "
|
|
1374
|
-
"default": "new
|
|
1375
|
-
"inheritedFrom": {
|
|
1376
|
-
"name": "FormAssociatedMixin",
|
|
1377
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1378
|
-
}
|
|
1207
|
+
"name": "footerSlot",
|
|
1208
|
+
"privacy": "private",
|
|
1209
|
+
"default": "new SlotController(this, \"footer\")"
|
|
1379
1210
|
},
|
|
1380
1211
|
{
|
|
1381
1212
|
"kind": "field",
|
|
1382
|
-
"name": "
|
|
1213
|
+
"name": "padding",
|
|
1383
1214
|
"type": {
|
|
1384
|
-
"text": "
|
|
1215
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1385
1216
|
},
|
|
1386
|
-
"
|
|
1387
|
-
"
|
|
1388
|
-
"
|
|
1389
|
-
|
|
1390
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1391
|
-
}
|
|
1217
|
+
"default": "\"m\"",
|
|
1218
|
+
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1219
|
+
"attribute": "padding",
|
|
1220
|
+
"reflects": true
|
|
1392
1221
|
},
|
|
1393
1222
|
{
|
|
1394
1223
|
"kind": "field",
|
|
1395
|
-
"name": "
|
|
1224
|
+
"name": "_warningLogged",
|
|
1396
1225
|
"type": {
|
|
1397
|
-
"text": "
|
|
1226
|
+
"text": "boolean"
|
|
1398
1227
|
},
|
|
1399
|
-
"privacy": "
|
|
1400
|
-
"
|
|
1228
|
+
"privacy": "private",
|
|
1229
|
+
"static": true,
|
|
1230
|
+
"default": "false",
|
|
1401
1231
|
"inheritedFrom": {
|
|
1402
|
-
"name": "
|
|
1403
|
-
"module": "src/common/mixins/
|
|
1232
|
+
"name": "DraftComponentMixin",
|
|
1233
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
1404
1234
|
}
|
|
1405
|
-
}
|
|
1235
|
+
}
|
|
1236
|
+
],
|
|
1237
|
+
"attributes": [
|
|
1406
1238
|
{
|
|
1407
|
-
"
|
|
1408
|
-
"name": "hintId",
|
|
1239
|
+
"name": "padding",
|
|
1409
1240
|
"type": {
|
|
1410
|
-
"text": "
|
|
1241
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
1411
1242
|
},
|
|
1412
|
-
"
|
|
1413
|
-
"
|
|
1414
|
-
"
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1243
|
+
"default": "\"m\"",
|
|
1244
|
+
"description": "Controls the padding of card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
1245
|
+
"fieldName": "padding"
|
|
1246
|
+
}
|
|
1247
|
+
],
|
|
1248
|
+
"mixins": [
|
|
1249
|
+
{
|
|
1250
|
+
"name": "DraftComponentMixin",
|
|
1251
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
1252
|
+
}
|
|
1253
|
+
],
|
|
1254
|
+
"superclass": {
|
|
1255
|
+
"name": "LitElement",
|
|
1256
|
+
"package": "lit"
|
|
1257
|
+
},
|
|
1258
|
+
"status": "draft",
|
|
1259
|
+
"category": "structure",
|
|
1260
|
+
"tagName": "nord-card",
|
|
1261
|
+
"customElement": true
|
|
1262
|
+
}
|
|
1263
|
+
],
|
|
1264
|
+
"exports": [
|
|
1265
|
+
{
|
|
1266
|
+
"kind": "js",
|
|
1267
|
+
"name": "default",
|
|
1268
|
+
"declaration": {
|
|
1269
|
+
"name": "Card",
|
|
1270
|
+
"module": "src/card/Card.ts"
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
"kind": "custom-element-definition",
|
|
1275
|
+
"name": "nord-card",
|
|
1276
|
+
"declaration": {
|
|
1277
|
+
"name": "Card",
|
|
1278
|
+
"module": "src/card/Card.ts"
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
],
|
|
1282
|
+
"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 display content and actions on a single topic inside a container.\n- Use to visually separate specific parts of content in an application view.\n- Use to wrap a form into a container, for example a login form.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when you need to capture user’s attention in a prominent way.\n- Don’t use to inform user about important changes or conditions in the interface.\n- Don’t use multiple primary buttons inside a card. A card should only contain a single primary action.\n\n</div>\n"
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
"kind": "javascript-module",
|
|
1286
|
+
"path": "src/command-menu/CommandMenu.ts",
|
|
1287
|
+
"declarations": [
|
|
1288
|
+
{
|
|
1289
|
+
"kind": "class",
|
|
1290
|
+
"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.",
|
|
1291
|
+
"name": "CommandMenu",
|
|
1292
|
+
"slots": [
|
|
1293
|
+
{
|
|
1294
|
+
"description": "Used to replace the default footer contents.",
|
|
1295
|
+
"name": "footer"
|
|
1296
|
+
}
|
|
1297
|
+
],
|
|
1298
|
+
"members": [
|
|
1419
1299
|
{
|
|
1420
1300
|
"kind": "field",
|
|
1421
|
-
"name": "
|
|
1422
|
-
"
|
|
1423
|
-
"text": "string"
|
|
1424
|
-
},
|
|
1425
|
-
"default": "\"\"",
|
|
1426
|
-
"description": "Label for the input.",
|
|
1427
|
-
"attribute": "label",
|
|
1428
|
-
"inheritedFrom": {
|
|
1429
|
-
"name": "FormAssociatedMixin",
|
|
1430
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1431
|
-
}
|
|
1301
|
+
"name": "inputRef",
|
|
1302
|
+
"privacy": "private"
|
|
1432
1303
|
},
|
|
1433
1304
|
{
|
|
1434
1305
|
"kind": "field",
|
|
1435
|
-
"name": "
|
|
1306
|
+
"name": "listRef",
|
|
1307
|
+
"privacy": "private"
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
"kind": "field",
|
|
1311
|
+
"name": "previousFocus",
|
|
1436
1312
|
"type": {
|
|
1437
|
-
"text": "
|
|
1313
|
+
"text": "HTMLElement | undefined"
|
|
1438
1314
|
},
|
|
1439
|
-
"
|
|
1440
|
-
"attribute": "hint",
|
|
1441
|
-
"inheritedFrom": {
|
|
1442
|
-
"name": "FormAssociatedMixin",
|
|
1443
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1444
|
-
}
|
|
1315
|
+
"privacy": "private"
|
|
1445
1316
|
},
|
|
1446
1317
|
{
|
|
1447
1318
|
"kind": "field",
|
|
1448
|
-
"name": "
|
|
1319
|
+
"name": "dismissController",
|
|
1320
|
+
"privacy": "private",
|
|
1321
|
+
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
"kind": "field",
|
|
1325
|
+
"name": "keyboardController",
|
|
1326
|
+
"privacy": "private",
|
|
1327
|
+
"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 })"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
"kind": "field",
|
|
1331
|
+
"name": "open",
|
|
1449
1332
|
"type": {
|
|
1450
1333
|
"text": "boolean"
|
|
1451
1334
|
},
|
|
1452
1335
|
"default": "false",
|
|
1453
|
-
"description": "
|
|
1454
|
-
"attribute": "
|
|
1455
|
-
"inheritedFrom": {
|
|
1456
|
-
"name": "FormAssociatedMixin",
|
|
1457
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1458
|
-
}
|
|
1336
|
+
"description": "Show or hide the command menu.",
|
|
1337
|
+
"attribute": "open"
|
|
1459
1338
|
},
|
|
1460
1339
|
{
|
|
1461
1340
|
"kind": "field",
|
|
1462
1341
|
"name": "placeholder",
|
|
1463
1342
|
"type": {
|
|
1464
|
-
"text": "string
|
|
1343
|
+
"text": "string"
|
|
1465
1344
|
},
|
|
1466
|
-
"
|
|
1467
|
-
"
|
|
1468
|
-
"
|
|
1469
|
-
"name": "FormAssociatedMixin",
|
|
1470
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1471
|
-
}
|
|
1345
|
+
"default": "\"Type a command or search...\"",
|
|
1346
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
1347
|
+
"attribute": "placeholder"
|
|
1472
1348
|
},
|
|
1473
1349
|
{
|
|
1474
1350
|
"kind": "field",
|
|
1475
|
-
"name": "
|
|
1351
|
+
"name": "commands",
|
|
1352
|
+
"type": {
|
|
1353
|
+
"text": "Array<ICommandMenuAction>"
|
|
1354
|
+
},
|
|
1355
|
+
"default": "[]",
|
|
1356
|
+
"description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"kind": "field",
|
|
1360
|
+
"name": "parent",
|
|
1476
1361
|
"type": {
|
|
1477
1362
|
"text": "string | undefined"
|
|
1478
1363
|
},
|
|
1479
|
-
"
|
|
1480
|
-
"attribute": "error",
|
|
1481
|
-
"inheritedFrom": {
|
|
1482
|
-
"name": "FormAssociatedMixin",
|
|
1483
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1484
|
-
}
|
|
1364
|
+
"privacy": "private"
|
|
1485
1365
|
},
|
|
1486
1366
|
{
|
|
1487
1367
|
"kind": "field",
|
|
1488
|
-
"name": "
|
|
1368
|
+
"name": "search",
|
|
1489
1369
|
"type": {
|
|
1490
|
-
"text": "
|
|
1370
|
+
"text": "string"
|
|
1491
1371
|
},
|
|
1492
|
-
"
|
|
1493
|
-
"
|
|
1494
|
-
"attribute": "required",
|
|
1495
|
-
"inheritedFrom": {
|
|
1496
|
-
"name": "FormAssociatedMixin",
|
|
1497
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1498
|
-
}
|
|
1372
|
+
"privacy": "private",
|
|
1373
|
+
"default": "\"\""
|
|
1499
1374
|
},
|
|
1500
1375
|
{
|
|
1501
1376
|
"kind": "field",
|
|
1502
|
-
"name": "
|
|
1377
|
+
"name": "bump",
|
|
1503
1378
|
"type": {
|
|
1504
1379
|
"text": "boolean"
|
|
1505
1380
|
},
|
|
1506
|
-
"
|
|
1507
|
-
"
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
"
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1381
|
+
"privacy": "private",
|
|
1382
|
+
"default": "true"
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
"kind": "field",
|
|
1386
|
+
"name": "selectedIndex",
|
|
1387
|
+
"type": {
|
|
1388
|
+
"text": "number"
|
|
1389
|
+
},
|
|
1390
|
+
"privacy": "private",
|
|
1391
|
+
"default": "0"
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
"kind": "field",
|
|
1395
|
+
"name": "filteredCommands",
|
|
1396
|
+
"type": {
|
|
1397
|
+
"text": "Array<ICommandMenuAction>"
|
|
1398
|
+
},
|
|
1399
|
+
"privacy": "private",
|
|
1400
|
+
"default": "[]"
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
"kind": "field",
|
|
1404
|
+
"name": "selected",
|
|
1405
|
+
"type": {
|
|
1406
|
+
"text": "ICommandMenuAction"
|
|
1407
|
+
},
|
|
1408
|
+
"privacy": "private"
|
|
1514
1409
|
},
|
|
1515
1410
|
{
|
|
1516
1411
|
"kind": "method",
|
|
1517
|
-
"name": "
|
|
1518
|
-
"privacy": "protected",
|
|
1412
|
+
"name": "show",
|
|
1519
1413
|
"parameters": [
|
|
1520
1414
|
{
|
|
1521
|
-
"name": "
|
|
1415
|
+
"name": "options",
|
|
1416
|
+
"default": "{}",
|
|
1522
1417
|
"type": {
|
|
1523
|
-
"text": "
|
|
1524
|
-
}
|
|
1418
|
+
"text": "{ parent?: string }"
|
|
1419
|
+
},
|
|
1420
|
+
"description": "allows you to open the menu filtered to a specific parent command."
|
|
1525
1421
|
}
|
|
1526
1422
|
],
|
|
1527
|
-
"
|
|
1528
|
-
"name": "FormAssociatedMixin",
|
|
1529
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1530
|
-
}
|
|
1423
|
+
"description": "Show the command menu programmatically."
|
|
1531
1424
|
},
|
|
1532
1425
|
{
|
|
1533
1426
|
"kind": "method",
|
|
1534
|
-
"name": "
|
|
1535
|
-
"
|
|
1536
|
-
"inheritedFrom": {
|
|
1537
|
-
"name": "FormAssociatedMixin",
|
|
1538
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1539
|
-
}
|
|
1427
|
+
"name": "close",
|
|
1428
|
+
"description": "Close the command menu programmatically."
|
|
1540
1429
|
},
|
|
1541
1430
|
{
|
|
1542
1431
|
"kind": "method",
|
|
1543
|
-
"name": "
|
|
1544
|
-
"
|
|
1545
|
-
"inheritedFrom": {
|
|
1546
|
-
"name": "FormAssociatedMixin",
|
|
1547
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1548
|
-
}
|
|
1432
|
+
"name": "toggleOpen",
|
|
1433
|
+
"description": "Toggle the open state programmatically."
|
|
1549
1434
|
},
|
|
1550
1435
|
{
|
|
1551
1436
|
"kind": "method",
|
|
1552
|
-
"name": "
|
|
1553
|
-
"
|
|
1554
|
-
"inheritedFrom": {
|
|
1555
|
-
"name": "FormAssociatedMixin",
|
|
1556
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1557
|
-
}
|
|
1437
|
+
"name": "focus",
|
|
1438
|
+
"description": "Focus the command menu's input."
|
|
1558
1439
|
},
|
|
1559
1440
|
{
|
|
1560
1441
|
"kind": "method",
|
|
1561
|
-
"name": "
|
|
1562
|
-
"privacy": "
|
|
1563
|
-
"inheritedFrom": {
|
|
1564
|
-
"name": "FormAssociatedMixin",
|
|
1565
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1566
|
-
}
|
|
1567
|
-
},
|
|
1568
|
-
{
|
|
1569
|
-
"kind": "field",
|
|
1570
|
-
"name": "hasHint",
|
|
1571
|
-
"privacy": "protected",
|
|
1572
|
-
"inheritedFrom": {
|
|
1573
|
-
"name": "FormAssociatedMixin",
|
|
1574
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1575
|
-
}
|
|
1576
|
-
},
|
|
1577
|
-
{
|
|
1578
|
-
"kind": "field",
|
|
1579
|
-
"name": "hasError",
|
|
1580
|
-
"privacy": "protected",
|
|
1581
|
-
"inheritedFrom": {
|
|
1582
|
-
"name": "FormAssociatedMixin",
|
|
1583
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1584
|
-
}
|
|
1442
|
+
"name": "renderNoResults",
|
|
1443
|
+
"privacy": "private"
|
|
1585
1444
|
},
|
|
1586
1445
|
{
|
|
1587
|
-
"kind": "
|
|
1588
|
-
"name": "
|
|
1589
|
-
"
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1446
|
+
"kind": "method",
|
|
1447
|
+
"name": "renderSection",
|
|
1448
|
+
"privacy": "private",
|
|
1449
|
+
"parameters": [
|
|
1450
|
+
{
|
|
1451
|
+
"name": "section",
|
|
1452
|
+
"type": {
|
|
1453
|
+
"text": "string | undefined"
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
{
|
|
1457
|
+
"name": "commands",
|
|
1458
|
+
"type": {
|
|
1459
|
+
"text": "ICommandMenuAction[]"
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
]
|
|
1600
1463
|
},
|
|
1601
1464
|
{
|
|
1602
|
-
"kind": "
|
|
1603
|
-
"name": "
|
|
1604
|
-
"
|
|
1605
|
-
"text": "string | undefined"
|
|
1606
|
-
},
|
|
1607
|
-
"description": "The name of the form component.",
|
|
1608
|
-
"attribute": "name",
|
|
1609
|
-
"inheritedFrom": {
|
|
1610
|
-
"name": "InputMixin",
|
|
1611
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1612
|
-
}
|
|
1465
|
+
"kind": "method",
|
|
1466
|
+
"name": "handleAnimationEnd",
|
|
1467
|
+
"privacy": "private"
|
|
1613
1468
|
},
|
|
1614
1469
|
{
|
|
1615
|
-
"kind": "
|
|
1616
|
-
"name": "
|
|
1617
|
-
"
|
|
1618
|
-
"text": "string"
|
|
1619
|
-
},
|
|
1620
|
-
"default": "\"\"",
|
|
1621
|
-
"description": "The value of the form component.",
|
|
1622
|
-
"attribute": "value",
|
|
1623
|
-
"inheritedFrom": {
|
|
1624
|
-
"name": "InputMixin",
|
|
1625
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1626
|
-
}
|
|
1470
|
+
"kind": "method",
|
|
1471
|
+
"name": "handleBlur",
|
|
1472
|
+
"privacy": "private"
|
|
1627
1473
|
},
|
|
1628
1474
|
{
|
|
1629
|
-
"kind": "
|
|
1630
|
-
"name": "
|
|
1631
|
-
"privacy": "
|
|
1632
|
-
"
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1475
|
+
"kind": "method",
|
|
1476
|
+
"name": "handleInput",
|
|
1477
|
+
"privacy": "private",
|
|
1478
|
+
"parameters": [
|
|
1479
|
+
{
|
|
1480
|
+
"name": "event",
|
|
1481
|
+
"type": {
|
|
1482
|
+
"text": "KeyboardEvent"
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
]
|
|
1637
1486
|
},
|
|
1638
1487
|
{
|
|
1639
|
-
"kind": "
|
|
1640
|
-
"name": "
|
|
1641
|
-
"privacy": "
|
|
1642
|
-
"
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1488
|
+
"kind": "method",
|
|
1489
|
+
"name": "select",
|
|
1490
|
+
"privacy": "private",
|
|
1491
|
+
"parameters": [
|
|
1492
|
+
{
|
|
1493
|
+
"name": "command",
|
|
1494
|
+
"default": "this.selected",
|
|
1495
|
+
"type": {
|
|
1496
|
+
"text": "ICommandMenuAction"
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
]
|
|
1646
1500
|
},
|
|
1647
1501
|
{
|
|
1648
1502
|
"kind": "method",
|
|
1649
|
-
"name": "
|
|
1503
|
+
"name": "start",
|
|
1504
|
+
"privacy": "private"
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
"kind": "method",
|
|
1508
|
+
"name": "end",
|
|
1509
|
+
"privacy": "private"
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
"kind": "method",
|
|
1513
|
+
"name": "next",
|
|
1514
|
+
"privacy": "private"
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
"kind": "method",
|
|
1518
|
+
"name": "previous",
|
|
1519
|
+
"privacy": "private"
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
"kind": "method",
|
|
1523
|
+
"name": "goBack",
|
|
1524
|
+
"privacy": "private"
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
"kind": "method",
|
|
1528
|
+
"name": "setParent",
|
|
1529
|
+
"privacy": "private",
|
|
1650
1530
|
"parameters": [
|
|
1651
1531
|
{
|
|
1652
|
-
"name": "
|
|
1532
|
+
"name": "parent",
|
|
1653
1533
|
"optional": true,
|
|
1654
1534
|
"type": {
|
|
1655
|
-
"text": "
|
|
1656
|
-
}
|
|
1657
|
-
"description": "An object which controls aspects of the focusing process."
|
|
1535
|
+
"text": "string"
|
|
1536
|
+
}
|
|
1658
1537
|
}
|
|
1659
|
-
]
|
|
1660
|
-
"description": "Programmatically move focus to the component.",
|
|
1661
|
-
"inheritedFrom": {
|
|
1662
|
-
"name": "FocusableMixin",
|
|
1663
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1664
|
-
}
|
|
1538
|
+
]
|
|
1665
1539
|
},
|
|
1666
1540
|
{
|
|
1667
1541
|
"kind": "method",
|
|
1668
|
-
"name": "
|
|
1669
|
-
"
|
|
1670
|
-
"
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1542
|
+
"name": "setSearch",
|
|
1543
|
+
"privacy": "private",
|
|
1544
|
+
"parameters": [
|
|
1545
|
+
{
|
|
1546
|
+
"name": "str",
|
|
1547
|
+
"type": {
|
|
1548
|
+
"text": "string"
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
]
|
|
1674
1552
|
},
|
|
1675
1553
|
{
|
|
1676
1554
|
"kind": "method",
|
|
1677
|
-
"name": "
|
|
1678
|
-
"
|
|
1679
|
-
"inheritedFrom": {
|
|
1680
|
-
"name": "FocusableMixin",
|
|
1681
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1682
|
-
}
|
|
1555
|
+
"name": "filterCommands",
|
|
1556
|
+
"privacy": "private"
|
|
1683
1557
|
},
|
|
1684
1558
|
{
|
|
1685
1559
|
"kind": "field",
|
|
@@ -1696,156 +1570,50 @@
|
|
|
1696
1570
|
}
|
|
1697
1571
|
}
|
|
1698
1572
|
],
|
|
1699
|
-
"
|
|
1573
|
+
"events": [
|
|
1700
1574
|
{
|
|
1701
|
-
"name": "
|
|
1575
|
+
"name": "open",
|
|
1702
1576
|
"type": {
|
|
1703
|
-
"text": "
|
|
1577
|
+
"text": "NordEvent"
|
|
1704
1578
|
},
|
|
1705
|
-
"
|
|
1706
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
1707
|
-
"fieldName": "checked"
|
|
1579
|
+
"description": "The command menu was opened."
|
|
1708
1580
|
},
|
|
1709
1581
|
{
|
|
1710
|
-
"name": "
|
|
1582
|
+
"name": "close",
|
|
1711
1583
|
"type": {
|
|
1712
|
-
"text": "
|
|
1584
|
+
"text": "NordEvent"
|
|
1713
1585
|
},
|
|
1714
|
-
"
|
|
1715
|
-
"description": "Label for the input.",
|
|
1716
|
-
"fieldName": "label",
|
|
1717
|
-
"inheritedFrom": {
|
|
1718
|
-
"name": "FormAssociatedMixin",
|
|
1719
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1720
|
-
}
|
|
1586
|
+
"description": "The command menu was closed."
|
|
1721
1587
|
},
|
|
1722
1588
|
{
|
|
1723
|
-
"name": "hint",
|
|
1724
1589
|
"type": {
|
|
1725
|
-
"text": "
|
|
1590
|
+
"text": "SelectEvent"
|
|
1726
1591
|
},
|
|
1727
|
-
"description": "
|
|
1728
|
-
"
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
}
|
|
1733
|
-
},
|
|
1592
|
+
"description": "User selected a command from the menu.",
|
|
1593
|
+
"name": "nord-select"
|
|
1594
|
+
}
|
|
1595
|
+
],
|
|
1596
|
+
"attributes": [
|
|
1734
1597
|
{
|
|
1735
|
-
"name": "
|
|
1598
|
+
"name": "open",
|
|
1736
1599
|
"type": {
|
|
1737
1600
|
"text": "boolean"
|
|
1738
1601
|
},
|
|
1739
1602
|
"default": "false",
|
|
1740
|
-
"description": "
|
|
1741
|
-
"fieldName": "
|
|
1742
|
-
"inheritedFrom": {
|
|
1743
|
-
"name": "FormAssociatedMixin",
|
|
1744
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1745
|
-
}
|
|
1603
|
+
"description": "Show or hide the command menu.",
|
|
1604
|
+
"fieldName": "open"
|
|
1746
1605
|
},
|
|
1747
1606
|
{
|
|
1748
1607
|
"name": "placeholder",
|
|
1749
1608
|
"type": {
|
|
1750
|
-
"text": "string
|
|
1751
|
-
},
|
|
1752
|
-
"description": "Placeholder text to display within the input.",
|
|
1753
|
-
"fieldName": "placeholder",
|
|
1754
|
-
"inheritedFrom": {
|
|
1755
|
-
"name": "FormAssociatedMixin",
|
|
1756
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1757
|
-
}
|
|
1758
|
-
},
|
|
1759
|
-
{
|
|
1760
|
-
"name": "error",
|
|
1761
|
-
"type": {
|
|
1762
|
-
"text": "string | undefined"
|
|
1763
|
-
},
|
|
1764
|
-
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
1765
|
-
"fieldName": "error",
|
|
1766
|
-
"inheritedFrom": {
|
|
1767
|
-
"name": "FormAssociatedMixin",
|
|
1768
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1769
|
-
}
|
|
1770
|
-
},
|
|
1771
|
-
{
|
|
1772
|
-
"name": "required",
|
|
1773
|
-
"type": {
|
|
1774
|
-
"text": "boolean"
|
|
1609
|
+
"text": "string"
|
|
1775
1610
|
},
|
|
1776
|
-
"default": "
|
|
1777
|
-
"description": "
|
|
1778
|
-
"fieldName": "
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
}
|
|
1783
|
-
},
|
|
1784
|
-
{
|
|
1785
|
-
"name": "expand",
|
|
1786
|
-
"type": {
|
|
1787
|
-
"text": "boolean"
|
|
1788
|
-
},
|
|
1789
|
-
"default": "false",
|
|
1790
|
-
"description": "Controls whether the input expands to fill the width of its container.",
|
|
1791
|
-
"fieldName": "expand",
|
|
1792
|
-
"inheritedFrom": {
|
|
1793
|
-
"name": "FormAssociatedMixin",
|
|
1794
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1795
|
-
}
|
|
1796
|
-
},
|
|
1797
|
-
{
|
|
1798
|
-
"name": "disabled",
|
|
1799
|
-
"type": {
|
|
1800
|
-
"text": "boolean"
|
|
1801
|
-
},
|
|
1802
|
-
"default": "false",
|
|
1803
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1804
|
-
"fieldName": "disabled",
|
|
1805
|
-
"inheritedFrom": {
|
|
1806
|
-
"name": "InputMixin",
|
|
1807
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1808
|
-
}
|
|
1809
|
-
},
|
|
1810
|
-
{
|
|
1811
|
-
"name": "name",
|
|
1812
|
-
"type": {
|
|
1813
|
-
"text": "string | undefined"
|
|
1814
|
-
},
|
|
1815
|
-
"description": "The name of the form component.",
|
|
1816
|
-
"fieldName": "name",
|
|
1817
|
-
"inheritedFrom": {
|
|
1818
|
-
"name": "InputMixin",
|
|
1819
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1820
|
-
}
|
|
1821
|
-
},
|
|
1822
|
-
{
|
|
1823
|
-
"name": "value",
|
|
1824
|
-
"type": {
|
|
1825
|
-
"text": "string"
|
|
1826
|
-
},
|
|
1827
|
-
"default": "\"\"",
|
|
1828
|
-
"description": "The value of the form component.",
|
|
1829
|
-
"fieldName": "value",
|
|
1830
|
-
"inheritedFrom": {
|
|
1831
|
-
"name": "InputMixin",
|
|
1832
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
],
|
|
1836
|
-
"mixins": [
|
|
1837
|
-
{
|
|
1838
|
-
"name": "FormAssociatedMixin",
|
|
1839
|
-
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
1840
|
-
},
|
|
1841
|
-
{
|
|
1842
|
-
"name": "InputMixin",
|
|
1843
|
-
"module": "/src/common/mixins/InputMixin.js"
|
|
1844
|
-
},
|
|
1845
|
-
{
|
|
1846
|
-
"name": "FocusableMixin",
|
|
1847
|
-
"module": "/src/common/mixins/FocusableMixin.js"
|
|
1848
|
-
},
|
|
1611
|
+
"default": "\"Type a command or search...\"",
|
|
1612
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
1613
|
+
"fieldName": "placeholder"
|
|
1614
|
+
}
|
|
1615
|
+
],
|
|
1616
|
+
"mixins": [
|
|
1849
1617
|
{
|
|
1850
1618
|
"name": "DraftComponentMixin",
|
|
1851
1619
|
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
@@ -1856,33 +1624,9 @@
|
|
|
1856
1624
|
"package": "lit"
|
|
1857
1625
|
},
|
|
1858
1626
|
"status": "draft",
|
|
1859
|
-
"category": "
|
|
1860
|
-
"tagName": "nord-
|
|
1861
|
-
"customElement": true
|
|
1862
|
-
"events": [
|
|
1863
|
-
{
|
|
1864
|
-
"name": "input",
|
|
1865
|
-
"type": {
|
|
1866
|
-
"text": "NordEvent"
|
|
1867
|
-
},
|
|
1868
|
-
"description": "Fired as the user types into the input.",
|
|
1869
|
-
"inheritedFrom": {
|
|
1870
|
-
"name": "FormAssociatedMixin",
|
|
1871
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1872
|
-
}
|
|
1873
|
-
},
|
|
1874
|
-
{
|
|
1875
|
-
"name": "change",
|
|
1876
|
-
"type": {
|
|
1877
|
-
"text": "NordEvent"
|
|
1878
|
-
},
|
|
1879
|
-
"description": "Fired whenever the input's value is changed via user interaction.",
|
|
1880
|
-
"inheritedFrom": {
|
|
1881
|
-
"name": "FormAssociatedMixin",
|
|
1882
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
]
|
|
1627
|
+
"category": "action",
|
|
1628
|
+
"tagName": "nord-command-menu",
|
|
1629
|
+
"customElement": true
|
|
1886
1630
|
}
|
|
1887
1631
|
],
|
|
1888
1632
|
"exports": [
|
|
@@ -1890,589 +1634,853 @@
|
|
|
1890
1634
|
"kind": "js",
|
|
1891
1635
|
"name": "default",
|
|
1892
1636
|
"declaration": {
|
|
1893
|
-
"name": "
|
|
1894
|
-
"module": "src/
|
|
1637
|
+
"name": "CommandMenu",
|
|
1638
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
1895
1639
|
}
|
|
1896
1640
|
},
|
|
1897
1641
|
{
|
|
1898
1642
|
"kind": "custom-element-definition",
|
|
1899
|
-
"name": "nord-
|
|
1643
|
+
"name": "nord-command-menu",
|
|
1900
1644
|
"declaration": {
|
|
1901
|
-
"name": "
|
|
1902
|
-
"module": "src/
|
|
1645
|
+
"name": "CommandMenu",
|
|
1646
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
1903
1647
|
}
|
|
1904
1648
|
}
|
|
1905
1649
|
],
|
|
1906
|
-
"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"
|
|
1650
|
+
"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"
|
|
1907
1651
|
},
|
|
1908
1652
|
{
|
|
1909
1653
|
"kind": "javascript-module",
|
|
1910
|
-
"path": "src/command-menu/
|
|
1654
|
+
"path": "src/command-menu/CommandMenuAction.ts",
|
|
1911
1655
|
"declarations": [
|
|
1912
1656
|
{
|
|
1913
1657
|
"kind": "class",
|
|
1914
|
-
"description": "Command Menu
|
|
1915
|
-
"name": "
|
|
1916
|
-
"slots": [
|
|
1917
|
-
{
|
|
1918
|
-
"description": "Used to replace the default footer contents.",
|
|
1919
|
-
"name": "footer"
|
|
1920
|
-
}
|
|
1921
|
-
],
|
|
1658
|
+
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
1659
|
+
"name": "CommandMenuAction",
|
|
1922
1660
|
"members": [
|
|
1923
1661
|
{
|
|
1924
1662
|
"kind": "field",
|
|
1925
|
-
"name": "
|
|
1926
|
-
"privacy": "private"
|
|
1927
|
-
},
|
|
1928
|
-
{
|
|
1929
|
-
"kind": "field",
|
|
1930
|
-
"name": "listRef",
|
|
1931
|
-
"privacy": "private"
|
|
1932
|
-
},
|
|
1933
|
-
{
|
|
1934
|
-
"kind": "field",
|
|
1935
|
-
"name": "previousFocus",
|
|
1663
|
+
"name": "command",
|
|
1936
1664
|
"type": {
|
|
1937
|
-
"text": "
|
|
1665
|
+
"text": "ICommandMenuAction"
|
|
1938
1666
|
},
|
|
1939
|
-
"
|
|
1940
|
-
},
|
|
1941
|
-
{
|
|
1942
|
-
"kind": "field",
|
|
1943
|
-
"name": "dismissController",
|
|
1944
|
-
"privacy": "private",
|
|
1945
|
-
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
|
|
1946
|
-
},
|
|
1947
|
-
{
|
|
1948
|
-
"kind": "field",
|
|
1949
|
-
"name": "keyboardController",
|
|
1950
|
-
"privacy": "private",
|
|
1951
|
-
"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 })"
|
|
1667
|
+
"attribute": "command"
|
|
1952
1668
|
},
|
|
1953
1669
|
{
|
|
1954
1670
|
"kind": "field",
|
|
1955
|
-
"name": "
|
|
1671
|
+
"name": "selected",
|
|
1956
1672
|
"type": {
|
|
1957
1673
|
"text": "boolean"
|
|
1958
1674
|
},
|
|
1959
1675
|
"default": "false",
|
|
1960
|
-
"
|
|
1961
|
-
"attribute": "open"
|
|
1676
|
+
"attribute": "selected"
|
|
1962
1677
|
},
|
|
1963
1678
|
{
|
|
1964
|
-
"kind": "
|
|
1965
|
-
"name": "
|
|
1966
|
-
"
|
|
1967
|
-
|
|
1968
|
-
},
|
|
1969
|
-
"default": "\"Type a command or search...\"",
|
|
1970
|
-
"description": "Hint text to display in the Command Menu search field.",
|
|
1971
|
-
"attribute": "placeholder"
|
|
1679
|
+
"kind": "method",
|
|
1680
|
+
"name": "ensureInView",
|
|
1681
|
+
"privacy": "private",
|
|
1682
|
+
"description": "Scroll to show element"
|
|
1972
1683
|
},
|
|
1973
1684
|
{
|
|
1974
|
-
"kind": "
|
|
1975
|
-
"name": "
|
|
1685
|
+
"kind": "method",
|
|
1686
|
+
"name": "renderShortcut",
|
|
1687
|
+
"privacy": "private"
|
|
1688
|
+
}
|
|
1689
|
+
],
|
|
1690
|
+
"attributes": [
|
|
1691
|
+
{
|
|
1692
|
+
"name": "command",
|
|
1976
1693
|
"type": {
|
|
1977
|
-
"text": "
|
|
1694
|
+
"text": "ICommandMenuAction"
|
|
1978
1695
|
},
|
|
1979
|
-
"
|
|
1980
|
-
"description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
|
|
1696
|
+
"fieldName": "command"
|
|
1981
1697
|
},
|
|
1982
1698
|
{
|
|
1983
|
-
"
|
|
1984
|
-
"name": "parent",
|
|
1699
|
+
"name": "selected",
|
|
1985
1700
|
"type": {
|
|
1986
|
-
"text": "
|
|
1701
|
+
"text": "boolean"
|
|
1987
1702
|
},
|
|
1988
|
-
"
|
|
1989
|
-
|
|
1703
|
+
"default": "false",
|
|
1704
|
+
"fieldName": "selected"
|
|
1705
|
+
}
|
|
1706
|
+
],
|
|
1707
|
+
"superclass": {
|
|
1708
|
+
"name": "LitElement",
|
|
1709
|
+
"package": "lit"
|
|
1710
|
+
},
|
|
1711
|
+
"status": "internal",
|
|
1712
|
+
"category": null,
|
|
1713
|
+
"tagName": "nord-command-menu-action",
|
|
1714
|
+
"customElement": true
|
|
1715
|
+
}
|
|
1716
|
+
],
|
|
1717
|
+
"exports": [
|
|
1718
|
+
{
|
|
1719
|
+
"kind": "js",
|
|
1720
|
+
"name": "default",
|
|
1721
|
+
"declaration": {
|
|
1722
|
+
"name": "CommandMenuAction",
|
|
1723
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
"kind": "custom-element-definition",
|
|
1728
|
+
"name": "nord-command-menu-action",
|
|
1729
|
+
"declaration": {
|
|
1730
|
+
"name": "CommandMenuAction",
|
|
1731
|
+
"module": "src/command-menu/CommandMenuAction.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/command-menu/ICommandMenuAction.ts",
|
|
1740
|
+
"declarations": [],
|
|
1741
|
+
"exports": [],
|
|
1742
|
+
"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"
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
"kind": "javascript-module",
|
|
1746
|
+
"path": "src/command-menu/KeyboardController.ts",
|
|
1747
|
+
"declarations": [
|
|
1748
|
+
{
|
|
1749
|
+
"kind": "class",
|
|
1750
|
+
"description": "",
|
|
1751
|
+
"name": "KeyboardController",
|
|
1752
|
+
"members": [
|
|
1990
1753
|
{
|
|
1991
1754
|
"kind": "field",
|
|
1992
|
-
"name": "
|
|
1755
|
+
"name": "host",
|
|
1993
1756
|
"type": {
|
|
1994
|
-
"text": "
|
|
1757
|
+
"text": "CommandMenu"
|
|
1995
1758
|
},
|
|
1996
1759
|
"privacy": "private",
|
|
1997
|
-
"default": "
|
|
1760
|
+
"default": "host"
|
|
1998
1761
|
},
|
|
1999
1762
|
{
|
|
2000
1763
|
"kind": "field",
|
|
2001
|
-
"name": "
|
|
1764
|
+
"name": "globalShortcuts",
|
|
2002
1765
|
"type": {
|
|
2003
|
-
"text": "
|
|
1766
|
+
"text": "ShortcutController"
|
|
2004
1767
|
},
|
|
2005
1768
|
"privacy": "private",
|
|
2006
|
-
"default": "
|
|
1769
|
+
"default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
|
|
2007
1770
|
},
|
|
2008
1771
|
{
|
|
2009
1772
|
"kind": "field",
|
|
2010
|
-
"name": "
|
|
1773
|
+
"name": "navigationShortcuts",
|
|
2011
1774
|
"type": {
|
|
2012
|
-
"text": "
|
|
1775
|
+
"text": "ShortcutController"
|
|
2013
1776
|
},
|
|
2014
1777
|
"privacy": "private",
|
|
2015
|
-
"default": "
|
|
1778
|
+
"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 )"
|
|
2016
1779
|
},
|
|
2017
1780
|
{
|
|
2018
1781
|
"kind": "field",
|
|
2019
|
-
"name": "
|
|
1782
|
+
"name": "commandShortcuts",
|
|
2020
1783
|
"type": {
|
|
2021
|
-
"text": "
|
|
1784
|
+
"text": "ShortcutController"
|
|
2022
1785
|
},
|
|
2023
1786
|
"privacy": "private",
|
|
2024
|
-
"default": "
|
|
1787
|
+
"default": "new ShortcutController(host)"
|
|
2025
1788
|
},
|
|
2026
1789
|
{
|
|
2027
|
-
"kind": "
|
|
2028
|
-
"name": "
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
1790
|
+
"kind": "method",
|
|
1791
|
+
"name": "registerCommandShortcuts"
|
|
1792
|
+
}
|
|
1793
|
+
]
|
|
1794
|
+
}
|
|
1795
|
+
],
|
|
1796
|
+
"exports": [
|
|
1797
|
+
{
|
|
1798
|
+
"kind": "js",
|
|
1799
|
+
"name": "KeyboardController",
|
|
1800
|
+
"declaration": {
|
|
1801
|
+
"name": "KeyboardController",
|
|
1802
|
+
"module": "src/command-menu/KeyboardController.ts"
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1805
|
+
],
|
|
1806
|
+
"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"
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
"kind": "javascript-module",
|
|
1810
|
+
"path": "src/command-menu/SelectEvent.ts",
|
|
1811
|
+
"declarations": [
|
|
1812
|
+
{
|
|
1813
|
+
"kind": "class",
|
|
1814
|
+
"description": "",
|
|
1815
|
+
"name": "SelectEvent",
|
|
1816
|
+
"members": [
|
|
1817
|
+
{
|
|
1818
|
+
"kind": "field",
|
|
1819
|
+
"name": "eventName",
|
|
1820
|
+
"type": {
|
|
1821
|
+
"text": "string"
|
|
1822
|
+
},
|
|
1823
|
+
"static": true,
|
|
1824
|
+
"default": "\"nord-select\""
|
|
1825
|
+
},
|
|
1826
|
+
{
|
|
1827
|
+
"kind": "field",
|
|
1828
|
+
"name": "command",
|
|
1829
|
+
"type": {
|
|
1830
|
+
"text": "ICommandMenuAction"
|
|
1831
|
+
},
|
|
1832
|
+
"default": "command"
|
|
1833
|
+
}
|
|
1834
|
+
],
|
|
1835
|
+
"superclass": {
|
|
1836
|
+
"name": "NordEvent",
|
|
1837
|
+
"module": "/src/common/events.js"
|
|
1838
|
+
}
|
|
1839
|
+
}
|
|
1840
|
+
],
|
|
1841
|
+
"exports": [
|
|
1842
|
+
{
|
|
1843
|
+
"kind": "js",
|
|
1844
|
+
"name": "SelectEvent",
|
|
1845
|
+
"declaration": {
|
|
1846
|
+
"name": "SelectEvent",
|
|
1847
|
+
"module": "src/command-menu/SelectEvent.ts"
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
],
|
|
1851
|
+
"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"
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
"kind": "javascript-module",
|
|
1855
|
+
"path": "src/checkbox/Checkbox.ts",
|
|
1856
|
+
"declarations": [
|
|
1857
|
+
{
|
|
1858
|
+
"kind": "class",
|
|
1859
|
+
"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.",
|
|
1860
|
+
"name": "Checkbox",
|
|
1861
|
+
"slots": [
|
|
1862
|
+
{
|
|
1863
|
+
"description": "Use when a label requires more than plain text.",
|
|
1864
|
+
"name": "label"
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
"description": "Optional slot that holds hint text for the input.",
|
|
1868
|
+
"name": "hint"
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
"description": "Optional slot that holds error text for the input.",
|
|
1872
|
+
"name": "error"
|
|
1873
|
+
}
|
|
1874
|
+
],
|
|
1875
|
+
"members": [
|
|
1876
|
+
{
|
|
1877
|
+
"kind": "field",
|
|
1878
|
+
"name": "formValue",
|
|
1879
|
+
"privacy": "protected",
|
|
1880
|
+
"inheritedFrom": {
|
|
1881
|
+
"name": "FormAssociatedMixin",
|
|
1882
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
"kind": "field",
|
|
1887
|
+
"name": "checked",
|
|
1888
|
+
"type": {
|
|
1889
|
+
"text": "boolean"
|
|
1890
|
+
},
|
|
1891
|
+
"default": "false",
|
|
1892
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
1893
|
+
"attribute": "checked"
|
|
2033
1894
|
},
|
|
2034
1895
|
{
|
|
2035
1896
|
"kind": "method",
|
|
2036
|
-
"name": "
|
|
1897
|
+
"name": "handleChange",
|
|
1898
|
+
"privacy": "protected",
|
|
1899
|
+
"return": {
|
|
1900
|
+
"type": {
|
|
1901
|
+
"text": "void"
|
|
1902
|
+
}
|
|
1903
|
+
},
|
|
2037
1904
|
"parameters": [
|
|
2038
1905
|
{
|
|
2039
|
-
"name": "
|
|
2040
|
-
"default": "{}",
|
|
1906
|
+
"name": "e",
|
|
2041
1907
|
"type": {
|
|
2042
|
-
"text": "
|
|
2043
|
-
}
|
|
2044
|
-
"description": "allows you to open the menu filtered to a specific parent command."
|
|
1908
|
+
"text": "Event"
|
|
1909
|
+
}
|
|
2045
1910
|
}
|
|
2046
1911
|
],
|
|
2047
|
-
"
|
|
1912
|
+
"inheritedFrom": {
|
|
1913
|
+
"name": "FormAssociatedMixin",
|
|
1914
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1915
|
+
}
|
|
2048
1916
|
},
|
|
2049
1917
|
{
|
|
2050
|
-
"kind": "
|
|
2051
|
-
"name": "
|
|
2052
|
-
"
|
|
1918
|
+
"kind": "field",
|
|
1919
|
+
"name": "labelSlot",
|
|
1920
|
+
"privacy": "protected",
|
|
1921
|
+
"default": "new SlotController(this, \"label\")",
|
|
1922
|
+
"inheritedFrom": {
|
|
1923
|
+
"name": "FormAssociatedMixin",
|
|
1924
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1925
|
+
}
|
|
2053
1926
|
},
|
|
2054
1927
|
{
|
|
2055
|
-
"kind": "
|
|
2056
|
-
"name": "
|
|
2057
|
-
"
|
|
1928
|
+
"kind": "field",
|
|
1929
|
+
"name": "errorSlot",
|
|
1930
|
+
"privacy": "protected",
|
|
1931
|
+
"default": "new SlotController(this, \"error\")",
|
|
1932
|
+
"inheritedFrom": {
|
|
1933
|
+
"name": "FormAssociatedMixin",
|
|
1934
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1935
|
+
}
|
|
2058
1936
|
},
|
|
2059
1937
|
{
|
|
2060
|
-
"kind": "
|
|
2061
|
-
"name": "
|
|
2062
|
-
"
|
|
1938
|
+
"kind": "field",
|
|
1939
|
+
"name": "hintSlot",
|
|
1940
|
+
"privacy": "protected",
|
|
1941
|
+
"default": "new SlotController(this, \"hint\")",
|
|
1942
|
+
"inheritedFrom": {
|
|
1943
|
+
"name": "FormAssociatedMixin",
|
|
1944
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1945
|
+
}
|
|
2063
1946
|
},
|
|
2064
1947
|
{
|
|
2065
|
-
"kind": "
|
|
2066
|
-
"name": "
|
|
2067
|
-
"privacy": "
|
|
1948
|
+
"kind": "field",
|
|
1949
|
+
"name": "formData",
|
|
1950
|
+
"privacy": "protected",
|
|
1951
|
+
"default": "new FormDataController(this, { value: () => this.formValue })",
|
|
1952
|
+
"inheritedFrom": {
|
|
1953
|
+
"name": "FormAssociatedMixin",
|
|
1954
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1955
|
+
}
|
|
2068
1956
|
},
|
|
2069
1957
|
{
|
|
2070
|
-
"kind": "
|
|
2071
|
-
"name": "
|
|
2072
|
-
"
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
"name": "commands",
|
|
2082
|
-
"type": {
|
|
2083
|
-
"text": "ICommandMenuAction[]"
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
]
|
|
1958
|
+
"kind": "field",
|
|
1959
|
+
"name": "inputId",
|
|
1960
|
+
"type": {
|
|
1961
|
+
"text": "string"
|
|
1962
|
+
},
|
|
1963
|
+
"privacy": "protected",
|
|
1964
|
+
"default": "\"input\"",
|
|
1965
|
+
"inheritedFrom": {
|
|
1966
|
+
"name": "FormAssociatedMixin",
|
|
1967
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1968
|
+
}
|
|
2087
1969
|
},
|
|
2088
1970
|
{
|
|
2089
|
-
"kind": "
|
|
2090
|
-
"name": "
|
|
2091
|
-
"
|
|
1971
|
+
"kind": "field",
|
|
1972
|
+
"name": "errorId",
|
|
1973
|
+
"type": {
|
|
1974
|
+
"text": "string"
|
|
1975
|
+
},
|
|
1976
|
+
"privacy": "protected",
|
|
1977
|
+
"default": "\"error\"",
|
|
1978
|
+
"inheritedFrom": {
|
|
1979
|
+
"name": "FormAssociatedMixin",
|
|
1980
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1981
|
+
}
|
|
2092
1982
|
},
|
|
2093
1983
|
{
|
|
2094
|
-
"kind": "
|
|
2095
|
-
"name": "
|
|
2096
|
-
"
|
|
1984
|
+
"kind": "field",
|
|
1985
|
+
"name": "hintId",
|
|
1986
|
+
"type": {
|
|
1987
|
+
"text": "string"
|
|
1988
|
+
},
|
|
1989
|
+
"privacy": "protected",
|
|
1990
|
+
"default": "\"hint\"",
|
|
1991
|
+
"inheritedFrom": {
|
|
1992
|
+
"name": "FormAssociatedMixin",
|
|
1993
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1994
|
+
}
|
|
2097
1995
|
},
|
|
2098
1996
|
{
|
|
2099
|
-
"kind": "
|
|
2100
|
-
"name": "
|
|
2101
|
-
"
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
1997
|
+
"kind": "field",
|
|
1998
|
+
"name": "label",
|
|
1999
|
+
"type": {
|
|
2000
|
+
"text": "string"
|
|
2001
|
+
},
|
|
2002
|
+
"default": "\"\"",
|
|
2003
|
+
"description": "Label for the input.",
|
|
2004
|
+
"attribute": "label",
|
|
2005
|
+
"inheritedFrom": {
|
|
2006
|
+
"name": "FormAssociatedMixin",
|
|
2007
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2008
|
+
}
|
|
2110
2009
|
},
|
|
2111
2010
|
{
|
|
2112
|
-
"kind": "
|
|
2113
|
-
"name": "
|
|
2114
|
-
"
|
|
2011
|
+
"kind": "field",
|
|
2012
|
+
"name": "hint",
|
|
2013
|
+
"type": {
|
|
2014
|
+
"text": "string | undefined"
|
|
2015
|
+
},
|
|
2016
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
2017
|
+
"attribute": "hint",
|
|
2018
|
+
"inheritedFrom": {
|
|
2019
|
+
"name": "FormAssociatedMixin",
|
|
2020
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2021
|
+
}
|
|
2022
|
+
},
|
|
2023
|
+
{
|
|
2024
|
+
"kind": "field",
|
|
2025
|
+
"name": "hideLabel",
|
|
2026
|
+
"type": {
|
|
2027
|
+
"text": "boolean"
|
|
2028
|
+
},
|
|
2029
|
+
"default": "false",
|
|
2030
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
2031
|
+
"attribute": "hide-label",
|
|
2032
|
+
"inheritedFrom": {
|
|
2033
|
+
"name": "FormAssociatedMixin",
|
|
2034
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2035
|
+
}
|
|
2036
|
+
},
|
|
2037
|
+
{
|
|
2038
|
+
"kind": "field",
|
|
2039
|
+
"name": "placeholder",
|
|
2040
|
+
"type": {
|
|
2041
|
+
"text": "string | undefined"
|
|
2042
|
+
},
|
|
2043
|
+
"description": "Placeholder text to display within the input.",
|
|
2044
|
+
"attribute": "placeholder",
|
|
2045
|
+
"inheritedFrom": {
|
|
2046
|
+
"name": "FormAssociatedMixin",
|
|
2047
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2048
|
+
}
|
|
2049
|
+
},
|
|
2050
|
+
{
|
|
2051
|
+
"kind": "field",
|
|
2052
|
+
"name": "error",
|
|
2053
|
+
"type": {
|
|
2054
|
+
"text": "string | undefined"
|
|
2055
|
+
},
|
|
2056
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
2057
|
+
"attribute": "error",
|
|
2058
|
+
"inheritedFrom": {
|
|
2059
|
+
"name": "FormAssociatedMixin",
|
|
2060
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2061
|
+
}
|
|
2062
|
+
},
|
|
2063
|
+
{
|
|
2064
|
+
"kind": "field",
|
|
2065
|
+
"name": "required",
|
|
2066
|
+
"type": {
|
|
2067
|
+
"text": "boolean"
|
|
2068
|
+
},
|
|
2069
|
+
"default": "false",
|
|
2070
|
+
"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.",
|
|
2071
|
+
"attribute": "required",
|
|
2072
|
+
"inheritedFrom": {
|
|
2073
|
+
"name": "FormAssociatedMixin",
|
|
2074
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2075
|
+
}
|
|
2076
|
+
},
|
|
2077
|
+
{
|
|
2078
|
+
"kind": "field",
|
|
2079
|
+
"name": "expand",
|
|
2080
|
+
"type": {
|
|
2081
|
+
"text": "boolean"
|
|
2082
|
+
},
|
|
2083
|
+
"default": "false",
|
|
2084
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2085
|
+
"attribute": "expand",
|
|
2086
|
+
"reflects": true,
|
|
2087
|
+
"inheritedFrom": {
|
|
2088
|
+
"name": "FormAssociatedMixin",
|
|
2089
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2090
|
+
}
|
|
2091
|
+
},
|
|
2092
|
+
{
|
|
2093
|
+
"kind": "method",
|
|
2094
|
+
"name": "handleInput",
|
|
2095
|
+
"privacy": "protected",
|
|
2115
2096
|
"parameters": [
|
|
2116
2097
|
{
|
|
2117
|
-
"name": "
|
|
2118
|
-
"default": "this.selected",
|
|
2098
|
+
"name": "e",
|
|
2119
2099
|
"type": {
|
|
2120
|
-
"text": "
|
|
2100
|
+
"text": "Event"
|
|
2121
2101
|
}
|
|
2122
2102
|
}
|
|
2123
|
-
]
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
"privacy": "private"
|
|
2129
|
-
},
|
|
2130
|
-
{
|
|
2131
|
-
"kind": "method",
|
|
2132
|
-
"name": "end",
|
|
2133
|
-
"privacy": "private"
|
|
2103
|
+
],
|
|
2104
|
+
"inheritedFrom": {
|
|
2105
|
+
"name": "FormAssociatedMixin",
|
|
2106
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2107
|
+
}
|
|
2134
2108
|
},
|
|
2135
2109
|
{
|
|
2136
2110
|
"kind": "method",
|
|
2137
|
-
"name": "
|
|
2138
|
-
"privacy": "
|
|
2111
|
+
"name": "renderLabel",
|
|
2112
|
+
"privacy": "protected",
|
|
2113
|
+
"inheritedFrom": {
|
|
2114
|
+
"name": "FormAssociatedMixin",
|
|
2115
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2116
|
+
}
|
|
2139
2117
|
},
|
|
2140
2118
|
{
|
|
2141
2119
|
"kind": "method",
|
|
2142
|
-
"name": "
|
|
2143
|
-
"privacy": "
|
|
2120
|
+
"name": "renderError",
|
|
2121
|
+
"privacy": "protected",
|
|
2122
|
+
"inheritedFrom": {
|
|
2123
|
+
"name": "FormAssociatedMixin",
|
|
2124
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2125
|
+
}
|
|
2144
2126
|
},
|
|
2145
2127
|
{
|
|
2146
2128
|
"kind": "method",
|
|
2147
|
-
"name": "
|
|
2148
|
-
"privacy": "
|
|
2129
|
+
"name": "getDescribedBy",
|
|
2130
|
+
"privacy": "protected",
|
|
2131
|
+
"inheritedFrom": {
|
|
2132
|
+
"name": "FormAssociatedMixin",
|
|
2133
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2134
|
+
}
|
|
2149
2135
|
},
|
|
2150
2136
|
{
|
|
2151
2137
|
"kind": "method",
|
|
2152
|
-
"name": "
|
|
2153
|
-
"privacy": "
|
|
2154
|
-
"
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
"type": {
|
|
2159
|
-
"text": "string"
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
]
|
|
2138
|
+
"name": "getInvalid",
|
|
2139
|
+
"privacy": "protected",
|
|
2140
|
+
"inheritedFrom": {
|
|
2141
|
+
"name": "FormAssociatedMixin",
|
|
2142
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2143
|
+
}
|
|
2163
2144
|
},
|
|
2164
2145
|
{
|
|
2165
|
-
"kind": "
|
|
2166
|
-
"name": "
|
|
2167
|
-
"privacy": "
|
|
2168
|
-
"
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
"text": "string"
|
|
2173
|
-
}
|
|
2174
|
-
}
|
|
2175
|
-
]
|
|
2146
|
+
"kind": "field",
|
|
2147
|
+
"name": "hasHint",
|
|
2148
|
+
"privacy": "protected",
|
|
2149
|
+
"inheritedFrom": {
|
|
2150
|
+
"name": "FormAssociatedMixin",
|
|
2151
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2152
|
+
}
|
|
2176
2153
|
},
|
|
2177
2154
|
{
|
|
2178
|
-
"kind": "
|
|
2179
|
-
"name": "
|
|
2180
|
-
"privacy": "
|
|
2155
|
+
"kind": "field",
|
|
2156
|
+
"name": "hasError",
|
|
2157
|
+
"privacy": "protected",
|
|
2158
|
+
"inheritedFrom": {
|
|
2159
|
+
"name": "FormAssociatedMixin",
|
|
2160
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2161
|
+
}
|
|
2181
2162
|
},
|
|
2182
2163
|
{
|
|
2183
2164
|
"kind": "field",
|
|
2184
|
-
"name": "
|
|
2165
|
+
"name": "disabled",
|
|
2185
2166
|
"type": {
|
|
2186
2167
|
"text": "boolean"
|
|
2187
2168
|
},
|
|
2188
|
-
"privacy": "private",
|
|
2189
|
-
"static": true,
|
|
2190
2169
|
"default": "false",
|
|
2170
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2171
|
+
"attribute": "disabled",
|
|
2172
|
+
"reflects": true,
|
|
2191
2173
|
"inheritedFrom": {
|
|
2192
|
-
"name": "
|
|
2193
|
-
"module": "src/common/mixins/
|
|
2174
|
+
"name": "InputMixin",
|
|
2175
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2194
2176
|
}
|
|
2195
|
-
}
|
|
2196
|
-
],
|
|
2197
|
-
"events": [
|
|
2177
|
+
},
|
|
2198
2178
|
{
|
|
2199
|
-
"
|
|
2179
|
+
"kind": "field",
|
|
2180
|
+
"name": "name",
|
|
2200
2181
|
"type": {
|
|
2201
|
-
"text": "
|
|
2182
|
+
"text": "string | undefined"
|
|
2202
2183
|
},
|
|
2203
|
-
"description": "The
|
|
2184
|
+
"description": "The name of the form component.",
|
|
2185
|
+
"attribute": "name",
|
|
2186
|
+
"inheritedFrom": {
|
|
2187
|
+
"name": "InputMixin",
|
|
2188
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2189
|
+
}
|
|
2204
2190
|
},
|
|
2205
2191
|
{
|
|
2206
|
-
"
|
|
2192
|
+
"kind": "field",
|
|
2193
|
+
"name": "value",
|
|
2207
2194
|
"type": {
|
|
2208
|
-
"text": "
|
|
2195
|
+
"text": "string"
|
|
2209
2196
|
},
|
|
2210
|
-
"
|
|
2197
|
+
"default": "\"\"",
|
|
2198
|
+
"description": "The value of the form component.",
|
|
2199
|
+
"attribute": "value",
|
|
2200
|
+
"inheritedFrom": {
|
|
2201
|
+
"name": "InputMixin",
|
|
2202
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2203
|
+
}
|
|
2211
2204
|
},
|
|
2212
2205
|
{
|
|
2213
|
-
"
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
"description": "
|
|
2217
|
-
"
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2206
|
+
"kind": "field",
|
|
2207
|
+
"name": "form",
|
|
2208
|
+
"privacy": "protected",
|
|
2209
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
2210
|
+
"inheritedFrom": {
|
|
2211
|
+
"name": "InputMixin",
|
|
2212
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2213
|
+
}
|
|
2214
|
+
},
|
|
2221
2215
|
{
|
|
2222
|
-
"
|
|
2223
|
-
"
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2216
|
+
"kind": "field",
|
|
2217
|
+
"name": "focusableRef",
|
|
2218
|
+
"privacy": "protected",
|
|
2219
|
+
"inheritedFrom": {
|
|
2220
|
+
"name": "FocusableMixin",
|
|
2221
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2222
|
+
}
|
|
2229
2223
|
},
|
|
2230
2224
|
{
|
|
2231
|
-
"
|
|
2232
|
-
"
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2225
|
+
"kind": "method",
|
|
2226
|
+
"name": "focus",
|
|
2227
|
+
"parameters": [
|
|
2228
|
+
{
|
|
2229
|
+
"name": "options",
|
|
2230
|
+
"optional": true,
|
|
2231
|
+
"type": {
|
|
2232
|
+
"text": "FocusOptions"
|
|
2233
|
+
},
|
|
2234
|
+
"description": "An object which controls aspects of the focusing process."
|
|
2235
|
+
}
|
|
2236
|
+
],
|
|
2237
|
+
"description": "Programmatically move focus to the component.",
|
|
2238
|
+
"inheritedFrom": {
|
|
2239
|
+
"name": "FocusableMixin",
|
|
2240
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2241
|
+
}
|
|
2242
|
+
},
|
|
2241
2243
|
{
|
|
2242
|
-
"
|
|
2243
|
-
"
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
"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"
|
|
2275
|
-
},
|
|
2276
|
-
{
|
|
2277
|
-
"kind": "javascript-module",
|
|
2278
|
-
"path": "src/command-menu/CommandMenuAction.ts",
|
|
2279
|
-
"declarations": [
|
|
2280
|
-
{
|
|
2281
|
-
"kind": "class",
|
|
2282
|
-
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
2283
|
-
"name": "CommandMenuAction",
|
|
2284
|
-
"members": [
|
|
2244
|
+
"kind": "method",
|
|
2245
|
+
"name": "blur",
|
|
2246
|
+
"description": "Programmatically remove focus from the component.",
|
|
2247
|
+
"inheritedFrom": {
|
|
2248
|
+
"name": "FocusableMixin",
|
|
2249
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2250
|
+
}
|
|
2251
|
+
},
|
|
2252
|
+
{
|
|
2253
|
+
"kind": "method",
|
|
2254
|
+
"name": "click",
|
|
2255
|
+
"description": "Programmatically simulates a click on the component.",
|
|
2256
|
+
"inheritedFrom": {
|
|
2257
|
+
"name": "FocusableMixin",
|
|
2258
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
{
|
|
2262
|
+
"kind": "field",
|
|
2263
|
+
"name": "_warningLogged",
|
|
2264
|
+
"type": {
|
|
2265
|
+
"text": "boolean"
|
|
2266
|
+
},
|
|
2267
|
+
"privacy": "private",
|
|
2268
|
+
"static": true,
|
|
2269
|
+
"default": "false",
|
|
2270
|
+
"inheritedFrom": {
|
|
2271
|
+
"name": "DraftComponentMixin",
|
|
2272
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
],
|
|
2276
|
+
"attributes": [
|
|
2285
2277
|
{
|
|
2286
|
-
"
|
|
2287
|
-
"name": "command",
|
|
2278
|
+
"name": "checked",
|
|
2288
2279
|
"type": {
|
|
2289
|
-
"text": "
|
|
2280
|
+
"text": "boolean"
|
|
2290
2281
|
},
|
|
2291
|
-
"
|
|
2282
|
+
"default": "false",
|
|
2283
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
2284
|
+
"fieldName": "checked"
|
|
2292
2285
|
},
|
|
2293
2286
|
{
|
|
2294
|
-
"
|
|
2295
|
-
"
|
|
2287
|
+
"name": "label",
|
|
2288
|
+
"type": {
|
|
2289
|
+
"text": "string"
|
|
2290
|
+
},
|
|
2291
|
+
"default": "\"\"",
|
|
2292
|
+
"description": "Label for the input.",
|
|
2293
|
+
"fieldName": "label",
|
|
2294
|
+
"inheritedFrom": {
|
|
2295
|
+
"name": "FormAssociatedMixin",
|
|
2296
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2297
|
+
}
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
"name": "hint",
|
|
2301
|
+
"type": {
|
|
2302
|
+
"text": "string | undefined"
|
|
2303
|
+
},
|
|
2304
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
2305
|
+
"fieldName": "hint",
|
|
2306
|
+
"inheritedFrom": {
|
|
2307
|
+
"name": "FormAssociatedMixin",
|
|
2308
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2309
|
+
}
|
|
2310
|
+
},
|
|
2311
|
+
{
|
|
2312
|
+
"name": "hide-label",
|
|
2296
2313
|
"type": {
|
|
2297
2314
|
"text": "boolean"
|
|
2298
2315
|
},
|
|
2299
2316
|
"default": "false",
|
|
2300
|
-
"
|
|
2317
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
2318
|
+
"fieldName": "hideLabel",
|
|
2319
|
+
"inheritedFrom": {
|
|
2320
|
+
"name": "FormAssociatedMixin",
|
|
2321
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2322
|
+
}
|
|
2301
2323
|
},
|
|
2302
2324
|
{
|
|
2303
|
-
"
|
|
2304
|
-
"
|
|
2305
|
-
|
|
2306
|
-
|
|
2325
|
+
"name": "placeholder",
|
|
2326
|
+
"type": {
|
|
2327
|
+
"text": "string | undefined"
|
|
2328
|
+
},
|
|
2329
|
+
"description": "Placeholder text to display within the input.",
|
|
2330
|
+
"fieldName": "placeholder",
|
|
2331
|
+
"inheritedFrom": {
|
|
2332
|
+
"name": "FormAssociatedMixin",
|
|
2333
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2334
|
+
}
|
|
2307
2335
|
},
|
|
2308
2336
|
{
|
|
2309
|
-
"
|
|
2310
|
-
"name": "renderShortcut",
|
|
2311
|
-
"privacy": "private"
|
|
2312
|
-
}
|
|
2313
|
-
],
|
|
2314
|
-
"attributes": [
|
|
2315
|
-
{
|
|
2316
|
-
"name": "command",
|
|
2337
|
+
"name": "error",
|
|
2317
2338
|
"type": {
|
|
2318
|
-
"text": "
|
|
2339
|
+
"text": "string | undefined"
|
|
2319
2340
|
},
|
|
2320
|
-
"
|
|
2341
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
2342
|
+
"fieldName": "error",
|
|
2343
|
+
"inheritedFrom": {
|
|
2344
|
+
"name": "FormAssociatedMixin",
|
|
2345
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2346
|
+
}
|
|
2321
2347
|
},
|
|
2322
2348
|
{
|
|
2323
|
-
"name": "
|
|
2349
|
+
"name": "required",
|
|
2324
2350
|
"type": {
|
|
2325
2351
|
"text": "boolean"
|
|
2326
2352
|
},
|
|
2327
2353
|
"default": "false",
|
|
2328
|
-
"
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
"status": "internal",
|
|
2336
|
-
"category": null,
|
|
2337
|
-
"tagName": "nord-command-menu-action",
|
|
2338
|
-
"customElement": true
|
|
2339
|
-
}
|
|
2340
|
-
],
|
|
2341
|
-
"exports": [
|
|
2342
|
-
{
|
|
2343
|
-
"kind": "js",
|
|
2344
|
-
"name": "default",
|
|
2345
|
-
"declaration": {
|
|
2346
|
-
"name": "CommandMenuAction",
|
|
2347
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2348
|
-
}
|
|
2349
|
-
},
|
|
2350
|
-
{
|
|
2351
|
-
"kind": "custom-element-definition",
|
|
2352
|
-
"name": "nord-command-menu-action",
|
|
2353
|
-
"declaration": {
|
|
2354
|
-
"name": "CommandMenuAction",
|
|
2355
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
],
|
|
2359
|
-
"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"
|
|
2360
|
-
},
|
|
2361
|
-
{
|
|
2362
|
-
"kind": "javascript-module",
|
|
2363
|
-
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
2364
|
-
"declarations": [],
|
|
2365
|
-
"exports": [],
|
|
2366
|
-
"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
|
-
},
|
|
2368
|
-
{
|
|
2369
|
-
"kind": "javascript-module",
|
|
2370
|
-
"path": "src/command-menu/KeyboardController.ts",
|
|
2371
|
-
"declarations": [
|
|
2372
|
-
{
|
|
2373
|
-
"kind": "class",
|
|
2374
|
-
"description": "",
|
|
2375
|
-
"name": "KeyboardController",
|
|
2376
|
-
"members": [
|
|
2354
|
+
"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.",
|
|
2355
|
+
"fieldName": "required",
|
|
2356
|
+
"inheritedFrom": {
|
|
2357
|
+
"name": "FormAssociatedMixin",
|
|
2358
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2359
|
+
}
|
|
2360
|
+
},
|
|
2377
2361
|
{
|
|
2378
|
-
"
|
|
2379
|
-
"name": "host",
|
|
2362
|
+
"name": "expand",
|
|
2380
2363
|
"type": {
|
|
2381
|
-
"text": "
|
|
2364
|
+
"text": "boolean"
|
|
2382
2365
|
},
|
|
2383
|
-
"
|
|
2384
|
-
"
|
|
2366
|
+
"default": "false",
|
|
2367
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2368
|
+
"fieldName": "expand",
|
|
2369
|
+
"inheritedFrom": {
|
|
2370
|
+
"name": "FormAssociatedMixin",
|
|
2371
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2372
|
+
}
|
|
2385
2373
|
},
|
|
2386
2374
|
{
|
|
2387
|
-
"
|
|
2388
|
-
"name": "globalShortcuts",
|
|
2375
|
+
"name": "disabled",
|
|
2389
2376
|
"type": {
|
|
2390
|
-
"text": "
|
|
2377
|
+
"text": "boolean"
|
|
2391
2378
|
},
|
|
2392
|
-
"
|
|
2393
|
-
"
|
|
2379
|
+
"default": "false",
|
|
2380
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2381
|
+
"fieldName": "disabled",
|
|
2382
|
+
"inheritedFrom": {
|
|
2383
|
+
"name": "InputMixin",
|
|
2384
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2385
|
+
}
|
|
2394
2386
|
},
|
|
2395
2387
|
{
|
|
2396
|
-
"
|
|
2397
|
-
"name": "navigationShortcuts",
|
|
2388
|
+
"name": "name",
|
|
2398
2389
|
"type": {
|
|
2399
|
-
"text": "
|
|
2390
|
+
"text": "string | undefined"
|
|
2400
2391
|
},
|
|
2401
|
-
"
|
|
2402
|
-
"
|
|
2392
|
+
"description": "The name of the form component.",
|
|
2393
|
+
"fieldName": "name",
|
|
2394
|
+
"inheritedFrom": {
|
|
2395
|
+
"name": "InputMixin",
|
|
2396
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2397
|
+
}
|
|
2403
2398
|
},
|
|
2404
2399
|
{
|
|
2405
|
-
"
|
|
2406
|
-
"name": "commandShortcuts",
|
|
2400
|
+
"name": "value",
|
|
2407
2401
|
"type": {
|
|
2408
|
-
"text": "
|
|
2402
|
+
"text": "string"
|
|
2409
2403
|
},
|
|
2410
|
-
"
|
|
2411
|
-
"
|
|
2404
|
+
"default": "\"\"",
|
|
2405
|
+
"description": "The value of the form component.",
|
|
2406
|
+
"fieldName": "value",
|
|
2407
|
+
"inheritedFrom": {
|
|
2408
|
+
"name": "InputMixin",
|
|
2409
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
],
|
|
2413
|
+
"mixins": [
|
|
2414
|
+
{
|
|
2415
|
+
"name": "FormAssociatedMixin",
|
|
2416
|
+
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
2412
2417
|
},
|
|
2413
2418
|
{
|
|
2414
|
-
"
|
|
2415
|
-
"
|
|
2416
|
-
}
|
|
2417
|
-
]
|
|
2418
|
-
}
|
|
2419
|
-
],
|
|
2420
|
-
"exports": [
|
|
2421
|
-
{
|
|
2422
|
-
"kind": "js",
|
|
2423
|
-
"name": "KeyboardController",
|
|
2424
|
-
"declaration": {
|
|
2425
|
-
"name": "KeyboardController",
|
|
2426
|
-
"module": "src/command-menu/KeyboardController.ts"
|
|
2427
|
-
}
|
|
2428
|
-
}
|
|
2429
|
-
],
|
|
2430
|
-
"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"
|
|
2431
|
-
},
|
|
2432
|
-
{
|
|
2433
|
-
"kind": "javascript-module",
|
|
2434
|
-
"path": "src/command-menu/SelectEvent.ts",
|
|
2435
|
-
"declarations": [
|
|
2436
|
-
{
|
|
2437
|
-
"kind": "class",
|
|
2438
|
-
"description": "",
|
|
2439
|
-
"name": "SelectEvent",
|
|
2440
|
-
"members": [
|
|
2419
|
+
"name": "InputMixin",
|
|
2420
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
2421
|
+
},
|
|
2441
2422
|
{
|
|
2442
|
-
"
|
|
2443
|
-
"
|
|
2423
|
+
"name": "FocusableMixin",
|
|
2424
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
2425
|
+
},
|
|
2426
|
+
{
|
|
2427
|
+
"name": "DraftComponentMixin",
|
|
2428
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
2429
|
+
}
|
|
2430
|
+
],
|
|
2431
|
+
"superclass": {
|
|
2432
|
+
"name": "LitElement",
|
|
2433
|
+
"package": "lit"
|
|
2434
|
+
},
|
|
2435
|
+
"status": "draft",
|
|
2436
|
+
"category": "form",
|
|
2437
|
+
"tagName": "nord-checkbox",
|
|
2438
|
+
"customElement": true,
|
|
2439
|
+
"events": [
|
|
2440
|
+
{
|
|
2441
|
+
"name": "input",
|
|
2444
2442
|
"type": {
|
|
2445
|
-
"text": "
|
|
2443
|
+
"text": "NordEvent"
|
|
2446
2444
|
},
|
|
2447
|
-
"
|
|
2448
|
-
"
|
|
2445
|
+
"description": "Fired as the user types into the input.",
|
|
2446
|
+
"inheritedFrom": {
|
|
2447
|
+
"name": "FormAssociatedMixin",
|
|
2448
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2449
|
+
}
|
|
2449
2450
|
},
|
|
2450
2451
|
{
|
|
2451
|
-
"
|
|
2452
|
-
"name": "command",
|
|
2452
|
+
"name": "change",
|
|
2453
2453
|
"type": {
|
|
2454
|
-
"text": "
|
|
2454
|
+
"text": "NordEvent"
|
|
2455
2455
|
},
|
|
2456
|
-
"
|
|
2456
|
+
"description": "Fired whenever the input's value is changed via user interaction.",
|
|
2457
|
+
"inheritedFrom": {
|
|
2458
|
+
"name": "FormAssociatedMixin",
|
|
2459
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2460
|
+
}
|
|
2457
2461
|
}
|
|
2458
|
-
]
|
|
2459
|
-
"superclass": {
|
|
2460
|
-
"name": "NordEvent",
|
|
2461
|
-
"module": "/src/common/events.js"
|
|
2462
|
-
}
|
|
2462
|
+
]
|
|
2463
2463
|
}
|
|
2464
2464
|
],
|
|
2465
2465
|
"exports": [
|
|
2466
2466
|
{
|
|
2467
2467
|
"kind": "js",
|
|
2468
|
-
"name": "
|
|
2468
|
+
"name": "default",
|
|
2469
2469
|
"declaration": {
|
|
2470
|
-
"name": "
|
|
2471
|
-
"module": "src/
|
|
2470
|
+
"name": "Checkbox",
|
|
2471
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2474
|
+
{
|
|
2475
|
+
"kind": "custom-element-definition",
|
|
2476
|
+
"name": "nord-checkbox",
|
|
2477
|
+
"declaration": {
|
|
2478
|
+
"name": "Checkbox",
|
|
2479
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
2472
2480
|
}
|
|
2473
2481
|
}
|
|
2474
2482
|
],
|
|
2475
|
-
"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"
|
|
2483
|
+
"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"
|
|
2476
2484
|
},
|
|
2477
2485
|
{
|
|
2478
2486
|
"kind": "javascript-module",
|
|
@@ -4493,82 +4501,6 @@
|
|
|
4493
4501
|
],
|
|
4494
4502
|
"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 fieldset component when you need to create a relationship between multiple form inputs.\n- It is especially important to use with a group of radio components.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t place interactive content (buttons, links etc) inside the label.\n- Don’t use with a checkbox component when there is **only one** checkbox. For example, when accepting terms and conditions.\n\n</div>\n\n-------\n\n## Content guidelines\n\nFieldset label should be clear, accurate and predictable. It should help the user to understand how the items in the fieldset are grouped together, or what kind of choice the user is making:\n\n<div class=\"n-usage n-usage-do\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Choose</div>\n\nWhen writing fieldset 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\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick A Color</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\">Pick a color</div>\n<div class=\"n-usage n-usage-dont\">Pick a color.</div>\n\nDo not use colons in fieldset label:\n\n<div class=\"n-usage n-usage-do\">Payment details</div>\n<div class=\"n-usage n-usage-dont\">Payment details:</div>\n\n-------\n\n## Additional considerations\n\n- A label (which becomes to `<legend>` inside the fieldset) is always required.\n- Hint text can be used to offer further information or explanation for an option.\n"
|
|
4495
4503
|
},
|
|
4496
|
-
{
|
|
4497
|
-
"kind": "javascript-module",
|
|
4498
|
-
"path": "src/header/Header.ts",
|
|
4499
|
-
"declarations": [
|
|
4500
|
-
{
|
|
4501
|
-
"kind": "class",
|
|
4502
|
-
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4503
|
-
"name": "Header",
|
|
4504
|
-
"slots": [
|
|
4505
|
-
{
|
|
4506
|
-
"description": "The header content.",
|
|
4507
|
-
"name": ""
|
|
4508
|
-
},
|
|
4509
|
-
{
|
|
4510
|
-
"description": "Optional slot for buttons, toggles, etc.",
|
|
4511
|
-
"name": "action"
|
|
4512
|
-
}
|
|
4513
|
-
],
|
|
4514
|
-
"members": [
|
|
4515
|
-
{
|
|
4516
|
-
"kind": "field",
|
|
4517
|
-
"name": "actionSlot",
|
|
4518
|
-
"privacy": "private",
|
|
4519
|
-
"default": "new SlotController(this, \"action\")"
|
|
4520
|
-
},
|
|
4521
|
-
{
|
|
4522
|
-
"kind": "field",
|
|
4523
|
-
"name": "_warningLogged",
|
|
4524
|
-
"type": {
|
|
4525
|
-
"text": "boolean"
|
|
4526
|
-
},
|
|
4527
|
-
"privacy": "private",
|
|
4528
|
-
"static": true,
|
|
4529
|
-
"default": "false",
|
|
4530
|
-
"inheritedFrom": {
|
|
4531
|
-
"name": "DraftComponentMixin",
|
|
4532
|
-
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4533
|
-
}
|
|
4534
|
-
}
|
|
4535
|
-
],
|
|
4536
|
-
"mixins": [
|
|
4537
|
-
{
|
|
4538
|
-
"name": "DraftComponentMixin",
|
|
4539
|
-
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4540
|
-
}
|
|
4541
|
-
],
|
|
4542
|
-
"superclass": {
|
|
4543
|
-
"name": "LitElement",
|
|
4544
|
-
"package": "lit"
|
|
4545
|
-
},
|
|
4546
|
-
"status": "draft",
|
|
4547
|
-
"category": "structure",
|
|
4548
|
-
"tagName": "nord-header",
|
|
4549
|
-
"customElement": true
|
|
4550
|
-
}
|
|
4551
|
-
],
|
|
4552
|
-
"exports": [
|
|
4553
|
-
{
|
|
4554
|
-
"kind": "js",
|
|
4555
|
-
"name": "default",
|
|
4556
|
-
"declaration": {
|
|
4557
|
-
"name": "Header",
|
|
4558
|
-
"module": "src/header/Header.ts"
|
|
4559
|
-
}
|
|
4560
|
-
},
|
|
4561
|
-
{
|
|
4562
|
-
"kind": "custom-element-definition",
|
|
4563
|
-
"name": "nord-header",
|
|
4564
|
-
"declaration": {
|
|
4565
|
-
"name": "Header",
|
|
4566
|
-
"module": "src/header/Header.ts"
|
|
4567
|
-
}
|
|
4568
|
-
}
|
|
4569
|
-
],
|
|
4570
|
-
"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"
|
|
4571
|
-
},
|
|
4572
4504
|
{
|
|
4573
4505
|
"kind": "javascript-module",
|
|
4574
4506
|
"path": "src/icon/Icon.ts",
|
|
@@ -4824,6 +4756,82 @@
|
|
|
4824
4756
|
],
|
|
4825
4757
|
"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
4758
|
},
|
|
4759
|
+
{
|
|
4760
|
+
"kind": "javascript-module",
|
|
4761
|
+
"path": "src/header/Header.ts",
|
|
4762
|
+
"declarations": [
|
|
4763
|
+
{
|
|
4764
|
+
"kind": "class",
|
|
4765
|
+
"description": "The header is a block of designated space for labelling the currently\nviewed context as well as providing primary actions.",
|
|
4766
|
+
"name": "Header",
|
|
4767
|
+
"slots": [
|
|
4768
|
+
{
|
|
4769
|
+
"description": "The header content.",
|
|
4770
|
+
"name": ""
|
|
4771
|
+
},
|
|
4772
|
+
{
|
|
4773
|
+
"description": "Optional slot for buttons, toggles, etc.",
|
|
4774
|
+
"name": "action"
|
|
4775
|
+
}
|
|
4776
|
+
],
|
|
4777
|
+
"members": [
|
|
4778
|
+
{
|
|
4779
|
+
"kind": "field",
|
|
4780
|
+
"name": "actionSlot",
|
|
4781
|
+
"privacy": "private",
|
|
4782
|
+
"default": "new SlotController(this, \"action\")"
|
|
4783
|
+
},
|
|
4784
|
+
{
|
|
4785
|
+
"kind": "field",
|
|
4786
|
+
"name": "_warningLogged",
|
|
4787
|
+
"type": {
|
|
4788
|
+
"text": "boolean"
|
|
4789
|
+
},
|
|
4790
|
+
"privacy": "private",
|
|
4791
|
+
"static": true,
|
|
4792
|
+
"default": "false",
|
|
4793
|
+
"inheritedFrom": {
|
|
4794
|
+
"name": "DraftComponentMixin",
|
|
4795
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
4796
|
+
}
|
|
4797
|
+
}
|
|
4798
|
+
],
|
|
4799
|
+
"mixins": [
|
|
4800
|
+
{
|
|
4801
|
+
"name": "DraftComponentMixin",
|
|
4802
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
4803
|
+
}
|
|
4804
|
+
],
|
|
4805
|
+
"superclass": {
|
|
4806
|
+
"name": "LitElement",
|
|
4807
|
+
"package": "lit"
|
|
4808
|
+
},
|
|
4809
|
+
"status": "draft",
|
|
4810
|
+
"category": "structure",
|
|
4811
|
+
"tagName": "nord-header",
|
|
4812
|
+
"customElement": true
|
|
4813
|
+
}
|
|
4814
|
+
],
|
|
4815
|
+
"exports": [
|
|
4816
|
+
{
|
|
4817
|
+
"kind": "js",
|
|
4818
|
+
"name": "default",
|
|
4819
|
+
"declaration": {
|
|
4820
|
+
"name": "Header",
|
|
4821
|
+
"module": "src/header/Header.ts"
|
|
4822
|
+
}
|
|
4823
|
+
},
|
|
4824
|
+
{
|
|
4825
|
+
"kind": "custom-element-definition",
|
|
4826
|
+
"name": "nord-header",
|
|
4827
|
+
"declaration": {
|
|
4828
|
+
"name": "Header",
|
|
4829
|
+
"module": "src/header/Header.ts"
|
|
4830
|
+
}
|
|
4831
|
+
}
|
|
4832
|
+
],
|
|
4833
|
+
"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"
|
|
4834
|
+
},
|
|
4827
4835
|
{
|
|
4828
4836
|
"kind": "javascript-module",
|
|
4829
4837
|
"path": "src/input/Input.ts",
|
|
@@ -5466,6 +5474,80 @@
|
|
|
5466
5474
|
],
|
|
5467
5475
|
"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 a text input where the expected input is short.\n- Use to only ask for information that’s really needed. Hide optional fields by default if possible or have them shown with a lower priority.\n- Use help text and placeholder to provide additional, non-critical instructions.\n- Validate input as soon as users have finished interacting with them (but not before).\n- Where necessary, label the input as “Optional” when you need to request input that’s not required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use when the expected text input is long. Use textarea component instead.\n- Don’t use the placeholder to provide information that’s required to use the input. Hint text should be used for this purpose instead.\n\n</div>\n\n---\n\n## Content guidelines\n\nInput labels act as a title for the text field. Labels should typically be short and in noun form:\n\n<div class=\"n-usage n-usage-do\">Company name</div>\n<div class=\"n-usage n-usage-dont\">What is your company name?</div>\n\nWhen writing input 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\">Company name</div>\n<div class=\"n-usage n-usage-dont\">Company Name</div>\n\nWhen an input isn’t part of a form and is placed individually on a page, you could provide the input label as a call to action:\n\n<div class=\"n-usage n-usage-do\">Leave a comment</div>\n<div class=\"n-usage n-usage-dont\">Comment</div>\n\nDo not use colons in input label:\n\n<div class=\"n-usage n-usage-do\">First name</div>\n<div class=\"n-usage n-usage-dont\">First name:</div>\n\n---\n\n## Types\n\nThis section describes the different input types, their purpose, and when to use each type.\n\n| Name | Purpose |\n| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `text` | The default and most common variant. Displayed as a single-line text field. Line-breaks are automatically removed from the input value. |\n| `email` | A field for editing an email address. Looks similar to a text input, but has validation parameters and relevant keyboard for devices with dynamic keyboards. |\n| `password` | A single-line text field where the value is obscured. This type will alert user if a site is not secure. |\n| `tel` | A field for entering a telephone number. Displays a number keypad on mobile devices. |\n| `url` | A field variant that is used to let the user enter and edit an URL. |\n| `search` | A single-line text field for entering search strings. |\n| `number` | Used to let the user enter a number. |\n"
|
|
5468
5476
|
},
|
|
5477
|
+
{
|
|
5478
|
+
"kind": "javascript-module",
|
|
5479
|
+
"path": "src/layout/Layout.ts",
|
|
5480
|
+
"declarations": [
|
|
5481
|
+
{
|
|
5482
|
+
"kind": "class",
|
|
5483
|
+
"description": "Layout component is used to create the main layout of an app. Layout\ncurrently comes with one main configurations: one-column. Please note\nthat responsive behaviour is still under work.",
|
|
5484
|
+
"name": "Layout",
|
|
5485
|
+
"slots": [
|
|
5486
|
+
{
|
|
5487
|
+
"description": "The default main section content.",
|
|
5488
|
+
"name": ""
|
|
5489
|
+
},
|
|
5490
|
+
{
|
|
5491
|
+
"description": "Used to place content inside the navigation sidebar.",
|
|
5492
|
+
"name": "nav"
|
|
5493
|
+
},
|
|
5494
|
+
{
|
|
5495
|
+
"description": "Used to place content inside the header section.",
|
|
5496
|
+
"name": "header"
|
|
5497
|
+
}
|
|
5498
|
+
],
|
|
5499
|
+
"members": [
|
|
5500
|
+
{
|
|
5501
|
+
"kind": "field",
|
|
5502
|
+
"name": "_warningLogged",
|
|
5503
|
+
"type": {
|
|
5504
|
+
"text": "boolean"
|
|
5505
|
+
},
|
|
5506
|
+
"privacy": "private",
|
|
5507
|
+
"static": true,
|
|
5508
|
+
"default": "false",
|
|
5509
|
+
"inheritedFrom": {
|
|
5510
|
+
"name": "DraftComponentMixin",
|
|
5511
|
+
"module": "src/common/mixins/DraftComponentMixin.ts"
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5514
|
+
],
|
|
5515
|
+
"mixins": [
|
|
5516
|
+
{
|
|
5517
|
+
"name": "DraftComponentMixin",
|
|
5518
|
+
"module": "/src/common/mixins/DraftComponentMixin.js"
|
|
5519
|
+
}
|
|
5520
|
+
],
|
|
5521
|
+
"superclass": {
|
|
5522
|
+
"name": "LitElement",
|
|
5523
|
+
"package": "lit"
|
|
5524
|
+
},
|
|
5525
|
+
"status": "draft",
|
|
5526
|
+
"category": "structure",
|
|
5527
|
+
"tagName": "nord-layout",
|
|
5528
|
+
"customElement": true
|
|
5529
|
+
}
|
|
5530
|
+
],
|
|
5531
|
+
"exports": [
|
|
5532
|
+
{
|
|
5533
|
+
"kind": "js",
|
|
5534
|
+
"name": "default",
|
|
5535
|
+
"declaration": {
|
|
5536
|
+
"name": "Layout",
|
|
5537
|
+
"module": "src/layout/Layout.ts"
|
|
5538
|
+
}
|
|
5539
|
+
},
|
|
5540
|
+
{
|
|
5541
|
+
"kind": "custom-element-definition",
|
|
5542
|
+
"name": "nord-layout",
|
|
5543
|
+
"declaration": {
|
|
5544
|
+
"name": "Layout",
|
|
5545
|
+
"module": "src/layout/Layout.ts"
|
|
5546
|
+
}
|
|
5547
|
+
}
|
|
5548
|
+
],
|
|
5549
|
+
"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- To visually group content in a layout section, use the Card component.\n- To lay out a set of smaller components, use the Stack component.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Never put layout component inside another HTML landmark.\n- Don’t use when you need a vertical or horizontal layout system. Use Stack component instead.\n\n</div>\n\n---\n\n## Additional considerations\n\n- Layout component uses `<main>` element internally which is an HTML sectioning element which by default defines an ARIA landmark role. For that reason you should never put layout component inside another HTML landmark.\n"
|
|
5550
|
+
},
|
|
5469
5551
|
{
|
|
5470
5552
|
"kind": "javascript-module",
|
|
5471
5553
|
"path": "src/nav-group/NavGroup.ts",
|