@nordhealth/components 1.8.0 → 1.8.2
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 +1647 -1647
- package/lib/Select.js +1 -1
- package/lib/Select.js.map +1 -1
- package/lib/TabGroup.js +1 -1
- package/lib/TabGroup.js.map +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.js.map +1 -1
- package/package.json +5 -5
package/custom-elements.json
CHANGED
|
@@ -472,247 +472,399 @@
|
|
|
472
472
|
},
|
|
473
473
|
{
|
|
474
474
|
"kind": "javascript-module",
|
|
475
|
-
"path": "src/
|
|
475
|
+
"path": "src/banner/Banner.ts",
|
|
476
476
|
"declarations": [
|
|
477
477
|
{
|
|
478
478
|
"kind": "class",
|
|
479
|
-
"description": "
|
|
480
|
-
"name": "
|
|
479
|
+
"description": "Banner informs users about important changes or conditions in the\ninterface. Use this component if you need to communicate to users\nin a prominent way.",
|
|
480
|
+
"name": "Banner",
|
|
481
481
|
"slots": [
|
|
482
482
|
{
|
|
483
|
-
"description": "
|
|
483
|
+
"description": "default slot",
|
|
484
484
|
"name": ""
|
|
485
|
-
}
|
|
485
|
+
}
|
|
486
|
+
],
|
|
487
|
+
"members": [
|
|
486
488
|
{
|
|
487
|
-
"
|
|
488
|
-
"name": "
|
|
489
|
-
|
|
489
|
+
"kind": "field",
|
|
490
|
+
"name": "variant",
|
|
491
|
+
"type": {
|
|
492
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
493
|
+
},
|
|
494
|
+
"default": "\"info\"",
|
|
495
|
+
"description": "The style variant of the banner.",
|
|
496
|
+
"attribute": "variant",
|
|
497
|
+
"reflects": true
|
|
498
|
+
}
|
|
499
|
+
],
|
|
500
|
+
"attributes": [
|
|
490
501
|
{
|
|
491
|
-
"
|
|
492
|
-
"
|
|
502
|
+
"name": "variant",
|
|
503
|
+
"type": {
|
|
504
|
+
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
505
|
+
},
|
|
506
|
+
"default": "\"info\"",
|
|
507
|
+
"description": "The style variant of the banner.",
|
|
508
|
+
"fieldName": "variant"
|
|
509
|
+
}
|
|
510
|
+
],
|
|
511
|
+
"superclass": {
|
|
512
|
+
"name": "LitElement",
|
|
513
|
+
"package": "lit"
|
|
514
|
+
},
|
|
515
|
+
"status": "ready",
|
|
516
|
+
"category": "feedback",
|
|
517
|
+
"tagName": "nord-banner",
|
|
518
|
+
"customElement": true
|
|
519
|
+
}
|
|
520
|
+
],
|
|
521
|
+
"exports": [
|
|
522
|
+
{
|
|
523
|
+
"kind": "js",
|
|
524
|
+
"name": "default",
|
|
525
|
+
"declaration": {
|
|
526
|
+
"name": "Banner",
|
|
527
|
+
"module": "src/banner/Banner.ts"
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"kind": "custom-element-definition",
|
|
532
|
+
"name": "nord-banner",
|
|
533
|
+
"declaration": {
|
|
534
|
+
"name": "Banner",
|
|
535
|
+
"module": "src/banner/Banner.ts"
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
"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 this component if you need to communicate in a prominent way.\n- Place banner at the top of the section it applies to.\n- Use for highlighting errors and success statuses.\n- Put banner close to the context it’s referring to.\n- Move focus to the banner if it’s relevant to the current workflow.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Move focus to banner if it appears on page load.\n- Use for highlighting general content or as a banner.\n- Use to replace an error page.\n\n</div>\n\n---\n\n## Content guidelines\n\nBanner content should be clear, accurate and easy to understand:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident. Please see our status page for more details.</div>\n<div class=\"n-usage n-usage-dont\">There was an error.</div>\n\nWhen writing banner content, always write it 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\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re Experiencing An Incident.</div>\n\nAlways end in punctuation:\n\n<div class=\"n-usage n-usage-do\">We’re experiencing an incident.</div>\n<div class=\"n-usage n-usage-dont\">We’re experiencing an incident</div>\n"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"kind": "javascript-module",
|
|
543
|
+
"path": "src/badge/Badge.ts",
|
|
544
|
+
"declarations": [
|
|
545
|
+
{
|
|
546
|
+
"kind": "class",
|
|
547
|
+
"description": "Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.",
|
|
548
|
+
"name": "Badge",
|
|
549
|
+
"slots": [
|
|
550
|
+
{
|
|
551
|
+
"description": "The badge content.",
|
|
552
|
+
"name": ""
|
|
493
553
|
}
|
|
494
554
|
],
|
|
495
555
|
"members": [
|
|
496
556
|
{
|
|
497
557
|
"kind": "field",
|
|
498
|
-
"name": "
|
|
499
|
-
"
|
|
558
|
+
"name": "type",
|
|
559
|
+
"type": {
|
|
560
|
+
"text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
|
|
561
|
+
},
|
|
562
|
+
"default": "\"info\"",
|
|
563
|
+
"description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
|
|
564
|
+
"attribute": "type",
|
|
565
|
+
"reflects": true
|
|
566
|
+
}
|
|
567
|
+
],
|
|
568
|
+
"attributes": [
|
|
569
|
+
{
|
|
570
|
+
"name": "type",
|
|
571
|
+
"type": {
|
|
572
|
+
"text": "\"warning\" | \"success\" | \"danger\" | \"highlight\" | \"info\" | undefined"
|
|
573
|
+
},
|
|
574
|
+
"default": "\"info\"",
|
|
575
|
+
"description": "The type of badge.\nDetermines the color of the chip shown on the badge.",
|
|
576
|
+
"fieldName": "type"
|
|
577
|
+
}
|
|
578
|
+
],
|
|
579
|
+
"superclass": {
|
|
580
|
+
"name": "LitElement",
|
|
581
|
+
"package": "lit"
|
|
582
|
+
},
|
|
583
|
+
"status": "ready",
|
|
584
|
+
"category": "text",
|
|
585
|
+
"tagName": "nord-badge",
|
|
586
|
+
"customElement": true
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
"exports": [
|
|
590
|
+
{
|
|
591
|
+
"kind": "js",
|
|
592
|
+
"name": "default",
|
|
593
|
+
"declaration": {
|
|
594
|
+
"name": "Badge",
|
|
595
|
+
"module": "src/badge/Badge.ts"
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"kind": "custom-element-definition",
|
|
600
|
+
"name": "nord-badge",
|
|
601
|
+
"declaration": {
|
|
602
|
+
"name": "Badge",
|
|
603
|
+
"module": "src/badge/Badge.ts"
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
],
|
|
607
|
+
"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 show a status update on a piece of information or action.\n- Use to mark something as a “draft” or “new”.\n- Use when you want to highlight something that has been added recently.\n- Use established color patterns so that users can clearly identify the importance level.\n- Always position badge so that it’s clear to understand what object it’s related to.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t make badges clickable. Instead use button component’s small variant.\n- Don’t use alternatives to existing badge variants.\n\n</div>\n\n---\n\n## Content guidelines\n\nBadge labels should use a single word to describe the status of an object. Only use two words if you need to describe a complex state:\n\n<div class=\"n-usage n-usage-do\">Complete</div>\n<div class=\"n-usage n-usage-dont\">Action completed</div>\n\nWhen writing badge 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\">Partially refunded</div>\n<div class=\"n-usage n-usage-dont\">Partially Refunded</div>\n\nAvoid unnecessary words and articles in badge labels, such as “is”, “the”, “an” or “a”:\n\n<div class=\"n-usage n-usage-do\">Pending</div>\n<div class=\"n-usage n-usage-dont\">Item is pending</div>\n\nAlways describe the status in the past tense:\n\n<div class=\"n-usage n-usage-do\">Refunded</div>\n<div class=\"n-usage n-usage-dont\">Refund</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| `info` | The default variant. Used to convey general information that isn’t critical. |\n| `success` | Used to convey success states. For example, you might want to show a badge that tells the user a payment was successful. |\n| `highlight` | Used to highlight specific items in the interface, like notifications. |\n| `danger` | Used to communicate problems that have to be resolved so that user can continue forward. Should always be used for highlighting errors. |\n| `warning` | Used to display information that needs a user’s attention attention and may require further steps. |\n"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"kind": "javascript-module",
|
|
611
|
+
"path": "src/card/Card.ts",
|
|
612
|
+
"declarations": [
|
|
613
|
+
{
|
|
614
|
+
"kind": "class",
|
|
615
|
+
"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.",
|
|
616
|
+
"name": "Card",
|
|
617
|
+
"slots": [
|
|
618
|
+
{
|
|
619
|
+
"description": "The card content.",
|
|
620
|
+
"name": ""
|
|
500
621
|
},
|
|
501
622
|
{
|
|
502
|
-
"
|
|
503
|
-
"name": "
|
|
504
|
-
"privacy": "private",
|
|
505
|
-
"default": "new EventController(this)"
|
|
623
|
+
"description": "Optional slot that holds a header for the card.",
|
|
624
|
+
"name": "header"
|
|
506
625
|
},
|
|
626
|
+
{
|
|
627
|
+
"description": "Optional slot that holds footer content for the card.",
|
|
628
|
+
"name": "footer"
|
|
629
|
+
}
|
|
630
|
+
],
|
|
631
|
+
"members": [
|
|
507
632
|
{
|
|
508
633
|
"kind": "field",
|
|
509
|
-
"name": "
|
|
634
|
+
"name": "headerSlot",
|
|
510
635
|
"privacy": "private",
|
|
511
|
-
"default": "new
|
|
636
|
+
"default": "new SlotController(this, \"header\")"
|
|
512
637
|
},
|
|
513
638
|
{
|
|
514
639
|
"kind": "field",
|
|
515
|
-
"name": "
|
|
516
|
-
"
|
|
517
|
-
|
|
518
|
-
},
|
|
519
|
-
"default": "\"default\"",
|
|
520
|
-
"description": "The style variant of the button.",
|
|
521
|
-
"attribute": "variant",
|
|
522
|
-
"reflects": true
|
|
640
|
+
"name": "footerSlot",
|
|
641
|
+
"privacy": "private",
|
|
642
|
+
"default": "new SlotController(this, \"footer\")"
|
|
523
643
|
},
|
|
524
644
|
{
|
|
525
645
|
"kind": "field",
|
|
526
|
-
"name": "
|
|
646
|
+
"name": "padding",
|
|
527
647
|
"type": {
|
|
528
|
-
"text": "\"
|
|
648
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
529
649
|
},
|
|
530
|
-
"default": "\"
|
|
531
|
-
"description": "
|
|
532
|
-
"attribute": "
|
|
650
|
+
"default": "\"m\"",
|
|
651
|
+
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
652
|
+
"attribute": "padding",
|
|
533
653
|
"reflects": true
|
|
534
|
-
}
|
|
654
|
+
}
|
|
655
|
+
],
|
|
656
|
+
"attributes": [
|
|
535
657
|
{
|
|
536
|
-
"
|
|
537
|
-
"name": "size",
|
|
658
|
+
"name": "padding",
|
|
538
659
|
"type": {
|
|
539
|
-
"text": "\"
|
|
660
|
+
"text": "\"m\" | \"l\" | \"none\""
|
|
540
661
|
},
|
|
541
662
|
"default": "\"m\"",
|
|
542
|
-
"description": "
|
|
543
|
-
"
|
|
544
|
-
|
|
545
|
-
|
|
663
|
+
"description": "Controls the padding of the card component. When set to “none”,\nthe header and footer slots will still have padding.",
|
|
664
|
+
"fieldName": "padding"
|
|
665
|
+
}
|
|
666
|
+
],
|
|
667
|
+
"superclass": {
|
|
668
|
+
"name": "LitElement",
|
|
669
|
+
"package": "lit"
|
|
670
|
+
},
|
|
671
|
+
"status": "ready",
|
|
672
|
+
"category": "structure",
|
|
673
|
+
"tagName": "nord-card",
|
|
674
|
+
"customElement": true
|
|
675
|
+
}
|
|
676
|
+
],
|
|
677
|
+
"exports": [
|
|
678
|
+
{
|
|
679
|
+
"kind": "js",
|
|
680
|
+
"name": "default",
|
|
681
|
+
"declaration": {
|
|
682
|
+
"name": "Card",
|
|
683
|
+
"module": "src/card/Card.ts"
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"kind": "custom-element-definition",
|
|
688
|
+
"name": "nord-card",
|
|
689
|
+
"declaration": {
|
|
690
|
+
"name": "Card",
|
|
691
|
+
"module": "src/card/Card.ts"
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
],
|
|
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 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"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"kind": "javascript-module",
|
|
699
|
+
"path": "src/calendar/Calendar.ts",
|
|
700
|
+
"declarations": [
|
|
701
|
+
{
|
|
702
|
+
"kind": "class",
|
|
703
|
+
"description": "Calendar allows user to pick a date. It comes with built-in\nfunctionality that allows you to set a minimum and a maximum allowed date.\nPlease note that the date must be passed in ISO-8601 format.",
|
|
704
|
+
"name": "Calendar",
|
|
705
|
+
"members": [
|
|
546
706
|
{
|
|
547
707
|
"kind": "field",
|
|
548
|
-
"name": "
|
|
708
|
+
"name": "dialogLabelId",
|
|
549
709
|
"type": {
|
|
550
|
-
"text": "
|
|
710
|
+
"text": "string"
|
|
551
711
|
},
|
|
552
712
|
"privacy": "private",
|
|
553
|
-
"
|
|
713
|
+
"default": "\"dialog-header\""
|
|
554
714
|
},
|
|
555
715
|
{
|
|
556
716
|
"kind": "field",
|
|
557
|
-
"name": "
|
|
717
|
+
"name": "monthSelectNode",
|
|
558
718
|
"type": {
|
|
559
|
-
"text": "
|
|
719
|
+
"text": "HTMLElement"
|
|
560
720
|
},
|
|
561
|
-
"privacy": "private"
|
|
562
|
-
"attribute": "aria-haspopup"
|
|
721
|
+
"privacy": "private"
|
|
563
722
|
},
|
|
564
723
|
{
|
|
565
724
|
"kind": "field",
|
|
566
|
-
"name": "
|
|
725
|
+
"name": "focusedDayNode",
|
|
567
726
|
"type": {
|
|
568
|
-
"text": "
|
|
727
|
+
"text": "HTMLButtonElement"
|
|
569
728
|
},
|
|
570
|
-
"
|
|
571
|
-
"attribute": "href",
|
|
572
|
-
"reflects": true
|
|
729
|
+
"privacy": "private"
|
|
573
730
|
},
|
|
574
731
|
{
|
|
575
732
|
"kind": "field",
|
|
576
|
-
"name": "
|
|
577
|
-
"
|
|
578
|
-
|
|
579
|
-
},
|
|
580
|
-
"default": "false",
|
|
581
|
-
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
582
|
-
"attribute": "download"
|
|
733
|
+
"name": "direction",
|
|
734
|
+
"privacy": "private",
|
|
735
|
+
"default": "new DirectionController(this)"
|
|
583
736
|
},
|
|
584
737
|
{
|
|
585
738
|
"kind": "field",
|
|
586
|
-
"name": "
|
|
587
|
-
"
|
|
588
|
-
|
|
589
|
-
},
|
|
590
|
-
"default": "\"_self\"",
|
|
591
|
-
"description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
|
|
592
|
-
"attribute": "target",
|
|
593
|
-
"reflects": true
|
|
739
|
+
"name": "swipe",
|
|
740
|
+
"privacy": "private",
|
|
741
|
+
"default": "new SwipeController(this, {\n matchesGesture: isHorizontalSwipe,\n onSwipeEnd: ({ distX }) => this.addMonths(distX < 0 ? 1 : -1),\n })"
|
|
594
742
|
},
|
|
595
743
|
{
|
|
596
744
|
"kind": "field",
|
|
597
|
-
"name": "
|
|
598
|
-
"
|
|
599
|
-
"text": "boolean"
|
|
600
|
-
},
|
|
601
|
-
"default": "false",
|
|
602
|
-
"description": "Controls whether the button expands to fill the width of its container.",
|
|
603
|
-
"attribute": "expand",
|
|
604
|
-
"reflects": true
|
|
745
|
+
"name": "shortcuts",
|
|
746
|
+
"privacy": "private"
|
|
605
747
|
},
|
|
606
748
|
{
|
|
607
|
-
"kind": "
|
|
608
|
-
"name": "
|
|
749
|
+
"kind": "field",
|
|
750
|
+
"name": "localize",
|
|
609
751
|
"privacy": "private",
|
|
610
|
-
"
|
|
611
|
-
{
|
|
612
|
-
"name": "innards",
|
|
613
|
-
"type": {
|
|
614
|
-
"text": "TemplateResult"
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
],
|
|
618
|
-
"description": "We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\nLinks cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\nAlong with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order."
|
|
752
|
+
"default": "new LocalizeController<\"nord-calendar\">(this, {\n onLangChange: () => this.handleLangChange(),\n })"
|
|
619
753
|
},
|
|
620
754
|
{
|
|
621
|
-
"kind": "
|
|
622
|
-
"name": "
|
|
755
|
+
"kind": "field",
|
|
756
|
+
"name": "dateFormatShort",
|
|
757
|
+
"type": {
|
|
758
|
+
"text": "Intl.DateTimeFormat"
|
|
759
|
+
},
|
|
623
760
|
"privacy": "private",
|
|
624
|
-
"
|
|
625
|
-
{
|
|
626
|
-
"name": "innards",
|
|
627
|
-
"type": {
|
|
628
|
-
"text": "TemplateResult"
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
]
|
|
761
|
+
"description": "Whilst dateAdapter is used for handling the formatting/parsing dates in the input,\nthese are used to format dates exclusively for the benefit of screen readers.\n\nWe prefer DateTimeFormat over date.toLocaleDateString, as the former has\nbetter performance when formatting large number of dates. See:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString#Performance"
|
|
632
762
|
},
|
|
633
763
|
{
|
|
634
|
-
"kind": "
|
|
635
|
-
"name": "
|
|
764
|
+
"kind": "field",
|
|
765
|
+
"name": "monthNames",
|
|
766
|
+
"type": {
|
|
767
|
+
"text": "string[]"
|
|
768
|
+
},
|
|
636
769
|
"privacy": "private"
|
|
637
770
|
},
|
|
638
771
|
{
|
|
639
772
|
"kind": "field",
|
|
640
|
-
"name": "
|
|
773
|
+
"name": "monthNamesShort",
|
|
774
|
+
"type": {
|
|
775
|
+
"text": "string[]"
|
|
776
|
+
},
|
|
641
777
|
"privacy": "private"
|
|
642
778
|
},
|
|
643
779
|
{
|
|
644
|
-
"kind": "
|
|
645
|
-
"name": "
|
|
646
|
-
"
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
"type": {
|
|
651
|
-
"text": "Event"
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
]
|
|
780
|
+
"kind": "field",
|
|
781
|
+
"name": "dayNames",
|
|
782
|
+
"type": {
|
|
783
|
+
"text": "string[]"
|
|
784
|
+
},
|
|
785
|
+
"privacy": "private"
|
|
655
786
|
},
|
|
656
787
|
{
|
|
657
788
|
"kind": "field",
|
|
658
|
-
"name": "
|
|
789
|
+
"name": "dayNamesShort",
|
|
659
790
|
"type": {
|
|
660
|
-
"text": "
|
|
791
|
+
"text": "string[]"
|
|
661
792
|
},
|
|
662
|
-
"
|
|
663
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
664
|
-
"attribute": "disabled",
|
|
665
|
-
"reflects": true,
|
|
666
|
-
"inheritedFrom": {
|
|
667
|
-
"name": "InputMixin",
|
|
668
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
669
|
-
}
|
|
793
|
+
"privacy": "private"
|
|
670
794
|
},
|
|
671
795
|
{
|
|
672
796
|
"kind": "field",
|
|
673
|
-
"name": "
|
|
797
|
+
"name": "value",
|
|
674
798
|
"type": {
|
|
675
|
-
"text": "string
|
|
799
|
+
"text": "string"
|
|
676
800
|
},
|
|
677
|
-
"
|
|
678
|
-
"
|
|
679
|
-
"
|
|
680
|
-
"name": "InputMixin",
|
|
681
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
682
|
-
}
|
|
801
|
+
"default": "\"\"",
|
|
802
|
+
"description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
|
|
803
|
+
"attribute": "value"
|
|
683
804
|
},
|
|
684
805
|
{
|
|
685
806
|
"kind": "field",
|
|
686
|
-
"name": "
|
|
807
|
+
"name": "firstDayOfWeek",
|
|
808
|
+
"type": {
|
|
809
|
+
"text": "DaysOfWeek"
|
|
810
|
+
},
|
|
811
|
+
"description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
|
|
812
|
+
"attribute": "firstDayOfWeek"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"kind": "field",
|
|
816
|
+
"name": "min",
|
|
687
817
|
"type": {
|
|
688
818
|
"text": "string"
|
|
689
819
|
},
|
|
690
820
|
"default": "\"\"",
|
|
691
|
-
"description": "
|
|
692
|
-
"attribute": "
|
|
693
|
-
"inheritedFrom": {
|
|
694
|
-
"name": "InputMixin",
|
|
695
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
696
|
-
}
|
|
821
|
+
"description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
|
|
822
|
+
"attribute": "min"
|
|
697
823
|
},
|
|
698
824
|
{
|
|
699
825
|
"kind": "field",
|
|
700
|
-
"name": "
|
|
701
|
-
"
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
826
|
+
"name": "max",
|
|
827
|
+
"type": {
|
|
828
|
+
"text": "string"
|
|
829
|
+
},
|
|
830
|
+
"default": "\"\"",
|
|
831
|
+
"description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
|
|
832
|
+
"attribute": "max"
|
|
707
833
|
},
|
|
708
834
|
{
|
|
709
835
|
"kind": "field",
|
|
710
|
-
"name": "
|
|
711
|
-
"
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
836
|
+
"name": "expand",
|
|
837
|
+
"type": {
|
|
838
|
+
"text": "boolean"
|
|
839
|
+
},
|
|
840
|
+
"default": "false",
|
|
841
|
+
"description": "Controls whether the calendar expands to fill the width of its container.",
|
|
842
|
+
"attribute": "expand",
|
|
843
|
+
"reflects": true
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"kind": "field",
|
|
847
|
+
"name": "isDateDisabled",
|
|
848
|
+
"type": {
|
|
849
|
+
"text": "DateDisabledPredicate"
|
|
850
|
+
},
|
|
851
|
+
"default": "isDateDisabled",
|
|
852
|
+
"description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
"kind": "field",
|
|
856
|
+
"name": "activeFocus",
|
|
857
|
+
"type": {
|
|
858
|
+
"text": "boolean"
|
|
859
|
+
},
|
|
860
|
+
"privacy": "private",
|
|
861
|
+
"default": "false"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"kind": "field",
|
|
865
|
+
"name": "focusedDay",
|
|
866
|
+
"privacy": "private",
|
|
867
|
+
"default": "new Date()"
|
|
716
868
|
},
|
|
717
869
|
{
|
|
718
870
|
"kind": "method",
|
|
@@ -722,160 +874,212 @@
|
|
|
722
874
|
"name": "options",
|
|
723
875
|
"optional": true,
|
|
724
876
|
"type": {
|
|
725
|
-
"text": "FocusOptions"
|
|
877
|
+
"text": "FocusOptions & { target: \"day\" | \"month\" }"
|
|
726
878
|
},
|
|
727
879
|
"description": "An object which controls aspects of the focusing process."
|
|
728
880
|
}
|
|
729
881
|
],
|
|
730
|
-
"description": "Programmatically move focus to the
|
|
731
|
-
"inheritedFrom": {
|
|
732
|
-
"name": "FocusableMixin",
|
|
733
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
734
|
-
}
|
|
882
|
+
"description": "Programmatically move focus to the calendar."
|
|
735
883
|
},
|
|
736
884
|
{
|
|
737
885
|
"kind": "method",
|
|
738
|
-
"name": "
|
|
739
|
-
"
|
|
740
|
-
"inheritedFrom": {
|
|
741
|
-
"name": "FocusableMixin",
|
|
742
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
743
|
-
}
|
|
886
|
+
"name": "handleValueChange",
|
|
887
|
+
"privacy": "protected"
|
|
744
888
|
},
|
|
745
889
|
{
|
|
746
890
|
"kind": "method",
|
|
747
|
-
"name": "
|
|
748
|
-
"
|
|
749
|
-
|
|
750
|
-
"name": "FocusableMixin",
|
|
751
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
],
|
|
755
|
-
"attributes": [
|
|
891
|
+
"name": "handleFocusedDayChange",
|
|
892
|
+
"privacy": "protected"
|
|
893
|
+
},
|
|
756
894
|
{
|
|
757
|
-
"
|
|
758
|
-
"
|
|
759
|
-
|
|
760
|
-
},
|
|
761
|
-
"default": "\"default\"",
|
|
762
|
-
"description": "The style variant of the button.",
|
|
763
|
-
"fieldName": "variant"
|
|
895
|
+
"kind": "method",
|
|
896
|
+
"name": "handleLangChange",
|
|
897
|
+
"privacy": "private"
|
|
764
898
|
},
|
|
765
899
|
{
|
|
766
|
-
"
|
|
767
|
-
"
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
"default": "\"submit\"",
|
|
771
|
-
"description": "The type of the button.",
|
|
772
|
-
"fieldName": "type"
|
|
900
|
+
"kind": "field",
|
|
901
|
+
"name": "handleDaySelect",
|
|
902
|
+
"privacy": "private"
|
|
773
903
|
},
|
|
774
904
|
{
|
|
775
|
-
"
|
|
776
|
-
"
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
905
|
+
"kind": "method",
|
|
906
|
+
"name": "addDays",
|
|
907
|
+
"privacy": "private",
|
|
908
|
+
"parameters": [
|
|
909
|
+
{
|
|
910
|
+
"name": "days",
|
|
911
|
+
"type": {
|
|
912
|
+
"text": "number"
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
]
|
|
782
916
|
},
|
|
783
917
|
{
|
|
784
|
-
"
|
|
785
|
-
"
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
918
|
+
"kind": "method",
|
|
919
|
+
"name": "addMonths",
|
|
920
|
+
"privacy": "private",
|
|
921
|
+
"parameters": [
|
|
922
|
+
{
|
|
923
|
+
"name": "months",
|
|
924
|
+
"type": {
|
|
925
|
+
"text": "number"
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
]
|
|
789
929
|
},
|
|
790
930
|
{
|
|
791
|
-
"
|
|
792
|
-
"
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
931
|
+
"kind": "method",
|
|
932
|
+
"name": "addYears",
|
|
933
|
+
"privacy": "private",
|
|
934
|
+
"parameters": [
|
|
935
|
+
{
|
|
936
|
+
"name": "years",
|
|
937
|
+
"type": {
|
|
938
|
+
"text": "number"
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
]
|
|
796
942
|
},
|
|
797
943
|
{
|
|
798
|
-
"
|
|
799
|
-
"
|
|
800
|
-
|
|
801
|
-
},
|
|
802
|
-
"description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
|
|
803
|
-
"fieldName": "href"
|
|
944
|
+
"kind": "method",
|
|
945
|
+
"name": "startOfWeek",
|
|
946
|
+
"privacy": "private"
|
|
804
947
|
},
|
|
805
948
|
{
|
|
806
|
-
"
|
|
949
|
+
"kind": "method",
|
|
950
|
+
"name": "endOfWeek",
|
|
951
|
+
"privacy": "private"
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
"kind": "method",
|
|
955
|
+
"name": "setMonth",
|
|
956
|
+
"privacy": "private",
|
|
957
|
+
"parameters": [
|
|
958
|
+
{
|
|
959
|
+
"name": "month",
|
|
960
|
+
"type": {
|
|
961
|
+
"text": "number"
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
]
|
|
965
|
+
},
|
|
966
|
+
{
|
|
967
|
+
"kind": "method",
|
|
968
|
+
"name": "setYear",
|
|
969
|
+
"privacy": "private",
|
|
970
|
+
"parameters": [
|
|
971
|
+
{
|
|
972
|
+
"name": "year",
|
|
973
|
+
"type": {
|
|
974
|
+
"text": "number"
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
]
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
"kind": "method",
|
|
981
|
+
"name": "setFocusedDay",
|
|
982
|
+
"privacy": "private",
|
|
983
|
+
"parameters": [
|
|
984
|
+
{
|
|
985
|
+
"name": "day",
|
|
986
|
+
"type": {
|
|
987
|
+
"text": "Date"
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
]
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"kind": "field",
|
|
994
|
+
"name": "handleMonthSelect",
|
|
995
|
+
"privacy": "private"
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
"kind": "field",
|
|
999
|
+
"name": "handleYearSelect",
|
|
1000
|
+
"privacy": "private"
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"kind": "field",
|
|
1004
|
+
"name": "handleNextMonthClick",
|
|
1005
|
+
"privacy": "private"
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
"kind": "field",
|
|
1009
|
+
"name": "handlePreviousMonthClick",
|
|
1010
|
+
"privacy": "private"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
"kind": "field",
|
|
1014
|
+
"name": "enableActiveFocus",
|
|
1015
|
+
"privacy": "private"
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
"kind": "field",
|
|
1019
|
+
"name": "disableActiveFocus",
|
|
1020
|
+
"privacy": "private"
|
|
1021
|
+
}
|
|
1022
|
+
],
|
|
1023
|
+
"events": [
|
|
1024
|
+
{
|
|
1025
|
+
"name": "nord-focus-date",
|
|
807
1026
|
"type": {
|
|
808
|
-
"text": "
|
|
1027
|
+
"text": "DateSelectEvent"
|
|
809
1028
|
},
|
|
810
|
-
"
|
|
811
|
-
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
812
|
-
"fieldName": "download"
|
|
1029
|
+
"description": "Dispatched when the calendar's focused date changes."
|
|
813
1030
|
},
|
|
814
1031
|
{
|
|
815
|
-
"name": "target",
|
|
816
1032
|
"type": {
|
|
817
|
-
"text": "
|
|
1033
|
+
"text": "DateSelectEvent"
|
|
818
1034
|
},
|
|
819
|
-
"
|
|
820
|
-
"
|
|
821
|
-
|
|
822
|
-
|
|
1035
|
+
"description": "Dispatched when a date is selected and the value changes.",
|
|
1036
|
+
"name": "change"
|
|
1037
|
+
}
|
|
1038
|
+
],
|
|
1039
|
+
"attributes": [
|
|
823
1040
|
{
|
|
824
|
-
"name": "
|
|
1041
|
+
"name": "value",
|
|
825
1042
|
"type": {
|
|
826
|
-
"text": "
|
|
1043
|
+
"text": "string"
|
|
827
1044
|
},
|
|
828
|
-
"default": "
|
|
829
|
-
"description": "
|
|
830
|
-
"fieldName": "
|
|
1045
|
+
"default": "\"\"",
|
|
1046
|
+
"description": "The selected date on the calendar. Must be in IS0-8601 format: YYYY-MM-DD.",
|
|
1047
|
+
"fieldName": "value"
|
|
831
1048
|
},
|
|
832
1049
|
{
|
|
833
|
-
"name": "
|
|
1050
|
+
"name": "firstDayOfWeek",
|
|
834
1051
|
"type": {
|
|
835
|
-
"text": "
|
|
1052
|
+
"text": "DaysOfWeek"
|
|
836
1053
|
},
|
|
837
|
-
"
|
|
838
|
-
"
|
|
839
|
-
"fieldName": "disabled",
|
|
840
|
-
"inheritedFrom": {
|
|
841
|
-
"name": "InputMixin",
|
|
842
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
843
|
-
}
|
|
1054
|
+
"description": "Which day is considered first day of the week? `0` for Sunday, `1` for Monday, etc.\nDefault is Monday.",
|
|
1055
|
+
"fieldName": "firstDayOfWeek"
|
|
844
1056
|
},
|
|
845
1057
|
{
|
|
846
|
-
"name": "
|
|
1058
|
+
"name": "min",
|
|
847
1059
|
"type": {
|
|
848
|
-
"text": "string
|
|
1060
|
+
"text": "string"
|
|
849
1061
|
},
|
|
850
|
-
"
|
|
851
|
-
"
|
|
852
|
-
"
|
|
853
|
-
"name": "InputMixin",
|
|
854
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
855
|
-
}
|
|
1062
|
+
"default": "\"\"",
|
|
1063
|
+
"description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
|
|
1064
|
+
"fieldName": "min"
|
|
856
1065
|
},
|
|
857
1066
|
{
|
|
858
|
-
"name": "
|
|
1067
|
+
"name": "max",
|
|
859
1068
|
"type": {
|
|
860
1069
|
"text": "string"
|
|
861
1070
|
},
|
|
862
1071
|
"default": "\"\"",
|
|
863
|
-
"description": "
|
|
864
|
-
"fieldName": "
|
|
865
|
-
"inheritedFrom": {
|
|
866
|
-
"name": "InputMixin",
|
|
867
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
],
|
|
871
|
-
"mixins": [
|
|
872
|
-
{
|
|
873
|
-
"name": "InputMixin",
|
|
874
|
-
"module": "/src/common/mixins/InputMixin.js"
|
|
1072
|
+
"description": "Maximum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the min property.",
|
|
1073
|
+
"fieldName": "max"
|
|
875
1074
|
},
|
|
876
1075
|
{
|
|
877
|
-
"name": "
|
|
878
|
-
"
|
|
1076
|
+
"name": "expand",
|
|
1077
|
+
"type": {
|
|
1078
|
+
"text": "boolean"
|
|
1079
|
+
},
|
|
1080
|
+
"default": "false",
|
|
1081
|
+
"description": "Controls whether the calendar expands to fill the width of its container.",
|
|
1082
|
+
"fieldName": "expand"
|
|
879
1083
|
}
|
|
880
1084
|
],
|
|
881
1085
|
"superclass": {
|
|
@@ -883,8 +1087,8 @@
|
|
|
883
1087
|
"package": "lit"
|
|
884
1088
|
},
|
|
885
1089
|
"status": "ready",
|
|
886
|
-
"category": "
|
|
887
|
-
"tagName": "nord-
|
|
1090
|
+
"category": "list",
|
|
1091
|
+
"tagName": "nord-calendar",
|
|
888
1092
|
"customElement": true
|
|
889
1093
|
}
|
|
890
1094
|
],
|
|
@@ -893,225 +1097,242 @@
|
|
|
893
1097
|
"kind": "js",
|
|
894
1098
|
"name": "default",
|
|
895
1099
|
"declaration": {
|
|
896
|
-
"name": "
|
|
897
|
-
"module": "src/
|
|
1100
|
+
"name": "Calendar",
|
|
1101
|
+
"module": "src/calendar/Calendar.ts"
|
|
898
1102
|
}
|
|
899
1103
|
},
|
|
900
1104
|
{
|
|
901
1105
|
"kind": "custom-element-definition",
|
|
902
|
-
"name": "nord-
|
|
1106
|
+
"name": "nord-calendar",
|
|
903
1107
|
"declaration": {
|
|
904
|
-
"name": "
|
|
905
|
-
"module": "src/
|
|
1108
|
+
"name": "Calendar",
|
|
1109
|
+
"module": "src/calendar/Calendar.ts"
|
|
906
1110
|
}
|
|
907
1111
|
}
|
|
908
1112
|
],
|
|
909
|
-
"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
|
|
1113
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
910
1114
|
},
|
|
911
1115
|
{
|
|
912
1116
|
"kind": "javascript-module",
|
|
913
|
-
"path": "src/
|
|
1117
|
+
"path": "src/calendar/DateSelectEvent.ts",
|
|
914
1118
|
"declarations": [
|
|
915
1119
|
{
|
|
916
1120
|
"kind": "class",
|
|
917
|
-
"description": "
|
|
918
|
-
"name": "
|
|
919
|
-
"slots": [
|
|
920
|
-
{
|
|
921
|
-
"description": "default slot",
|
|
922
|
-
"name": ""
|
|
923
|
-
}
|
|
924
|
-
],
|
|
925
|
-
"members": [
|
|
926
|
-
{
|
|
927
|
-
"kind": "field",
|
|
928
|
-
"name": "variant",
|
|
929
|
-
"type": {
|
|
930
|
-
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
931
|
-
},
|
|
932
|
-
"default": "\"info\"",
|
|
933
|
-
"description": "The style variant of the banner.",
|
|
934
|
-
"attribute": "variant",
|
|
935
|
-
"reflects": true
|
|
936
|
-
}
|
|
937
|
-
],
|
|
938
|
-
"attributes": [
|
|
939
|
-
{
|
|
940
|
-
"name": "variant",
|
|
941
|
-
"type": {
|
|
942
|
-
"text": "\"info\" | \"danger\" | \"success\" | \"warning\""
|
|
943
|
-
},
|
|
944
|
-
"default": "\"info\"",
|
|
945
|
-
"description": "The style variant of the banner.",
|
|
946
|
-
"fieldName": "variant"
|
|
947
|
-
}
|
|
948
|
-
],
|
|
1121
|
+
"description": "",
|
|
1122
|
+
"name": "DateSelectEvent",
|
|
949
1123
|
"superclass": {
|
|
950
|
-
"name": "
|
|
951
|
-
"
|
|
952
|
-
}
|
|
953
|
-
"status": "ready",
|
|
954
|
-
"category": "feedback",
|
|
955
|
-
"tagName": "nord-banner",
|
|
956
|
-
"customElement": true
|
|
1124
|
+
"name": "NordEvent",
|
|
1125
|
+
"module": "/src/common/events.js"
|
|
1126
|
+
}
|
|
957
1127
|
}
|
|
958
1128
|
],
|
|
959
1129
|
"exports": [
|
|
960
1130
|
{
|
|
961
1131
|
"kind": "js",
|
|
962
|
-
"name": "
|
|
1132
|
+
"name": "DateSelectEvent",
|
|
963
1133
|
"declaration": {
|
|
964
|
-
"name": "
|
|
965
|
-
"module": "src/
|
|
1134
|
+
"name": "DateSelectEvent",
|
|
1135
|
+
"module": "src/calendar/DateSelectEvent.ts"
|
|
966
1136
|
}
|
|
967
|
-
}
|
|
1137
|
+
}
|
|
1138
|
+
],
|
|
1139
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
"kind": "javascript-module",
|
|
1143
|
+
"path": "src/calendar/localization.ts",
|
|
1144
|
+
"declarations": [
|
|
968
1145
|
{
|
|
969
|
-
"kind": "
|
|
970
|
-
"name": "
|
|
1146
|
+
"kind": "variable",
|
|
1147
|
+
"name": "calendarLocalization",
|
|
1148
|
+
"type": {
|
|
1149
|
+
"text": "object"
|
|
1150
|
+
},
|
|
1151
|
+
"default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n}"
|
|
1152
|
+
}
|
|
1153
|
+
],
|
|
1154
|
+
"exports": [
|
|
1155
|
+
{
|
|
1156
|
+
"kind": "js",
|
|
1157
|
+
"name": "default",
|
|
971
1158
|
"declaration": {
|
|
972
|
-
"name": "
|
|
973
|
-
"module": "src/
|
|
1159
|
+
"name": "calendarLocalization",
|
|
1160
|
+
"module": "src/calendar/localization.ts"
|
|
974
1161
|
}
|
|
975
1162
|
}
|
|
976
1163
|
],
|
|
977
|
-
"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
|
|
1164
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
978
1165
|
},
|
|
979
1166
|
{
|
|
980
1167
|
"kind": "javascript-module",
|
|
981
|
-
"path": "src/calendar/
|
|
1168
|
+
"path": "src/calendar/month-view.ts",
|
|
982
1169
|
"declarations": [
|
|
983
1170
|
{
|
|
984
|
-
"kind": "
|
|
985
|
-
"
|
|
986
|
-
"
|
|
987
|
-
"members": [
|
|
1171
|
+
"kind": "function",
|
|
1172
|
+
"name": "dayView",
|
|
1173
|
+
"parameters": [
|
|
988
1174
|
{
|
|
989
|
-
"
|
|
990
|
-
"name": "dialogLabelId",
|
|
1175
|
+
"name": "{\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}",
|
|
991
1176
|
"type": {
|
|
992
|
-
"text": "
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1177
|
+
"text": "DatePickerDayProps"
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
]
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
"kind": "function",
|
|
1184
|
+
"name": "monthView",
|
|
1185
|
+
"parameters": [
|
|
997
1186
|
{
|
|
998
|
-
"
|
|
999
|
-
"name": "monthSelectNode",
|
|
1187
|
+
"name": "{\n onFocusIn,\n onFocusOut,\n selectedDate,\n focusedDate,\n labelledById,\n dayNames,\n dayNamesShort,\n firstDayOfWeek,\n min,\n max,\n dateFormatter,\n isDateDisabled,\n onDateSelect,\n onKeyboardNavigation,\n}",
|
|
1000
1188
|
"type": {
|
|
1001
|
-
"text": "
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
|
|
1189
|
+
"text": "MonthViewArgs"
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
]
|
|
1193
|
+
}
|
|
1194
|
+
],
|
|
1195
|
+
"exports": [
|
|
1196
|
+
{
|
|
1197
|
+
"kind": "js",
|
|
1198
|
+
"name": "dayView",
|
|
1199
|
+
"declaration": {
|
|
1200
|
+
"name": "dayView",
|
|
1201
|
+
"module": "src/calendar/month-view.ts"
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"kind": "js",
|
|
1206
|
+
"name": "monthView",
|
|
1207
|
+
"declaration": {
|
|
1208
|
+
"name": "monthView",
|
|
1209
|
+
"module": "src/calendar/month-view.ts"
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
],
|
|
1213
|
+
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
"kind": "javascript-module",
|
|
1217
|
+
"path": "src/button/Button.ts",
|
|
1218
|
+
"declarations": [
|
|
1219
|
+
{
|
|
1220
|
+
"kind": "class",
|
|
1221
|
+
"description": "Buttons are used for interface actions. Primary style should be\nused only once per section for main call-to-action, while other\nstyles can appear more frequently.",
|
|
1222
|
+
"name": "Button",
|
|
1223
|
+
"slots": [
|
|
1005
1224
|
{
|
|
1006
|
-
"
|
|
1007
|
-
"name": "
|
|
1008
|
-
"type": {
|
|
1009
|
-
"text": "HTMLButtonElement"
|
|
1010
|
-
},
|
|
1011
|
-
"privacy": "private"
|
|
1225
|
+
"description": "The button content",
|
|
1226
|
+
"name": ""
|
|
1012
1227
|
},
|
|
1013
1228
|
{
|
|
1014
|
-
"
|
|
1015
|
-
"name": "
|
|
1016
|
-
"privacy": "private",
|
|
1017
|
-
"default": "new DirectionController(this)"
|
|
1229
|
+
"description": "Used to place content at the start of button text. Typically used for icons.",
|
|
1230
|
+
"name": "start"
|
|
1018
1231
|
},
|
|
1019
1232
|
{
|
|
1020
|
-
"
|
|
1021
|
-
"name": "
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1233
|
+
"description": "Used to place content at the end of button text. Typically used for icons.",
|
|
1234
|
+
"name": "end"
|
|
1235
|
+
}
|
|
1236
|
+
],
|
|
1237
|
+
"members": [
|
|
1025
1238
|
{
|
|
1026
1239
|
"kind": "field",
|
|
1027
|
-
"name": "
|
|
1240
|
+
"name": "buttonRef",
|
|
1028
1241
|
"privacy": "private"
|
|
1029
1242
|
},
|
|
1030
1243
|
{
|
|
1031
1244
|
"kind": "field",
|
|
1032
|
-
"name": "
|
|
1245
|
+
"name": "events",
|
|
1033
1246
|
"privacy": "private",
|
|
1034
|
-
"default": "new
|
|
1247
|
+
"default": "new EventController(this)"
|
|
1035
1248
|
},
|
|
1036
1249
|
{
|
|
1037
1250
|
"kind": "field",
|
|
1038
|
-
"name": "
|
|
1039
|
-
"type": {
|
|
1040
|
-
"text": "Intl.DateTimeFormat"
|
|
1041
|
-
},
|
|
1251
|
+
"name": "lightDom",
|
|
1042
1252
|
"privacy": "private",
|
|
1043
|
-
"
|
|
1253
|
+
"default": "new LightDomController(this, {\n render: () => this.renderLightDom(),\n })"
|
|
1044
1254
|
},
|
|
1045
1255
|
{
|
|
1046
1256
|
"kind": "field",
|
|
1047
|
-
"name": "
|
|
1257
|
+
"name": "variant",
|
|
1048
1258
|
"type": {
|
|
1049
|
-
"text": "
|
|
1259
|
+
"text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
|
|
1050
1260
|
},
|
|
1051
|
-
"
|
|
1261
|
+
"default": "\"default\"",
|
|
1262
|
+
"description": "The style variant of the button.",
|
|
1263
|
+
"attribute": "variant",
|
|
1264
|
+
"reflects": true
|
|
1052
1265
|
},
|
|
1053
1266
|
{
|
|
1054
1267
|
"kind": "field",
|
|
1055
|
-
"name": "
|
|
1268
|
+
"name": "type",
|
|
1056
1269
|
"type": {
|
|
1057
|
-
"text": "
|
|
1270
|
+
"text": "\"button\" | \"submit\" | \"reset\""
|
|
1058
1271
|
},
|
|
1059
|
-
"
|
|
1272
|
+
"default": "\"submit\"",
|
|
1273
|
+
"description": "The type of the button.",
|
|
1274
|
+
"attribute": "type",
|
|
1275
|
+
"reflects": true
|
|
1060
1276
|
},
|
|
1061
1277
|
{
|
|
1062
1278
|
"kind": "field",
|
|
1063
|
-
"name": "
|
|
1279
|
+
"name": "size",
|
|
1064
1280
|
"type": {
|
|
1065
|
-
"text": "
|
|
1281
|
+
"text": "\"s\" | \"m\" | \"l\""
|
|
1066
1282
|
},
|
|
1067
|
-
"
|
|
1283
|
+
"default": "\"m\"",
|
|
1284
|
+
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
1285
|
+
"attribute": "size",
|
|
1286
|
+
"reflects": true
|
|
1068
1287
|
},
|
|
1069
1288
|
{
|
|
1070
1289
|
"kind": "field",
|
|
1071
|
-
"name": "
|
|
1290
|
+
"name": "accessibleExpanded",
|
|
1072
1291
|
"type": {
|
|
1073
|
-
"text": "
|
|
1292
|
+
"text": "\"true\" | \"false\" | undefined"
|
|
1074
1293
|
},
|
|
1075
|
-
"privacy": "private"
|
|
1294
|
+
"privacy": "private",
|
|
1295
|
+
"attribute": "aria-expanded"
|
|
1076
1296
|
},
|
|
1077
1297
|
{
|
|
1078
1298
|
"kind": "field",
|
|
1079
|
-
"name": "
|
|
1299
|
+
"name": "accessibleHasPopup",
|
|
1080
1300
|
"type": {
|
|
1081
|
-
"text": "
|
|
1301
|
+
"text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
|
|
1082
1302
|
},
|
|
1083
|
-
"
|
|
1084
|
-
"
|
|
1085
|
-
"attribute": "value"
|
|
1303
|
+
"privacy": "private",
|
|
1304
|
+
"attribute": "aria-haspopup"
|
|
1086
1305
|
},
|
|
1087
1306
|
{
|
|
1088
1307
|
"kind": "field",
|
|
1089
|
-
"name": "
|
|
1308
|
+
"name": "href",
|
|
1090
1309
|
"type": {
|
|
1091
|
-
"text": "
|
|
1310
|
+
"text": "string | undefined"
|
|
1092
1311
|
},
|
|
1093
|
-
"description": "
|
|
1094
|
-
"attribute": "
|
|
1312
|
+
"description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
|
|
1313
|
+
"attribute": "href",
|
|
1314
|
+
"reflects": true
|
|
1095
1315
|
},
|
|
1096
1316
|
{
|
|
1097
1317
|
"kind": "field",
|
|
1098
|
-
"name": "
|
|
1318
|
+
"name": "download",
|
|
1099
1319
|
"type": {
|
|
1100
|
-
"text": "
|
|
1320
|
+
"text": "boolean"
|
|
1101
1321
|
},
|
|
1102
|
-
"default": "
|
|
1103
|
-
"description": "
|
|
1104
|
-
"attribute": "
|
|
1322
|
+
"default": "false",
|
|
1323
|
+
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
1324
|
+
"attribute": "download"
|
|
1105
1325
|
},
|
|
1106
1326
|
{
|
|
1107
1327
|
"kind": "field",
|
|
1108
|
-
"name": "
|
|
1328
|
+
"name": "target",
|
|
1109
1329
|
"type": {
|
|
1110
|
-
"text": "
|
|
1330
|
+
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
1111
1331
|
},
|
|
1112
|
-
"default": "\"\"",
|
|
1113
|
-
"description": "
|
|
1114
|
-
"attribute": "
|
|
1332
|
+
"default": "\"_self\"",
|
|
1333
|
+
"description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
|
|
1334
|
+
"attribute": "target",
|
|
1335
|
+
"reflects": true
|
|
1115
1336
|
},
|
|
1116
1337
|
{
|
|
1117
1338
|
"kind": "field",
|
|
@@ -1120,504 +1341,283 @@
|
|
|
1120
1341
|
"text": "boolean"
|
|
1121
1342
|
},
|
|
1122
1343
|
"default": "false",
|
|
1123
|
-
"description": "Controls whether the
|
|
1344
|
+
"description": "Controls whether the button expands to fill the width of its container.",
|
|
1124
1345
|
"attribute": "expand",
|
|
1125
1346
|
"reflects": true
|
|
1126
1347
|
},
|
|
1127
|
-
{
|
|
1128
|
-
"kind": "field",
|
|
1129
|
-
"name": "isDateDisabled",
|
|
1130
|
-
"type": {
|
|
1131
|
-
"text": "DateDisabledPredicate"
|
|
1132
|
-
},
|
|
1133
|
-
"default": "isDateDisabled",
|
|
1134
|
-
"description": "Controls which days are disabled and therefore disallowed.\nFor example, this can be used to disallow selection of weekends."
|
|
1135
|
-
},
|
|
1136
|
-
{
|
|
1137
|
-
"kind": "field",
|
|
1138
|
-
"name": "activeFocus",
|
|
1139
|
-
"type": {
|
|
1140
|
-
"text": "boolean"
|
|
1141
|
-
},
|
|
1142
|
-
"privacy": "private",
|
|
1143
|
-
"default": "false"
|
|
1144
|
-
},
|
|
1145
|
-
{
|
|
1146
|
-
"kind": "field",
|
|
1147
|
-
"name": "focusedDay",
|
|
1148
|
-
"privacy": "private",
|
|
1149
|
-
"default": "new Date()"
|
|
1150
|
-
},
|
|
1151
1348
|
{
|
|
1152
1349
|
"kind": "method",
|
|
1153
|
-
"name": "
|
|
1350
|
+
"name": "renderLink",
|
|
1351
|
+
"privacy": "private",
|
|
1154
1352
|
"parameters": [
|
|
1155
1353
|
{
|
|
1156
|
-
"name": "
|
|
1157
|
-
"optional": true,
|
|
1354
|
+
"name": "innards",
|
|
1158
1355
|
"type": {
|
|
1159
|
-
"text": "
|
|
1160
|
-
}
|
|
1161
|
-
"description": "An object which controls aspects of the focusing process."
|
|
1356
|
+
"text": "TemplateResult"
|
|
1357
|
+
}
|
|
1162
1358
|
}
|
|
1163
1359
|
],
|
|
1164
|
-
"description": "
|
|
1360
|
+
"description": "We jump through some hoops here to ensure the link is treated correctly when \"disabled\".\nLinks cannot be disabled natively, so we need to rely on some aria magic to get the correct semantics.\nAlong with the advice in the article below, we also set tabindex to \"-1\", so it is taken out of tab order."
|
|
1165
1361
|
},
|
|
1166
1362
|
{
|
|
1167
1363
|
"kind": "method",
|
|
1168
|
-
"name": "
|
|
1169
|
-
"privacy": "protected"
|
|
1170
|
-
},
|
|
1171
|
-
{
|
|
1172
|
-
"kind": "method",
|
|
1173
|
-
"name": "handleFocusedDayChange",
|
|
1174
|
-
"privacy": "protected"
|
|
1175
|
-
},
|
|
1176
|
-
{
|
|
1177
|
-
"kind": "method",
|
|
1178
|
-
"name": "handleLangChange",
|
|
1179
|
-
"privacy": "private"
|
|
1180
|
-
},
|
|
1181
|
-
{
|
|
1182
|
-
"kind": "field",
|
|
1183
|
-
"name": "handleDaySelect",
|
|
1184
|
-
"privacy": "private"
|
|
1185
|
-
},
|
|
1186
|
-
{
|
|
1187
|
-
"kind": "method",
|
|
1188
|
-
"name": "addDays",
|
|
1189
|
-
"privacy": "private",
|
|
1190
|
-
"parameters": [
|
|
1191
|
-
{
|
|
1192
|
-
"name": "days",
|
|
1193
|
-
"type": {
|
|
1194
|
-
"text": "number"
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
]
|
|
1198
|
-
},
|
|
1199
|
-
{
|
|
1200
|
-
"kind": "method",
|
|
1201
|
-
"name": "addMonths",
|
|
1202
|
-
"privacy": "private",
|
|
1203
|
-
"parameters": [
|
|
1204
|
-
{
|
|
1205
|
-
"name": "months",
|
|
1206
|
-
"type": {
|
|
1207
|
-
"text": "number"
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
]
|
|
1211
|
-
},
|
|
1212
|
-
{
|
|
1213
|
-
"kind": "method",
|
|
1214
|
-
"name": "addYears",
|
|
1364
|
+
"name": "renderButton",
|
|
1215
1365
|
"privacy": "private",
|
|
1216
1366
|
"parameters": [
|
|
1217
1367
|
{
|
|
1218
|
-
"name": "
|
|
1368
|
+
"name": "innards",
|
|
1219
1369
|
"type": {
|
|
1220
|
-
"text": "
|
|
1370
|
+
"text": "TemplateResult"
|
|
1221
1371
|
}
|
|
1222
1372
|
}
|
|
1223
1373
|
]
|
|
1224
1374
|
},
|
|
1225
1375
|
{
|
|
1226
1376
|
"kind": "method",
|
|
1227
|
-
"name": "
|
|
1377
|
+
"name": "renderLightDom",
|
|
1228
1378
|
"privacy": "private"
|
|
1229
1379
|
},
|
|
1230
1380
|
{
|
|
1231
|
-
"kind": "
|
|
1232
|
-
"name": "
|
|
1381
|
+
"kind": "field",
|
|
1382
|
+
"name": "handleOuterClick",
|
|
1233
1383
|
"privacy": "private"
|
|
1234
1384
|
},
|
|
1235
1385
|
{
|
|
1236
1386
|
"kind": "method",
|
|
1237
|
-
"name": "
|
|
1387
|
+
"name": "handleClick",
|
|
1238
1388
|
"privacy": "private",
|
|
1239
1389
|
"parameters": [
|
|
1240
1390
|
{
|
|
1241
|
-
"name": "
|
|
1391
|
+
"name": "e",
|
|
1242
1392
|
"type": {
|
|
1243
|
-
"text": "
|
|
1393
|
+
"text": "Event"
|
|
1244
1394
|
}
|
|
1245
1395
|
}
|
|
1246
1396
|
]
|
|
1247
1397
|
},
|
|
1248
1398
|
{
|
|
1249
|
-
"kind": "
|
|
1250
|
-
"name": "
|
|
1251
|
-
"
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1399
|
+
"kind": "field",
|
|
1400
|
+
"name": "disabled",
|
|
1401
|
+
"type": {
|
|
1402
|
+
"text": "boolean"
|
|
1403
|
+
},
|
|
1404
|
+
"default": "false",
|
|
1405
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1406
|
+
"attribute": "disabled",
|
|
1407
|
+
"reflects": true,
|
|
1408
|
+
"inheritedFrom": {
|
|
1409
|
+
"name": "InputMixin",
|
|
1410
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1411
|
+
}
|
|
1260
1412
|
},
|
|
1261
1413
|
{
|
|
1262
|
-
"kind": "
|
|
1263
|
-
"name": "
|
|
1264
|
-
"
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1414
|
+
"kind": "field",
|
|
1415
|
+
"name": "name",
|
|
1416
|
+
"type": {
|
|
1417
|
+
"text": "string | undefined"
|
|
1418
|
+
},
|
|
1419
|
+
"description": "The name of the form component.",
|
|
1420
|
+
"attribute": "name",
|
|
1421
|
+
"inheritedFrom": {
|
|
1422
|
+
"name": "InputMixin",
|
|
1423
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1424
|
+
}
|
|
1273
1425
|
},
|
|
1274
1426
|
{
|
|
1275
1427
|
"kind": "field",
|
|
1276
|
-
"name": "
|
|
1277
|
-
"
|
|
1428
|
+
"name": "value",
|
|
1429
|
+
"type": {
|
|
1430
|
+
"text": "string"
|
|
1431
|
+
},
|
|
1432
|
+
"default": "\"\"",
|
|
1433
|
+
"description": "The value of the form component.",
|
|
1434
|
+
"attribute": "value",
|
|
1435
|
+
"inheritedFrom": {
|
|
1436
|
+
"name": "InputMixin",
|
|
1437
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1438
|
+
}
|
|
1278
1439
|
},
|
|
1279
1440
|
{
|
|
1280
1441
|
"kind": "field",
|
|
1281
|
-
"name": "
|
|
1282
|
-
"privacy": "
|
|
1442
|
+
"name": "form",
|
|
1443
|
+
"privacy": "protected",
|
|
1444
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
1445
|
+
"inheritedFrom": {
|
|
1446
|
+
"name": "InputMixin",
|
|
1447
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1448
|
+
}
|
|
1283
1449
|
},
|
|
1284
1450
|
{
|
|
1285
1451
|
"kind": "field",
|
|
1286
|
-
"name": "
|
|
1287
|
-
"privacy": "
|
|
1452
|
+
"name": "focusableRef",
|
|
1453
|
+
"privacy": "protected",
|
|
1454
|
+
"inheritedFrom": {
|
|
1455
|
+
"name": "FocusableMixin",
|
|
1456
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1457
|
+
}
|
|
1288
1458
|
},
|
|
1289
1459
|
{
|
|
1290
|
-
"kind": "
|
|
1291
|
-
"name": "
|
|
1292
|
-
"
|
|
1460
|
+
"kind": "method",
|
|
1461
|
+
"name": "focus",
|
|
1462
|
+
"parameters": [
|
|
1463
|
+
{
|
|
1464
|
+
"name": "options",
|
|
1465
|
+
"optional": true,
|
|
1466
|
+
"type": {
|
|
1467
|
+
"text": "FocusOptions"
|
|
1468
|
+
},
|
|
1469
|
+
"description": "An object which controls aspects of the focusing process."
|
|
1470
|
+
}
|
|
1471
|
+
],
|
|
1472
|
+
"description": "Programmatically move focus to the component.",
|
|
1473
|
+
"inheritedFrom": {
|
|
1474
|
+
"name": "FocusableMixin",
|
|
1475
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1476
|
+
}
|
|
1293
1477
|
},
|
|
1294
1478
|
{
|
|
1295
|
-
"kind": "
|
|
1296
|
-
"name": "
|
|
1297
|
-
"
|
|
1479
|
+
"kind": "method",
|
|
1480
|
+
"name": "blur",
|
|
1481
|
+
"description": "Programmatically remove focus from the component.",
|
|
1482
|
+
"inheritedFrom": {
|
|
1483
|
+
"name": "FocusableMixin",
|
|
1484
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1485
|
+
}
|
|
1298
1486
|
},
|
|
1299
1487
|
{
|
|
1300
|
-
"kind": "
|
|
1301
|
-
"name": "
|
|
1302
|
-
"
|
|
1488
|
+
"kind": "method",
|
|
1489
|
+
"name": "click",
|
|
1490
|
+
"description": "Programmatically simulates a click on the component.",
|
|
1491
|
+
"inheritedFrom": {
|
|
1492
|
+
"name": "FocusableMixin",
|
|
1493
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
1494
|
+
}
|
|
1303
1495
|
}
|
|
1304
1496
|
],
|
|
1305
|
-
"
|
|
1497
|
+
"attributes": [
|
|
1306
1498
|
{
|
|
1307
|
-
"name": "
|
|
1499
|
+
"name": "variant",
|
|
1308
1500
|
"type": {
|
|
1309
|
-
"text": "
|
|
1501
|
+
"text": "\"default\" | \"primary\" | \"dashed\" | \"plain\" | \"danger\" | \"switch\""
|
|
1310
1502
|
},
|
|
1311
|
-
"
|
|
1503
|
+
"default": "\"default\"",
|
|
1504
|
+
"description": "The style variant of the button.",
|
|
1505
|
+
"fieldName": "variant"
|
|
1312
1506
|
},
|
|
1313
1507
|
{
|
|
1508
|
+
"name": "type",
|
|
1314
1509
|
"type": {
|
|
1315
|
-
"text": "
|
|
1510
|
+
"text": "\"button\" | \"submit\" | \"reset\""
|
|
1316
1511
|
},
|
|
1317
|
-
"
|
|
1318
|
-
"
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
"attributes": [
|
|
1512
|
+
"default": "\"submit\"",
|
|
1513
|
+
"description": "The type of the button.",
|
|
1514
|
+
"fieldName": "type"
|
|
1515
|
+
},
|
|
1322
1516
|
{
|
|
1323
|
-
"name": "
|
|
1517
|
+
"name": "size",
|
|
1324
1518
|
"type": {
|
|
1325
|
-
"text": "
|
|
1519
|
+
"text": "\"s\" | \"m\" | \"l\""
|
|
1326
1520
|
},
|
|
1327
|
-
"default": "\"\"",
|
|
1328
|
-
"description": "The
|
|
1329
|
-
"fieldName": "
|
|
1521
|
+
"default": "\"m\"",
|
|
1522
|
+
"description": "The size of the button.\nThis affects font-size and padding.",
|
|
1523
|
+
"fieldName": "size"
|
|
1330
1524
|
},
|
|
1331
1525
|
{
|
|
1332
|
-
"name": "
|
|
1526
|
+
"name": "aria-expanded",
|
|
1333
1527
|
"type": {
|
|
1334
|
-
"text": "
|
|
1528
|
+
"text": "\"true\" | \"false\" | undefined"
|
|
1335
1529
|
},
|
|
1336
|
-
"
|
|
1337
|
-
"fieldName": "firstDayOfWeek"
|
|
1530
|
+
"fieldName": "accessibleExpanded"
|
|
1338
1531
|
},
|
|
1339
1532
|
{
|
|
1340
|
-
"name": "
|
|
1533
|
+
"name": "aria-haspopup",
|
|
1341
1534
|
"type": {
|
|
1342
|
-
"text": "
|
|
1535
|
+
"text": "| \"false\"\n | \"true\"\n | \"menu\"\n | \"listbox\"\n | \"tree\"\n | \"grid\"\n | \"dialog\" | undefined"
|
|
1343
1536
|
},
|
|
1344
|
-
"
|
|
1345
|
-
"description": "Minimum date allowed to be picked. Must be in IS0-8601 format: YYYY-MM-DD.\nThis setting can be used alone or together with the max property.",
|
|
1346
|
-
"fieldName": "min"
|
|
1537
|
+
"fieldName": "accessibleHasPopup"
|
|
1347
1538
|
},
|
|
1348
1539
|
{
|
|
1349
|
-
"name": "
|
|
1540
|
+
"name": "href",
|
|
1350
1541
|
"type": {
|
|
1351
|
-
"text": "string"
|
|
1542
|
+
"text": "string | undefined"
|
|
1352
1543
|
},
|
|
1353
|
-
"
|
|
1354
|
-
"
|
|
1355
|
-
"fieldName": "max"
|
|
1544
|
+
"description": "When provided, renders the button as a link,\nwith its href attribute set to the given value.",
|
|
1545
|
+
"fieldName": "href"
|
|
1356
1546
|
},
|
|
1357
1547
|
{
|
|
1358
|
-
"name": "
|
|
1548
|
+
"name": "download",
|
|
1359
1549
|
"type": {
|
|
1360
1550
|
"text": "boolean"
|
|
1361
1551
|
},
|
|
1362
1552
|
"default": "false",
|
|
1363
|
-
"description": "
|
|
1364
|
-
"fieldName": "
|
|
1365
|
-
}
|
|
1366
|
-
],
|
|
1367
|
-
"superclass": {
|
|
1368
|
-
"name": "LitElement",
|
|
1369
|
-
"package": "lit"
|
|
1370
|
-
},
|
|
1371
|
-
"status": "ready",
|
|
1372
|
-
"category": "list",
|
|
1373
|
-
"tagName": "nord-calendar",
|
|
1374
|
-
"customElement": true
|
|
1375
|
-
}
|
|
1376
|
-
],
|
|
1377
|
-
"exports": [
|
|
1378
|
-
{
|
|
1379
|
-
"kind": "js",
|
|
1380
|
-
"name": "default",
|
|
1381
|
-
"declaration": {
|
|
1382
|
-
"name": "Calendar",
|
|
1383
|
-
"module": "src/calendar/Calendar.ts"
|
|
1384
|
-
}
|
|
1385
|
-
},
|
|
1386
|
-
{
|
|
1387
|
-
"kind": "custom-element-definition",
|
|
1388
|
-
"name": "nord-calendar",
|
|
1389
|
-
"declaration": {
|
|
1390
|
-
"name": "Calendar",
|
|
1391
|
-
"module": "src/calendar/Calendar.ts"
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
],
|
|
1395
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1396
|
-
},
|
|
1397
|
-
{
|
|
1398
|
-
"kind": "javascript-module",
|
|
1399
|
-
"path": "src/calendar/DateSelectEvent.ts",
|
|
1400
|
-
"declarations": [
|
|
1401
|
-
{
|
|
1402
|
-
"kind": "class",
|
|
1403
|
-
"description": "",
|
|
1404
|
-
"name": "DateSelectEvent",
|
|
1405
|
-
"superclass": {
|
|
1406
|
-
"name": "NordEvent",
|
|
1407
|
-
"module": "/src/common/events.js"
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
],
|
|
1411
|
-
"exports": [
|
|
1412
|
-
{
|
|
1413
|
-
"kind": "js",
|
|
1414
|
-
"name": "DateSelectEvent",
|
|
1415
|
-
"declaration": {
|
|
1416
|
-
"name": "DateSelectEvent",
|
|
1417
|
-
"module": "src/calendar/DateSelectEvent.ts"
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
],
|
|
1421
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1422
|
-
},
|
|
1423
|
-
{
|
|
1424
|
-
"kind": "javascript-module",
|
|
1425
|
-
"path": "src/calendar/localization.ts",
|
|
1426
|
-
"declarations": [
|
|
1427
|
-
{
|
|
1428
|
-
"kind": "variable",
|
|
1429
|
-
"name": "calendarLocalization",
|
|
1430
|
-
"type": {
|
|
1431
|
-
"text": "object"
|
|
1432
|
-
},
|
|
1433
|
-
"default": "{\n prevMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n}"
|
|
1434
|
-
}
|
|
1435
|
-
],
|
|
1436
|
-
"exports": [
|
|
1437
|
-
{
|
|
1438
|
-
"kind": "js",
|
|
1439
|
-
"name": "default",
|
|
1440
|
-
"declaration": {
|
|
1441
|
-
"name": "calendarLocalization",
|
|
1442
|
-
"module": "src/calendar/localization.ts"
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
],
|
|
1446
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1447
|
-
},
|
|
1448
|
-
{
|
|
1449
|
-
"kind": "javascript-module",
|
|
1450
|
-
"path": "src/calendar/month-view.ts",
|
|
1451
|
-
"declarations": [
|
|
1452
|
-
{
|
|
1453
|
-
"kind": "function",
|
|
1454
|
-
"name": "dayView",
|
|
1455
|
-
"parameters": [
|
|
1456
|
-
{
|
|
1457
|
-
"name": "{\n focusedDay,\n today,\n day,\n onDaySelect,\n onKeyboardNavigation,\n disabled,\n inRange,\n isSelected,\n dateFormatter,\n}",
|
|
1458
|
-
"type": {
|
|
1459
|
-
"text": "DatePickerDayProps"
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
]
|
|
1463
|
-
},
|
|
1464
|
-
{
|
|
1465
|
-
"kind": "function",
|
|
1466
|
-
"name": "monthView",
|
|
1467
|
-
"parameters": [
|
|
1468
|
-
{
|
|
1469
|
-
"name": "{\n onFocusIn,\n onFocusOut,\n selectedDate,\n focusedDate,\n labelledById,\n dayNames,\n dayNamesShort,\n firstDayOfWeek,\n min,\n max,\n dateFormatter,\n isDateDisabled,\n onDateSelect,\n onKeyboardNavigation,\n}",
|
|
1470
|
-
"type": {
|
|
1471
|
-
"text": "MonthViewArgs"
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
]
|
|
1475
|
-
}
|
|
1476
|
-
],
|
|
1477
|
-
"exports": [
|
|
1478
|
-
{
|
|
1479
|
-
"kind": "js",
|
|
1480
|
-
"name": "dayView",
|
|
1481
|
-
"declaration": {
|
|
1482
|
-
"name": "dayView",
|
|
1483
|
-
"module": "src/calendar/month-view.ts"
|
|
1484
|
-
}
|
|
1485
|
-
},
|
|
1486
|
-
{
|
|
1487
|
-
"kind": "js",
|
|
1488
|
-
"name": "monthView",
|
|
1489
|
-
"declaration": {
|
|
1490
|
-
"name": "monthView",
|
|
1491
|
-
"module": "src/calendar/month-view.ts"
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
],
|
|
1495
|
-
"readme": "## Usage\n\nThis section includes guidelines for designers and developers about the usage of this component in different contexts.\n\n<div class=\"n-usage n-usage-do\">\n\n### Do\n\n- Use when the user needs to choose a single date or a date range.\n- Close calendar after a single date is selected, unless a range with a start and end date is required.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for entering date of birth. Use input component instead.\n- Don’t use for choosing a date that is over 10 years in the future or the past.\n\n</div>\n\n---\n\n## Keyboard accessibility\n\nCalendar component is built to closely follow [W3C Date Picker Dialog example](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/datepicker-dialog.html) with some small exceptions to e.g. better support iOS VoiceOver and Android TalkBack.\n\n### Month/year buttons\n\n- `Space, Enter`: Changes the month and/or year displayed.\n\n### Calendar grid\n\n- `Space, Enter`: Selects a date.\n- `Arrow up`: Moves focus to the same day of the previous week.\n- `Arrow down`: Moves focus to the same day of the next week.\n- `Arrow right`: Moves focus to the next day. In right-to-left languages, moves focus to the previous day.\n- `Arrow left`: Moves focus to the previous day. In right-to-left languages, moves focus to the next day.\n- `Home`: Moves focus to the first day (e.g Monday) of the current week.\n- `End`: Moves focus to the last day (e.g. Sunday) of the current week.\n- `Page Up`: Changes the grid of dates to the previous month and sets focus on the same day of the same week.\n- `Shift + Page Up`: Changes the grid of dates to the previous year and sets focus on the same day of the same week.\n- `Page Down`: Changes the grid of dates to the next month and sets focus on the same day of the same week.\n- `Shift + Page Down`: Changes the grid of dates to the next year and sets focus on the same day of the same week.\n"
|
|
1496
|
-
},
|
|
1497
|
-
{
|
|
1498
|
-
"kind": "javascript-module",
|
|
1499
|
-
"path": "src/card/Card.ts",
|
|
1500
|
-
"declarations": [
|
|
1501
|
-
{
|
|
1502
|
-
"kind": "class",
|
|
1503
|
-
"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.",
|
|
1504
|
-
"name": "Card",
|
|
1505
|
-
"slots": [
|
|
1506
|
-
{
|
|
1507
|
-
"description": "The card content.",
|
|
1508
|
-
"name": ""
|
|
1509
|
-
},
|
|
1510
|
-
{
|
|
1511
|
-
"description": "Optional slot that holds a header for the card.",
|
|
1512
|
-
"name": "header"
|
|
1513
|
-
},
|
|
1514
|
-
{
|
|
1515
|
-
"description": "Optional slot that holds footer content for the card.",
|
|
1516
|
-
"name": "footer"
|
|
1517
|
-
}
|
|
1518
|
-
],
|
|
1519
|
-
"members": [
|
|
1520
|
-
{
|
|
1521
|
-
"kind": "field",
|
|
1522
|
-
"name": "headerSlot",
|
|
1523
|
-
"privacy": "private",
|
|
1524
|
-
"default": "new SlotController(this, \"header\")"
|
|
1553
|
+
"description": "When provided together with a href property, the button will\ntrigger a file download instead of a page visit.",
|
|
1554
|
+
"fieldName": "download"
|
|
1525
1555
|
},
|
|
1526
1556
|
{
|
|
1527
|
-
"
|
|
1528
|
-
"
|
|
1529
|
-
|
|
1530
|
-
|
|
1557
|
+
"name": "target",
|
|
1558
|
+
"type": {
|
|
1559
|
+
"text": "\"_self\" | \"_blank\" | \"_parent\" | \"_top\""
|
|
1560
|
+
},
|
|
1561
|
+
"default": "\"_self\"",
|
|
1562
|
+
"description": "When provided together with a href property, determines where\nto open the linked URL. The keywords have special meanings for\nwhere to load the URL: “_self” means the current browsing context,\n“_blank” usually a new tab but users can configure browsers this to\nopen a new window instead, “_parent” means the parent browsing\ncontext of the current one, but if no parent exists, behaves as\n_self, and finally “top” means the topmost browsing context.",
|
|
1563
|
+
"fieldName": "target"
|
|
1531
1564
|
},
|
|
1532
1565
|
{
|
|
1533
|
-
"
|
|
1534
|
-
"name": "padding",
|
|
1566
|
+
"name": "expand",
|
|
1535
1567
|
"type": {
|
|
1536
|
-
"text": "
|
|
1568
|
+
"text": "boolean"
|
|
1537
1569
|
},
|
|
1538
|
-
"default": "
|
|
1539
|
-
"description": "Controls
|
|
1540
|
-
"
|
|
1541
|
-
|
|
1542
|
-
}
|
|
1543
|
-
],
|
|
1544
|
-
"attributes": [
|
|
1570
|
+
"default": "false",
|
|
1571
|
+
"description": "Controls whether the button expands to fill the width of its container.",
|
|
1572
|
+
"fieldName": "expand"
|
|
1573
|
+
},
|
|
1545
1574
|
{
|
|
1546
|
-
"name": "
|
|
1575
|
+
"name": "disabled",
|
|
1547
1576
|
"type": {
|
|
1548
|
-
"text": "
|
|
1549
|
-
},
|
|
1550
|
-
"default": "
|
|
1551
|
-
"description": "
|
|
1552
|
-
"fieldName": "
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
},
|
|
1559
|
-
"status": "ready",
|
|
1560
|
-
"category": "structure",
|
|
1561
|
-
"tagName": "nord-card",
|
|
1562
|
-
"customElement": true
|
|
1563
|
-
}
|
|
1564
|
-
],
|
|
1565
|
-
"exports": [
|
|
1566
|
-
{
|
|
1567
|
-
"kind": "js",
|
|
1568
|
-
"name": "default",
|
|
1569
|
-
"declaration": {
|
|
1570
|
-
"name": "Card",
|
|
1571
|
-
"module": "src/card/Card.ts"
|
|
1572
|
-
}
|
|
1573
|
-
},
|
|
1574
|
-
{
|
|
1575
|
-
"kind": "custom-element-definition",
|
|
1576
|
-
"name": "nord-card",
|
|
1577
|
-
"declaration": {
|
|
1578
|
-
"name": "Card",
|
|
1579
|
-
"module": "src/card/Card.ts"
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
],
|
|
1583
|
-
"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"
|
|
1584
|
-
},
|
|
1585
|
-
{
|
|
1586
|
-
"kind": "javascript-module",
|
|
1587
|
-
"path": "src/badge/Badge.ts",
|
|
1588
|
-
"declarations": [
|
|
1589
|
-
{
|
|
1590
|
-
"kind": "class",
|
|
1591
|
-
"description": "Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.",
|
|
1592
|
-
"name": "Badge",
|
|
1593
|
-
"slots": [
|
|
1577
|
+
"text": "boolean"
|
|
1578
|
+
},
|
|
1579
|
+
"default": "false",
|
|
1580
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1581
|
+
"fieldName": "disabled",
|
|
1582
|
+
"inheritedFrom": {
|
|
1583
|
+
"name": "InputMixin",
|
|
1584
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1585
|
+
}
|
|
1586
|
+
},
|
|
1594
1587
|
{
|
|
1595
|
-
"
|
|
1596
|
-
"
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1588
|
+
"name": "name",
|
|
1589
|
+
"type": {
|
|
1590
|
+
"text": "string | undefined"
|
|
1591
|
+
},
|
|
1592
|
+
"description": "The name of the form component.",
|
|
1593
|
+
"fieldName": "name",
|
|
1594
|
+
"inheritedFrom": {
|
|
1595
|
+
"name": "InputMixin",
|
|
1596
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1597
|
+
}
|
|
1598
|
+
},
|
|
1600
1599
|
{
|
|
1601
|
-
"
|
|
1602
|
-
"name": "type",
|
|
1600
|
+
"name": "value",
|
|
1603
1601
|
"type": {
|
|
1604
|
-
"text": "
|
|
1602
|
+
"text": "string"
|
|
1605
1603
|
},
|
|
1606
|
-
"default": "\"
|
|
1607
|
-
"description": "The
|
|
1608
|
-
"
|
|
1609
|
-
"
|
|
1604
|
+
"default": "\"\"",
|
|
1605
|
+
"description": "The value of the form component.",
|
|
1606
|
+
"fieldName": "value",
|
|
1607
|
+
"inheritedFrom": {
|
|
1608
|
+
"name": "InputMixin",
|
|
1609
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
1610
|
+
}
|
|
1610
1611
|
}
|
|
1611
1612
|
],
|
|
1612
|
-
"
|
|
1613
|
+
"mixins": [
|
|
1613
1614
|
{
|
|
1614
|
-
"name": "
|
|
1615
|
-
"
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
"
|
|
1619
|
-
"
|
|
1620
|
-
"fieldName": "type"
|
|
1615
|
+
"name": "InputMixin",
|
|
1616
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
1617
|
+
},
|
|
1618
|
+
{
|
|
1619
|
+
"name": "FocusableMixin",
|
|
1620
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
1621
1621
|
}
|
|
1622
1622
|
],
|
|
1623
1623
|
"superclass": {
|
|
@@ -1625,8 +1625,8 @@
|
|
|
1625
1625
|
"package": "lit"
|
|
1626
1626
|
},
|
|
1627
1627
|
"status": "ready",
|
|
1628
|
-
"category": "
|
|
1629
|
-
"tagName": "nord-
|
|
1628
|
+
"category": "action",
|
|
1629
|
+
"tagName": "nord-button",
|
|
1630
1630
|
"customElement": true
|
|
1631
1631
|
}
|
|
1632
1632
|
],
|
|
@@ -1635,611 +1635,532 @@
|
|
|
1635
1635
|
"kind": "js",
|
|
1636
1636
|
"name": "default",
|
|
1637
1637
|
"declaration": {
|
|
1638
|
-
"name": "
|
|
1639
|
-
"module": "src/
|
|
1638
|
+
"name": "Button",
|
|
1639
|
+
"module": "src/button/Button.ts"
|
|
1640
1640
|
}
|
|
1641
1641
|
},
|
|
1642
1642
|
{
|
|
1643
1643
|
"kind": "custom-element-definition",
|
|
1644
|
-
"name": "nord-
|
|
1644
|
+
"name": "nord-button",
|
|
1645
1645
|
"declaration": {
|
|
1646
|
-
"name": "
|
|
1647
|
-
"module": "src/
|
|
1646
|
+
"name": "Button",
|
|
1647
|
+
"module": "src/button/Button.ts"
|
|
1648
1648
|
}
|
|
1649
1649
|
}
|
|
1650
1650
|
],
|
|
1651
|
-
"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
|
|
1651
|
+
"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| `switch` | Switch style is reserved for the clinic switcher in the top left corner of an application. |\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"
|
|
1652
1652
|
},
|
|
1653
1653
|
{
|
|
1654
1654
|
"kind": "javascript-module",
|
|
1655
|
-
"path": "src/
|
|
1655
|
+
"path": "src/command-menu/CommandMenu.ts",
|
|
1656
1656
|
"declarations": [
|
|
1657
1657
|
{
|
|
1658
1658
|
"kind": "class",
|
|
1659
|
-
"description": "
|
|
1660
|
-
"name": "
|
|
1659
|
+
"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.",
|
|
1660
|
+
"name": "CommandMenu",
|
|
1661
1661
|
"slots": [
|
|
1662
1662
|
{
|
|
1663
|
-
"description": "
|
|
1664
|
-
"name": "
|
|
1665
|
-
},
|
|
1666
|
-
{
|
|
1667
|
-
"description": "Optional slot that holds hint text for the input.",
|
|
1668
|
-
"name": "hint"
|
|
1669
|
-
},
|
|
1670
|
-
{
|
|
1671
|
-
"description": "Optional slot that holds error text for the input.",
|
|
1672
|
-
"name": "error"
|
|
1663
|
+
"description": "Used to replace the default footer contents.",
|
|
1664
|
+
"name": "footer"
|
|
1673
1665
|
}
|
|
1674
1666
|
],
|
|
1675
1667
|
"members": [
|
|
1676
1668
|
{
|
|
1677
1669
|
"kind": "field",
|
|
1678
|
-
"name": "
|
|
1679
|
-
"privacy": "
|
|
1680
|
-
"inheritedFrom": {
|
|
1681
|
-
"name": "FormAssociatedMixin",
|
|
1682
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1683
|
-
}
|
|
1684
|
-
},
|
|
1685
|
-
{
|
|
1686
|
-
"kind": "field",
|
|
1687
|
-
"name": "checked",
|
|
1688
|
-
"type": {
|
|
1689
|
-
"text": "boolean"
|
|
1690
|
-
},
|
|
1691
|
-
"default": "false",
|
|
1692
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
1693
|
-
"attribute": "checked"
|
|
1694
|
-
},
|
|
1695
|
-
{
|
|
1696
|
-
"kind": "method",
|
|
1697
|
-
"name": "handleChange",
|
|
1698
|
-
"privacy": "protected",
|
|
1699
|
-
"parameters": [
|
|
1700
|
-
{
|
|
1701
|
-
"name": "e",
|
|
1702
|
-
"type": {
|
|
1703
|
-
"text": "Event"
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
],
|
|
1707
|
-
"return": {
|
|
1708
|
-
"type": {
|
|
1709
|
-
"text": "void"
|
|
1710
|
-
}
|
|
1711
|
-
},
|
|
1712
|
-
"inheritedFrom": {
|
|
1713
|
-
"name": "FormAssociatedMixin",
|
|
1714
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1715
|
-
}
|
|
1670
|
+
"name": "inputRef",
|
|
1671
|
+
"privacy": "private"
|
|
1716
1672
|
},
|
|
1717
1673
|
{
|
|
1718
1674
|
"kind": "field",
|
|
1719
|
-
"name": "
|
|
1720
|
-
"privacy": "
|
|
1721
|
-
"default": "new SlotController(this, \"label\")",
|
|
1722
|
-
"inheritedFrom": {
|
|
1723
|
-
"name": "FormAssociatedMixin",
|
|
1724
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1725
|
-
}
|
|
1675
|
+
"name": "listRef",
|
|
1676
|
+
"privacy": "private"
|
|
1726
1677
|
},
|
|
1727
1678
|
{
|
|
1728
1679
|
"kind": "field",
|
|
1729
|
-
"name": "
|
|
1730
|
-
"
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1735
|
-
}
|
|
1680
|
+
"name": "previousFocus",
|
|
1681
|
+
"type": {
|
|
1682
|
+
"text": "HTMLElement | undefined"
|
|
1683
|
+
},
|
|
1684
|
+
"privacy": "private"
|
|
1736
1685
|
},
|
|
1737
1686
|
{
|
|
1738
1687
|
"kind": "field",
|
|
1739
|
-
"name": "
|
|
1740
|
-
"privacy": "
|
|
1741
|
-
"default": "new
|
|
1742
|
-
"inheritedFrom": {
|
|
1743
|
-
"name": "FormAssociatedMixin",
|
|
1744
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1745
|
-
}
|
|
1688
|
+
"name": "localize",
|
|
1689
|
+
"privacy": "private",
|
|
1690
|
+
"default": "new LocalizeController<\"nord-command-menu\">(this)"
|
|
1746
1691
|
},
|
|
1747
1692
|
{
|
|
1748
1693
|
"kind": "field",
|
|
1749
|
-
"name": "
|
|
1750
|
-
"privacy": "
|
|
1751
|
-
"default": "new
|
|
1752
|
-
"inheritedFrom": {
|
|
1753
|
-
"name": "FormAssociatedMixin",
|
|
1754
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1755
|
-
}
|
|
1694
|
+
"name": "dismissController",
|
|
1695
|
+
"privacy": "private",
|
|
1696
|
+
"default": "new LightDismissController(this, {\n isOpen: () => this.open,\n onDismiss: () => this.close(),\n })"
|
|
1756
1697
|
},
|
|
1757
1698
|
{
|
|
1758
1699
|
"kind": "field",
|
|
1759
|
-
"name": "
|
|
1760
|
-
"
|
|
1761
|
-
|
|
1762
|
-
},
|
|
1763
|
-
"privacy": "protected",
|
|
1764
|
-
"default": "\"input\"",
|
|
1765
|
-
"inheritedFrom": {
|
|
1766
|
-
"name": "FormAssociatedMixin",
|
|
1767
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1768
|
-
}
|
|
1700
|
+
"name": "keyboardController",
|
|
1701
|
+
"privacy": "private",
|
|
1702
|
+
"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 })"
|
|
1769
1703
|
},
|
|
1770
1704
|
{
|
|
1771
1705
|
"kind": "field",
|
|
1772
|
-
"name": "
|
|
1706
|
+
"name": "open",
|
|
1773
1707
|
"type": {
|
|
1774
|
-
"text": "
|
|
1708
|
+
"text": "boolean"
|
|
1775
1709
|
},
|
|
1776
|
-
"
|
|
1777
|
-
"
|
|
1778
|
-
"
|
|
1779
|
-
"name": "FormAssociatedMixin",
|
|
1780
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1781
|
-
}
|
|
1710
|
+
"default": "false",
|
|
1711
|
+
"description": "Show or hide the command menu.",
|
|
1712
|
+
"attribute": "open"
|
|
1782
1713
|
},
|
|
1783
1714
|
{
|
|
1784
1715
|
"kind": "field",
|
|
1785
|
-
"name": "
|
|
1716
|
+
"name": "placeholder",
|
|
1786
1717
|
"type": {
|
|
1787
1718
|
"text": "string"
|
|
1788
1719
|
},
|
|
1789
|
-
"
|
|
1790
|
-
"
|
|
1791
|
-
"
|
|
1792
|
-
"name": "FormAssociatedMixin",
|
|
1793
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1794
|
-
}
|
|
1720
|
+
"default": "\"Type a command or search...\"",
|
|
1721
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
1722
|
+
"attribute": "placeholder"
|
|
1795
1723
|
},
|
|
1796
1724
|
{
|
|
1797
1725
|
"kind": "field",
|
|
1798
|
-
"name": "
|
|
1726
|
+
"name": "commands",
|
|
1799
1727
|
"type": {
|
|
1800
|
-
"text": "
|
|
1728
|
+
"text": "Array<ICommandMenuAction>"
|
|
1801
1729
|
},
|
|
1802
|
-
"default": "
|
|
1803
|
-
"description": "
|
|
1804
|
-
"attribute": "label",
|
|
1805
|
-
"inheritedFrom": {
|
|
1806
|
-
"name": "FormAssociatedMixin",
|
|
1807
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1808
|
-
}
|
|
1730
|
+
"default": "[]",
|
|
1731
|
+
"description": "Array of commands to be included in the menu.\nPlease see “Commands data” section for more documentation."
|
|
1809
1732
|
},
|
|
1810
1733
|
{
|
|
1811
1734
|
"kind": "field",
|
|
1812
|
-
"name": "
|
|
1735
|
+
"name": "parent",
|
|
1813
1736
|
"type": {
|
|
1814
1737
|
"text": "string | undefined"
|
|
1815
1738
|
},
|
|
1816
|
-
"
|
|
1817
|
-
"attribute": "hint",
|
|
1818
|
-
"inheritedFrom": {
|
|
1819
|
-
"name": "FormAssociatedMixin",
|
|
1820
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1821
|
-
}
|
|
1739
|
+
"privacy": "private"
|
|
1822
1740
|
},
|
|
1823
1741
|
{
|
|
1824
1742
|
"kind": "field",
|
|
1825
|
-
"name": "
|
|
1743
|
+
"name": "search",
|
|
1826
1744
|
"type": {
|
|
1827
|
-
"text": "
|
|
1745
|
+
"text": "string"
|
|
1828
1746
|
},
|
|
1829
|
-
"
|
|
1830
|
-
"
|
|
1831
|
-
"attribute": "hide-label",
|
|
1832
|
-
"inheritedFrom": {
|
|
1833
|
-
"name": "FormAssociatedMixin",
|
|
1834
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1835
|
-
}
|
|
1747
|
+
"privacy": "private",
|
|
1748
|
+
"default": "\"\""
|
|
1836
1749
|
},
|
|
1837
1750
|
{
|
|
1838
1751
|
"kind": "field",
|
|
1839
|
-
"name": "
|
|
1752
|
+
"name": "bump",
|
|
1840
1753
|
"type": {
|
|
1841
|
-
"text": "
|
|
1754
|
+
"text": "boolean"
|
|
1842
1755
|
},
|
|
1843
|
-
"
|
|
1844
|
-
"
|
|
1845
|
-
"inheritedFrom": {
|
|
1846
|
-
"name": "FormAssociatedMixin",
|
|
1847
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1848
|
-
}
|
|
1756
|
+
"privacy": "private",
|
|
1757
|
+
"default": "true"
|
|
1849
1758
|
},
|
|
1850
1759
|
{
|
|
1851
1760
|
"kind": "field",
|
|
1852
|
-
"name": "
|
|
1761
|
+
"name": "selectedIndex",
|
|
1853
1762
|
"type": {
|
|
1854
|
-
"text": "
|
|
1763
|
+
"text": "number"
|
|
1855
1764
|
},
|
|
1856
|
-
"
|
|
1857
|
-
"
|
|
1858
|
-
"inheritedFrom": {
|
|
1859
|
-
"name": "FormAssociatedMixin",
|
|
1860
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1861
|
-
}
|
|
1765
|
+
"privacy": "private",
|
|
1766
|
+
"default": "0"
|
|
1862
1767
|
},
|
|
1863
1768
|
{
|
|
1864
1769
|
"kind": "field",
|
|
1865
|
-
"name": "
|
|
1770
|
+
"name": "filteredCommands",
|
|
1866
1771
|
"type": {
|
|
1867
|
-
"text": "
|
|
1772
|
+
"text": "Array<ICommandMenuAction>"
|
|
1868
1773
|
},
|
|
1869
|
-
"
|
|
1870
|
-
"
|
|
1871
|
-
"attribute": "required",
|
|
1872
|
-
"inheritedFrom": {
|
|
1873
|
-
"name": "FormAssociatedMixin",
|
|
1874
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1875
|
-
}
|
|
1774
|
+
"privacy": "private",
|
|
1775
|
+
"default": "[]"
|
|
1876
1776
|
},
|
|
1877
1777
|
{
|
|
1878
1778
|
"kind": "field",
|
|
1879
|
-
"name": "
|
|
1779
|
+
"name": "selected",
|
|
1880
1780
|
"type": {
|
|
1881
|
-
"text": "
|
|
1781
|
+
"text": "ICommandMenuAction"
|
|
1882
1782
|
},
|
|
1883
|
-
"
|
|
1884
|
-
"description": "Controls whether the input expands to fill the width of its container.",
|
|
1885
|
-
"attribute": "expand",
|
|
1886
|
-
"reflects": true,
|
|
1887
|
-
"inheritedFrom": {
|
|
1888
|
-
"name": "FormAssociatedMixin",
|
|
1889
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1890
|
-
}
|
|
1783
|
+
"privacy": "private"
|
|
1891
1784
|
},
|
|
1892
1785
|
{
|
|
1893
1786
|
"kind": "method",
|
|
1894
|
-
"name": "
|
|
1895
|
-
"privacy": "protected",
|
|
1787
|
+
"name": "show",
|
|
1896
1788
|
"parameters": [
|
|
1897
1789
|
{
|
|
1898
|
-
"name": "
|
|
1790
|
+
"name": "options",
|
|
1791
|
+
"default": "{}",
|
|
1899
1792
|
"type": {
|
|
1900
|
-
"text": "
|
|
1901
|
-
}
|
|
1793
|
+
"text": "{ parent?: string }"
|
|
1794
|
+
},
|
|
1795
|
+
"description": "allows you to open the menu filtered to a specific parent command."
|
|
1902
1796
|
}
|
|
1903
1797
|
],
|
|
1904
|
-
"
|
|
1905
|
-
"name": "FormAssociatedMixin",
|
|
1906
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1907
|
-
}
|
|
1798
|
+
"description": "Show the command menu programmatically."
|
|
1908
1799
|
},
|
|
1909
1800
|
{
|
|
1910
1801
|
"kind": "method",
|
|
1911
|
-
"name": "
|
|
1912
|
-
"
|
|
1913
|
-
"inheritedFrom": {
|
|
1914
|
-
"name": "FormAssociatedMixin",
|
|
1915
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1916
|
-
}
|
|
1802
|
+
"name": "close",
|
|
1803
|
+
"description": "Close the command menu programmatically."
|
|
1917
1804
|
},
|
|
1918
1805
|
{
|
|
1919
1806
|
"kind": "method",
|
|
1920
|
-
"name": "
|
|
1921
|
-
"
|
|
1922
|
-
"inheritedFrom": {
|
|
1923
|
-
"name": "FormAssociatedMixin",
|
|
1924
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1925
|
-
}
|
|
1807
|
+
"name": "toggleOpen",
|
|
1808
|
+
"description": "Toggle the open state programmatically."
|
|
1926
1809
|
},
|
|
1927
1810
|
{
|
|
1928
1811
|
"kind": "method",
|
|
1929
|
-
"name": "
|
|
1930
|
-
"
|
|
1931
|
-
"inheritedFrom": {
|
|
1932
|
-
"name": "FormAssociatedMixin",
|
|
1933
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1934
|
-
}
|
|
1812
|
+
"name": "focus",
|
|
1813
|
+
"description": "Focus the command menu's input."
|
|
1935
1814
|
},
|
|
1936
1815
|
{
|
|
1937
1816
|
"kind": "method",
|
|
1938
|
-
"name": "
|
|
1939
|
-
"privacy": "
|
|
1940
|
-
"inheritedFrom": {
|
|
1941
|
-
"name": "FormAssociatedMixin",
|
|
1942
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1943
|
-
}
|
|
1817
|
+
"name": "renderNoResults",
|
|
1818
|
+
"privacy": "private"
|
|
1944
1819
|
},
|
|
1945
1820
|
{
|
|
1946
|
-
"kind": "
|
|
1947
|
-
"name": "
|
|
1948
|
-
"privacy": "
|
|
1949
|
-
"
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1821
|
+
"kind": "method",
|
|
1822
|
+
"name": "renderSection",
|
|
1823
|
+
"privacy": "private",
|
|
1824
|
+
"parameters": [
|
|
1825
|
+
{
|
|
1826
|
+
"name": "section",
|
|
1827
|
+
"type": {
|
|
1828
|
+
"text": "string | undefined"
|
|
1829
|
+
}
|
|
1830
|
+
},
|
|
1831
|
+
{
|
|
1832
|
+
"name": "commands",
|
|
1833
|
+
"type": {
|
|
1834
|
+
"text": "ICommandMenuAction[]"
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
]
|
|
1953
1838
|
},
|
|
1954
1839
|
{
|
|
1955
|
-
"kind": "
|
|
1956
|
-
"name": "
|
|
1957
|
-
"privacy": "protected"
|
|
1958
|
-
"inheritedFrom": {
|
|
1959
|
-
"name": "FormAssociatedMixin",
|
|
1960
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
1961
|
-
}
|
|
1840
|
+
"kind": "method",
|
|
1841
|
+
"name": "handleCommandsChange",
|
|
1842
|
+
"privacy": "protected"
|
|
1962
1843
|
},
|
|
1963
1844
|
{
|
|
1964
|
-
"kind": "
|
|
1965
|
-
"name": "
|
|
1966
|
-
"
|
|
1967
|
-
"text": "boolean"
|
|
1968
|
-
},
|
|
1969
|
-
"default": "false",
|
|
1970
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
1971
|
-
"attribute": "disabled",
|
|
1972
|
-
"reflects": true,
|
|
1973
|
-
"inheritedFrom": {
|
|
1974
|
-
"name": "InputMixin",
|
|
1975
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1976
|
-
}
|
|
1845
|
+
"kind": "method",
|
|
1846
|
+
"name": "handleBump",
|
|
1847
|
+
"privacy": "protected"
|
|
1977
1848
|
},
|
|
1978
1849
|
{
|
|
1979
|
-
"kind": "
|
|
1980
|
-
"name": "
|
|
1981
|
-
"
|
|
1982
|
-
"text": "string | undefined"
|
|
1983
|
-
},
|
|
1984
|
-
"description": "The name of the form component.",
|
|
1985
|
-
"attribute": "name",
|
|
1986
|
-
"inheritedFrom": {
|
|
1987
|
-
"name": "InputMixin",
|
|
1988
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
1989
|
-
}
|
|
1850
|
+
"kind": "method",
|
|
1851
|
+
"name": "focusOnOpen",
|
|
1852
|
+
"privacy": "protected"
|
|
1990
1853
|
},
|
|
1991
1854
|
{
|
|
1992
|
-
"kind": "
|
|
1993
|
-
"name": "
|
|
1994
|
-
"
|
|
1995
|
-
"text": "string"
|
|
1996
|
-
},
|
|
1997
|
-
"default": "\"\"",
|
|
1998
|
-
"description": "The value of the form component.",
|
|
1999
|
-
"attribute": "value",
|
|
2000
|
-
"inheritedFrom": {
|
|
2001
|
-
"name": "InputMixin",
|
|
2002
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2003
|
-
}
|
|
1855
|
+
"kind": "method",
|
|
1856
|
+
"name": "handleAnimationEnd",
|
|
1857
|
+
"privacy": "private"
|
|
2004
1858
|
},
|
|
2005
1859
|
{
|
|
2006
|
-
"kind": "
|
|
2007
|
-
"name": "
|
|
2008
|
-
"privacy": "
|
|
2009
|
-
"description": "Gets the form, if any, associated with the form element.",
|
|
2010
|
-
"inheritedFrom": {
|
|
2011
|
-
"name": "InputMixin",
|
|
2012
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2013
|
-
}
|
|
1860
|
+
"kind": "method",
|
|
1861
|
+
"name": "handleBlur",
|
|
1862
|
+
"privacy": "private"
|
|
2014
1863
|
},
|
|
2015
1864
|
{
|
|
2016
|
-
"kind": "
|
|
2017
|
-
"name": "
|
|
2018
|
-
"privacy": "
|
|
2019
|
-
"
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
1865
|
+
"kind": "method",
|
|
1866
|
+
"name": "handleInput",
|
|
1867
|
+
"privacy": "private",
|
|
1868
|
+
"parameters": [
|
|
1869
|
+
{
|
|
1870
|
+
"name": "event",
|
|
1871
|
+
"type": {
|
|
1872
|
+
"text": "KeyboardEvent"
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
]
|
|
2023
1876
|
},
|
|
2024
1877
|
{
|
|
2025
1878
|
"kind": "method",
|
|
2026
|
-
"name": "
|
|
1879
|
+
"name": "select",
|
|
1880
|
+
"privacy": "private",
|
|
2027
1881
|
"parameters": [
|
|
2028
1882
|
{
|
|
2029
|
-
"name": "
|
|
2030
|
-
"
|
|
1883
|
+
"name": "command",
|
|
1884
|
+
"default": "this.selected",
|
|
2031
1885
|
"type": {
|
|
2032
|
-
"text": "
|
|
2033
|
-
}
|
|
2034
|
-
"description": "An object which controls aspects of the focusing process."
|
|
1886
|
+
"text": "ICommandMenuAction"
|
|
1887
|
+
}
|
|
2035
1888
|
}
|
|
2036
|
-
]
|
|
2037
|
-
"description": "Programmatically move focus to the component.",
|
|
2038
|
-
"inheritedFrom": {
|
|
2039
|
-
"name": "FocusableMixin",
|
|
2040
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2041
|
-
}
|
|
1889
|
+
]
|
|
2042
1890
|
},
|
|
2043
1891
|
{
|
|
2044
1892
|
"kind": "method",
|
|
2045
|
-
"name": "
|
|
2046
|
-
"
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
1893
|
+
"name": "start",
|
|
1894
|
+
"privacy": "private"
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
"kind": "method",
|
|
1898
|
+
"name": "end",
|
|
1899
|
+
"privacy": "private"
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
"kind": "method",
|
|
1903
|
+
"name": "next",
|
|
1904
|
+
"privacy": "private"
|
|
1905
|
+
},
|
|
1906
|
+
{
|
|
1907
|
+
"kind": "method",
|
|
1908
|
+
"name": "previous",
|
|
1909
|
+
"privacy": "private"
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
"kind": "method",
|
|
1913
|
+
"name": "goBack",
|
|
1914
|
+
"privacy": "private"
|
|
1915
|
+
},
|
|
1916
|
+
{
|
|
1917
|
+
"kind": "method",
|
|
1918
|
+
"name": "setParent",
|
|
1919
|
+
"privacy": "private",
|
|
1920
|
+
"parameters": [
|
|
1921
|
+
{
|
|
1922
|
+
"name": "parent",
|
|
1923
|
+
"optional": true,
|
|
1924
|
+
"type": {
|
|
1925
|
+
"text": "string"
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
]
|
|
1929
|
+
},
|
|
1930
|
+
{
|
|
1931
|
+
"kind": "method",
|
|
1932
|
+
"name": "setSearch",
|
|
1933
|
+
"privacy": "private",
|
|
1934
|
+
"parameters": [
|
|
1935
|
+
{
|
|
1936
|
+
"name": "str",
|
|
1937
|
+
"type": {
|
|
1938
|
+
"text": "string"
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
]
|
|
2051
1942
|
},
|
|
2052
1943
|
{
|
|
2053
1944
|
"kind": "method",
|
|
2054
|
-
"name": "
|
|
2055
|
-
"
|
|
2056
|
-
"inheritedFrom": {
|
|
2057
|
-
"name": "FocusableMixin",
|
|
2058
|
-
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2059
|
-
}
|
|
1945
|
+
"name": "filterCommands",
|
|
1946
|
+
"privacy": "private"
|
|
2060
1947
|
}
|
|
2061
1948
|
],
|
|
2062
|
-
"
|
|
1949
|
+
"events": [
|
|
2063
1950
|
{
|
|
2064
|
-
"name": "
|
|
1951
|
+
"name": "open",
|
|
2065
1952
|
"type": {
|
|
2066
|
-
"text": "
|
|
1953
|
+
"text": "NordEvent"
|
|
2067
1954
|
},
|
|
2068
|
-
"
|
|
2069
|
-
"description": "Controls whether the checkbox is checked or not.",
|
|
2070
|
-
"fieldName": "checked"
|
|
1955
|
+
"description": "The command menu was opened."
|
|
2071
1956
|
},
|
|
2072
1957
|
{
|
|
2073
|
-
"name": "
|
|
1958
|
+
"name": "close",
|
|
2074
1959
|
"type": {
|
|
2075
|
-
"text": "
|
|
1960
|
+
"text": "NordEvent"
|
|
2076
1961
|
},
|
|
2077
|
-
"
|
|
2078
|
-
"description": "Label for the input.",
|
|
2079
|
-
"fieldName": "label",
|
|
2080
|
-
"inheritedFrom": {
|
|
2081
|
-
"name": "FormAssociatedMixin",
|
|
2082
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2083
|
-
}
|
|
1962
|
+
"description": "The command menu was closed."
|
|
2084
1963
|
},
|
|
2085
1964
|
{
|
|
2086
|
-
"name": "hint",
|
|
2087
1965
|
"type": {
|
|
2088
|
-
"text": "
|
|
1966
|
+
"text": "SelectEvent"
|
|
2089
1967
|
},
|
|
2090
|
-
"description": "
|
|
2091
|
-
"
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
}
|
|
2096
|
-
},
|
|
1968
|
+
"description": "User selected a command from the menu.",
|
|
1969
|
+
"name": "nord-select"
|
|
1970
|
+
}
|
|
1971
|
+
],
|
|
1972
|
+
"attributes": [
|
|
2097
1973
|
{
|
|
2098
|
-
"name": "
|
|
1974
|
+
"name": "open",
|
|
2099
1975
|
"type": {
|
|
2100
1976
|
"text": "boolean"
|
|
2101
1977
|
},
|
|
2102
1978
|
"default": "false",
|
|
2103
|
-
"description": "
|
|
2104
|
-
"fieldName": "
|
|
2105
|
-
"inheritedFrom": {
|
|
2106
|
-
"name": "FormAssociatedMixin",
|
|
2107
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2108
|
-
}
|
|
1979
|
+
"description": "Show or hide the command menu.",
|
|
1980
|
+
"fieldName": "open"
|
|
2109
1981
|
},
|
|
2110
1982
|
{
|
|
2111
1983
|
"name": "placeholder",
|
|
2112
1984
|
"type": {
|
|
2113
|
-
"text": "string
|
|
1985
|
+
"text": "string"
|
|
2114
1986
|
},
|
|
2115
|
-
"
|
|
2116
|
-
"
|
|
2117
|
-
"
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
1987
|
+
"default": "\"Type a command or search...\"",
|
|
1988
|
+
"description": "Hint text to display in the Command Menu search field.",
|
|
1989
|
+
"fieldName": "placeholder"
|
|
1990
|
+
}
|
|
1991
|
+
],
|
|
1992
|
+
"superclass": {
|
|
1993
|
+
"name": "LitElement",
|
|
1994
|
+
"package": "lit"
|
|
1995
|
+
},
|
|
1996
|
+
"status": "ready",
|
|
1997
|
+
"category": "action",
|
|
1998
|
+
"tagName": "nord-command-menu",
|
|
1999
|
+
"customElement": true
|
|
2000
|
+
}
|
|
2001
|
+
],
|
|
2002
|
+
"exports": [
|
|
2003
|
+
{
|
|
2004
|
+
"kind": "js",
|
|
2005
|
+
"name": "default",
|
|
2006
|
+
"declaration": {
|
|
2007
|
+
"name": "CommandMenu",
|
|
2008
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
2009
|
+
}
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
"kind": "custom-element-definition",
|
|
2013
|
+
"name": "nord-command-menu",
|
|
2014
|
+
"declaration": {
|
|
2015
|
+
"name": "CommandMenu",
|
|
2016
|
+
"module": "src/command-menu/CommandMenu.ts"
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
],
|
|
2020
|
+
"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"
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
"kind": "javascript-module",
|
|
2024
|
+
"path": "src/command-menu/CommandMenuAction.ts",
|
|
2025
|
+
"declarations": [
|
|
2026
|
+
{
|
|
2027
|
+
"kind": "class",
|
|
2028
|
+
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
2029
|
+
"name": "CommandMenuAction",
|
|
2030
|
+
"members": [
|
|
2031
|
+
{
|
|
2032
|
+
"kind": "field",
|
|
2033
|
+
"name": "direction",
|
|
2034
|
+
"privacy": "private",
|
|
2035
|
+
"default": "new DirectionController(this)"
|
|
2121
2036
|
},
|
|
2122
2037
|
{
|
|
2123
|
-
"
|
|
2038
|
+
"kind": "field",
|
|
2039
|
+
"name": "command",
|
|
2124
2040
|
"type": {
|
|
2125
|
-
"text": "
|
|
2041
|
+
"text": "ICommandMenuAction"
|
|
2126
2042
|
},
|
|
2127
|
-
"
|
|
2128
|
-
"fieldName": "error",
|
|
2129
|
-
"inheritedFrom": {
|
|
2130
|
-
"name": "FormAssociatedMixin",
|
|
2131
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2132
|
-
}
|
|
2043
|
+
"attribute": "command"
|
|
2133
2044
|
},
|
|
2134
2045
|
{
|
|
2135
|
-
"
|
|
2046
|
+
"kind": "field",
|
|
2047
|
+
"name": "selected",
|
|
2136
2048
|
"type": {
|
|
2137
2049
|
"text": "boolean"
|
|
2138
2050
|
},
|
|
2139
2051
|
"default": "false",
|
|
2140
|
-
"
|
|
2141
|
-
"fieldName": "required",
|
|
2142
|
-
"inheritedFrom": {
|
|
2143
|
-
"name": "FormAssociatedMixin",
|
|
2144
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2145
|
-
}
|
|
2052
|
+
"attribute": "selected"
|
|
2146
2053
|
},
|
|
2147
2054
|
{
|
|
2148
|
-
"
|
|
2149
|
-
"
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
"default": "false",
|
|
2153
|
-
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2154
|
-
"fieldName": "expand",
|
|
2155
|
-
"inheritedFrom": {
|
|
2156
|
-
"name": "FormAssociatedMixin",
|
|
2157
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2158
|
-
}
|
|
2055
|
+
"kind": "method",
|
|
2056
|
+
"name": "ensureInView",
|
|
2057
|
+
"privacy": "protected",
|
|
2058
|
+
"description": "Scroll to show element"
|
|
2159
2059
|
},
|
|
2160
2060
|
{
|
|
2161
|
-
"
|
|
2162
|
-
"
|
|
2163
|
-
|
|
2164
|
-
},
|
|
2165
|
-
"default": "false",
|
|
2166
|
-
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2167
|
-
"fieldName": "disabled",
|
|
2168
|
-
"inheritedFrom": {
|
|
2169
|
-
"name": "InputMixin",
|
|
2170
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2171
|
-
}
|
|
2061
|
+
"kind": "method",
|
|
2062
|
+
"name": "getIconName",
|
|
2063
|
+
"privacy": "private"
|
|
2172
2064
|
},
|
|
2173
2065
|
{
|
|
2174
|
-
"
|
|
2066
|
+
"kind": "method",
|
|
2067
|
+
"name": "renderShortcut",
|
|
2068
|
+
"privacy": "private"
|
|
2069
|
+
}
|
|
2070
|
+
],
|
|
2071
|
+
"attributes": [
|
|
2072
|
+
{
|
|
2073
|
+
"name": "command",
|
|
2175
2074
|
"type": {
|
|
2176
|
-
"text": "
|
|
2075
|
+
"text": "ICommandMenuAction"
|
|
2177
2076
|
},
|
|
2178
|
-
"
|
|
2179
|
-
"fieldName": "name",
|
|
2180
|
-
"inheritedFrom": {
|
|
2181
|
-
"name": "InputMixin",
|
|
2182
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2183
|
-
}
|
|
2077
|
+
"fieldName": "command"
|
|
2184
2078
|
},
|
|
2185
2079
|
{
|
|
2186
|
-
"name": "
|
|
2080
|
+
"name": "selected",
|
|
2187
2081
|
"type": {
|
|
2188
|
-
"text": "
|
|
2082
|
+
"text": "boolean"
|
|
2189
2083
|
},
|
|
2190
|
-
"default": "
|
|
2191
|
-
"
|
|
2192
|
-
"fieldName": "value",
|
|
2193
|
-
"inheritedFrom": {
|
|
2194
|
-
"name": "InputMixin",
|
|
2195
|
-
"module": "src/common/mixins/InputMixin.ts"
|
|
2196
|
-
}
|
|
2084
|
+
"default": "false",
|
|
2085
|
+
"fieldName": "selected"
|
|
2197
2086
|
}
|
|
2198
2087
|
],
|
|
2199
|
-
"
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2088
|
+
"superclass": {
|
|
2089
|
+
"name": "LitElement",
|
|
2090
|
+
"package": "lit"
|
|
2091
|
+
},
|
|
2092
|
+
"status": "internal",
|
|
2093
|
+
"category": null,
|
|
2094
|
+
"tagName": "nord-command-menu-action",
|
|
2095
|
+
"customElement": true
|
|
2096
|
+
}
|
|
2097
|
+
],
|
|
2098
|
+
"exports": [
|
|
2099
|
+
{
|
|
2100
|
+
"kind": "js",
|
|
2101
|
+
"name": "default",
|
|
2102
|
+
"declaration": {
|
|
2103
|
+
"name": "CommandMenuAction",
|
|
2104
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2105
|
+
}
|
|
2106
|
+
},
|
|
2107
|
+
{
|
|
2108
|
+
"kind": "custom-element-definition",
|
|
2109
|
+
"name": "nord-command-menu-action",
|
|
2110
|
+
"declaration": {
|
|
2111
|
+
"name": "CommandMenuAction",
|
|
2112
|
+
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
],
|
|
2116
|
+
"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"
|
|
2117
|
+
},
|
|
2118
|
+
{
|
|
2119
|
+
"kind": "javascript-module",
|
|
2120
|
+
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
2121
|
+
"declarations": [],
|
|
2122
|
+
"exports": [],
|
|
2123
|
+
"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"
|
|
2124
|
+
},
|
|
2125
|
+
{
|
|
2126
|
+
"kind": "javascript-module",
|
|
2127
|
+
"path": "src/command-menu/KeyboardController.ts",
|
|
2128
|
+
"declarations": [
|
|
2129
|
+
{
|
|
2130
|
+
"kind": "class",
|
|
2131
|
+
"description": "",
|
|
2132
|
+
"name": "KeyboardController",
|
|
2133
|
+
"members": [
|
|
2204
2134
|
{
|
|
2205
|
-
"
|
|
2206
|
-
"
|
|
2135
|
+
"kind": "field",
|
|
2136
|
+
"name": "globalShortcuts",
|
|
2137
|
+
"type": {
|
|
2138
|
+
"text": "ShortcutController"
|
|
2139
|
+
},
|
|
2140
|
+
"privacy": "private",
|
|
2141
|
+
"default": "new ShortcutController(host, { \"$mod+k\": preventDefault(actions.toggleOpen) })"
|
|
2207
2142
|
},
|
|
2208
2143
|
{
|
|
2209
|
-
"
|
|
2210
|
-
"
|
|
2211
|
-
}
|
|
2212
|
-
],
|
|
2213
|
-
"superclass": {
|
|
2214
|
-
"name": "LitElement",
|
|
2215
|
-
"package": "lit"
|
|
2216
|
-
},
|
|
2217
|
-
"status": "ready",
|
|
2218
|
-
"category": "form",
|
|
2219
|
-
"tagName": "nord-checkbox",
|
|
2220
|
-
"customElement": true,
|
|
2221
|
-
"events": [
|
|
2222
|
-
{
|
|
2223
|
-
"name": "input",
|
|
2144
|
+
"kind": "field",
|
|
2145
|
+
"name": "navigationShortcuts",
|
|
2224
2146
|
"type": {
|
|
2225
|
-
"text": "
|
|
2147
|
+
"text": "ShortcutController"
|
|
2226
2148
|
},
|
|
2227
|
-
"
|
|
2228
|
-
"
|
|
2229
|
-
"name": "FormAssociatedMixin",
|
|
2230
|
-
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2231
|
-
}
|
|
2149
|
+
"privacy": "private",
|
|
2150
|
+
"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 )"
|
|
2232
2151
|
},
|
|
2233
2152
|
{
|
|
2234
|
-
"
|
|
2153
|
+
"kind": "field",
|
|
2154
|
+
"name": "commandShortcuts",
|
|
2235
2155
|
"type": {
|
|
2236
|
-
"text": "
|
|
2156
|
+
"text": "ShortcutController"
|
|
2237
2157
|
},
|
|
2238
|
-
"
|
|
2239
|
-
"
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2158
|
+
"privacy": "private",
|
|
2159
|
+
"default": "new ShortcutController(host)"
|
|
2160
|
+
},
|
|
2161
|
+
{
|
|
2162
|
+
"kind": "method",
|
|
2163
|
+
"name": "registerCommandShortcuts"
|
|
2243
2164
|
}
|
|
2244
2165
|
]
|
|
2245
2166
|
}
|
|
@@ -2247,611 +2168,690 @@
|
|
|
2247
2168
|
"exports": [
|
|
2248
2169
|
{
|
|
2249
2170
|
"kind": "js",
|
|
2250
|
-
"name": "
|
|
2171
|
+
"name": "KeyboardController",
|
|
2251
2172
|
"declaration": {
|
|
2252
|
-
"name": "
|
|
2253
|
-
"module": "src/
|
|
2173
|
+
"name": "KeyboardController",
|
|
2174
|
+
"module": "src/command-menu/KeyboardController.ts"
|
|
2254
2175
|
}
|
|
2255
|
-
}
|
|
2176
|
+
}
|
|
2177
|
+
],
|
|
2178
|
+
"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"
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
"kind": "javascript-module",
|
|
2182
|
+
"path": "src/command-menu/SelectEvent.ts",
|
|
2183
|
+
"declarations": [
|
|
2256
2184
|
{
|
|
2257
|
-
"kind": "
|
|
2258
|
-
"
|
|
2185
|
+
"kind": "class",
|
|
2186
|
+
"description": "",
|
|
2187
|
+
"name": "SelectEvent",
|
|
2188
|
+
"members": [
|
|
2189
|
+
{
|
|
2190
|
+
"kind": "field",
|
|
2191
|
+
"name": "eventName",
|
|
2192
|
+
"type": {
|
|
2193
|
+
"text": "string"
|
|
2194
|
+
},
|
|
2195
|
+
"static": true,
|
|
2196
|
+
"default": "\"nord-select\""
|
|
2197
|
+
}
|
|
2198
|
+
],
|
|
2199
|
+
"superclass": {
|
|
2200
|
+
"name": "NordEvent",
|
|
2201
|
+
"module": "/src/common/events.js"
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
],
|
|
2205
|
+
"exports": [
|
|
2206
|
+
{
|
|
2207
|
+
"kind": "js",
|
|
2208
|
+
"name": "SelectEvent",
|
|
2259
2209
|
"declaration": {
|
|
2260
|
-
"name": "
|
|
2261
|
-
"module": "src/
|
|
2210
|
+
"name": "SelectEvent",
|
|
2211
|
+
"module": "src/command-menu/SelectEvent.ts"
|
|
2262
2212
|
}
|
|
2263
2213
|
}
|
|
2264
2214
|
],
|
|
2265
|
-
"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- Avoid using 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"
|
|
2215
|
+
"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"
|
|
2266
2216
|
},
|
|
2267
2217
|
{
|
|
2268
2218
|
"kind": "javascript-module",
|
|
2269
|
-
"path": "src/command-menu/
|
|
2219
|
+
"path": "src/command-menu/localization.ts",
|
|
2220
|
+
"declarations": [
|
|
2221
|
+
{
|
|
2222
|
+
"kind": "variable",
|
|
2223
|
+
"name": "commandMenuLocalization",
|
|
2224
|
+
"type": {
|
|
2225
|
+
"text": "object"
|
|
2226
|
+
},
|
|
2227
|
+
"default": "{\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.\",\n}"
|
|
2228
|
+
}
|
|
2229
|
+
],
|
|
2230
|
+
"exports": [
|
|
2231
|
+
{
|
|
2232
|
+
"kind": "js",
|
|
2233
|
+
"name": "default",
|
|
2234
|
+
"declaration": {
|
|
2235
|
+
"name": "commandMenuLocalization",
|
|
2236
|
+
"module": "src/command-menu/localization.ts"
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
],
|
|
2240
|
+
"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"
|
|
2241
|
+
},
|
|
2242
|
+
{
|
|
2243
|
+
"kind": "javascript-module",
|
|
2244
|
+
"path": "src/checkbox/Checkbox.ts",
|
|
2270
2245
|
"declarations": [
|
|
2271
2246
|
{
|
|
2272
2247
|
"kind": "class",
|
|
2273
|
-
"description": "
|
|
2274
|
-
"name": "
|
|
2248
|
+
"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.",
|
|
2249
|
+
"name": "Checkbox",
|
|
2275
2250
|
"slots": [
|
|
2276
2251
|
{
|
|
2277
|
-
"description": "
|
|
2278
|
-
"name": "
|
|
2252
|
+
"description": "Use when a label requires more than plain text.",
|
|
2253
|
+
"name": "label"
|
|
2254
|
+
},
|
|
2255
|
+
{
|
|
2256
|
+
"description": "Optional slot that holds hint text for the input.",
|
|
2257
|
+
"name": "hint"
|
|
2258
|
+
},
|
|
2259
|
+
{
|
|
2260
|
+
"description": "Optional slot that holds error text for the input.",
|
|
2261
|
+
"name": "error"
|
|
2279
2262
|
}
|
|
2280
2263
|
],
|
|
2281
2264
|
"members": [
|
|
2282
2265
|
{
|
|
2283
2266
|
"kind": "field",
|
|
2284
|
-
"name": "
|
|
2285
|
-
"privacy": "
|
|
2267
|
+
"name": "formValue",
|
|
2268
|
+
"privacy": "protected",
|
|
2269
|
+
"inheritedFrom": {
|
|
2270
|
+
"name": "FormAssociatedMixin",
|
|
2271
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2272
|
+
}
|
|
2286
2273
|
},
|
|
2287
2274
|
{
|
|
2288
2275
|
"kind": "field",
|
|
2289
|
-
"name": "
|
|
2290
|
-
"
|
|
2276
|
+
"name": "checked",
|
|
2277
|
+
"type": {
|
|
2278
|
+
"text": "boolean"
|
|
2279
|
+
},
|
|
2280
|
+
"default": "false",
|
|
2281
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
2282
|
+
"attribute": "checked"
|
|
2291
2283
|
},
|
|
2292
2284
|
{
|
|
2293
|
-
"kind": "
|
|
2294
|
-
"name": "
|
|
2295
|
-
"
|
|
2296
|
-
|
|
2285
|
+
"kind": "method",
|
|
2286
|
+
"name": "handleChange",
|
|
2287
|
+
"privacy": "protected",
|
|
2288
|
+
"parameters": [
|
|
2289
|
+
{
|
|
2290
|
+
"name": "e",
|
|
2291
|
+
"type": {
|
|
2292
|
+
"text": "Event"
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
],
|
|
2296
|
+
"return": {
|
|
2297
|
+
"type": {
|
|
2298
|
+
"text": "void"
|
|
2299
|
+
}
|
|
2297
2300
|
},
|
|
2298
|
-
"
|
|
2301
|
+
"inheritedFrom": {
|
|
2302
|
+
"name": "FormAssociatedMixin",
|
|
2303
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2304
|
+
}
|
|
2299
2305
|
},
|
|
2300
2306
|
{
|
|
2301
2307
|
"kind": "field",
|
|
2302
|
-
"name": "
|
|
2303
|
-
"privacy": "
|
|
2304
|
-
"default": "new
|
|
2308
|
+
"name": "labelSlot",
|
|
2309
|
+
"privacy": "protected",
|
|
2310
|
+
"default": "new SlotController(this, \"label\")",
|
|
2311
|
+
"inheritedFrom": {
|
|
2312
|
+
"name": "FormAssociatedMixin",
|
|
2313
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2314
|
+
}
|
|
2305
2315
|
},
|
|
2306
2316
|
{
|
|
2307
2317
|
"kind": "field",
|
|
2308
|
-
"name": "
|
|
2309
|
-
"privacy": "
|
|
2310
|
-
"default": "new
|
|
2318
|
+
"name": "errorSlot",
|
|
2319
|
+
"privacy": "protected",
|
|
2320
|
+
"default": "new SlotController(this, \"error\")",
|
|
2321
|
+
"inheritedFrom": {
|
|
2322
|
+
"name": "FormAssociatedMixin",
|
|
2323
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2324
|
+
}
|
|
2311
2325
|
},
|
|
2312
2326
|
{
|
|
2313
2327
|
"kind": "field",
|
|
2314
|
-
"name": "
|
|
2315
|
-
"privacy": "
|
|
2316
|
-
"default": "new
|
|
2328
|
+
"name": "hintSlot",
|
|
2329
|
+
"privacy": "protected",
|
|
2330
|
+
"default": "new SlotController(this, \"hint\")",
|
|
2331
|
+
"inheritedFrom": {
|
|
2332
|
+
"name": "FormAssociatedMixin",
|
|
2333
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2334
|
+
}
|
|
2317
2335
|
},
|
|
2318
2336
|
{
|
|
2319
2337
|
"kind": "field",
|
|
2320
|
-
"name": "
|
|
2338
|
+
"name": "formData",
|
|
2339
|
+
"privacy": "protected",
|
|
2340
|
+
"default": "new FormDataController(this, { value: () => this.formValue })",
|
|
2341
|
+
"inheritedFrom": {
|
|
2342
|
+
"name": "FormAssociatedMixin",
|
|
2343
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2344
|
+
}
|
|
2345
|
+
},
|
|
2346
|
+
{
|
|
2347
|
+
"kind": "field",
|
|
2348
|
+
"name": "inputId",
|
|
2321
2349
|
"type": {
|
|
2322
|
-
"text": "
|
|
2350
|
+
"text": "string"
|
|
2323
2351
|
},
|
|
2324
|
-
"
|
|
2325
|
-
"
|
|
2326
|
-
"
|
|
2352
|
+
"privacy": "protected",
|
|
2353
|
+
"default": "\"input\"",
|
|
2354
|
+
"inheritedFrom": {
|
|
2355
|
+
"name": "FormAssociatedMixin",
|
|
2356
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2357
|
+
}
|
|
2327
2358
|
},
|
|
2328
2359
|
{
|
|
2329
2360
|
"kind": "field",
|
|
2330
|
-
"name": "
|
|
2361
|
+
"name": "errorId",
|
|
2331
2362
|
"type": {
|
|
2332
2363
|
"text": "string"
|
|
2333
2364
|
},
|
|
2334
|
-
"
|
|
2335
|
-
"
|
|
2336
|
-
"
|
|
2365
|
+
"privacy": "protected",
|
|
2366
|
+
"default": "\"error\"",
|
|
2367
|
+
"inheritedFrom": {
|
|
2368
|
+
"name": "FormAssociatedMixin",
|
|
2369
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2370
|
+
}
|
|
2337
2371
|
},
|
|
2338
2372
|
{
|
|
2339
2373
|
"kind": "field",
|
|
2340
|
-
"name": "
|
|
2374
|
+
"name": "hintId",
|
|
2341
2375
|
"type": {
|
|
2342
|
-
"text": "
|
|
2376
|
+
"text": "string"
|
|
2343
2377
|
},
|
|
2344
|
-
"
|
|
2345
|
-
"
|
|
2378
|
+
"privacy": "protected",
|
|
2379
|
+
"default": "\"hint\"",
|
|
2380
|
+
"inheritedFrom": {
|
|
2381
|
+
"name": "FormAssociatedMixin",
|
|
2382
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2383
|
+
}
|
|
2346
2384
|
},
|
|
2347
2385
|
{
|
|
2348
2386
|
"kind": "field",
|
|
2349
|
-
"name": "
|
|
2387
|
+
"name": "label",
|
|
2350
2388
|
"type": {
|
|
2351
|
-
"text": "string
|
|
2389
|
+
"text": "string"
|
|
2352
2390
|
},
|
|
2353
|
-
"
|
|
2391
|
+
"default": "\"\"",
|
|
2392
|
+
"description": "Label for the input.",
|
|
2393
|
+
"attribute": "label",
|
|
2394
|
+
"inheritedFrom": {
|
|
2395
|
+
"name": "FormAssociatedMixin",
|
|
2396
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2397
|
+
}
|
|
2354
2398
|
},
|
|
2355
2399
|
{
|
|
2356
2400
|
"kind": "field",
|
|
2357
|
-
"name": "
|
|
2401
|
+
"name": "hint",
|
|
2358
2402
|
"type": {
|
|
2359
|
-
"text": "string"
|
|
2403
|
+
"text": "string | undefined"
|
|
2360
2404
|
},
|
|
2361
|
-
"
|
|
2362
|
-
"
|
|
2405
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
2406
|
+
"attribute": "hint",
|
|
2407
|
+
"inheritedFrom": {
|
|
2408
|
+
"name": "FormAssociatedMixin",
|
|
2409
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2410
|
+
}
|
|
2363
2411
|
},
|
|
2364
2412
|
{
|
|
2365
2413
|
"kind": "field",
|
|
2366
|
-
"name": "
|
|
2414
|
+
"name": "hideLabel",
|
|
2367
2415
|
"type": {
|
|
2368
2416
|
"text": "boolean"
|
|
2369
2417
|
},
|
|
2370
|
-
"
|
|
2371
|
-
"
|
|
2418
|
+
"default": "false",
|
|
2419
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
2420
|
+
"attribute": "hide-label",
|
|
2421
|
+
"inheritedFrom": {
|
|
2422
|
+
"name": "FormAssociatedMixin",
|
|
2423
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2424
|
+
}
|
|
2372
2425
|
},
|
|
2373
2426
|
{
|
|
2374
2427
|
"kind": "field",
|
|
2375
|
-
"name": "
|
|
2428
|
+
"name": "placeholder",
|
|
2376
2429
|
"type": {
|
|
2377
|
-
"text": "
|
|
2430
|
+
"text": "string | undefined"
|
|
2378
2431
|
},
|
|
2379
|
-
"
|
|
2380
|
-
"
|
|
2432
|
+
"description": "Placeholder text to display within the input.",
|
|
2433
|
+
"attribute": "placeholder",
|
|
2434
|
+
"inheritedFrom": {
|
|
2435
|
+
"name": "FormAssociatedMixin",
|
|
2436
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2437
|
+
}
|
|
2381
2438
|
},
|
|
2382
2439
|
{
|
|
2383
2440
|
"kind": "field",
|
|
2384
|
-
"name": "
|
|
2441
|
+
"name": "error",
|
|
2385
2442
|
"type": {
|
|
2386
|
-
"text": "
|
|
2443
|
+
"text": "string | undefined"
|
|
2387
2444
|
},
|
|
2388
|
-
"
|
|
2389
|
-
"
|
|
2445
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
2446
|
+
"attribute": "error",
|
|
2447
|
+
"inheritedFrom": {
|
|
2448
|
+
"name": "FormAssociatedMixin",
|
|
2449
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2450
|
+
}
|
|
2390
2451
|
},
|
|
2391
2452
|
{
|
|
2392
2453
|
"kind": "field",
|
|
2393
|
-
"name": "
|
|
2454
|
+
"name": "required",
|
|
2394
2455
|
"type": {
|
|
2395
|
-
"text": "
|
|
2456
|
+
"text": "boolean"
|
|
2396
2457
|
},
|
|
2397
|
-
"
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
"
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
"name": "options",
|
|
2405
|
-
"default": "{}",
|
|
2406
|
-
"type": {
|
|
2407
|
-
"text": "{ parent?: string }"
|
|
2408
|
-
},
|
|
2409
|
-
"description": "allows you to open the menu filtered to a specific parent command."
|
|
2410
|
-
}
|
|
2411
|
-
],
|
|
2412
|
-
"description": "Show the command menu programmatically."
|
|
2413
|
-
},
|
|
2414
|
-
{
|
|
2415
|
-
"kind": "method",
|
|
2416
|
-
"name": "close",
|
|
2417
|
-
"description": "Close the command menu programmatically."
|
|
2418
|
-
},
|
|
2419
|
-
{
|
|
2420
|
-
"kind": "method",
|
|
2421
|
-
"name": "toggleOpen",
|
|
2422
|
-
"description": "Toggle the open state programmatically."
|
|
2423
|
-
},
|
|
2424
|
-
{
|
|
2425
|
-
"kind": "method",
|
|
2426
|
-
"name": "focus",
|
|
2427
|
-
"description": "Focus the command menu's input."
|
|
2458
|
+
"default": "false",
|
|
2459
|
+
"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.",
|
|
2460
|
+
"attribute": "required",
|
|
2461
|
+
"inheritedFrom": {
|
|
2462
|
+
"name": "FormAssociatedMixin",
|
|
2463
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2464
|
+
}
|
|
2428
2465
|
},
|
|
2429
2466
|
{
|
|
2430
|
-
"kind": "
|
|
2431
|
-
"name": "
|
|
2432
|
-
"
|
|
2467
|
+
"kind": "field",
|
|
2468
|
+
"name": "expand",
|
|
2469
|
+
"type": {
|
|
2470
|
+
"text": "boolean"
|
|
2471
|
+
},
|
|
2472
|
+
"default": "false",
|
|
2473
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2474
|
+
"attribute": "expand",
|
|
2475
|
+
"reflects": true,
|
|
2476
|
+
"inheritedFrom": {
|
|
2477
|
+
"name": "FormAssociatedMixin",
|
|
2478
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2479
|
+
}
|
|
2433
2480
|
},
|
|
2434
2481
|
{
|
|
2435
2482
|
"kind": "method",
|
|
2436
|
-
"name": "
|
|
2437
|
-
"privacy": "
|
|
2483
|
+
"name": "handleInput",
|
|
2484
|
+
"privacy": "protected",
|
|
2438
2485
|
"parameters": [
|
|
2439
2486
|
{
|
|
2440
|
-
"name": "
|
|
2441
|
-
"type": {
|
|
2442
|
-
"text": "string | undefined"
|
|
2443
|
-
}
|
|
2444
|
-
},
|
|
2445
|
-
{
|
|
2446
|
-
"name": "commands",
|
|
2487
|
+
"name": "e",
|
|
2447
2488
|
"type": {
|
|
2448
|
-
"text": "
|
|
2489
|
+
"text": "Event"
|
|
2449
2490
|
}
|
|
2450
2491
|
}
|
|
2451
|
-
]
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
"privacy": "protected"
|
|
2492
|
+
],
|
|
2493
|
+
"inheritedFrom": {
|
|
2494
|
+
"name": "FormAssociatedMixin",
|
|
2495
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2496
|
+
}
|
|
2457
2497
|
},
|
|
2458
2498
|
{
|
|
2459
2499
|
"kind": "method",
|
|
2460
|
-
"name": "
|
|
2461
|
-
"privacy": "protected"
|
|
2500
|
+
"name": "renderLabel",
|
|
2501
|
+
"privacy": "protected",
|
|
2502
|
+
"inheritedFrom": {
|
|
2503
|
+
"name": "FormAssociatedMixin",
|
|
2504
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2505
|
+
}
|
|
2462
2506
|
},
|
|
2463
2507
|
{
|
|
2464
2508
|
"kind": "method",
|
|
2465
|
-
"name": "
|
|
2466
|
-
"privacy": "protected"
|
|
2509
|
+
"name": "renderError",
|
|
2510
|
+
"privacy": "protected",
|
|
2511
|
+
"inheritedFrom": {
|
|
2512
|
+
"name": "FormAssociatedMixin",
|
|
2513
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2514
|
+
}
|
|
2467
2515
|
},
|
|
2468
2516
|
{
|
|
2469
2517
|
"kind": "method",
|
|
2470
|
-
"name": "
|
|
2471
|
-
"privacy": "
|
|
2518
|
+
"name": "getDescribedBy",
|
|
2519
|
+
"privacy": "protected",
|
|
2520
|
+
"inheritedFrom": {
|
|
2521
|
+
"name": "FormAssociatedMixin",
|
|
2522
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2523
|
+
}
|
|
2472
2524
|
},
|
|
2473
2525
|
{
|
|
2474
2526
|
"kind": "method",
|
|
2475
|
-
"name": "
|
|
2476
|
-
"privacy": "
|
|
2527
|
+
"name": "getInvalid",
|
|
2528
|
+
"privacy": "protected",
|
|
2529
|
+
"inheritedFrom": {
|
|
2530
|
+
"name": "FormAssociatedMixin",
|
|
2531
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2532
|
+
}
|
|
2477
2533
|
},
|
|
2478
2534
|
{
|
|
2479
|
-
"kind": "
|
|
2480
|
-
"name": "
|
|
2481
|
-
"privacy": "
|
|
2482
|
-
"
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
"text": "KeyboardEvent"
|
|
2487
|
-
}
|
|
2488
|
-
}
|
|
2489
|
-
]
|
|
2535
|
+
"kind": "field",
|
|
2536
|
+
"name": "hasHint",
|
|
2537
|
+
"privacy": "protected",
|
|
2538
|
+
"inheritedFrom": {
|
|
2539
|
+
"name": "FormAssociatedMixin",
|
|
2540
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2541
|
+
}
|
|
2490
2542
|
},
|
|
2491
2543
|
{
|
|
2492
|
-
"kind": "
|
|
2493
|
-
"name": "
|
|
2494
|
-
"privacy": "
|
|
2495
|
-
"
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
"type": {
|
|
2500
|
-
"text": "ICommandMenuAction"
|
|
2501
|
-
}
|
|
2502
|
-
}
|
|
2503
|
-
]
|
|
2544
|
+
"kind": "field",
|
|
2545
|
+
"name": "hasError",
|
|
2546
|
+
"privacy": "protected",
|
|
2547
|
+
"inheritedFrom": {
|
|
2548
|
+
"name": "FormAssociatedMixin",
|
|
2549
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2550
|
+
}
|
|
2504
2551
|
},
|
|
2505
2552
|
{
|
|
2506
|
-
"kind": "
|
|
2507
|
-
"name": "
|
|
2508
|
-
"
|
|
2553
|
+
"kind": "field",
|
|
2554
|
+
"name": "disabled",
|
|
2555
|
+
"type": {
|
|
2556
|
+
"text": "boolean"
|
|
2557
|
+
},
|
|
2558
|
+
"default": "false",
|
|
2559
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2560
|
+
"attribute": "disabled",
|
|
2561
|
+
"reflects": true,
|
|
2562
|
+
"inheritedFrom": {
|
|
2563
|
+
"name": "InputMixin",
|
|
2564
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2565
|
+
}
|
|
2509
2566
|
},
|
|
2510
2567
|
{
|
|
2511
|
-
"kind": "
|
|
2512
|
-
"name": "
|
|
2513
|
-
"
|
|
2568
|
+
"kind": "field",
|
|
2569
|
+
"name": "name",
|
|
2570
|
+
"type": {
|
|
2571
|
+
"text": "string | undefined"
|
|
2572
|
+
},
|
|
2573
|
+
"description": "The name of the form component.",
|
|
2574
|
+
"attribute": "name",
|
|
2575
|
+
"inheritedFrom": {
|
|
2576
|
+
"name": "InputMixin",
|
|
2577
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2578
|
+
}
|
|
2514
2579
|
},
|
|
2515
2580
|
{
|
|
2516
|
-
"kind": "
|
|
2517
|
-
"name": "
|
|
2518
|
-
"
|
|
2581
|
+
"kind": "field",
|
|
2582
|
+
"name": "value",
|
|
2583
|
+
"type": {
|
|
2584
|
+
"text": "string"
|
|
2585
|
+
},
|
|
2586
|
+
"default": "\"\"",
|
|
2587
|
+
"description": "The value of the form component.",
|
|
2588
|
+
"attribute": "value",
|
|
2589
|
+
"inheritedFrom": {
|
|
2590
|
+
"name": "InputMixin",
|
|
2591
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2592
|
+
}
|
|
2519
2593
|
},
|
|
2520
2594
|
{
|
|
2521
|
-
"kind": "
|
|
2522
|
-
"name": "
|
|
2523
|
-
"privacy": "
|
|
2595
|
+
"kind": "field",
|
|
2596
|
+
"name": "form",
|
|
2597
|
+
"privacy": "protected",
|
|
2598
|
+
"description": "Gets the form, if any, associated with the form element.",
|
|
2599
|
+
"inheritedFrom": {
|
|
2600
|
+
"name": "InputMixin",
|
|
2601
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2602
|
+
}
|
|
2524
2603
|
},
|
|
2525
2604
|
{
|
|
2526
|
-
"kind": "
|
|
2527
|
-
"name": "
|
|
2528
|
-
"privacy": "
|
|
2605
|
+
"kind": "field",
|
|
2606
|
+
"name": "focusableRef",
|
|
2607
|
+
"privacy": "protected",
|
|
2608
|
+
"inheritedFrom": {
|
|
2609
|
+
"name": "FocusableMixin",
|
|
2610
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2611
|
+
}
|
|
2529
2612
|
},
|
|
2530
2613
|
{
|
|
2531
2614
|
"kind": "method",
|
|
2532
|
-
"name": "
|
|
2533
|
-
"privacy": "private",
|
|
2615
|
+
"name": "focus",
|
|
2534
2616
|
"parameters": [
|
|
2535
2617
|
{
|
|
2536
|
-
"name": "
|
|
2618
|
+
"name": "options",
|
|
2537
2619
|
"optional": true,
|
|
2538
2620
|
"type": {
|
|
2539
|
-
"text": "
|
|
2540
|
-
}
|
|
2621
|
+
"text": "FocusOptions"
|
|
2622
|
+
},
|
|
2623
|
+
"description": "An object which controls aspects of the focusing process."
|
|
2541
2624
|
}
|
|
2542
|
-
]
|
|
2625
|
+
],
|
|
2626
|
+
"description": "Programmatically move focus to the component.",
|
|
2627
|
+
"inheritedFrom": {
|
|
2628
|
+
"name": "FocusableMixin",
|
|
2629
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2630
|
+
}
|
|
2543
2631
|
},
|
|
2544
2632
|
{
|
|
2545
2633
|
"kind": "method",
|
|
2546
|
-
"name": "
|
|
2547
|
-
"
|
|
2548
|
-
"
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
"text": "string"
|
|
2553
|
-
}
|
|
2554
|
-
}
|
|
2555
|
-
]
|
|
2634
|
+
"name": "blur",
|
|
2635
|
+
"description": "Programmatically remove focus from the component.",
|
|
2636
|
+
"inheritedFrom": {
|
|
2637
|
+
"name": "FocusableMixin",
|
|
2638
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2639
|
+
}
|
|
2556
2640
|
},
|
|
2557
2641
|
{
|
|
2558
2642
|
"kind": "method",
|
|
2559
|
-
"name": "
|
|
2560
|
-
"
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
"name": "open",
|
|
2566
|
-
"type": {
|
|
2567
|
-
"text": "NordEvent"
|
|
2568
|
-
},
|
|
2569
|
-
"description": "The command menu was opened."
|
|
2570
|
-
},
|
|
2571
|
-
{
|
|
2572
|
-
"name": "close",
|
|
2573
|
-
"type": {
|
|
2574
|
-
"text": "NordEvent"
|
|
2575
|
-
},
|
|
2576
|
-
"description": "The command menu was closed."
|
|
2577
|
-
},
|
|
2578
|
-
{
|
|
2579
|
-
"type": {
|
|
2580
|
-
"text": "SelectEvent"
|
|
2581
|
-
},
|
|
2582
|
-
"description": "User selected a command from the menu.",
|
|
2583
|
-
"name": "nord-select"
|
|
2643
|
+
"name": "click",
|
|
2644
|
+
"description": "Programmatically simulates a click on the component.",
|
|
2645
|
+
"inheritedFrom": {
|
|
2646
|
+
"name": "FocusableMixin",
|
|
2647
|
+
"module": "src/common/mixins/FocusableMixin.ts"
|
|
2648
|
+
}
|
|
2584
2649
|
}
|
|
2585
2650
|
],
|
|
2586
2651
|
"attributes": [
|
|
2587
2652
|
{
|
|
2588
|
-
"name": "
|
|
2653
|
+
"name": "checked",
|
|
2589
2654
|
"type": {
|
|
2590
2655
|
"text": "boolean"
|
|
2591
2656
|
},
|
|
2592
2657
|
"default": "false",
|
|
2593
|
-
"description": "
|
|
2594
|
-
"fieldName": "
|
|
2658
|
+
"description": "Controls whether the checkbox is checked or not.",
|
|
2659
|
+
"fieldName": "checked"
|
|
2595
2660
|
},
|
|
2596
2661
|
{
|
|
2597
|
-
"name": "
|
|
2662
|
+
"name": "label",
|
|
2598
2663
|
"type": {
|
|
2599
2664
|
"text": "string"
|
|
2600
2665
|
},
|
|
2601
|
-
"default": "\"
|
|
2602
|
-
"description": "
|
|
2603
|
-
"fieldName": "
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
"package": "lit"
|
|
2609
|
-
},
|
|
2610
|
-
"status": "ready",
|
|
2611
|
-
"category": "action",
|
|
2612
|
-
"tagName": "nord-command-menu",
|
|
2613
|
-
"customElement": true
|
|
2614
|
-
}
|
|
2615
|
-
],
|
|
2616
|
-
"exports": [
|
|
2617
|
-
{
|
|
2618
|
-
"kind": "js",
|
|
2619
|
-
"name": "default",
|
|
2620
|
-
"declaration": {
|
|
2621
|
-
"name": "CommandMenu",
|
|
2622
|
-
"module": "src/command-menu/CommandMenu.ts"
|
|
2623
|
-
}
|
|
2624
|
-
},
|
|
2625
|
-
{
|
|
2626
|
-
"kind": "custom-element-definition",
|
|
2627
|
-
"name": "nord-command-menu",
|
|
2628
|
-
"declaration": {
|
|
2629
|
-
"name": "CommandMenu",
|
|
2630
|
-
"module": "src/command-menu/CommandMenu.ts"
|
|
2631
|
-
}
|
|
2632
|
-
}
|
|
2633
|
-
],
|
|
2634
|
-
"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"
|
|
2635
|
-
},
|
|
2636
|
-
{
|
|
2637
|
-
"kind": "javascript-module",
|
|
2638
|
-
"path": "src/command-menu/CommandMenuAction.ts",
|
|
2639
|
-
"declarations": [
|
|
2640
|
-
{
|
|
2641
|
-
"kind": "class",
|
|
2642
|
-
"description": "Command Menu Action displays a single action that can be executed by the user. For usage examples, please see Command Menu component.",
|
|
2643
|
-
"name": "CommandMenuAction",
|
|
2644
|
-
"members": [
|
|
2645
|
-
{
|
|
2646
|
-
"kind": "field",
|
|
2647
|
-
"name": "direction",
|
|
2648
|
-
"privacy": "private",
|
|
2649
|
-
"default": "new DirectionController(this)"
|
|
2666
|
+
"default": "\"\"",
|
|
2667
|
+
"description": "Label for the input.",
|
|
2668
|
+
"fieldName": "label",
|
|
2669
|
+
"inheritedFrom": {
|
|
2670
|
+
"name": "FormAssociatedMixin",
|
|
2671
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2672
|
+
}
|
|
2650
2673
|
},
|
|
2651
2674
|
{
|
|
2652
|
-
"
|
|
2653
|
-
"name": "command",
|
|
2675
|
+
"name": "hint",
|
|
2654
2676
|
"type": {
|
|
2655
|
-
"text": "
|
|
2677
|
+
"text": "string | undefined"
|
|
2656
2678
|
},
|
|
2657
|
-
"
|
|
2679
|
+
"description": "Optional hint text to be displayed with the input. Alternatively use the hint slot.",
|
|
2680
|
+
"fieldName": "hint",
|
|
2681
|
+
"inheritedFrom": {
|
|
2682
|
+
"name": "FormAssociatedMixin",
|
|
2683
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2684
|
+
}
|
|
2658
2685
|
},
|
|
2659
2686
|
{
|
|
2660
|
-
"
|
|
2661
|
-
"name": "selected",
|
|
2687
|
+
"name": "hide-label",
|
|
2662
2688
|
"type": {
|
|
2663
2689
|
"text": "boolean"
|
|
2664
2690
|
},
|
|
2665
2691
|
"default": "false",
|
|
2666
|
-
"
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
"description": "Scroll to show element"
|
|
2673
|
-
},
|
|
2674
|
-
{
|
|
2675
|
-
"kind": "method",
|
|
2676
|
-
"name": "getIconName",
|
|
2677
|
-
"privacy": "private"
|
|
2692
|
+
"description": "Visually hide the label, but still show it to assistive technologies like screen readers.",
|
|
2693
|
+
"fieldName": "hideLabel",
|
|
2694
|
+
"inheritedFrom": {
|
|
2695
|
+
"name": "FormAssociatedMixin",
|
|
2696
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2697
|
+
}
|
|
2678
2698
|
},
|
|
2679
2699
|
{
|
|
2680
|
-
"
|
|
2681
|
-
"name": "renderShortcut",
|
|
2682
|
-
"privacy": "private"
|
|
2683
|
-
}
|
|
2684
|
-
],
|
|
2685
|
-
"attributes": [
|
|
2686
|
-
{
|
|
2687
|
-
"name": "command",
|
|
2700
|
+
"name": "placeholder",
|
|
2688
2701
|
"type": {
|
|
2689
|
-
"text": "
|
|
2702
|
+
"text": "string | undefined"
|
|
2690
2703
|
},
|
|
2691
|
-
"
|
|
2704
|
+
"description": "Placeholder text to display within the input.",
|
|
2705
|
+
"fieldName": "placeholder",
|
|
2706
|
+
"inheritedFrom": {
|
|
2707
|
+
"name": "FormAssociatedMixin",
|
|
2708
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2709
|
+
}
|
|
2692
2710
|
},
|
|
2693
2711
|
{
|
|
2694
|
-
"name": "
|
|
2695
|
-
"type": {
|
|
2696
|
-
"text": "
|
|
2697
|
-
},
|
|
2698
|
-
"
|
|
2699
|
-
"fieldName": "
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
},
|
|
2706
|
-
"status": "internal",
|
|
2707
|
-
"category": null,
|
|
2708
|
-
"tagName": "nord-command-menu-action",
|
|
2709
|
-
"customElement": true
|
|
2710
|
-
}
|
|
2711
|
-
],
|
|
2712
|
-
"exports": [
|
|
2713
|
-
{
|
|
2714
|
-
"kind": "js",
|
|
2715
|
-
"name": "default",
|
|
2716
|
-
"declaration": {
|
|
2717
|
-
"name": "CommandMenuAction",
|
|
2718
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2719
|
-
}
|
|
2720
|
-
},
|
|
2721
|
-
{
|
|
2722
|
-
"kind": "custom-element-definition",
|
|
2723
|
-
"name": "nord-command-menu-action",
|
|
2724
|
-
"declaration": {
|
|
2725
|
-
"name": "CommandMenuAction",
|
|
2726
|
-
"module": "src/command-menu/CommandMenuAction.ts"
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
|
-
],
|
|
2730
|
-
"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"
|
|
2731
|
-
},
|
|
2732
|
-
{
|
|
2733
|
-
"kind": "javascript-module",
|
|
2734
|
-
"path": "src/command-menu/ICommandMenuAction.ts",
|
|
2735
|
-
"declarations": [],
|
|
2736
|
-
"exports": [],
|
|
2737
|
-
"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"
|
|
2738
|
-
},
|
|
2739
|
-
{
|
|
2740
|
-
"kind": "javascript-module",
|
|
2741
|
-
"path": "src/command-menu/KeyboardController.ts",
|
|
2742
|
-
"declarations": [
|
|
2743
|
-
{
|
|
2744
|
-
"kind": "class",
|
|
2745
|
-
"description": "",
|
|
2746
|
-
"name": "KeyboardController",
|
|
2747
|
-
"members": [
|
|
2712
|
+
"name": "error",
|
|
2713
|
+
"type": {
|
|
2714
|
+
"text": "string | undefined"
|
|
2715
|
+
},
|
|
2716
|
+
"description": "Optional error to be shown with the input. Alternatively use the error slot.",
|
|
2717
|
+
"fieldName": "error",
|
|
2718
|
+
"inheritedFrom": {
|
|
2719
|
+
"name": "FormAssociatedMixin",
|
|
2720
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2721
|
+
}
|
|
2722
|
+
},
|
|
2748
2723
|
{
|
|
2749
|
-
"
|
|
2750
|
-
"name": "globalShortcuts",
|
|
2724
|
+
"name": "required",
|
|
2751
2725
|
"type": {
|
|
2752
|
-
"text": "
|
|
2726
|
+
"text": "boolean"
|
|
2753
2727
|
},
|
|
2754
|
-
"
|
|
2755
|
-
"
|
|
2728
|
+
"default": "false",
|
|
2729
|
+
"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.",
|
|
2730
|
+
"fieldName": "required",
|
|
2731
|
+
"inheritedFrom": {
|
|
2732
|
+
"name": "FormAssociatedMixin",
|
|
2733
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2734
|
+
}
|
|
2756
2735
|
},
|
|
2757
2736
|
{
|
|
2758
|
-
"
|
|
2759
|
-
"name": "navigationShortcuts",
|
|
2737
|
+
"name": "expand",
|
|
2760
2738
|
"type": {
|
|
2761
|
-
"text": "
|
|
2739
|
+
"text": "boolean"
|
|
2762
2740
|
},
|
|
2763
|
-
"
|
|
2764
|
-
"
|
|
2741
|
+
"default": "false",
|
|
2742
|
+
"description": "Controls whether the input expands to fill the width of its container.",
|
|
2743
|
+
"fieldName": "expand",
|
|
2744
|
+
"inheritedFrom": {
|
|
2745
|
+
"name": "FormAssociatedMixin",
|
|
2746
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2747
|
+
}
|
|
2765
2748
|
},
|
|
2766
2749
|
{
|
|
2767
|
-
"
|
|
2768
|
-
"name": "commandShortcuts",
|
|
2750
|
+
"name": "disabled",
|
|
2769
2751
|
"type": {
|
|
2770
|
-
"text": "
|
|
2752
|
+
"text": "boolean"
|
|
2771
2753
|
},
|
|
2772
|
-
"
|
|
2773
|
-
"
|
|
2754
|
+
"default": "false",
|
|
2755
|
+
"description": "Makes the component disabled. This prevents users from\nbeing able to interact with the component, and conveys\nits inactive state to assistive technologies.",
|
|
2756
|
+
"fieldName": "disabled",
|
|
2757
|
+
"inheritedFrom": {
|
|
2758
|
+
"name": "InputMixin",
|
|
2759
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2760
|
+
}
|
|
2774
2761
|
},
|
|
2775
2762
|
{
|
|
2776
|
-
"
|
|
2777
|
-
"
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
"name": "KeyboardController",
|
|
2788
|
-
"module": "src/command-menu/KeyboardController.ts"
|
|
2789
|
-
}
|
|
2790
|
-
}
|
|
2791
|
-
],
|
|
2792
|
-
"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"
|
|
2793
|
-
},
|
|
2794
|
-
{
|
|
2795
|
-
"kind": "javascript-module",
|
|
2796
|
-
"path": "src/command-menu/SelectEvent.ts",
|
|
2797
|
-
"declarations": [
|
|
2798
|
-
{
|
|
2799
|
-
"kind": "class",
|
|
2800
|
-
"description": "",
|
|
2801
|
-
"name": "SelectEvent",
|
|
2802
|
-
"members": [
|
|
2763
|
+
"name": "name",
|
|
2764
|
+
"type": {
|
|
2765
|
+
"text": "string | undefined"
|
|
2766
|
+
},
|
|
2767
|
+
"description": "The name of the form component.",
|
|
2768
|
+
"fieldName": "name",
|
|
2769
|
+
"inheritedFrom": {
|
|
2770
|
+
"name": "InputMixin",
|
|
2771
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2772
|
+
}
|
|
2773
|
+
},
|
|
2803
2774
|
{
|
|
2804
|
-
"
|
|
2805
|
-
"name": "eventName",
|
|
2775
|
+
"name": "value",
|
|
2806
2776
|
"type": {
|
|
2807
2777
|
"text": "string"
|
|
2808
2778
|
},
|
|
2809
|
-
"
|
|
2810
|
-
"
|
|
2779
|
+
"default": "\"\"",
|
|
2780
|
+
"description": "The value of the form component.",
|
|
2781
|
+
"fieldName": "value",
|
|
2782
|
+
"inheritedFrom": {
|
|
2783
|
+
"name": "InputMixin",
|
|
2784
|
+
"module": "src/common/mixins/InputMixin.ts"
|
|
2785
|
+
}
|
|
2786
|
+
}
|
|
2787
|
+
],
|
|
2788
|
+
"mixins": [
|
|
2789
|
+
{
|
|
2790
|
+
"name": "FormAssociatedMixin",
|
|
2791
|
+
"module": "/src/common/mixins/FormAssociatedMixin.js"
|
|
2792
|
+
},
|
|
2793
|
+
{
|
|
2794
|
+
"name": "InputMixin",
|
|
2795
|
+
"module": "/src/common/mixins/InputMixin.js"
|
|
2796
|
+
},
|
|
2797
|
+
{
|
|
2798
|
+
"name": "FocusableMixin",
|
|
2799
|
+
"module": "/src/common/mixins/FocusableMixin.js"
|
|
2811
2800
|
}
|
|
2812
2801
|
],
|
|
2813
2802
|
"superclass": {
|
|
2814
|
-
"name": "
|
|
2815
|
-
"
|
|
2816
|
-
}
|
|
2803
|
+
"name": "LitElement",
|
|
2804
|
+
"package": "lit"
|
|
2805
|
+
},
|
|
2806
|
+
"status": "ready",
|
|
2807
|
+
"category": "form",
|
|
2808
|
+
"tagName": "nord-checkbox",
|
|
2809
|
+
"customElement": true,
|
|
2810
|
+
"events": [
|
|
2811
|
+
{
|
|
2812
|
+
"name": "input",
|
|
2813
|
+
"type": {
|
|
2814
|
+
"text": "NordEvent"
|
|
2815
|
+
},
|
|
2816
|
+
"description": "Fired as the user types into the input.",
|
|
2817
|
+
"inheritedFrom": {
|
|
2818
|
+
"name": "FormAssociatedMixin",
|
|
2819
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2820
|
+
}
|
|
2821
|
+
},
|
|
2822
|
+
{
|
|
2823
|
+
"name": "change",
|
|
2824
|
+
"type": {
|
|
2825
|
+
"text": "NordEvent"
|
|
2826
|
+
},
|
|
2827
|
+
"description": "Fired whenever the input's value is changed via user interaction.",
|
|
2828
|
+
"inheritedFrom": {
|
|
2829
|
+
"name": "FormAssociatedMixin",
|
|
2830
|
+
"module": "src/common/mixins/FormAssociatedMixin.ts"
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
]
|
|
2817
2834
|
}
|
|
2818
2835
|
],
|
|
2819
2836
|
"exports": [
|
|
2820
2837
|
{
|
|
2821
2838
|
"kind": "js",
|
|
2822
|
-
"name": "
|
|
2839
|
+
"name": "default",
|
|
2823
2840
|
"declaration": {
|
|
2824
|
-
"name": "
|
|
2825
|
-
"module": "src/
|
|
2841
|
+
"name": "Checkbox",
|
|
2842
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
2826
2843
|
}
|
|
2827
|
-
}
|
|
2828
|
-
],
|
|
2829
|
-
"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"
|
|
2830
|
-
},
|
|
2831
|
-
{
|
|
2832
|
-
"kind": "javascript-module",
|
|
2833
|
-
"path": "src/command-menu/localization.ts",
|
|
2834
|
-
"declarations": [
|
|
2835
|
-
{
|
|
2836
|
-
"kind": "variable",
|
|
2837
|
-
"name": "commandMenuLocalization",
|
|
2838
|
-
"type": {
|
|
2839
|
-
"text": "object"
|
|
2840
|
-
},
|
|
2841
|
-
"default": "{\n instructions: \"Press 'Enter' to confirm your input or 'Escape' to cancel\",\n inputLabel: \"Type the name of a command to run.\",\n footerArrowKeys: \"Navigate\",\n footerEnterKey: \"Select\",\n footerEscapeKey: \"Esc to dismiss\",\n footerBackspaceKey: \"Move to parent\",\n noResults: (searchTerm: string) => `No results for “${searchTerm}”`,\n tip: \"Search tips: some search terms require exact match. Try typing the entire command name, or use a different word or phrase.\",\n}"
|
|
2842
|
-
}
|
|
2843
|
-
],
|
|
2844
|
-
"exports": [
|
|
2844
|
+
},
|
|
2845
2845
|
{
|
|
2846
|
-
"kind": "
|
|
2847
|
-
"name": "
|
|
2846
|
+
"kind": "custom-element-definition",
|
|
2847
|
+
"name": "nord-checkbox",
|
|
2848
2848
|
"declaration": {
|
|
2849
|
-
"name": "
|
|
2850
|
-
"module": "src/
|
|
2849
|
+
"name": "Checkbox",
|
|
2850
|
+
"module": "src/checkbox/Checkbox.ts"
|
|
2851
2851
|
}
|
|
2852
2852
|
}
|
|
2853
2853
|
],
|
|
2854
|
-
"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"
|
|
2854
|
+
"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- Avoid using 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"
|
|
2855
2855
|
},
|
|
2856
2856
|
{
|
|
2857
2857
|
"kind": "javascript-module",
|
|
@@ -11831,6 +11831,41 @@
|
|
|
11831
11831
|
],
|
|
11832
11832
|
"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 hide text visually from the screen, but keep it available to assistive technologies, such as screen readers.\n\n</div>\n<div class=\"n-usage n-usage-dont\">\n\n### Don’t\n\n- Don’t use for hiding interactive content.\n\n</div>\n"
|
|
11833
11833
|
},
|
|
11834
|
+
{
|
|
11835
|
+
"kind": "javascript-module",
|
|
11836
|
+
"path": "src/common/decorators/observe.ts",
|
|
11837
|
+
"declarations": [
|
|
11838
|
+
{
|
|
11839
|
+
"kind": "function",
|
|
11840
|
+
"name": "observe",
|
|
11841
|
+
"parameters": [
|
|
11842
|
+
{
|
|
11843
|
+
"name": "propertyName",
|
|
11844
|
+
"type": {
|
|
11845
|
+
"text": "string"
|
|
11846
|
+
}
|
|
11847
|
+
},
|
|
11848
|
+
{
|
|
11849
|
+
"name": "lifecycle",
|
|
11850
|
+
"default": "\"update\"",
|
|
11851
|
+
"type": {
|
|
11852
|
+
"text": "ObserveLifecycle"
|
|
11853
|
+
}
|
|
11854
|
+
}
|
|
11855
|
+
]
|
|
11856
|
+
}
|
|
11857
|
+
],
|
|
11858
|
+
"exports": [
|
|
11859
|
+
{
|
|
11860
|
+
"kind": "js",
|
|
11861
|
+
"name": "observe",
|
|
11862
|
+
"declaration": {
|
|
11863
|
+
"name": "observe",
|
|
11864
|
+
"module": "src/common/decorators/observe.ts"
|
|
11865
|
+
}
|
|
11866
|
+
}
|
|
11867
|
+
]
|
|
11868
|
+
},
|
|
11834
11869
|
{
|
|
11835
11870
|
"kind": "javascript-module",
|
|
11836
11871
|
"path": "src/common/controllers/DirectionController.ts",
|
|
@@ -12842,41 +12877,6 @@
|
|
|
12842
12877
|
}
|
|
12843
12878
|
]
|
|
12844
12879
|
},
|
|
12845
|
-
{
|
|
12846
|
-
"kind": "javascript-module",
|
|
12847
|
-
"path": "src/common/decorators/observe.ts",
|
|
12848
|
-
"declarations": [
|
|
12849
|
-
{
|
|
12850
|
-
"kind": "function",
|
|
12851
|
-
"name": "observe",
|
|
12852
|
-
"parameters": [
|
|
12853
|
-
{
|
|
12854
|
-
"name": "propertyName",
|
|
12855
|
-
"type": {
|
|
12856
|
-
"text": "string"
|
|
12857
|
-
}
|
|
12858
|
-
},
|
|
12859
|
-
{
|
|
12860
|
-
"name": "lifecycle",
|
|
12861
|
-
"default": "\"update\"",
|
|
12862
|
-
"type": {
|
|
12863
|
-
"text": "ObserveLifecycle"
|
|
12864
|
-
}
|
|
12865
|
-
}
|
|
12866
|
-
]
|
|
12867
|
-
}
|
|
12868
|
-
],
|
|
12869
|
-
"exports": [
|
|
12870
|
-
{
|
|
12871
|
-
"kind": "js",
|
|
12872
|
-
"name": "observe",
|
|
12873
|
-
"declaration": {
|
|
12874
|
-
"name": "observe",
|
|
12875
|
-
"module": "src/common/decorators/observe.ts"
|
|
12876
|
-
}
|
|
12877
|
-
}
|
|
12878
|
-
]
|
|
12879
|
-
},
|
|
12880
12880
|
{
|
|
12881
12881
|
"kind": "javascript-module",
|
|
12882
12882
|
"path": "src/common/directives/cond.ts",
|