@ng-primitives/mcp 0.126.0 → 0.127.0
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/package.json
CHANGED
|
@@ -29,30 +29,6 @@
|
|
|
29
29
|
"inputs": [],
|
|
30
30
|
"outputs": []
|
|
31
31
|
},
|
|
32
|
-
"NgpAccordionItem": {
|
|
33
|
-
"name": "NgpAccordionItem",
|
|
34
|
-
"description": "Apply the `ngpAccordionItem` directive to an element that represents an accordion item.",
|
|
35
|
-
"selector": "[ngpAccordionItem]",
|
|
36
|
-
"exportAs": [
|
|
37
|
-
"ngpAccordionItem"
|
|
38
|
-
],
|
|
39
|
-
"inputs": [
|
|
40
|
-
{
|
|
41
|
-
"name": "ngpAccordionItemValue",
|
|
42
|
-
"type": "T",
|
|
43
|
-
"description": "The value of the accordion item.",
|
|
44
|
-
"isRequired": false
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"name": "ngpAccordionItemDisabled",
|
|
48
|
-
"type": "boolean",
|
|
49
|
-
"description": "Whether the accordion item is disabled.",
|
|
50
|
-
"isRequired": false,
|
|
51
|
-
"defaultValue": "false"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
"outputs": []
|
|
55
|
-
},
|
|
56
32
|
"NgpAccordion": {
|
|
57
33
|
"name": "NgpAccordion",
|
|
58
34
|
"description": "Apply the `ngpAccordion` directive to an element that represents the group of accordion items.",
|
|
@@ -105,6 +81,30 @@
|
|
|
105
81
|
}
|
|
106
82
|
]
|
|
107
83
|
},
|
|
84
|
+
"NgpAccordionItem": {
|
|
85
|
+
"name": "NgpAccordionItem",
|
|
86
|
+
"description": "Apply the `ngpAccordionItem` directive to an element that represents an accordion item.",
|
|
87
|
+
"selector": "[ngpAccordionItem]",
|
|
88
|
+
"exportAs": [
|
|
89
|
+
"ngpAccordionItem"
|
|
90
|
+
],
|
|
91
|
+
"inputs": [
|
|
92
|
+
{
|
|
93
|
+
"name": "ngpAccordionItemValue",
|
|
94
|
+
"type": "T",
|
|
95
|
+
"description": "The value of the accordion item.",
|
|
96
|
+
"isRequired": false
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "ngpAccordionItemDisabled",
|
|
100
|
+
"type": "boolean",
|
|
101
|
+
"description": "Whether the accordion item is disabled.",
|
|
102
|
+
"isRequired": false,
|
|
103
|
+
"defaultValue": "false"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"outputs": []
|
|
107
|
+
},
|
|
108
108
|
"NgpThread": {
|
|
109
109
|
"name": "NgpThread",
|
|
110
110
|
"description": "",
|
|
@@ -430,6 +430,407 @@
|
|
|
430
430
|
}
|
|
431
431
|
]
|
|
432
432
|
},
|
|
433
|
+
"NgpCollapsibleTrigger": {
|
|
434
|
+
"name": "NgpCollapsibleTrigger",
|
|
435
|
+
"description": "Apply the `ngpCollapsibleTrigger` directive to an element - typically a\n`button` - that toggles the collapsible open and closed.",
|
|
436
|
+
"selector": "[ngpCollapsibleTrigger]",
|
|
437
|
+
"exportAs": [
|
|
438
|
+
"ngpCollapsibleTrigger"
|
|
439
|
+
],
|
|
440
|
+
"inputs": [],
|
|
441
|
+
"outputs": []
|
|
442
|
+
},
|
|
443
|
+
"NgpCollapsibleContent": {
|
|
444
|
+
"name": "NgpCollapsibleContent",
|
|
445
|
+
"description": "Apply the `ngpCollapsibleContent` directive to the element that contains the\ncollapsible content that is shown and hidden by the trigger.",
|
|
446
|
+
"selector": "[ngpCollapsibleContent]",
|
|
447
|
+
"exportAs": [
|
|
448
|
+
"ngpCollapsibleContent"
|
|
449
|
+
],
|
|
450
|
+
"inputs": [],
|
|
451
|
+
"outputs": []
|
|
452
|
+
},
|
|
453
|
+
"NgpCollapsible": {
|
|
454
|
+
"name": "NgpCollapsible",
|
|
455
|
+
"description": "Apply the `ngpCollapsible` directive to an element that contains a collapsible\ntrigger and content. It manages the open state of a single disclosure.",
|
|
456
|
+
"selector": "[ngpCollapsible]",
|
|
457
|
+
"exportAs": [
|
|
458
|
+
"ngpCollapsible"
|
|
459
|
+
],
|
|
460
|
+
"inputs": [
|
|
461
|
+
{
|
|
462
|
+
"name": "ngpCollapsibleOpen",
|
|
463
|
+
"type": "boolean | undefined",
|
|
464
|
+
"description": "Whether the collapsible is open. Leave unset for uncontrolled usage.",
|
|
465
|
+
"isRequired": false
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"name": "ngpCollapsibleDefaultOpen",
|
|
469
|
+
"type": "boolean",
|
|
470
|
+
"description": "The default open state for uncontrolled usage.\n@default false",
|
|
471
|
+
"isRequired": false,
|
|
472
|
+
"defaultValue": "false"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "ngpCollapsibleDisabled",
|
|
476
|
+
"type": "boolean",
|
|
477
|
+
"description": "Whether the collapsible is disabled.\n@default false",
|
|
478
|
+
"isRequired": false,
|
|
479
|
+
"defaultValue": "false"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"name": "ngpCollapsibleOrientation",
|
|
483
|
+
"type": "'horizontal' | 'vertical'",
|
|
484
|
+
"description": "The orientation of the collapsible.\n@default 'vertical'",
|
|
485
|
+
"isRequired": false,
|
|
486
|
+
"defaultValue": "'vertical'"
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
"outputs": [
|
|
490
|
+
{
|
|
491
|
+
"name": "ngpCollapsibleOpenChange",
|
|
492
|
+
"type": "boolean",
|
|
493
|
+
"description": "Emits when the open state changes."
|
|
494
|
+
}
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
"NgpColorAreaThumb": {
|
|
498
|
+
"name": "NgpColorAreaThumb",
|
|
499
|
+
"description": "Apply the `ngpColorAreaThumb` directive to the element that represents the color area thumb.",
|
|
500
|
+
"selector": "[ngpColorAreaThumb]",
|
|
501
|
+
"exportAs": [
|
|
502
|
+
"ngpColorAreaThumb"
|
|
503
|
+
],
|
|
504
|
+
"inputs": [],
|
|
505
|
+
"outputs": []
|
|
506
|
+
},
|
|
507
|
+
"NgpColorWheelThumb": {
|
|
508
|
+
"name": "NgpColorWheelThumb",
|
|
509
|
+
"description": "Apply the `ngpColorWheelThumb` directive to the element that represents the color wheel thumb.\nPosition it with the `--ngp-color-wheel-hue` custom property, e.g.\n`transform: translate(-50%, -50%) rotate(var(--ngp-color-wheel-hue)) translateY(calc(-1 * <radius>))`.",
|
|
510
|
+
"selector": "[ngpColorWheelThumb]",
|
|
511
|
+
"exportAs": [
|
|
512
|
+
"ngpColorWheelThumb"
|
|
513
|
+
],
|
|
514
|
+
"inputs": [],
|
|
515
|
+
"outputs": []
|
|
516
|
+
},
|
|
517
|
+
"NgpColorSwatch": {
|
|
518
|
+
"name": "NgpColorSwatch",
|
|
519
|
+
"description": "Apply the `ngpColorSwatch` directive to an element to display a color preview. Set its background to\n`var(--ngp-color-swatch-color)`. Inside a color picker it shows the picker's value by default.",
|
|
520
|
+
"selector": "[ngpColorSwatch]",
|
|
521
|
+
"exportAs": [
|
|
522
|
+
"ngpColorSwatch"
|
|
523
|
+
],
|
|
524
|
+
"inputs": [
|
|
525
|
+
{
|
|
526
|
+
"name": "ngpColorSwatch",
|
|
527
|
+
"type": "Color | undefined",
|
|
528
|
+
"description": "The color to display. Falls back to the parent picker's value when omitted.",
|
|
529
|
+
"isRequired": false
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"name": "ngpColorSwatchLabel",
|
|
533
|
+
"type": "string | undefined",
|
|
534
|
+
"description": "An accessible label. Defaults to the color's hex string.",
|
|
535
|
+
"isRequired": false
|
|
536
|
+
}
|
|
537
|
+
],
|
|
538
|
+
"outputs": []
|
|
539
|
+
},
|
|
540
|
+
"NgpColorSliderTrack": {
|
|
541
|
+
"name": "NgpColorSliderTrack",
|
|
542
|
+
"description": "Apply the `ngpColorSliderTrack` directive to the element that represents the color slider track.\nSet its background to `var(--ngp-color-slider-background)` to render the channel gradient.",
|
|
543
|
+
"selector": "[ngpColorSliderTrack]",
|
|
544
|
+
"exportAs": [
|
|
545
|
+
"ngpColorSliderTrack"
|
|
546
|
+
],
|
|
547
|
+
"inputs": [],
|
|
548
|
+
"outputs": []
|
|
549
|
+
},
|
|
550
|
+
"NgpColorSliderThumb": {
|
|
551
|
+
"name": "NgpColorSliderThumb",
|
|
552
|
+
"description": "Apply the `ngpColorSliderThumb` directive to the element that represents the color slider thumb.",
|
|
553
|
+
"selector": "[ngpColorSliderThumb]",
|
|
554
|
+
"exportAs": [
|
|
555
|
+
"ngpColorSliderThumb"
|
|
556
|
+
],
|
|
557
|
+
"inputs": [],
|
|
558
|
+
"outputs": [
|
|
559
|
+
{
|
|
560
|
+
"name": "ngpColorSliderThumbDragStart",
|
|
561
|
+
"type": "void",
|
|
562
|
+
"description": "Emits when the thumb drag starts."
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
"name": "ngpColorSliderThumbDragEnd",
|
|
566
|
+
"type": "void",
|
|
567
|
+
"description": "Emits when the thumb drag ends."
|
|
568
|
+
}
|
|
569
|
+
]
|
|
570
|
+
},
|
|
571
|
+
"NgpColorPicker": {
|
|
572
|
+
"name": "NgpColorPicker",
|
|
573
|
+
"description": "Apply the `ngpColorPicker` directive to a container that coordinates a single color value across\nchild color components. Child areas, sliders and fields bind to the picker's value automatically.",
|
|
574
|
+
"selector": "[ngpColorPicker]",
|
|
575
|
+
"exportAs": [
|
|
576
|
+
"ngpColorPicker"
|
|
577
|
+
],
|
|
578
|
+
"inputs": [
|
|
579
|
+
{
|
|
580
|
+
"name": "ngpColorPickerValue",
|
|
581
|
+
"type": "Color",
|
|
582
|
+
"description": "The color value.",
|
|
583
|
+
"isRequired": false
|
|
584
|
+
}
|
|
585
|
+
],
|
|
586
|
+
"outputs": [
|
|
587
|
+
{
|
|
588
|
+
"name": "ngpColorPickerValueChange",
|
|
589
|
+
"type": "Color",
|
|
590
|
+
"description": "Emits when the value changes."
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
"NgpColorSwatchPickerItem": {
|
|
595
|
+
"name": "NgpColorSwatchPickerItem",
|
|
596
|
+
"description": "Apply the `ngpColorSwatchPickerItem` directive to a selectable swatch within a swatch picker. Set its\nbackground to `var(--ngp-color-swatch-color)`. It composes a roving focus item.",
|
|
597
|
+
"selector": "[ngpColorSwatchPickerItem]",
|
|
598
|
+
"exportAs": [
|
|
599
|
+
"ngpColorSwatchPickerItem"
|
|
600
|
+
],
|
|
601
|
+
"inputs": [
|
|
602
|
+
{
|
|
603
|
+
"name": "ngpColorSwatchPickerItem",
|
|
604
|
+
"type": "Color",
|
|
605
|
+
"description": "The color this swatch represents.",
|
|
606
|
+
"isRequired": false
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
"name": "ngpColorSwatchPickerItemDisabled",
|
|
610
|
+
"type": "boolean",
|
|
611
|
+
"description": "Whether the swatch is disabled.",
|
|
612
|
+
"isRequired": false,
|
|
613
|
+
"defaultValue": "false"
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
"outputs": []
|
|
617
|
+
},
|
|
618
|
+
"NgpColorWheel": {
|
|
619
|
+
"name": "NgpColorWheel",
|
|
620
|
+
"description": "Apply the `ngpColorWheel` directive to a circular element that adjusts the hue channel of a color.\nSet its background to `var(--ngp-color-wheel-background)` and contain a thumb.",
|
|
621
|
+
"selector": "[ngpColorWheel]",
|
|
622
|
+
"exportAs": [
|
|
623
|
+
"ngpColorWheel"
|
|
624
|
+
],
|
|
625
|
+
"inputs": [
|
|
626
|
+
{
|
|
627
|
+
"name": "ngpColorWheelValue",
|
|
628
|
+
"type": "Color",
|
|
629
|
+
"description": "The color value.",
|
|
630
|
+
"isRequired": false
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"name": "ngpColorWheelColorSpace",
|
|
634
|
+
"type": "'rgb' | 'hsl' | 'hsb'",
|
|
635
|
+
"description": "The color space to operate in.",
|
|
636
|
+
"isRequired": false,
|
|
637
|
+
"defaultValue": "'hsl'"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
"name": "ngpColorWheelDisabled",
|
|
641
|
+
"type": "boolean",
|
|
642
|
+
"description": "The disabled state of the wheel.",
|
|
643
|
+
"isRequired": false,
|
|
644
|
+
"defaultValue": "false"
|
|
645
|
+
}
|
|
646
|
+
],
|
|
647
|
+
"outputs": [
|
|
648
|
+
{
|
|
649
|
+
"name": "ngpColorWheelValueChange",
|
|
650
|
+
"type": "Color",
|
|
651
|
+
"description": "Emits when the value changes."
|
|
652
|
+
}
|
|
653
|
+
]
|
|
654
|
+
},
|
|
655
|
+
"NgpColorArea": {
|
|
656
|
+
"name": "NgpColorArea",
|
|
657
|
+
"description": "Apply the `ngpColorArea` directive to a 2D surface that adjusts two channels of a color value.\nThe surface should set its background to `var(--ngp-color-area-background)` and contain a thumb.",
|
|
658
|
+
"selector": "[ngpColorArea]",
|
|
659
|
+
"exportAs": [
|
|
660
|
+
"ngpColorArea"
|
|
661
|
+
],
|
|
662
|
+
"inputs": [
|
|
663
|
+
{
|
|
664
|
+
"name": "ngpColorAreaValue",
|
|
665
|
+
"type": "Color",
|
|
666
|
+
"description": "The color value.",
|
|
667
|
+
"isRequired": false
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"name": "ngpColorAreaXChannel",
|
|
671
|
+
"type": "'red' | 'green' | 'blue' | 'hue' | 'saturation' | 'lightness' | 'brightness' | 'alpha'",
|
|
672
|
+
"description": "The channel mapped to the horizontal axis.",
|
|
673
|
+
"isRequired": false,
|
|
674
|
+
"defaultValue": "'saturation'"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"name": "ngpColorAreaYChannel",
|
|
678
|
+
"type": "'red' | 'green' | 'blue' | 'hue' | 'saturation' | 'lightness' | 'brightness' | 'alpha'",
|
|
679
|
+
"description": "The channel mapped to the vertical axis.",
|
|
680
|
+
"isRequired": false,
|
|
681
|
+
"defaultValue": "'brightness'"
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
"name": "ngpColorAreaColorSpace",
|
|
685
|
+
"type": "ColorSpace | undefined",
|
|
686
|
+
"description": "The color space to operate in. Resolved from the channels/value when not set.",
|
|
687
|
+
"isRequired": false
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
"name": "ngpColorAreaDisabled",
|
|
691
|
+
"type": "boolean",
|
|
692
|
+
"description": "The disabled state of the area.",
|
|
693
|
+
"isRequired": false,
|
|
694
|
+
"defaultValue": "false"
|
|
695
|
+
}
|
|
696
|
+
],
|
|
697
|
+
"outputs": [
|
|
698
|
+
{
|
|
699
|
+
"name": "ngpColorAreaValueChange",
|
|
700
|
+
"type": "Color",
|
|
701
|
+
"description": "Emits when the value changes."
|
|
702
|
+
}
|
|
703
|
+
]
|
|
704
|
+
},
|
|
705
|
+
"NgpColorField": {
|
|
706
|
+
"name": "NgpColorField",
|
|
707
|
+
"description": "Apply the `ngpColorField` directive to an `input` element to edit a color. Without a channel it\nedits the whole color as a hex string; with a channel it edits that single channel as a number.\nIt composes the input primitive, so it provides the input state.",
|
|
708
|
+
"selector": "input[ngpColorField]",
|
|
709
|
+
"exportAs": [
|
|
710
|
+
"ngpColorField"
|
|
711
|
+
],
|
|
712
|
+
"inputs": [
|
|
713
|
+
{
|
|
714
|
+
"name": "ngpColorFieldValue",
|
|
715
|
+
"type": "Color",
|
|
716
|
+
"description": "The color value.",
|
|
717
|
+
"isRequired": false
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"name": "ngpColorFieldChannel",
|
|
721
|
+
"type": "ColorChannel | undefined",
|
|
722
|
+
"description": "The channel to edit. When omitted, the field edits the whole color as hex.",
|
|
723
|
+
"isRequired": false
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"name": "ngpColorFieldColorSpace",
|
|
727
|
+
"type": "ColorSpace | undefined",
|
|
728
|
+
"description": "The color space for channel mode. Resolved from the channel/value when not set.",
|
|
729
|
+
"isRequired": false
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"name": "ngpColorFieldDisabled",
|
|
733
|
+
"type": "boolean",
|
|
734
|
+
"description": "The disabled state of the field.",
|
|
735
|
+
"isRequired": false,
|
|
736
|
+
"defaultValue": "false"
|
|
737
|
+
}
|
|
738
|
+
],
|
|
739
|
+
"outputs": [
|
|
740
|
+
{
|
|
741
|
+
"name": "ngpColorFieldValueChange",
|
|
742
|
+
"type": "Color",
|
|
743
|
+
"description": "Emits when the value changes."
|
|
744
|
+
}
|
|
745
|
+
]
|
|
746
|
+
},
|
|
747
|
+
"NgpColorSlider": {
|
|
748
|
+
"name": "NgpColorSlider",
|
|
749
|
+
"description": "Apply the `ngpColorSlider` directive to an element that contains a color slider track and thumb.\nA color slider adjusts a single channel (e.g. hue, saturation, alpha) of a color value. It composes\nthe underlying slider primitive, so it provides the slider state its track and thumb parts read.",
|
|
750
|
+
"selector": "[ngpColorSlider]",
|
|
751
|
+
"exportAs": [
|
|
752
|
+
"ngpColorSlider"
|
|
753
|
+
],
|
|
754
|
+
"inputs": [
|
|
755
|
+
{
|
|
756
|
+
"name": "ngpColorSliderValue",
|
|
757
|
+
"type": "Color",
|
|
758
|
+
"description": "The color value.",
|
|
759
|
+
"isRequired": false
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"name": "ngpColorSliderChannel",
|
|
763
|
+
"type": "'red' | 'green' | 'blue' | 'hue' | 'saturation' | 'lightness' | 'brightness' | 'alpha'",
|
|
764
|
+
"description": "The channel this slider adjusts.",
|
|
765
|
+
"isRequired": false,
|
|
766
|
+
"defaultValue": "'hue'"
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
"name": "ngpColorSliderColorSpace",
|
|
770
|
+
"type": "ColorSpace | undefined",
|
|
771
|
+
"description": "The color space to operate in. Resolved from the channel/value when not set.",
|
|
772
|
+
"isRequired": false
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
"name": "ngpColorSliderOrientation",
|
|
776
|
+
"type": "'horizontal' | 'vertical'",
|
|
777
|
+
"description": "The orientation of the slider.",
|
|
778
|
+
"isRequired": false,
|
|
779
|
+
"defaultValue": "'horizontal'"
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"name": "ngpColorSliderDisabled",
|
|
783
|
+
"type": "boolean",
|
|
784
|
+
"description": "The disabled state of the slider.",
|
|
785
|
+
"isRequired": false,
|
|
786
|
+
"defaultValue": "false"
|
|
787
|
+
}
|
|
788
|
+
],
|
|
789
|
+
"outputs": [
|
|
790
|
+
{
|
|
791
|
+
"name": "ngpColorSliderValueChange",
|
|
792
|
+
"type": "Color",
|
|
793
|
+
"description": "Emits when the value changes."
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
},
|
|
797
|
+
"NgpColorSwatchPicker": {
|
|
798
|
+
"name": "NgpColorSwatchPicker",
|
|
799
|
+
"description": "Apply the `ngpColorSwatchPicker` directive to a container of selectable color swatches. It composes\nroving focus for keyboard navigation, so it provides the roving focus group state.",
|
|
800
|
+
"selector": "[ngpColorSwatchPicker]",
|
|
801
|
+
"exportAs": [
|
|
802
|
+
"ngpColorSwatchPicker"
|
|
803
|
+
],
|
|
804
|
+
"inputs": [
|
|
805
|
+
{
|
|
806
|
+
"name": "ngpColorSwatchPickerValue",
|
|
807
|
+
"type": "Color | undefined",
|
|
808
|
+
"description": "The selected color.",
|
|
809
|
+
"isRequired": false
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"name": "ngpColorSwatchPickerOrientation",
|
|
813
|
+
"type": "'horizontal' | 'vertical'",
|
|
814
|
+
"description": "The orientation of the swatch list.",
|
|
815
|
+
"isRequired": false,
|
|
816
|
+
"defaultValue": "'horizontal'"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
"name": "ngpColorSwatchPickerDisabled",
|
|
820
|
+
"type": "boolean",
|
|
821
|
+
"description": "The disabled state of the swatch picker.",
|
|
822
|
+
"isRequired": false,
|
|
823
|
+
"defaultValue": "false"
|
|
824
|
+
}
|
|
825
|
+
],
|
|
826
|
+
"outputs": [
|
|
827
|
+
{
|
|
828
|
+
"name": "ngpColorSwatchPickerValueChange",
|
|
829
|
+
"type": "Color",
|
|
830
|
+
"description": "Emits when the selected color changes."
|
|
831
|
+
}
|
|
832
|
+
]
|
|
833
|
+
},
|
|
433
834
|
"NgpComboboxPortal": {
|
|
434
835
|
"name": "NgpComboboxPortal",
|
|
435
836
|
"description": "",
|
|
@@ -1081,22 +1482,22 @@
|
|
|
1081
1482
|
}
|
|
1082
1483
|
]
|
|
1083
1484
|
},
|
|
1084
|
-
"
|
|
1085
|
-
"name": "
|
|
1485
|
+
"NgpDialogTitle": {
|
|
1486
|
+
"name": "NgpDialogTitle",
|
|
1086
1487
|
"description": "",
|
|
1087
|
-
"selector": "[
|
|
1488
|
+
"selector": "[ngpDialogTitle]",
|
|
1088
1489
|
"exportAs": [
|
|
1089
|
-
"
|
|
1490
|
+
"ngpDialogTitle"
|
|
1090
1491
|
],
|
|
1091
1492
|
"inputs": [],
|
|
1092
1493
|
"outputs": []
|
|
1093
1494
|
},
|
|
1094
|
-
"
|
|
1095
|
-
"name": "
|
|
1495
|
+
"NgpDialogDescription": {
|
|
1496
|
+
"name": "NgpDialogDescription",
|
|
1096
1497
|
"description": "",
|
|
1097
|
-
"selector": "[
|
|
1498
|
+
"selector": "[ngpDialogDescription]",
|
|
1098
1499
|
"exportAs": [
|
|
1099
|
-
"
|
|
1500
|
+
"ngpDialogDescription"
|
|
1100
1501
|
],
|
|
1101
1502
|
"inputs": [],
|
|
1102
1503
|
"outputs": []
|
|
@@ -2962,6 +3363,81 @@
|
|
|
2962
3363
|
}
|
|
2963
3364
|
]
|
|
2964
3365
|
},
|
|
3366
|
+
"NgpRating": {
|
|
3367
|
+
"name": "NgpRating",
|
|
3368
|
+
"description": "Apply the `ngpRating` directive to an element that represents the rating. It\nexposes the slider role and owns the value, keyboard, and form integration.\nProject the star markup once via the `*ngpRatingItem` structural directive.",
|
|
3369
|
+
"selector": "[ngpRating]",
|
|
3370
|
+
"exportAs": [
|
|
3371
|
+
"ngpRating"
|
|
3372
|
+
],
|
|
3373
|
+
"inputs": [
|
|
3374
|
+
{
|
|
3375
|
+
"name": "ngpRatingValue",
|
|
3376
|
+
"type": "number",
|
|
3377
|
+
"description": "The value of the rating.",
|
|
3378
|
+
"isRequired": false,
|
|
3379
|
+
"defaultValue": "0"
|
|
3380
|
+
},
|
|
3381
|
+
{
|
|
3382
|
+
"name": "ngpRatingCount",
|
|
3383
|
+
"type": "number",
|
|
3384
|
+
"description": "The number of items in the rating.",
|
|
3385
|
+
"isRequired": false,
|
|
3386
|
+
"defaultValue": "5"
|
|
3387
|
+
},
|
|
3388
|
+
{
|
|
3389
|
+
"name": "ngpRatingAllowHalf",
|
|
3390
|
+
"type": "boolean",
|
|
3391
|
+
"description": "Whether half values are allowed.",
|
|
3392
|
+
"isRequired": false,
|
|
3393
|
+
"defaultValue": "false"
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
"name": "ngpRatingDisabled",
|
|
3397
|
+
"type": "boolean",
|
|
3398
|
+
"description": "Whether the rating is disabled.",
|
|
3399
|
+
"isRequired": false,
|
|
3400
|
+
"defaultValue": "false"
|
|
3401
|
+
},
|
|
3402
|
+
{
|
|
3403
|
+
"name": "ngpRatingReadonly",
|
|
3404
|
+
"type": "boolean",
|
|
3405
|
+
"description": "Whether the rating is read-only.",
|
|
3406
|
+
"isRequired": false,
|
|
3407
|
+
"defaultValue": "false"
|
|
3408
|
+
},
|
|
3409
|
+
{
|
|
3410
|
+
"name": "ngpRatingClearable",
|
|
3411
|
+
"type": "boolean",
|
|
3412
|
+
"description": "Whether re-selecting the current value clears the rating to 0 (deselection).",
|
|
3413
|
+
"isRequired": false,
|
|
3414
|
+
"defaultValue": "false"
|
|
3415
|
+
},
|
|
3416
|
+
{
|
|
3417
|
+
"name": "ngpRatingValueText",
|
|
3418
|
+
"type": "(value: number, count: number) => string",
|
|
3419
|
+
"description": "Produce the `aria-valuetext` announced to assistive technology.",
|
|
3420
|
+
"isRequired": false
|
|
3421
|
+
}
|
|
3422
|
+
],
|
|
3423
|
+
"outputs": [
|
|
3424
|
+
{
|
|
3425
|
+
"name": "ngpRatingValueChange",
|
|
3426
|
+
"type": "number",
|
|
3427
|
+
"description": "Emits when the value changes."
|
|
3428
|
+
}
|
|
3429
|
+
]
|
|
3430
|
+
},
|
|
3431
|
+
"NgpRatingItem": {
|
|
3432
|
+
"name": "NgpRatingItem",
|
|
3433
|
+
"description": "A structural directive that renders one item (star) per `count`, driven by the\nparent `ngpRating`. Each generated element automatically receives the\n`data-checked`, `data-half` and `data-highlighted` attributes and has its\npointer interactions wired up via the `ngpRatingItem` state function.",
|
|
3434
|
+
"selector": "[ngpRatingItem]",
|
|
3435
|
+
"exportAs": [
|
|
3436
|
+
"ngpRatingItem"
|
|
3437
|
+
],
|
|
3438
|
+
"inputs": [],
|
|
3439
|
+
"outputs": []
|
|
3440
|
+
},
|
|
2965
3441
|
"NgpResize": {
|
|
2966
3442
|
"name": "NgpResize",
|
|
2967
3443
|
"description": "Apply the `ngpResize` directive to an element to listen for resize events.",
|
|
@@ -4518,6 +4994,28 @@
|
|
|
4518
4994
|
}
|
|
4519
4995
|
]
|
|
4520
4996
|
},
|
|
4997
|
+
"NgpRatingConfig": {
|
|
4998
|
+
"name": "NgpRatingConfig",
|
|
4999
|
+
"properties": [
|
|
5000
|
+
{
|
|
5001
|
+
"name": "count",
|
|
5002
|
+
"type": "number",
|
|
5003
|
+
"description": "The default number of items in the rating.",
|
|
5004
|
+
"default": "5"
|
|
5005
|
+
},
|
|
5006
|
+
{
|
|
5007
|
+
"name": "clearable",
|
|
5008
|
+
"type": "boolean",
|
|
5009
|
+
"description": "Whether re-selecting the current value clears the rating to 0 (deselection).",
|
|
5010
|
+
"default": "false"
|
|
5011
|
+
},
|
|
5012
|
+
{
|
|
5013
|
+
"name": "valueText",
|
|
5014
|
+
"type": "(value: number, count: number) => string",
|
|
5015
|
+
"description": "Produce the `aria-valuetext` announced to assistive technology. Override for localisation."
|
|
5016
|
+
}
|
|
5017
|
+
]
|
|
5018
|
+
},
|
|
4521
5019
|
"NgpSelectConfig": {
|
|
4522
5020
|
"name": "NgpSelectConfig",
|
|
4523
5021
|
"properties": [
|
|
@@ -316,6 +316,151 @@
|
|
|
316
316
|
"hasSizes": true
|
|
317
317
|
}
|
|
318
318
|
},
|
|
319
|
+
{
|
|
320
|
+
"name": "collapsible",
|
|
321
|
+
"entryPoint": "ng-primitives/collapsible",
|
|
322
|
+
"exports": [
|
|
323
|
+
"NgpCollapsible",
|
|
324
|
+
"NgpCollapsibleStateToken",
|
|
325
|
+
"ngpCollapsible",
|
|
326
|
+
"injectCollapsibleState",
|
|
327
|
+
"provideCollapsibleState",
|
|
328
|
+
"type NgpCollapsibleState",
|
|
329
|
+
"type NgpCollapsibleProps",
|
|
330
|
+
"NgpCollapsibleTrigger",
|
|
331
|
+
"NgpCollapsibleTriggerStateToken",
|
|
332
|
+
"ngpCollapsibleTrigger",
|
|
333
|
+
"injectCollapsibleTriggerState",
|
|
334
|
+
"provideCollapsibleTriggerState",
|
|
335
|
+
"type NgpCollapsibleTriggerState",
|
|
336
|
+
"type NgpCollapsibleTriggerProps",
|
|
337
|
+
"NgpCollapsibleContent",
|
|
338
|
+
"NgpCollapsibleContentStateToken",
|
|
339
|
+
"ngpCollapsibleContent",
|
|
340
|
+
"injectCollapsibleContentState",
|
|
341
|
+
"provideCollapsibleContentState",
|
|
342
|
+
"type NgpCollapsibleContentState",
|
|
343
|
+
"type NgpCollapsibleContentProps"
|
|
344
|
+
],
|
|
345
|
+
"hasSecondaryEntryPoint": true,
|
|
346
|
+
"category": "utility",
|
|
347
|
+
"description": "A collapsible shows and hides an associated section of content, following the WAI-ARIA disclosure pattern.",
|
|
348
|
+
"accessibility": [
|
|
349
|
+
"ARIA disclosure",
|
|
350
|
+
"ARIA design"
|
|
351
|
+
],
|
|
352
|
+
"examples": [
|
|
353
|
+
{
|
|
354
|
+
"name": "example-0",
|
|
355
|
+
"code": "import {\n NgpCollapsible,\n NgpCollapsibleTrigger,\n NgpCollapsibleContent,\n} from 'ng-primitives/collapsible';",
|
|
356
|
+
"description": "Import"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "example-1",
|
|
360
|
+
"code": "<div ngpCollapsible>\n <button ngpCollapsibleTrigger>Show details</button>\n <div ngpCollapsibleContent>The content that is shown and hidden.</div>\n</div>",
|
|
361
|
+
"description": "Usage"
|
|
362
|
+
}
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "color",
|
|
367
|
+
"entryPoint": "ng-primitives/color",
|
|
368
|
+
"exports": [
|
|
369
|
+
"Color",
|
|
370
|
+
"ColorSpace",
|
|
371
|
+
"ColorChannel",
|
|
372
|
+
"ColorChannelRange",
|
|
373
|
+
"NgpColorSlider",
|
|
374
|
+
"NgpColorSliderStateToken",
|
|
375
|
+
"ngpColorSlider",
|
|
376
|
+
"injectColorSliderState",
|
|
377
|
+
"provideColorSliderState",
|
|
378
|
+
"type NgpColorSliderState",
|
|
379
|
+
"type NgpColorSliderProps",
|
|
380
|
+
"NgpColorSliderTrack",
|
|
381
|
+
"NgpColorSliderTrackStateToken",
|
|
382
|
+
"ngpColorSliderTrack",
|
|
383
|
+
"injectColorSliderTrackState",
|
|
384
|
+
"provideColorSliderTrackState",
|
|
385
|
+
"type NgpColorSliderTrackState",
|
|
386
|
+
"type NgpColorSliderTrackProps",
|
|
387
|
+
"NgpColorSliderThumb",
|
|
388
|
+
"NgpColorSliderThumbStateToken",
|
|
389
|
+
"ngpColorSliderThumb",
|
|
390
|
+
"injectColorSliderThumbState",
|
|
391
|
+
"provideColorSliderThumbState",
|
|
392
|
+
"type NgpColorSliderThumbState",
|
|
393
|
+
"type NgpColorSliderThumbProps",
|
|
394
|
+
"NgpColorArea",
|
|
395
|
+
"NgpColorAreaStateToken",
|
|
396
|
+
"ngpColorArea",
|
|
397
|
+
"injectColorAreaState",
|
|
398
|
+
"provideColorAreaState",
|
|
399
|
+
"type NgpColorAreaState",
|
|
400
|
+
"type NgpColorAreaProps",
|
|
401
|
+
"NgpColorAreaThumb",
|
|
402
|
+
"NgpColorAreaThumbStateToken",
|
|
403
|
+
"ngpColorAreaThumb",
|
|
404
|
+
"injectColorAreaThumbState",
|
|
405
|
+
"provideColorAreaThumbState",
|
|
406
|
+
"type NgpColorAreaThumbState",
|
|
407
|
+
"type NgpColorAreaThumbProps",
|
|
408
|
+
"NgpColorField",
|
|
409
|
+
"NgpColorFieldStateToken",
|
|
410
|
+
"ngpColorField",
|
|
411
|
+
"injectColorFieldState",
|
|
412
|
+
"provideColorFieldState",
|
|
413
|
+
"type NgpColorFieldState",
|
|
414
|
+
"type NgpColorFieldProps",
|
|
415
|
+
"NgpColorPicker",
|
|
416
|
+
"NgpColorPickerStateToken",
|
|
417
|
+
"ngpColorPicker",
|
|
418
|
+
"injectColorPickerState",
|
|
419
|
+
"provideColorPickerState",
|
|
420
|
+
"type NgpColorPickerState",
|
|
421
|
+
"type NgpColorPickerProps",
|
|
422
|
+
"NgpColorSwatch",
|
|
423
|
+
"NgpColorSwatchStateToken",
|
|
424
|
+
"ngpColorSwatch",
|
|
425
|
+
"injectColorSwatchState",
|
|
426
|
+
"provideColorSwatchState",
|
|
427
|
+
"type NgpColorSwatchState",
|
|
428
|
+
"type NgpColorSwatchProps",
|
|
429
|
+
"NgpColorWheel",
|
|
430
|
+
"NgpColorWheelStateToken",
|
|
431
|
+
"ngpColorWheel",
|
|
432
|
+
"injectColorWheelState",
|
|
433
|
+
"provideColorWheelState",
|
|
434
|
+
"type NgpColorWheelState",
|
|
435
|
+
"type NgpColorWheelProps",
|
|
436
|
+
"NgpColorWheelThumb",
|
|
437
|
+
"NgpColorWheelThumbStateToken",
|
|
438
|
+
"ngpColorWheelThumb",
|
|
439
|
+
"injectColorWheelThumbState",
|
|
440
|
+
"provideColorWheelThumbState",
|
|
441
|
+
"type NgpColorWheelThumbState",
|
|
442
|
+
"type NgpColorWheelThumbProps",
|
|
443
|
+
"NgpColorSwatchPicker",
|
|
444
|
+
"NgpColorSwatchPickerStateToken",
|
|
445
|
+
"ngpColorSwatchPicker",
|
|
446
|
+
"injectColorSwatchPickerState",
|
|
447
|
+
"provideColorSwatchPickerState",
|
|
448
|
+
"type NgpColorSwatchPickerState",
|
|
449
|
+
"type NgpColorSwatchPickerProps",
|
|
450
|
+
"NgpColorSwatchPickerItem",
|
|
451
|
+
"NgpColorSwatchPickerItemStateToken",
|
|
452
|
+
"ngpColorSwatchPickerItem",
|
|
453
|
+
"injectColorSwatchPickerItemState",
|
|
454
|
+
"provideColorSwatchPickerItemState",
|
|
455
|
+
"type NgpColorSwatchPickerItemState",
|
|
456
|
+
"type NgpColorSwatchPickerItemProps"
|
|
457
|
+
],
|
|
458
|
+
"hasSecondaryEntryPoint": true,
|
|
459
|
+
"category": "utility",
|
|
460
|
+
"description": "color primitive component",
|
|
461
|
+
"accessibility": [],
|
|
462
|
+
"examples": []
|
|
463
|
+
},
|
|
319
464
|
{
|
|
320
465
|
"name": "combobox",
|
|
321
466
|
"entryPoint": "ng-primitives/combobox",
|
|
@@ -541,10 +686,44 @@
|
|
|
541
686
|
"NgpDialog",
|
|
542
687
|
"injectDialogRef",
|
|
543
688
|
"NgpDialogRef",
|
|
689
|
+
"NgpDialogContext",
|
|
690
|
+
"NgpDialogManager",
|
|
691
|
+
"NgpDialogDescriptionStateToken",
|
|
692
|
+
"ngpDialogDescription",
|
|
693
|
+
"injectDialogDescriptionState",
|
|
694
|
+
"provideDialogDescriptionState",
|
|
695
|
+
"type NgpDialogDescriptionState",
|
|
696
|
+
"type NgpDialogDescriptionProps",
|
|
697
|
+
"NgpDialogOverlayStateToken",
|
|
698
|
+
"ngpDialogOverlay",
|
|
699
|
+
"injectDialogOverlayState",
|
|
700
|
+
"provideDialogOverlayState",
|
|
701
|
+
"type NgpDialogOverlayState",
|
|
702
|
+
"type NgpDialogOverlayProps",
|
|
703
|
+
"NgpDialogPanelStateToken",
|
|
704
|
+
"ngpDialogPanel",
|
|
705
|
+
"injectDialogPanelState",
|
|
706
|
+
"provideDialogPanelState",
|
|
707
|
+
"type NgpDialogPanelState",
|
|
708
|
+
"type NgpDialogPanelProps",
|
|
709
|
+
"NgpDialogTitleStateToken",
|
|
710
|
+
"ngpDialogTitle",
|
|
711
|
+
"injectDialogTitleState",
|
|
712
|
+
"provideDialogTitleState",
|
|
713
|
+
"type NgpDialogTitleState",
|
|
714
|
+
"type NgpDialogTitleProps",
|
|
715
|
+
"NgpDialogTriggerStateToken",
|
|
716
|
+
"ngpDialogTrigger",
|
|
717
|
+
"injectDialogTriggerState",
|
|
718
|
+
"provideDialogTriggerState",
|
|
719
|
+
"type NgpDialogTriggerState",
|
|
720
|
+
"type NgpDialogTriggerProps",
|
|
721
|
+
"NgpDialogStateToken",
|
|
722
|
+
"ngpDialog",
|
|
544
723
|
"injectDialogState",
|
|
545
724
|
"provideDialogState",
|
|
546
|
-
"
|
|
547
|
-
"
|
|
725
|
+
"type NgpDialogState",
|
|
726
|
+
"type NgpDialogProps"
|
|
548
727
|
],
|
|
549
728
|
"hasSecondaryEntryPoint": true,
|
|
550
729
|
"category": "feedback",
|
|
@@ -1388,6 +1567,52 @@
|
|
|
1388
1567
|
"hasSizes": false
|
|
1389
1568
|
}
|
|
1390
1569
|
},
|
|
1570
|
+
{
|
|
1571
|
+
"name": "rating",
|
|
1572
|
+
"entryPoint": "ng-primitives/rating",
|
|
1573
|
+
"exports": [
|
|
1574
|
+
"NgpRating",
|
|
1575
|
+
"NgpRatingStateToken",
|
|
1576
|
+
"ngpRating",
|
|
1577
|
+
"injectRatingState",
|
|
1578
|
+
"provideRatingState",
|
|
1579
|
+
"type NgpRatingState",
|
|
1580
|
+
"type NgpRatingProps",
|
|
1581
|
+
"type NgpRatingItemState",
|
|
1582
|
+
"NgpRatingConfig",
|
|
1583
|
+
"provideRatingConfig",
|
|
1584
|
+
"NgpRatingItem",
|
|
1585
|
+
"type NgpRatingItemContext",
|
|
1586
|
+
"NgpRatingItemStateToken",
|
|
1587
|
+
"ngpRatingItem",
|
|
1588
|
+
"injectRatingItemState",
|
|
1589
|
+
"provideRatingItemState",
|
|
1590
|
+
"type NgpRatingItemProps"
|
|
1591
|
+
],
|
|
1592
|
+
"hasSecondaryEntryPoint": true,
|
|
1593
|
+
"category": "utility",
|
|
1594
|
+
"description": "Capture a star rating within a range.",
|
|
1595
|
+
"accessibility": [
|
|
1596
|
+
"ARIA design"
|
|
1597
|
+
],
|
|
1598
|
+
"examples": [
|
|
1599
|
+
{
|
|
1600
|
+
"name": "example-0",
|
|
1601
|
+
"code": "<div ngpRating [(ngpRatingValue)]=\"value\" [ngpRatingCount]=\"5\">\n <span *ngpRatingItem=\"let star\">{{ star.checked ? '★' : '☆' }}</span>\n</div>",
|
|
1602
|
+
"description": "Usage"
|
|
1603
|
+
},
|
|
1604
|
+
{
|
|
1605
|
+
"name": "example-1",
|
|
1606
|
+
"code": "import { provideRatingConfig } from 'ng-primitives/rating';\n\nbootstrapApplication(AppComponent, {\n providers: [\n provideRatingConfig({\n count: 5,\n clearable: false,\n valueText: (value, count) => `${value} out of ${count} stars`,\n }),\n ],\n});",
|
|
1607
|
+
"description": "Global Configuration"
|
|
1608
|
+
}
|
|
1609
|
+
],
|
|
1610
|
+
"reusableComponent": {
|
|
1611
|
+
"code": "import { Component } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { heroStarSolid } from '@ng-icons/heroicons/solid';\nimport { injectRatingState, NgpRating, NgpRatingItem } from 'ng-primitives/rating';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-rating',\n hostDirectives: [\n {\n directive: NgpRating,\n inputs: [\n 'ngpRatingValue:value',\n 'ngpRatingCount:count',\n 'ngpRatingAllowHalf:allowHalf',\n 'ngpRatingDisabled:disabled',\n 'ngpRatingReadonly:readonly',\n 'ngpRatingClearable:clearable',\n ],\n outputs: ['ngpRatingValueChange:valueChange'],\n },\n ],\n imports: [NgIcon, NgpRatingItem],\n providers: [provideIcons({ heroStarSolid }), provideValueAccessor(Rating)],\n template: `\n <span class=\"star\" *ngpRatingItem=\"let star\">\n <ng-icon class=\"star-background\" name=\"heroStarSolid\" />\n <span class=\"star-fill\" [style.width.%]=\"star.fraction * 100\">\n <ng-icon name=\"heroStarSolid\" />\n </span>\n </span>\n `,\n styles: `\n :host {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n outline: none;\n border-radius: 0.5rem;\n cursor: pointer;\n }\n\n :host[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n :host[data-readonly] {\n cursor: default;\n }\n\n :host[data-focus-visible] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 2px;\n }\n\n .star {\n position: relative;\n display: inline-flex;\n font-size: 1.5rem;\n line-height: 1;\n color: var(--ngp-background-secondary);\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .star-fill {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n display: inline-flex;\n overflow: hidden;\n color: var(--ngp-primary);\n }\n `,\n host: {\n '(focusout)': 'onTouched?.()',\n },\n})\nexport class Rating implements ControlValueAccessor {\n /** Access the rating state. */\n private readonly state = injectRatingState();\n\n /** The onChange callback function. */\n private onChange?: ChangeFn<number>;\n\n /** The onTouched callback function. */\n protected onTouched?: TouchedFn;\n\n constructor() {\n // Whenever the user interacts with the rating, call onChange with the new value.\n this.state()\n .valueChange.pipe(takeUntilDestroyed())\n .subscribe(value => this.onChange?.(value));\n }\n\n writeValue(value: number): void {\n // writing a value from the model must not re-emit through onChange\n this.state().setValue(value, { emit: false });\n }\n\n registerOnChange(fn: ChangeFn<number>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.state().setDisabled(isDisabled);\n }\n}\n",
|
|
1612
|
+
"hasVariants": false,
|
|
1613
|
+
"hasSizes": true
|
|
1614
|
+
}
|
|
1615
|
+
},
|
|
1391
1616
|
{
|
|
1392
1617
|
"name": "resize",
|
|
1393
1618
|
"entryPoint": "ng-primitives/resize",
|
|
@@ -160,6 +160,13 @@
|
|
|
160
160
|
"hasVariants": false,
|
|
161
161
|
"hasSizes": false
|
|
162
162
|
},
|
|
163
|
+
{
|
|
164
|
+
"name": "rating",
|
|
165
|
+
"code": "import { Component } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { heroStarSolid } from '@ng-icons/heroicons/solid';\nimport { injectRatingState, NgpRating, NgpRatingItem } from 'ng-primitives/rating';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-rating',\n hostDirectives: [\n {\n directive: NgpRating,\n inputs: [\n 'ngpRatingValue:value',\n 'ngpRatingCount:count',\n 'ngpRatingAllowHalf:allowHalf',\n 'ngpRatingDisabled:disabled',\n 'ngpRatingReadonly:readonly',\n 'ngpRatingClearable:clearable',\n ],\n outputs: ['ngpRatingValueChange:valueChange'],\n },\n ],\n imports: [NgIcon, NgpRatingItem],\n providers: [provideIcons({ heroStarSolid }), provideValueAccessor(Rating)],\n template: `\n <span class=\"star\" *ngpRatingItem=\"let star\">\n <ng-icon class=\"star-background\" name=\"heroStarSolid\" />\n <span class=\"star-fill\" [style.width.%]=\"star.fraction * 100\">\n <ng-icon name=\"heroStarSolid\" />\n </span>\n </span>\n `,\n styles: `\n :host {\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n outline: none;\n border-radius: 0.5rem;\n cursor: pointer;\n }\n\n :host[data-disabled] {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n :host[data-readonly] {\n cursor: default;\n }\n\n :host[data-focus-visible] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 2px;\n }\n\n .star {\n position: relative;\n display: inline-flex;\n font-size: 1.5rem;\n line-height: 1;\n color: var(--ngp-background-secondary);\n transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .star-fill {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n display: inline-flex;\n overflow: hidden;\n color: var(--ngp-primary);\n }\n `,\n host: {\n '(focusout)': 'onTouched?.()',\n },\n})\nexport class Rating implements ControlValueAccessor {\n /** Access the rating state. */\n private readonly state = injectRatingState();\n\n /** The onChange callback function. */\n private onChange?: ChangeFn<number>;\n\n /** The onTouched callback function. */\n protected onTouched?: TouchedFn;\n\n constructor() {\n // Whenever the user interacts with the rating, call onChange with the new value.\n this.state()\n .valueChange.pipe(takeUntilDestroyed())\n .subscribe(value => this.onChange?.(value));\n }\n\n writeValue(value: number): void {\n // writing a value from the model must not re-emit through onChange\n this.state().setValue(value, { emit: false });\n }\n\n registerOnChange(fn: ChangeFn<number>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.state().setDisabled(isDisabled);\n }\n}\n",
|
|
166
|
+
"primitive": "rating",
|
|
167
|
+
"hasVariants": false,
|
|
168
|
+
"hasSizes": true
|
|
169
|
+
},
|
|
163
170
|
{
|
|
164
171
|
"name": "search",
|
|
165
172
|
"code": "import { Component, input, model } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { heroMagnifyingGlass } from '@ng-icons/heroicons/outline';\nimport { NgpButton } from 'ng-primitives/button';\nimport { NgpInput } from 'ng-primitives/input';\nimport { NgpSearch, NgpSearchClear } from 'ng-primitives/search';\nimport { ChangeFn, provideValueAccessor, TouchedFn } from 'ng-primitives/utils';\n\n@Component({\n selector: 'app-search',\n hostDirectives: [NgpSearch],\n imports: [NgIcon, NgpSearchClear, NgpInput, NgpButton],\n providers: [provideValueAccessor(Search), provideIcons({ heroMagnifyingGlass })],\n template: `\n <ng-icon name=\"heroMagnifyingGlass\" />\n <input\n [value]=\"query()\"\n [placeholder]=\"placeholder()\"\n (input)=\"onQueryChange($event)\"\n ngpInput\n type=\"search\"\n />\n <button ngpSearchClear ngpButton aria-label=\"Clear search\">Clear</button>\n `,\n styles: `\n :host {\n display: block;\n position: relative;\n }\n\n [ngpInput] {\n height: 36px;\n width: 100%;\n border-radius: 8px;\n padding: 0 16px 0 40px;\n border: none;\n background: var(--ngp-background);\n box-shadow: var(--ngp-input-shadow);\n outline: none;\n }\n\n /* clears the 'X' from Chrome */\n [ngpInput]::-webkit-search-decoration,\n [ngpInput]::-webkit-search-cancel-button,\n [ngpInput]::-webkit-search-results-button,\n [ngpInput]::-webkit-search-results-decoration {\n display: none;\n }\n\n [ngpInput][data-focus] {\n outline: 2px solid var(--ngp-focus-ring);\n outline-offset: 0px;\n }\n\n [ngpInput]::placeholder {\n color: var(--ngp-text-placeholder);\n }\n\n [ngpButton] {\n position: absolute;\n top: 0;\n right: 0;\n height: 36px;\n padding: 0 16px;\n border: none;\n border-radius: 0 8px 8px 0;\n background-color: transparent;\n color: var(--ngp-text-blue);\n font-size: 0.875rem;\n line-height: 1.25rem;\n cursor: pointer;\n outline: none;\n display: none;\n }\n\n [ngpButton]:not([data-empty]) {\n display: block;\n }\n\n ng-icon {\n position: absolute;\n font-size: 1.25rem;\n top: 18px;\n left: 12px;\n transform: translateY(-50%);\n color: var(--ngp-text-tertiary);\n }\n `,\n host: {\n '(focusout)': 'onTouched?.()',\n },\n})\nexport class Search implements ControlValueAccessor {\n /** The search query */\n readonly query = model<string>('');\n\n /** The placeholder text */\n readonly placeholder = input<string>('');\n\n /** The function to call when the value changes */\n private onChange?: ChangeFn<string>;\n\n /** The function to call when the control is touched */\n protected onTouched?: TouchedFn;\n\n writeValue(value: string): void {\n this.query.set(value);\n }\n\n registerOnChange(fn: ChangeFn<string>): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: TouchedFn): void {\n this.onTouched = fn;\n }\n\n protected onQueryChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.query.set(input.value);\n this.onChange?.(input.value);\n }\n}\n",
|