@carbon/web-components 2.51.1 → 2.52.0-rc.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/custom-elements.json +477 -0
- package/es/components/checkbox/checkbox.js +8 -2
- package/es/components/checkbox/checkbox.js.map +1 -1
- package/es/components/contained-list/contained-list-item.d.ts +1 -1
- package/es/components/contained-list/contained-list-item.d.ts.map +1 -1
- package/es/components/contained-list/contained-list-item.js +3 -11
- package/es/components/contained-list/contained-list-item.js.map +1 -1
- package/es/components/contained-list/contained-list.scss.js +1 -1
- package/es/components/contained-list/contained-list.scss.js.map +1 -1
- package/es/components/dropdown/dropdown.d.ts +4 -0
- package/es/components/dropdown/dropdown.d.ts.map +1 -1
- package/es/components/dropdown/dropdown.js +3 -0
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/fluid-dropdown/fluid-dropdown-skeleton.d.ts +18 -0
- package/es/components/fluid-dropdown/fluid-dropdown-skeleton.d.ts.map +1 -0
- package/es/components/fluid-dropdown/fluid-dropdown-skeleton.js +47 -0
- package/es/components/fluid-dropdown/fluid-dropdown-skeleton.js.map +1 -0
- package/es/components/fluid-dropdown/fluid-dropdown.d.ts +21 -0
- package/es/components/fluid-dropdown/fluid-dropdown.d.ts.map +1 -0
- package/es/components/fluid-dropdown/fluid-dropdown.js +58 -0
- package/es/components/fluid-dropdown/fluid-dropdown.js.map +1 -0
- package/es/components/fluid-dropdown/fluid-dropdown.scss.js +15 -0
- package/es/components/fluid-dropdown/fluid-dropdown.scss.js.map +1 -0
- package/es/components/fluid-dropdown/index.d.ts +9 -0
- package/es/components/fluid-dropdown/index.d.ts.map +1 -0
- package/es/components/fluid-dropdown/index.js +9 -0
- package/es/components/list/list.scss.js +1 -1
- package/es-custom/components/checkbox/checkbox.js +8 -2
- package/es-custom/components/checkbox/checkbox.js.map +1 -1
- package/es-custom/components/contained-list/contained-list-item.d.ts +1 -1
- package/es-custom/components/contained-list/contained-list-item.d.ts.map +1 -1
- package/es-custom/components/contained-list/contained-list-item.js +3 -11
- package/es-custom/components/contained-list/contained-list-item.js.map +1 -1
- package/es-custom/components/contained-list/contained-list.scss.js +1 -1
- package/es-custom/components/contained-list/contained-list.scss.js.map +1 -1
- package/es-custom/components/dropdown/dropdown.d.ts +4 -0
- package/es-custom/components/dropdown/dropdown.d.ts.map +1 -1
- package/es-custom/components/dropdown/dropdown.js +3 -0
- package/es-custom/components/dropdown/dropdown.js.map +1 -1
- package/es-custom/components/fluid-dropdown/fluid-dropdown-skeleton.d.ts +18 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown-skeleton.d.ts.map +1 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown-skeleton.js +47 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown-skeleton.js.map +1 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown.d.ts +21 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown.d.ts.map +1 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown.js +58 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown.js.map +1 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown.scss.js +15 -0
- package/es-custom/components/fluid-dropdown/fluid-dropdown.scss.js.map +1 -0
- package/es-custom/components/fluid-dropdown/index.d.ts +9 -0
- package/es-custom/components/fluid-dropdown/index.d.ts.map +1 -0
- package/es-custom/components/fluid-dropdown/index.js +9 -0
- package/es-custom/components/list/list.scss.js +1 -1
- package/lib/components/contained-list/contained-list-item.d.ts +1 -1
- package/lib/components/contained-list/contained-list-item.d.ts.map +1 -1
- package/lib/components/dropdown/dropdown.d.ts +4 -0
- package/lib/components/dropdown/dropdown.d.ts.map +1 -1
- package/lib/components/fluid-dropdown/fluid-dropdown-skeleton.d.ts +18 -0
- package/lib/components/fluid-dropdown/fluid-dropdown-skeleton.d.ts.map +1 -0
- package/lib/components/fluid-dropdown/fluid-dropdown.d.ts +21 -0
- package/lib/components/fluid-dropdown/fluid-dropdown.d.ts.map +1 -0
- package/lib/components/fluid-dropdown/index.d.ts +9 -0
- package/lib/components/fluid-dropdown/index.d.ts.map +1 -0
- package/package.json +6 -6
- package/scss/components/contained-list/contained-list.scss +13 -1
- package/scss/components/fluid-dropdown/fluid-dropdown.scss +234 -0
- package/telemetry.yml +2 -0
package/custom-elements.json
CHANGED
|
@@ -2667,6 +2667,12 @@
|
|
|
2667
2667
|
"type": "DROPDOWN_TYPE",
|
|
2668
2668
|
"default": "\"\""
|
|
2669
2669
|
},
|
|
2670
|
+
{
|
|
2671
|
+
"name": "isFluid",
|
|
2672
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
2673
|
+
"type": "boolean",
|
|
2674
|
+
"default": "false"
|
|
2675
|
+
},
|
|
2670
2676
|
{
|
|
2671
2677
|
"name": "warn",
|
|
2672
2678
|
"description": "Specify whether the control is currently in warning state",
|
|
@@ -2868,6 +2874,13 @@
|
|
|
2868
2874
|
"type": "DROPDOWN_TYPE",
|
|
2869
2875
|
"default": "\"\""
|
|
2870
2876
|
},
|
|
2877
|
+
{
|
|
2878
|
+
"name": "isFluid",
|
|
2879
|
+
"attribute": "isFluid",
|
|
2880
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
2881
|
+
"type": "boolean",
|
|
2882
|
+
"default": "false"
|
|
2883
|
+
},
|
|
2871
2884
|
{
|
|
2872
2885
|
"name": "warn",
|
|
2873
2886
|
"attribute": "warn",
|
|
@@ -5859,6 +5872,12 @@
|
|
|
5859
5872
|
"type": "DROPDOWN_TYPE",
|
|
5860
5873
|
"default": "\"\""
|
|
5861
5874
|
},
|
|
5875
|
+
{
|
|
5876
|
+
"name": "isFluid",
|
|
5877
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
5878
|
+
"type": "boolean",
|
|
5879
|
+
"default": "false"
|
|
5880
|
+
},
|
|
5862
5881
|
{
|
|
5863
5882
|
"name": "warn",
|
|
5864
5883
|
"description": "Specify whether the control is currently in warning state",
|
|
@@ -6015,6 +6034,13 @@
|
|
|
6015
6034
|
"type": "DROPDOWN_TYPE",
|
|
6016
6035
|
"default": "\"\""
|
|
6017
6036
|
},
|
|
6037
|
+
{
|
|
6038
|
+
"name": "isFluid",
|
|
6039
|
+
"attribute": "isFluid",
|
|
6040
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
6041
|
+
"type": "boolean",
|
|
6042
|
+
"default": "false"
|
|
6043
|
+
},
|
|
6018
6044
|
{
|
|
6019
6045
|
"name": "warn",
|
|
6020
6046
|
"attribute": "warn",
|
|
@@ -6498,6 +6524,444 @@
|
|
|
6498
6524
|
}
|
|
6499
6525
|
]
|
|
6500
6526
|
},
|
|
6527
|
+
{
|
|
6528
|
+
"name": "cds-fluid-dropdown-skeleton",
|
|
6529
|
+
"path": "./src/components/fluid-dropdown/fluid-dropdown-skeleton.ts",
|
|
6530
|
+
"description": "Fluid dropdown skeleton.",
|
|
6531
|
+
"attributes": [
|
|
6532
|
+
{
|
|
6533
|
+
"name": "hide-label",
|
|
6534
|
+
"description": "Specify whether the label should be hidden, or not.",
|
|
6535
|
+
"type": "boolean",
|
|
6536
|
+
"default": "false"
|
|
6537
|
+
},
|
|
6538
|
+
{
|
|
6539
|
+
"name": "size",
|
|
6540
|
+
"description": "Specify the size of the ListBox.",
|
|
6541
|
+
"type": "DROPDOWN_SIZE",
|
|
6542
|
+
"default": "\"md\""
|
|
6543
|
+
}
|
|
6544
|
+
],
|
|
6545
|
+
"properties": [
|
|
6546
|
+
{
|
|
6547
|
+
"name": "hideLabel",
|
|
6548
|
+
"attribute": "hide-label",
|
|
6549
|
+
"description": "Specify whether the label should be hidden, or not.",
|
|
6550
|
+
"type": "boolean",
|
|
6551
|
+
"default": "false"
|
|
6552
|
+
},
|
|
6553
|
+
{
|
|
6554
|
+
"name": "size",
|
|
6555
|
+
"attribute": "size",
|
|
6556
|
+
"description": "Specify the size of the ListBox.",
|
|
6557
|
+
"type": "DROPDOWN_SIZE",
|
|
6558
|
+
"default": "\"md\""
|
|
6559
|
+
},
|
|
6560
|
+
{
|
|
6561
|
+
"name": "styles",
|
|
6562
|
+
"default": "\"styles\""
|
|
6563
|
+
}
|
|
6564
|
+
]
|
|
6565
|
+
},
|
|
6566
|
+
{
|
|
6567
|
+
"name": "cds-fluid-dropdown",
|
|
6568
|
+
"path": "./src/components/fluid-dropdown/fluid-dropdown.ts",
|
|
6569
|
+
"description": "Fluid dropdown.",
|
|
6570
|
+
"attributes": [
|
|
6571
|
+
{
|
|
6572
|
+
"name": "is-condensed",
|
|
6573
|
+
"type": "boolean",
|
|
6574
|
+
"default": "false"
|
|
6575
|
+
},
|
|
6576
|
+
{
|
|
6577
|
+
"name": "aria-label",
|
|
6578
|
+
"description": "'aria-label' of the ListBox component.\nSpecify a label to be read by screen readers on the container node",
|
|
6579
|
+
"type": "string",
|
|
6580
|
+
"default": "\"\""
|
|
6581
|
+
},
|
|
6582
|
+
{
|
|
6583
|
+
"name": "direction",
|
|
6584
|
+
"description": "Specify the direction of the dropdown. Can be either top or bottom.",
|
|
6585
|
+
"type": "DROPDOWN_DIRECTION",
|
|
6586
|
+
"default": "\"bottom\""
|
|
6587
|
+
},
|
|
6588
|
+
{
|
|
6589
|
+
"name": "autoalign",
|
|
6590
|
+
"description": "Specify whether auto align functionality should be applied",
|
|
6591
|
+
"type": "boolean",
|
|
6592
|
+
"default": "false"
|
|
6593
|
+
},
|
|
6594
|
+
{
|
|
6595
|
+
"name": "disabled",
|
|
6596
|
+
"description": "`true` if this dropdown should be disabled.",
|
|
6597
|
+
"type": "boolean",
|
|
6598
|
+
"default": "false"
|
|
6599
|
+
},
|
|
6600
|
+
{
|
|
6601
|
+
"name": "helper-text",
|
|
6602
|
+
"description": "The helper text.",
|
|
6603
|
+
"type": "string",
|
|
6604
|
+
"default": "\"\""
|
|
6605
|
+
},
|
|
6606
|
+
{
|
|
6607
|
+
"name": "hide-label",
|
|
6608
|
+
"description": "Specify whether the title text should be hidden or not",
|
|
6609
|
+
"type": "boolean",
|
|
6610
|
+
"default": "false"
|
|
6611
|
+
},
|
|
6612
|
+
{
|
|
6613
|
+
"name": "invalid-text",
|
|
6614
|
+
"description": "Message which is displayed if the value is invalid.",
|
|
6615
|
+
"type": "string",
|
|
6616
|
+
"default": "\"\""
|
|
6617
|
+
},
|
|
6618
|
+
{
|
|
6619
|
+
"name": "title-text",
|
|
6620
|
+
"description": "Provide the title text that will be read by a screen reader when visiting this control",
|
|
6621
|
+
"type": "string",
|
|
6622
|
+
"default": "\"\""
|
|
6623
|
+
},
|
|
6624
|
+
{
|
|
6625
|
+
"name": "name",
|
|
6626
|
+
"description": "Name for the dropdown in the `FormData`",
|
|
6627
|
+
"type": "string",
|
|
6628
|
+
"default": "\"\""
|
|
6629
|
+
},
|
|
6630
|
+
{
|
|
6631
|
+
"name": "open",
|
|
6632
|
+
"description": "`true` if this dropdown should be open.",
|
|
6633
|
+
"type": "boolean",
|
|
6634
|
+
"default": "false"
|
|
6635
|
+
},
|
|
6636
|
+
{
|
|
6637
|
+
"name": "read-only",
|
|
6638
|
+
"description": "Whether or not the Dropdown is readonly",
|
|
6639
|
+
"type": "boolean",
|
|
6640
|
+
"default": "false"
|
|
6641
|
+
},
|
|
6642
|
+
{
|
|
6643
|
+
"name": "size",
|
|
6644
|
+
"description": "Dropdown size.",
|
|
6645
|
+
"type": "DROPDOWN_SIZE",
|
|
6646
|
+
"default": "\"md\""
|
|
6647
|
+
},
|
|
6648
|
+
{
|
|
6649
|
+
"name": "toggle-label-closed",
|
|
6650
|
+
"description": "The `aria-label` attribute for the UI indicating the closed state.",
|
|
6651
|
+
"type": "string",
|
|
6652
|
+
"default": "\"\""
|
|
6653
|
+
},
|
|
6654
|
+
{
|
|
6655
|
+
"name": "toggle-label-open",
|
|
6656
|
+
"description": "The `aria-label` attribute for the UI indicating the open state.",
|
|
6657
|
+
"type": "string",
|
|
6658
|
+
"default": "\"\""
|
|
6659
|
+
},
|
|
6660
|
+
{
|
|
6661
|
+
"name": "label",
|
|
6662
|
+
"description": "Generic label that will be used as the textual representation of what this field is for",
|
|
6663
|
+
"type": "string",
|
|
6664
|
+
"default": "\"\""
|
|
6665
|
+
},
|
|
6666
|
+
{
|
|
6667
|
+
"name": "type",
|
|
6668
|
+
"description": "`true` if this dropdown should use the inline UI variant.",
|
|
6669
|
+
"type": "DROPDOWN_TYPE",
|
|
6670
|
+
"default": "\"\""
|
|
6671
|
+
},
|
|
6672
|
+
{
|
|
6673
|
+
"name": "isFluid",
|
|
6674
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
6675
|
+
"type": "boolean",
|
|
6676
|
+
"default": "false"
|
|
6677
|
+
},
|
|
6678
|
+
{
|
|
6679
|
+
"name": "warn",
|
|
6680
|
+
"description": "Specify whether the control is currently in warning state",
|
|
6681
|
+
"type": "boolean",
|
|
6682
|
+
"default": "false"
|
|
6683
|
+
},
|
|
6684
|
+
{
|
|
6685
|
+
"name": "warn-text",
|
|
6686
|
+
"description": "Provide the text that is displayed when the control is in warning state",
|
|
6687
|
+
"type": "string",
|
|
6688
|
+
"default": "\"\""
|
|
6689
|
+
},
|
|
6690
|
+
{
|
|
6691
|
+
"name": "invalid",
|
|
6692
|
+
"description": "`true` to show the UI of the invalid state.",
|
|
6693
|
+
"type": "boolean",
|
|
6694
|
+
"default": "false"
|
|
6695
|
+
},
|
|
6696
|
+
{
|
|
6697
|
+
"name": "required",
|
|
6698
|
+
"description": "`true` if the value is required.",
|
|
6699
|
+
"type": "boolean",
|
|
6700
|
+
"default": "false"
|
|
6701
|
+
},
|
|
6702
|
+
{
|
|
6703
|
+
"name": "required-validity-message",
|
|
6704
|
+
"description": "The special validity message for `required`.",
|
|
6705
|
+
"type": "string",
|
|
6706
|
+
"default": "\"Please fill out this field.\""
|
|
6707
|
+
},
|
|
6708
|
+
{
|
|
6709
|
+
"name": "validity-message",
|
|
6710
|
+
"description": "The validity message.",
|
|
6711
|
+
"type": "string",
|
|
6712
|
+
"default": "\"\""
|
|
6713
|
+
},
|
|
6714
|
+
{
|
|
6715
|
+
"name": "value",
|
|
6716
|
+
"description": "The value of the selected item.",
|
|
6717
|
+
"type": "string",
|
|
6718
|
+
"default": "\"\""
|
|
6719
|
+
}
|
|
6720
|
+
],
|
|
6721
|
+
"properties": [
|
|
6722
|
+
{
|
|
6723
|
+
"name": "isCondensed",
|
|
6724
|
+
"attribute": "is-condensed",
|
|
6725
|
+
"type": "boolean",
|
|
6726
|
+
"default": "false"
|
|
6727
|
+
},
|
|
6728
|
+
{
|
|
6729
|
+
"name": "ariaLabel",
|
|
6730
|
+
"attribute": "aria-label",
|
|
6731
|
+
"description": "'aria-label' of the ListBox component.\nSpecify a label to be read by screen readers on the container node",
|
|
6732
|
+
"type": "string",
|
|
6733
|
+
"default": "\"\""
|
|
6734
|
+
},
|
|
6735
|
+
{
|
|
6736
|
+
"name": "direction",
|
|
6737
|
+
"attribute": "direction",
|
|
6738
|
+
"description": "Specify the direction of the dropdown. Can be either top or bottom.",
|
|
6739
|
+
"type": "DROPDOWN_DIRECTION",
|
|
6740
|
+
"default": "\"bottom\""
|
|
6741
|
+
},
|
|
6742
|
+
{
|
|
6743
|
+
"name": "autoalign",
|
|
6744
|
+
"attribute": "autoalign",
|
|
6745
|
+
"description": "Specify whether auto align functionality should be applied",
|
|
6746
|
+
"type": "boolean",
|
|
6747
|
+
"default": "false"
|
|
6748
|
+
},
|
|
6749
|
+
{
|
|
6750
|
+
"name": "disabled",
|
|
6751
|
+
"attribute": "disabled",
|
|
6752
|
+
"description": "`true` if this dropdown should be disabled.",
|
|
6753
|
+
"type": "boolean",
|
|
6754
|
+
"default": "false"
|
|
6755
|
+
},
|
|
6756
|
+
{
|
|
6757
|
+
"name": "helperText",
|
|
6758
|
+
"attribute": "helper-text",
|
|
6759
|
+
"description": "The helper text.",
|
|
6760
|
+
"type": "string",
|
|
6761
|
+
"default": "\"\""
|
|
6762
|
+
},
|
|
6763
|
+
{
|
|
6764
|
+
"name": "hideLabel",
|
|
6765
|
+
"attribute": "hide-label",
|
|
6766
|
+
"description": "Specify whether the title text should be hidden or not",
|
|
6767
|
+
"type": "boolean",
|
|
6768
|
+
"default": "false"
|
|
6769
|
+
},
|
|
6770
|
+
{
|
|
6771
|
+
"name": "invalidText",
|
|
6772
|
+
"attribute": "invalid-text",
|
|
6773
|
+
"description": "Message which is displayed if the value is invalid.",
|
|
6774
|
+
"type": "string",
|
|
6775
|
+
"default": "\"\""
|
|
6776
|
+
},
|
|
6777
|
+
{
|
|
6778
|
+
"name": "titleText",
|
|
6779
|
+
"attribute": "title-text",
|
|
6780
|
+
"description": "Provide the title text that will be read by a screen reader when visiting this control",
|
|
6781
|
+
"type": "string",
|
|
6782
|
+
"default": "\"\""
|
|
6783
|
+
},
|
|
6784
|
+
{
|
|
6785
|
+
"name": "name",
|
|
6786
|
+
"attribute": "name",
|
|
6787
|
+
"description": "Name for the dropdown in the `FormData`",
|
|
6788
|
+
"type": "string",
|
|
6789
|
+
"default": "\"\""
|
|
6790
|
+
},
|
|
6791
|
+
{
|
|
6792
|
+
"name": "open",
|
|
6793
|
+
"attribute": "open",
|
|
6794
|
+
"description": "`true` if this dropdown should be open.",
|
|
6795
|
+
"type": "boolean",
|
|
6796
|
+
"default": "false"
|
|
6797
|
+
},
|
|
6798
|
+
{
|
|
6799
|
+
"name": "readOnly",
|
|
6800
|
+
"attribute": "read-only",
|
|
6801
|
+
"description": "Whether or not the Dropdown is readonly",
|
|
6802
|
+
"type": "boolean",
|
|
6803
|
+
"default": "false"
|
|
6804
|
+
},
|
|
6805
|
+
{
|
|
6806
|
+
"name": "size",
|
|
6807
|
+
"attribute": "size",
|
|
6808
|
+
"description": "Dropdown size.",
|
|
6809
|
+
"type": "DROPDOWN_SIZE",
|
|
6810
|
+
"default": "\"md\""
|
|
6811
|
+
},
|
|
6812
|
+
{
|
|
6813
|
+
"name": "toggleLabelClosed",
|
|
6814
|
+
"attribute": "toggle-label-closed",
|
|
6815
|
+
"description": "The `aria-label` attribute for the UI indicating the closed state.",
|
|
6816
|
+
"type": "string",
|
|
6817
|
+
"default": "\"\""
|
|
6818
|
+
},
|
|
6819
|
+
{
|
|
6820
|
+
"name": "toggleLabelOpen",
|
|
6821
|
+
"attribute": "toggle-label-open",
|
|
6822
|
+
"description": "The `aria-label` attribute for the UI indicating the open state.",
|
|
6823
|
+
"type": "string",
|
|
6824
|
+
"default": "\"\""
|
|
6825
|
+
},
|
|
6826
|
+
{
|
|
6827
|
+
"name": "label",
|
|
6828
|
+
"attribute": "label",
|
|
6829
|
+
"description": "Generic label that will be used as the textual representation of what this field is for",
|
|
6830
|
+
"type": "string",
|
|
6831
|
+
"default": "\"\""
|
|
6832
|
+
},
|
|
6833
|
+
{
|
|
6834
|
+
"name": "type",
|
|
6835
|
+
"attribute": "type",
|
|
6836
|
+
"description": "`true` if this dropdown should use the inline UI variant.",
|
|
6837
|
+
"type": "DROPDOWN_TYPE",
|
|
6838
|
+
"default": "\"\""
|
|
6839
|
+
},
|
|
6840
|
+
{
|
|
6841
|
+
"name": "isFluid",
|
|
6842
|
+
"attribute": "isFluid",
|
|
6843
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
6844
|
+
"type": "boolean",
|
|
6845
|
+
"default": "false"
|
|
6846
|
+
},
|
|
6847
|
+
{
|
|
6848
|
+
"name": "warn",
|
|
6849
|
+
"attribute": "warn",
|
|
6850
|
+
"description": "Specify whether the control is currently in warning state",
|
|
6851
|
+
"type": "boolean",
|
|
6852
|
+
"default": "false"
|
|
6853
|
+
},
|
|
6854
|
+
{
|
|
6855
|
+
"name": "warnText",
|
|
6856
|
+
"attribute": "warn-text",
|
|
6857
|
+
"description": "Provide the text that is displayed when the control is in warning state",
|
|
6858
|
+
"type": "string",
|
|
6859
|
+
"default": "\"\""
|
|
6860
|
+
},
|
|
6861
|
+
{
|
|
6862
|
+
"name": "toggleLabel",
|
|
6863
|
+
"description": "The computed aria-label for the toggle button based on open state.",
|
|
6864
|
+
"type": "string"
|
|
6865
|
+
},
|
|
6866
|
+
{
|
|
6867
|
+
"name": "TRIGGER_KEYS",
|
|
6868
|
+
"description": "Symbols of keys that triggers opening/closing menu and selecting/deselecting menu item.",
|
|
6869
|
+
"type": "Set<string>",
|
|
6870
|
+
"default": "\"new Set([' ', 'Enter'])\""
|
|
6871
|
+
},
|
|
6872
|
+
{
|
|
6873
|
+
"name": "shadowRootOptions",
|
|
6874
|
+
"type": "{ delegatesFocus: boolean; mode: ShadowRootMode; slotAssignment?: SlotAssignmentMode | undefined; customElements?: CustomElementRegistry | undefined; registry?: CustomElementRegistry | undefined; }",
|
|
6875
|
+
"default": "{\"delegatesFocus\":true}"
|
|
6876
|
+
},
|
|
6877
|
+
{
|
|
6878
|
+
"name": "styles",
|
|
6879
|
+
"type": "array",
|
|
6880
|
+
"default": "[\"styles\",\"styles\"]"
|
|
6881
|
+
},
|
|
6882
|
+
{
|
|
6883
|
+
"name": "invalid",
|
|
6884
|
+
"attribute": "invalid",
|
|
6885
|
+
"description": "`true` to show the UI of the invalid state.",
|
|
6886
|
+
"type": "boolean",
|
|
6887
|
+
"default": "false"
|
|
6888
|
+
},
|
|
6889
|
+
{
|
|
6890
|
+
"name": "required",
|
|
6891
|
+
"attribute": "required",
|
|
6892
|
+
"description": "`true` if the value is required.",
|
|
6893
|
+
"type": "boolean",
|
|
6894
|
+
"default": "false"
|
|
6895
|
+
},
|
|
6896
|
+
{
|
|
6897
|
+
"name": "requiredValidityMessage",
|
|
6898
|
+
"attribute": "required-validity-message",
|
|
6899
|
+
"description": "The special validity message for `required`.",
|
|
6900
|
+
"type": "string",
|
|
6901
|
+
"default": "\"Please fill out this field.\""
|
|
6902
|
+
},
|
|
6903
|
+
{
|
|
6904
|
+
"name": "validityMessage",
|
|
6905
|
+
"attribute": "validity-message",
|
|
6906
|
+
"description": "The validity message.",
|
|
6907
|
+
"type": "string",
|
|
6908
|
+
"default": "\"\""
|
|
6909
|
+
},
|
|
6910
|
+
{
|
|
6911
|
+
"name": "value",
|
|
6912
|
+
"attribute": "value",
|
|
6913
|
+
"description": "The value of the selected item.",
|
|
6914
|
+
"type": "string",
|
|
6915
|
+
"default": "\"\""
|
|
6916
|
+
}
|
|
6917
|
+
],
|
|
6918
|
+
"events": [
|
|
6919
|
+
{
|
|
6920
|
+
"name": "cds-dropdown-beingselected",
|
|
6921
|
+
"description": "The custom event fired before a dropdown item is selected upon a user gesture.\nCancellation of this event stops changing the user-initiated selection."
|
|
6922
|
+
},
|
|
6923
|
+
{
|
|
6924
|
+
"name": "cds-dropdown-beingtoggled",
|
|
6925
|
+
"description": "The custom event fired before the open state of this dropdown is toggled upon a user gesture.\nCancellation of this event stops the user-initiated toggling."
|
|
6926
|
+
},
|
|
6927
|
+
{
|
|
6928
|
+
"name": "cds-dropdown-selected",
|
|
6929
|
+
"description": "The custom event fired after a dropdown item is selected upon a user gesture."
|
|
6930
|
+
},
|
|
6931
|
+
{
|
|
6932
|
+
"name": "cds-dropdown-toggled",
|
|
6933
|
+
"description": "The custom event fired after the open state of this dropdown is toggled upon a user gesture."
|
|
6934
|
+
},
|
|
6935
|
+
{
|
|
6936
|
+
"name": "input"
|
|
6937
|
+
},
|
|
6938
|
+
{
|
|
6939
|
+
"name": "invalid"
|
|
6940
|
+
}
|
|
6941
|
+
],
|
|
6942
|
+
"cssParts": [
|
|
6943
|
+
{
|
|
6944
|
+
"name": "label",
|
|
6945
|
+
"description": "text The label text."
|
|
6946
|
+
},
|
|
6947
|
+
{
|
|
6948
|
+
"name": "helper",
|
|
6949
|
+
"description": "text The helper text."
|
|
6950
|
+
},
|
|
6951
|
+
{
|
|
6952
|
+
"name": "trigger",
|
|
6953
|
+
"description": "button The trigger button."
|
|
6954
|
+
},
|
|
6955
|
+
{
|
|
6956
|
+
"name": "menu",
|
|
6957
|
+
"description": "body The menu body."
|
|
6958
|
+
},
|
|
6959
|
+
{
|
|
6960
|
+
"name": "validity",
|
|
6961
|
+
"description": "message The validity message."
|
|
6962
|
+
}
|
|
6963
|
+
]
|
|
6964
|
+
},
|
|
6501
6965
|
{
|
|
6502
6966
|
"name": "cds-fluid-number-input-skeleton",
|
|
6503
6967
|
"path": "./src/components/fluid-number-input/fluid-number-input-skeleton.ts",
|
|
@@ -12182,6 +12646,12 @@
|
|
|
12182
12646
|
"type": "DROPDOWN_TYPE",
|
|
12183
12647
|
"default": "\"\""
|
|
12184
12648
|
},
|
|
12649
|
+
{
|
|
12650
|
+
"name": "isFluid",
|
|
12651
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
12652
|
+
"type": "boolean",
|
|
12653
|
+
"default": "false"
|
|
12654
|
+
},
|
|
12185
12655
|
{
|
|
12186
12656
|
"name": "warn",
|
|
12187
12657
|
"description": "Specify whether the control is currently in warning state",
|
|
@@ -12384,6 +12854,13 @@
|
|
|
12384
12854
|
"type": "DROPDOWN_TYPE",
|
|
12385
12855
|
"default": "\"\""
|
|
12386
12856
|
},
|
|
12857
|
+
{
|
|
12858
|
+
"name": "isFluid",
|
|
12859
|
+
"attribute": "isFluid",
|
|
12860
|
+
"description": "Specify whether the textarea is fluid or not",
|
|
12861
|
+
"type": "boolean",
|
|
12862
|
+
"default": "false"
|
|
12863
|
+
},
|
|
12387
12864
|
{
|
|
12388
12865
|
"name": "warn",
|
|
12389
12866
|
"attribute": "warn",
|
|
@@ -221,14 +221,20 @@ __decorate([property({
|
|
|
221
221
|
type: Boolean,
|
|
222
222
|
reflect: true
|
|
223
223
|
})], CDSCheckbox.prototype, "readonly", void 0);
|
|
224
|
-
__decorate([property({
|
|
224
|
+
__decorate([property({
|
|
225
|
+
type: Boolean,
|
|
226
|
+
reflect: true
|
|
227
|
+
})], CDSCheckbox.prototype, "invalid", void 0);
|
|
225
228
|
__decorate([property({
|
|
226
229
|
type: String,
|
|
227
230
|
attribute: "invalid-text"
|
|
228
231
|
})], CDSCheckbox.prototype, "invalidText", void 0);
|
|
229
232
|
__decorate([property({ attribute: "title" })], CDSCheckbox.prototype, "title", void 0);
|
|
230
233
|
__decorate([property()], CDSCheckbox.prototype, "value", void 0);
|
|
231
|
-
__decorate([property({
|
|
234
|
+
__decorate([property({
|
|
235
|
+
type: Boolean,
|
|
236
|
+
reflect: true
|
|
237
|
+
})], CDSCheckbox.prototype, "warn", void 0);
|
|
232
238
|
__decorate([property({
|
|
233
239
|
type: String,
|
|
234
240
|
attribute: "warn-text"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":["styles","customElement"],"sources":["../../../src/components/checkbox/checkbox.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport FormMixin from '../../globals/mixins/form';\nimport styles from './checkbox.scss?lit';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\n/**\n * Check box.\n *\n * @element cds-checkbox\n * @fires cds-checkbox-changed - The custom event fired after this changebox changes its checked state.\n * @csspart input The checkbox.\n * @csspart label The label.\n */\n@customElement(`${prefix}-checkbox`)\nclass CDSCheckbox extends FocusMixin(FormMixin(LitElement)) {\n @query('input')\n protected _checkboxNode!: HTMLInputElement;\n\n /**\n * Handles `click` event on the `<input>` in the shadow DOM.\n */\n protected _handleChange() {\n const { checked, indeterminate } = this._checkboxNode;\n this.checked = checked;\n this.indeterminate = indeterminate;\n const { eventChange } = this.constructor as typeof CDSCheckbox;\n this.dispatchEvent(\n new CustomEvent(eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n checked,\n indeterminate,\n },\n })\n );\n }\n\n /**\n * Prevent checkbox state from updating when readonly\n */\n private _handleClick(event: MouseEvent) {\n if (this.readonly) {\n event.preventDefault();\n }\n }\n\n _handleFormdata(event: FormDataEvent) {\n const { formData } = event;\n const { checked, disabled, name, value = 'on' } = this;\n if (!disabled && checked) {\n formData.append(name, value);\n }\n }\n\n /**\n * Specify whether the underlying input should be checked\n */\n @property({ type: Boolean, reflect: true, attribute: 'checked' })\n checked = false;\n\n /**\n * Specify if checkbox is being used in a data table\n */\n @property({ type: Boolean, reflect: true, attribute: 'data-table' })\n dataTable = false;\n\n /**\n * Specify whether the Checkbox should be disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Provide text for the form group for additional help\n */\n @property({ type: String, reflect: true, attribute: 'helper-text' })\n helperText;\n\n /**\n * Specify whether the checkbox should be present in the DOM,\n * but invisible and uninteractable. Used for data-table purposes.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-checkbox' })\n hideCheckbox = false;\n\n /**\n * Specify whether the label should be hidden, or not\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * Specify a custom id for the checkbox\n */\n @property({ reflect: true })\n id = 'checkbox';\n\n /**\n * Specify whether the Checkbox is in an indeterminate state\n */\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n\n /**\n * Provide a label to provide a description of the Checkbox input that you are\n * exposing to the user\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * The form name.\n */\n @property()\n name!: string;\n\n /**\n * Specify whether the Checkbox is read-only\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Specify whether the Checkbox is currently invalid\n */\n @property({ type: Boolean })\n invalid = false;\n\n /**\n * Provide the text that is displayed when the Checkbox is in an invalid state\n */\n @property({ type: String, attribute: 'invalid-text' })\n invalidText;\n\n /**\n * Specify a title for the node for the Checkbox\n */\n @property({ attribute: 'title' })\n title = '';\n\n /**\n * The value.\n */\n @property()\n value!: string;\n\n /**\n * Specify whether the Checkbox is in a warn state\n */\n @property({ type: Boolean })\n warn = false;\n\n /**\n * Provide the text that is displayed when the Checkbox is in a warn state\n */\n @property({ type: String, attribute: 'warn-text' })\n warnText = false;\n\n /**\n * Specify whether the underlying input should be checked by default\n */\n @property({ type: Boolean, attribute: 'default-checked' })\n defaultChecked;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .filter((elem) =>\n (elem as HTMLElement).matches !== undefined\n ? (elem as HTMLElement).matches(\n (this.constructor as typeof CDSCheckbox).aiLabelItem\n ) ||\n // remove slug reference in v12\n (elem as HTMLElement).matches(\n (this.constructor as typeof CDSCheckbox).slugItem\n )\n : false\n );\n\n this._hasAILabel = Boolean(hasContent);\n const type = (hasContent[0] as HTMLElement).getAttribute('kind');\n (hasContent[0] as HTMLElement).setAttribute(\n 'size',\n type === 'inline' ? 'md' : 'mini'\n );\n this.requestUpdate();\n }\n\n /**\n * `true` if there is an AI Label.\n */\n protected _hasAILabel = false;\n\n updated() {\n const { _hasAILabel: hasAILabel } = this;\n if (hasAILabel) {\n this.setAttribute('ai-label', '');\n } else {\n this.removeAttribute('ai-label');\n }\n }\n connectedCallback() {\n super.connectedCallback();\n if (this.defaultChecked) {\n this.checked = this.defaultChecked;\n }\n }\n\n render() {\n const {\n checked,\n disabled,\n helperText,\n hideLabel,\n id,\n indeterminate,\n invalid,\n invalidText,\n labelText,\n name,\n readonly,\n title,\n value,\n warn,\n warnText,\n defaultChecked,\n _handleChange: handleChange,\n _handleClick: handleClick,\n } = this;\n\n const showWarning = !readonly && !invalid && warn;\n const showHelper = !invalid && !warn;\n\n const helper = helperText\n ? html` <div class=\"${prefix}--form__helper-text\">${helperText}</div>`\n : null;\n\n const labelClasses = classMap({\n [`${prefix}--checkbox-label`]: true,\n });\n const labelTextClasses = classMap({\n [`${prefix}--checkbox-label-text`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n return html`\n <input\n id=\"${ifDefined(id)}\"\n type=\"checkbox\"\n part=\"input\"\n class=\"${`${prefix}--checkbox`}\"\n aria-readonly=\"${String(readonly)}\"\n .checked=\"${checked}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n ?defaultChecked=\"${defaultChecked}\"\n .indeterminate=\"${indeterminate}\"\n name=\"${ifDefined(name)}\"\n value=\"${ifDefined(value)}\"\n @change=\"${handleChange}\"\n @click=\"${handleClick}\" />\n <label\n for=\"${ifDefined(id)}\"\n part=\"label\"\n class=\"${labelClasses}\"\n title=\"${ifDefined(title)}\">\n <span class=\"${labelTextClasses}\"\n >${labelText ? labelText : html`<slot></slot>`}</span\n >\n </label>\n <slot name=\"ai-label\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <slot name=\"decorator\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <slot name=\"slug\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <div class=\"${prefix}--checkbox__validation-msg\">\n ${!readonly && invalid\n ? html`\n ${iconLoader(WarningFilled16, {\n class: `${prefix}--checkbox__invalid-icon`,\n })}\n <div class=\"${prefix}--form-requirement\">${invalidText}</div>\n `\n : null}\n ${showWarning\n ? html`\n ${iconLoader(WarningAltFilled16, {\n class: `${prefix}--checkbox__invalid-icon ${prefix}--checkbox__invalid-icon--warning`,\n })}\n <div class=\"${prefix}--form-requirement\">${warnText}</div>\n `\n : null}\n </div>\n ${showHelper ? helper : null}\n `;\n }\n\n /**\n * The name of the custom event fired after this changebox changes its checked state.\n */\n static get eventChange() {\n return `${prefix}-checkbox-changed`;\n }\n\n /**\n * A selector that will return the slug item.\n *\n * Remove in v12\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n /**\n * A selector that will return the ai-label item.\n */\n static get aiLabelItem() {\n return `${prefix}-ai-label`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSCheckbox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO;;;2BAGQ;GACzB,GAAG,WAAW;GACd,gBAAgB;GACjB;;;gBACeA;;;YAtTf,MAAM,QAAQ;YA2Cd,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAW,CAAC;YAMhE,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAc,CAAC;YAMnE,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC;YAM1C,SAAS;CAAE,MAAM;CAAQ,SAAS;CAAM,WAAW;CAAe,CAAC;YAOnE,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAiB,CAAC;YAMtE,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;CAAc,CAAC;YAMnE,SAAS,EAAE,SAAS,MAAM,CAAC;YAM3B,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC;YAO1C,SAAS,EAAE,WAAW,cAAc,CAAC;YAMrC,UAAU;YAMV,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC;YAM1C,SAAS,EAAE,MAAM,SAAS,CAAC;YAM3B,SAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,CAAC;YAMrD,SAAS,EAAE,WAAW,SAAS,CAAC;YAMhC,UAAU;YAMV,SAAS,EAAE,MAAM,SAAS,CAAC;YAM3B,SAAS;CAAE,MAAM;CAAQ,WAAW;CAAa,CAAC;YAMlD,SAAS;CAAE,MAAM;CAAS,WAAW;CAAmB,CAAC;0BArJ3DC,cAAc,GAAG,OAAO,WAAW;AA2TpC,uBAAe"}
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["styles","customElement"],"sources":["../../../src/components/checkbox/checkbox.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport FormMixin from '../../globals/mixins/form';\nimport styles from './checkbox.scss?lit';\nimport WarningFilled16 from '@carbon/icons/es/warning--filled/16.js';\nimport WarningAltFilled16 from '@carbon/icons/es/warning--alt--filled/16.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\n/**\n * Check box.\n *\n * @element cds-checkbox\n * @fires cds-checkbox-changed - The custom event fired after this changebox changes its checked state.\n * @csspart input The checkbox.\n * @csspart label The label.\n */\n@customElement(`${prefix}-checkbox`)\nclass CDSCheckbox extends FocusMixin(FormMixin(LitElement)) {\n @query('input')\n protected _checkboxNode!: HTMLInputElement;\n\n /**\n * Handles `click` event on the `<input>` in the shadow DOM.\n */\n protected _handleChange() {\n const { checked, indeterminate } = this._checkboxNode;\n this.checked = checked;\n this.indeterminate = indeterminate;\n const { eventChange } = this.constructor as typeof CDSCheckbox;\n this.dispatchEvent(\n new CustomEvent(eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n checked,\n indeterminate,\n },\n })\n );\n }\n\n /**\n * Prevent checkbox state from updating when readonly\n */\n private _handleClick(event: MouseEvent) {\n if (this.readonly) {\n event.preventDefault();\n }\n }\n\n _handleFormdata(event: FormDataEvent) {\n const { formData } = event;\n const { checked, disabled, name, value = 'on' } = this;\n if (!disabled && checked) {\n formData.append(name, value);\n }\n }\n\n /**\n * Specify whether the underlying input should be checked\n */\n @property({ type: Boolean, reflect: true, attribute: 'checked' })\n checked = false;\n\n /**\n * Specify if checkbox is being used in a data table\n */\n @property({ type: Boolean, reflect: true, attribute: 'data-table' })\n dataTable = false;\n\n /**\n * Specify whether the Checkbox should be disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Provide text for the form group for additional help\n */\n @property({ type: String, reflect: true, attribute: 'helper-text' })\n helperText;\n\n /**\n * Specify whether the checkbox should be present in the DOM,\n * but invisible and uninteractable. Used for data-table purposes.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-checkbox' })\n hideCheckbox = false;\n\n /**\n * Specify whether the label should be hidden, or not\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * Specify a custom id for the checkbox\n */\n @property({ reflect: true })\n id = 'checkbox';\n\n /**\n * Specify whether the Checkbox is in an indeterminate state\n */\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n\n /**\n * Provide a label to provide a description of the Checkbox input that you are\n * exposing to the user\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * The form name.\n */\n @property()\n name!: string;\n\n /**\n * Specify whether the Checkbox is read-only\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Specify whether the Checkbox is currently invalid\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * Provide the text that is displayed when the Checkbox is in an invalid state\n */\n @property({ type: String, attribute: 'invalid-text' })\n invalidText;\n\n /**\n * Specify a title for the node for the Checkbox\n */\n @property({ attribute: 'title' })\n title = '';\n\n /**\n * The value.\n */\n @property()\n value!: string;\n\n /**\n * Specify whether the Checkbox is in a warn state\n */\n @property({ type: Boolean, reflect: true })\n warn = false;\n\n /**\n * Provide the text that is displayed when the Checkbox is in a warn state\n */\n @property({ type: String, attribute: 'warn-text' })\n warnText = false;\n\n /**\n * Specify whether the underlying input should be checked by default\n */\n @property({ type: Boolean, attribute: 'default-checked' })\n defaultChecked;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .filter((elem) =>\n (elem as HTMLElement).matches !== undefined\n ? (elem as HTMLElement).matches(\n (this.constructor as typeof CDSCheckbox).aiLabelItem\n ) ||\n // remove slug reference in v12\n (elem as HTMLElement).matches(\n (this.constructor as typeof CDSCheckbox).slugItem\n )\n : false\n );\n\n this._hasAILabel = Boolean(hasContent);\n const type = (hasContent[0] as HTMLElement).getAttribute('kind');\n (hasContent[0] as HTMLElement).setAttribute(\n 'size',\n type === 'inline' ? 'md' : 'mini'\n );\n this.requestUpdate();\n }\n\n /**\n * `true` if there is an AI Label.\n */\n protected _hasAILabel = false;\n\n updated() {\n const { _hasAILabel: hasAILabel } = this;\n if (hasAILabel) {\n this.setAttribute('ai-label', '');\n } else {\n this.removeAttribute('ai-label');\n }\n }\n connectedCallback() {\n super.connectedCallback();\n if (this.defaultChecked) {\n this.checked = this.defaultChecked;\n }\n }\n\n render() {\n const {\n checked,\n disabled,\n helperText,\n hideLabel,\n id,\n indeterminate,\n invalid,\n invalidText,\n labelText,\n name,\n readonly,\n title,\n value,\n warn,\n warnText,\n defaultChecked,\n _handleChange: handleChange,\n _handleClick: handleClick,\n } = this;\n\n const showWarning = !readonly && !invalid && warn;\n const showHelper = !invalid && !warn;\n\n const helper = helperText\n ? html` <div class=\"${prefix}--form__helper-text\">${helperText}</div>`\n : null;\n\n const labelClasses = classMap({\n [`${prefix}--checkbox-label`]: true,\n });\n const labelTextClasses = classMap({\n [`${prefix}--checkbox-label-text`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n return html`\n <input\n id=\"${ifDefined(id)}\"\n type=\"checkbox\"\n part=\"input\"\n class=\"${`${prefix}--checkbox`}\"\n aria-readonly=\"${String(readonly)}\"\n .checked=\"${checked}\"\n ?data-invalid=\"${invalid}\"\n ?disabled=\"${disabled}\"\n ?defaultChecked=\"${defaultChecked}\"\n .indeterminate=\"${indeterminate}\"\n name=\"${ifDefined(name)}\"\n value=\"${ifDefined(value)}\"\n @change=\"${handleChange}\"\n @click=\"${handleClick}\" />\n <label\n for=\"${ifDefined(id)}\"\n part=\"label\"\n class=\"${labelClasses}\"\n title=\"${ifDefined(title)}\">\n <span class=\"${labelTextClasses}\"\n >${labelText ? labelText : html`<slot></slot>`}</span\n >\n </label>\n <slot name=\"ai-label\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <slot name=\"decorator\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <slot name=\"slug\" @slotchange=\"${this._handleSlotChange}\"></slot>\n <div class=\"${prefix}--checkbox__validation-msg\">\n ${!readonly && invalid\n ? html`\n ${iconLoader(WarningFilled16, {\n class: `${prefix}--checkbox__invalid-icon`,\n })}\n <div class=\"${prefix}--form-requirement\">${invalidText}</div>\n `\n : null}\n ${showWarning\n ? html`\n ${iconLoader(WarningAltFilled16, {\n class: `${prefix}--checkbox__invalid-icon ${prefix}--checkbox__invalid-icon--warning`,\n })}\n <div class=\"${prefix}--form-requirement\">${warnText}</div>\n `\n : null}\n </div>\n ${showHelper ? helper : null}\n `;\n }\n\n /**\n * The name of the custom event fired after this changebox changes its checked state.\n */\n static get eventChange() {\n return `${prefix}-checkbox-changed`;\n }\n\n /**\n * A selector that will return the slug item.\n *\n * Remove in v12\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n /**\n * A selector that will return the ai-label item.\n */\n static get aiLabelItem() {\n return `${prefix}-ai-label`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSCheckbox;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,wBACM,oBAAoB,WAAW,UAAU,WAAW,CAAC,CAAC;;;iBA6ChD;mBAME;kBAMD;sBAaI;mBAMH;YAMP;uBAMW;mBAOJ;kBAYD;iBAMD;eAYF;cAYD;kBAMI;qBAsCa;;;;;CA9KxB,AAAU,gBAAgB;EACxB,MAAM,EAAE,SAAS,kBAAkB,KAAK;AACxC,OAAK,UAAU;AACf,OAAK,gBAAgB;EACrB,MAAM,EAAE,gBAAgB,KAAK;AAC7B,OAAK,cACH,IAAI,YAAY,aAAa;GAC3B,SAAS;GACT,UAAU;GACV,QAAQ;IACN;IACA;IACD;GACF,CAAC,CACH;;;;;CAMH,AAAQ,aAAa,OAAmB;AACtC,MAAI,KAA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,SAAS,EAAE,SAAS,MAAM,CAAC;YAM3B,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC;YAO1C,SAAS,EAAE,WAAW,cAAc,CAAC;YAMrC,UAAU;YAMV,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC;YAM1C,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC;YAM1C,SAAS;CAAE,MAAM;CAAQ,WAAW;CAAgB,CAAC;YAMrD,SAAS,EAAE,WAAW,SAAS,CAAC;YAMhC,UAAU;YAMV,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,CAAC;YAM1C,SAAS;CAAE,MAAM;CAAQ,WAAW;CAAa,CAAC;YAMlD,SAAS;CAAE,MAAM;CAAS,WAAW;CAAmB,CAAC;0BArJ3DC,cAAc,GAAG,OAAO,WAAW;AA2TpC,uBAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contained-list-item.d.ts","sourceRoot":"","sources":["../../../src/components/contained-list/contained-list-item.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAOvC;;;;;;;;GAQG;AACH,cACM,oBAAqB,SAAQ,UAAU;IAC3C;;OAEG;IAEH,SAAS,UAAS;IAElB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAgBpB,iBAAiB;IAOjB,MAAM;
|
|
1
|
+
{"version":3,"file":"contained-list-item.d.ts","sourceRoot":"","sources":["../../../src/components/contained-list/contained-list-item.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAOvC;;;;;;;;GAQG;AACH,cACM,oBAAqB,SAAQ,UAAU;IAC3C;;OAEG;IAEH,SAAS,UAAS;IAElB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAgBpB,iBAAiB;IAOjB,MAAM;IAoCN;;OAEG;IACH,MAAM,KAAK,UAAU,WAEpB;IAED,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { classMap } from "lit/directives/class-map.js";
|
|
|
15
15
|
|
|
16
16
|
//#region src/components/contained-list/contained-list-item.ts
|
|
17
17
|
/**
|
|
18
|
-
* Copyright IBM Corp. 2022,
|
|
18
|
+
* Copyright IBM Corp. 2022, 2026
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -71,16 +71,8 @@ let CDSContainedListItem = class CDSContainedListItem extends LitElement {
|
|
|
71
71
|
});
|
|
72
72
|
const contentClasses = `${prefix}--contained-list-item__content`;
|
|
73
73
|
const content = html`
|
|
74
|
-
${
|
|
75
|
-
|
|
76
|
-
<slot
|
|
77
|
-
name="icon"
|
|
78
|
-
@slotchange="${this._handleIconSlotChange}"></slot>
|
|
79
|
-
</div>
|
|
80
|
-
` : html`<slot
|
|
81
|
-
name="icon"
|
|
82
|
-
@slotchange="${this._handleIconSlotChange}"></slot>`}
|
|
83
|
-
<div><slot></slot></div>
|
|
74
|
+
<slot name="icon" @slotchange="${this._handleIconSlotChange}"></slot>
|
|
75
|
+
<slot></slot>
|
|
84
76
|
`;
|
|
85
77
|
return html`
|
|
86
78
|
<div class="${classes}">
|