@carbon/web-components 2.3.0-rc.0 → 2.3.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.
Files changed (181) hide show
  1. package/custom-elements.json +20 -6
  2. package/dist/16-0961ca81.js +8 -8
  3. package/dist/16-1c29ced2.js +8 -8
  4. package/dist/16-2aa048a9.js +2 -2
  5. package/dist/16-36a4bc66.js +8 -8
  6. package/dist/16-3e54d388.js +8 -8
  7. package/dist/16-414edc3e.js +8 -8
  8. package/dist/16-44367639.js +2 -2
  9. package/dist/16-556b34ee.js +8 -8
  10. package/dist/16-661ec332.js +8 -8
  11. package/dist/16-880e779e.js +2 -2
  12. package/dist/16-8ab58ede.js +2 -2
  13. package/dist/16-945f9ad8.js +2 -2
  14. package/dist/16-9bdb8b2e.js +2 -2
  15. package/dist/16-afc2ad08.js +2 -2
  16. package/dist/16-d8f716ba.js +8 -8
  17. package/dist/16-f2df91a2.js +2 -2
  18. package/dist/20-7b4406d5.js +8 -8
  19. package/dist/20-c1834a3b.js +2 -2
  20. package/dist/accordion.min.js +2 -2
  21. package/dist/accordion.rtl.min.js +8 -8
  22. package/dist/breadcrumb.min.js +2 -2
  23. package/dist/breadcrumb.rtl.min.js +8 -8
  24. package/dist/button-5ca835b8.js +2 -2
  25. package/dist/button-7fc4c078.js +8 -8
  26. package/dist/button-set-31ee356e.js +8 -8
  27. package/dist/button-set-cb1d2f82.js +2 -2
  28. package/dist/button-skeleton-02a84471.js +2 -2
  29. package/dist/button-skeleton-b968c821.js +8 -8
  30. package/dist/button.min.js +2 -2
  31. package/dist/button.rtl.min.js +8 -8
  32. package/dist/carbon-element-4ca9803f.js +8 -8
  33. package/dist/checkbox-4f087c3e.js +8 -8
  34. package/dist/checkbox-db723d49.js +2 -2
  35. package/dist/checkbox.min.js +2 -2
  36. package/dist/checkbox.rtl.min.js +8 -8
  37. package/dist/class-map-b1739c02.js +8 -8
  38. package/dist/code-snippet.min.js +2 -2
  39. package/dist/code-snippet.rtl.min.js +8 -8
  40. package/dist/collection-helpers-4e32fe16.js +8 -8
  41. package/dist/combo-box.min.js +2 -2
  42. package/dist/combo-box.rtl.min.js +8 -8
  43. package/dist/content-switcher-item-719c9aea.js +8 -8
  44. package/dist/content-switcher-item-e8c64c79.js +2 -2
  45. package/dist/content-switcher.min.js +2 -2
  46. package/dist/content-switcher.rtl.min.js +8 -8
  47. package/dist/copy-button-480d7a5d.js +2 -2
  48. package/dist/copy-button-ba406cf0.js +8 -8
  49. package/dist/copy-button.min.js +2 -2
  50. package/dist/copy-button.rtl.min.js +8 -8
  51. package/dist/custom-element-975be15f.js +8 -8
  52. package/dist/data-table.min.js +5 -5
  53. package/dist/data-table.rtl.min.js +11 -11
  54. package/dist/date-picker.min.js +2 -2
  55. package/dist/date-picker.rtl.min.js +8 -8
  56. package/dist/directive-e2d48b9c.js +8 -8
  57. package/dist/dropdown-item-4e699ebf.js +8 -8
  58. package/dist/dropdown-item-5147a57e.js +2 -2
  59. package/dist/dropdown.min.js +2 -2
  60. package/dist/dropdown.rtl.min.js +8 -8
  61. package/dist/file-uploader.min.js +2 -2
  62. package/dist/file-uploader.rtl.min.js +8 -8
  63. package/dist/floating-menu-6ec5c7fa.js +8 -8
  64. package/dist/floating-menu.min.js +2 -2
  65. package/dist/floating-menu.rtl.min.js +8 -8
  66. package/dist/focus-92d82b5f.js +8 -8
  67. package/dist/form-group.min.js +2 -2
  68. package/dist/form-group.rtl.min.js +8 -8
  69. package/dist/form.min.js +2 -2
  70. package/dist/form.rtl.min.js +8 -8
  71. package/dist/get-d229c408.js +8 -8
  72. package/dist/host-listener-a948931e.js +8 -8
  73. package/dist/icon-button-a27462c6.js +8 -8
  74. package/dist/icon-button-e5479804.js +2 -2
  75. package/dist/icon-button.min.js +2 -2
  76. package/dist/icon-button.rtl.min.js +8 -8
  77. package/dist/if-defined-b99f5484.js +8 -8
  78. package/dist/if-non-empty-d69cc3f0.js +8 -8
  79. package/dist/inline-loading.min.js +2 -2
  80. package/dist/inline-loading.rtl.min.js +8 -8
  81. package/dist/layer-62995057.js +8 -8
  82. package/dist/layer.min.js +2 -2
  83. package/dist/layer.rtl.min.js +8 -8
  84. package/dist/link-d5d53be2.js +8 -8
  85. package/dist/link.min.js +2 -2
  86. package/dist/link.rtl.min.js +8 -8
  87. package/dist/list.min.js +2 -2
  88. package/dist/list.rtl.min.js +8 -8
  89. package/dist/loading-0b8c6feb.js +2 -2
  90. package/dist/loading-57249316.js +8 -8
  91. package/dist/loading-icon-2ac6de26.js +8 -8
  92. package/dist/loading.min.js +2 -2
  93. package/dist/loading.rtl.min.js +8 -8
  94. package/dist/modal.min.js +2 -2
  95. package/dist/modal.rtl.min.js +8 -8
  96. package/dist/multi-select.min.js +2 -2
  97. package/dist/multi-select.rtl.min.js +8 -8
  98. package/dist/notification.min.js +2 -2
  99. package/dist/notification.rtl.min.js +8 -8
  100. package/dist/number-input.min.js +2 -2
  101. package/dist/number-input.rtl.min.js +8 -8
  102. package/dist/objectSpread2-0b7e8561.js +8 -8
  103. package/dist/on-6c264d49.js +8 -8
  104. package/dist/overflow-menu.min.js +2 -2
  105. package/dist/overflow-menu.rtl.min.js +8 -8
  106. package/dist/pagination.min.js +2 -2
  107. package/dist/pagination.rtl.min.js +8 -8
  108. package/dist/popover-content-5fbce72e.js +8 -8
  109. package/dist/popover-content-da687335.js +2 -2
  110. package/dist/popover.min.js +2 -2
  111. package/dist/popover.rtl.min.js +8 -8
  112. package/dist/progress-bar.min.js +2 -2
  113. package/dist/progress-bar.rtl.min.js +8 -8
  114. package/dist/progress-indicator.min.js +2 -2
  115. package/dist/progress-indicator.rtl.min.js +8 -8
  116. package/dist/query-6ca5e414.js +8 -8
  117. package/dist/query-assigned-elements-8e88277c.js +8 -8
  118. package/dist/radio-button.min.js +2 -2
  119. package/dist/radio-button.rtl.min.js +8 -8
  120. package/dist/radio-group-manager-3cfdd620.js +8 -8
  121. package/dist/search-3bb823ad.js +8 -8
  122. package/dist/search-b982a365.js +2 -2
  123. package/dist/search.min.js +2 -2
  124. package/dist/search.rtl.min.js +8 -8
  125. package/dist/select-item-db3c6fa0.js +8 -8
  126. package/dist/select.min.js +2 -2
  127. package/dist/select.rtl.min.js +8 -8
  128. package/dist/settings-387c0fa4.js +8 -8
  129. package/dist/shared-enums-c6fe8c39.js +8 -8
  130. package/dist/side-panel.min.js +2 -2
  131. package/dist/side-panel.rtl.min.js +8 -8
  132. package/dist/skeleton-icon.min.js +2 -2
  133. package/dist/skeleton-icon.rtl.min.js +8 -8
  134. package/dist/skeleton-placeholder.min.js +2 -2
  135. package/dist/skeleton-placeholder.rtl.min.js +8 -8
  136. package/dist/skeleton-text-163b2352.js +2 -2
  137. package/dist/skeleton-text-6f56f1a0.js +8 -8
  138. package/dist/skeleton-text.min.js +2 -2
  139. package/dist/skeleton-text.rtl.min.js +8 -8
  140. package/dist/skip-to-content.min.js +2 -2
  141. package/dist/skip-to-content.rtl.min.js +8 -8
  142. package/dist/slider.min.js +2 -2
  143. package/dist/slider.rtl.min.js +8 -8
  144. package/dist/slug.min.js +2 -2
  145. package/dist/slug.rtl.min.js +8 -8
  146. package/dist/spread-6af5f657.js +8 -8
  147. package/dist/stack.min.js +2 -2
  148. package/dist/stack.rtl.min.js +8 -8
  149. package/dist/state-63312e74.js +8 -8
  150. package/dist/structured-list.min.js +2 -2
  151. package/dist/structured-list.rtl.min.js +8 -8
  152. package/dist/tabs.min.js +2 -2
  153. package/dist/tabs.rtl.min.js +8 -8
  154. package/dist/tag.min.js +2 -2
  155. package/dist/tag.rtl.min.js +8 -8
  156. package/dist/text-input-abdcbfb2.js +2 -2
  157. package/dist/text-input-b10ab3ea.js +8 -8
  158. package/dist/text-input.min.js +2 -2
  159. package/dist/text-input.rtl.min.js +8 -8
  160. package/dist/textarea.min.js +2 -2
  161. package/dist/textarea.rtl.min.js +8 -8
  162. package/dist/tile.min.js +2 -2
  163. package/dist/tile.rtl.min.js +8 -8
  164. package/dist/toggle-tip.min.js +2 -2
  165. package/dist/toggle-tip.rtl.min.js +8 -8
  166. package/dist/toggle.min.js +2 -2
  167. package/dist/toggle.rtl.min.js +8 -8
  168. package/dist/toggletip-cf2f43ca.js +2 -2
  169. package/dist/toggletip-e966d3f3.js +8 -8
  170. package/dist/tooltip-content-826c7891.js +8 -8
  171. package/dist/tooltip-content-c0773b7a.js +2 -2
  172. package/dist/tooltip.min.js +2 -2
  173. package/dist/tooltip.rtl.min.js +8 -8
  174. package/dist/ui-shell.min.js +2 -2
  175. package/dist/ui-shell.rtl.min.js +8 -8
  176. package/dist/validity-d86ffa4f.js +8 -8
  177. package/es/components/data-table/table-header-cell.js +2 -2
  178. package/es/components/data-table/table-header-cell.js.map +1 -1
  179. package/es/components/data-table/table.js +14 -2
  180. package/es/components/data-table/table.js.map +1 -1
  181. package/package.json +2 -2
@@ -25,7 +25,7 @@
25
25
  * lit-html:
26
26
  *
27
27
  * @license
28
- * Copyright 2022 Google LLC
28
+ * Copyright 2017 Google LLC
29
29
  * SPDX-License-Identifier: BSD-3-Clause
30
30
  *
31
31
  * lit-element:
@@ -49,8 +49,8 @@
49
49
  *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
- * https://www.npmjs.com/package/lit
53
52
  * https://www.npmjs.com/package/@carbon/icons
53
+ * https://www.npmjs.com/package/lit
54
54
  * https://www.npmjs.com/package/lodash-es
55
55
  */
56
56
 
@@ -22,16 +22,22 @@
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  *
25
+ * lit-html:
26
+ *
27
+ * @license
28
+ * Copyright 2022 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ *
25
31
  * lit-element:
26
32
  *
27
33
  * @license
28
34
  * Copyright 2017 Google LLC
29
35
  * SPDX-License-Identifier: BSD-3-Clause
30
36
  *
31
- * lit-html:
37
+ * @lit/reactive-element:
32
38
  *
33
39
  * @license
34
- * Copyright 2022 Google LLC
40
+ * Copyright 2017 Google LLC
35
41
  * SPDX-License-Identifier: BSD-3-Clause
36
42
  *
37
43
  * @carbon/layout:
@@ -41,12 +47,6 @@
41
47
  * This source code is licensed under the Apache-2.0 license found in the
42
48
  * LICENSE file in the root directory of this source tree.
43
49
  *
44
- * @lit/reactive-element:
45
- *
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
52
  * https://www.npmjs.com/package/@carbon/icons
@@ -25,7 +25,7 @@
25
25
  * lit-html:
26
26
  *
27
27
  * @license
28
- * Copyright 2022 Google LLC
28
+ * Copyright 2017 Google LLC
29
29
  * SPDX-License-Identifier: BSD-3-Clause
30
30
  *
31
31
  * lit-element:
@@ -49,8 +49,8 @@
49
49
  *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
- * https://www.npmjs.com/package/lit
53
52
  * https://www.npmjs.com/package/@carbon/icons
53
+ * https://www.npmjs.com/package/lit
54
54
  * https://www.npmjs.com/package/lodash-es
55
55
  */
56
56
 
@@ -22,16 +22,22 @@
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  *
25
+ * lit-html:
26
+ *
27
+ * @license
28
+ * Copyright 2022 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ *
25
31
  * lit-element:
26
32
  *
27
33
  * @license
28
34
  * Copyright 2017 Google LLC
29
35
  * SPDX-License-Identifier: BSD-3-Clause
30
36
  *
31
- * lit-html:
37
+ * @lit/reactive-element:
32
38
  *
33
39
  * @license
34
- * Copyright 2022 Google LLC
40
+ * Copyright 2017 Google LLC
35
41
  * SPDX-License-Identifier: BSD-3-Clause
36
42
  *
37
43
  * @carbon/layout:
@@ -41,12 +47,6 @@
41
47
  * This source code is licensed under the Apache-2.0 license found in the
42
48
  * LICENSE file in the root directory of this source tree.
43
49
  *
44
- * @lit/reactive-element:
45
- *
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
52
  * https://www.npmjs.com/package/@carbon/icons
@@ -22,16 +22,22 @@
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  *
25
+ * lit-html:
26
+ *
27
+ * @license
28
+ * Copyright 2022 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ *
25
31
  * lit-element:
26
32
  *
27
33
  * @license
28
34
  * Copyright 2017 Google LLC
29
35
  * SPDX-License-Identifier: BSD-3-Clause
30
36
  *
31
- * lit-html:
37
+ * @lit/reactive-element:
32
38
  *
33
39
  * @license
34
- * Copyright 2022 Google LLC
40
+ * Copyright 2017 Google LLC
35
41
  * SPDX-License-Identifier: BSD-3-Clause
36
42
  *
37
43
  * @carbon/layout:
@@ -41,12 +47,6 @@
41
47
  * This source code is licensed under the Apache-2.0 license found in the
42
48
  * LICENSE file in the root directory of this source tree.
43
49
  *
44
- * @lit/reactive-element:
45
- *
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
52
  * https://www.npmjs.com/package/@carbon/icons
@@ -25,7 +25,7 @@
25
25
  * lit-html:
26
26
  *
27
27
  * @license
28
- * Copyright 2022 Google LLC
28
+ * Copyright 2017 Google LLC
29
29
  * SPDX-License-Identifier: BSD-3-Clause
30
30
  *
31
31
  * lit-element:
@@ -49,8 +49,8 @@
49
49
  *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
- * https://www.npmjs.com/package/lit
53
52
  * https://www.npmjs.com/package/@carbon/icons
53
+ * https://www.npmjs.com/package/lit
54
54
  * https://www.npmjs.com/package/lodash-es
55
55
  */
56
56
 
@@ -25,7 +25,7 @@
25
25
  * lit-html:
26
26
  *
27
27
  * @license
28
- * Copyright 2022 Google LLC
28
+ * Copyright 2017 Google LLC
29
29
  * SPDX-License-Identifier: BSD-3-Clause
30
30
  *
31
31
  * lit-element:
@@ -49,8 +49,8 @@
49
49
  *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
- * https://www.npmjs.com/package/lit
53
52
  * https://www.npmjs.com/package/@carbon/icons
53
+ * https://www.npmjs.com/package/lit
54
54
  * https://www.npmjs.com/package/lodash-es
55
55
  */
56
56
 
@@ -22,16 +22,22 @@
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  *
25
+ * lit-html:
26
+ *
27
+ * @license
28
+ * Copyright 2022 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ *
25
31
  * lit-element:
26
32
  *
27
33
  * @license
28
34
  * Copyright 2017 Google LLC
29
35
  * SPDX-License-Identifier: BSD-3-Clause
30
36
  *
31
- * lit-html:
37
+ * @lit/reactive-element:
32
38
  *
33
39
  * @license
34
- * Copyright 2022 Google LLC
40
+ * Copyright 2017 Google LLC
35
41
  * SPDX-License-Identifier: BSD-3-Clause
36
42
  *
37
43
  * @carbon/layout:
@@ -41,12 +47,6 @@
41
47
  * This source code is licensed under the Apache-2.0 license found in the
42
48
  * LICENSE file in the root directory of this source tree.
43
49
  *
44
- * @lit/reactive-element:
45
- *
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
52
  * https://www.npmjs.com/package/@carbon/icons
@@ -25,7 +25,7 @@
25
25
  * lit-html:
26
26
  *
27
27
  * @license
28
- * Copyright 2022 Google LLC
28
+ * Copyright 2017 Google LLC
29
29
  * SPDX-License-Identifier: BSD-3-Clause
30
30
  *
31
31
  * lit-element:
@@ -49,8 +49,8 @@
49
49
  *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
- * https://www.npmjs.com/package/lit
53
52
  * https://www.npmjs.com/package/@carbon/icons
53
+ * https://www.npmjs.com/package/lit
54
54
  * https://www.npmjs.com/package/lodash-es
55
55
  */
56
56
 
@@ -22,16 +22,22 @@
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  *
25
+ * lit-html:
26
+ *
27
+ * @license
28
+ * Copyright 2022 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ *
25
31
  * lit-element:
26
32
  *
27
33
  * @license
28
34
  * Copyright 2017 Google LLC
29
35
  * SPDX-License-Identifier: BSD-3-Clause
30
36
  *
31
- * lit-html:
37
+ * @lit/reactive-element:
32
38
  *
33
39
  * @license
34
- * Copyright 2022 Google LLC
40
+ * Copyright 2017 Google LLC
35
41
  * SPDX-License-Identifier: BSD-3-Clause
36
42
  *
37
43
  * @carbon/layout:
@@ -41,12 +47,6 @@
41
47
  * This source code is licensed under the Apache-2.0 license found in the
42
48
  * LICENSE file in the root directory of this source tree.
43
49
  *
44
- * @lit/reactive-element:
45
- *
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
52
  * https://www.npmjs.com/package/@carbon/icons
@@ -22,16 +22,22 @@
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  *
25
+ * lit-html:
26
+ *
27
+ * @license
28
+ * Copyright 2022 Google LLC
29
+ * SPDX-License-Identifier: BSD-3-Clause
30
+ *
25
31
  * lit-element:
26
32
  *
27
33
  * @license
28
34
  * Copyright 2017 Google LLC
29
35
  * SPDX-License-Identifier: BSD-3-Clause
30
36
  *
31
- * lit-html:
37
+ * @lit/reactive-element:
32
38
  *
33
39
  * @license
34
- * Copyright 2022 Google LLC
40
+ * Copyright 2017 Google LLC
35
41
  * SPDX-License-Identifier: BSD-3-Clause
36
42
  *
37
43
  * @carbon/layout:
@@ -41,12 +47,6 @@
41
47
  * This source code is licensed under the Apache-2.0 license found in the
42
48
  * LICENSE file in the root directory of this source tree.
43
49
  *
44
- * @lit/reactive-element:
45
- *
46
- * @license
47
- * Copyright 2017 Google LLC
48
- * SPDX-License-Identifier: BSD-3-Clause
49
- *
50
50
  * Also refer to the following links for the license of other third-party dependencies:
51
51
  *
52
52
  * https://www.npmjs.com/package/@carbon/icons
@@ -139,7 +139,7 @@ let CDSTableHeaderCell = _decorate([customElement(`${prefix}-table-header-cell`)
139
139
  decorators: [property({
140
140
  type: Boolean,
141
141
  reflect: true,
142
- attribute: 'is-sortable'
142
+ attribute: 'expandable'
143
143
  })],
144
144
  key: "isExpandable",
145
145
  value() {
@@ -150,7 +150,7 @@ let CDSTableHeaderCell = _decorate([customElement(`${prefix}-table-header-cell`)
150
150
  decorators: [property({
151
151
  type: Boolean,
152
152
  reflect: true,
153
- attribute: 'is-sortable'
153
+ attribute: 'is-selectable'
154
154
  })],
155
155
  key: "isSelectable",
156
156
  value() {
@@ -1 +1 @@
1
- {"version":3,"file":"table-header-cell.js","names":["LitElement","html","property","classMap","ArrowsVertical32","ArrowDown32","prefix","FocusMixin","TABLE_SORT_CYCLE","TABLE_SORT_CYCLES","TABLE_SORT_DIRECTION","styles","carbonElement","customElement","CDSTableHeaderCell","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","key","value","_handleClickSortButton","event","target","matches","slugItem","nextSortDirection","_getNextSort","init","bubbles","cancelable","composed","detail","oldSortDirection","sortDirection","dispatchEvent","CustomEvent","eventBeforeSort","sortActive","_handleSlotChange","requestUpdate","_handleSlugSlotChange","hasContent","assignedNodes","filter","elem","undefined","length","_hasSlug","Boolean","setAttribute","sortCycle","TRI_STATES_FROM_ASCENDING","TypeError","directions","index","indexOf","NONE","RangeError","decorators","type","reflect","attribute","connectedCallback","hasAttribute","_get","_getPrototypeOf","prototype","call","updated","changedProperties","isSortable","has","removeAttribute","render","labelClasses","sortIcon","part","class","_t","_","textContent","_t2","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/data-table/table-header-cell.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\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 { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport ArrowsVertical32 from '@carbon/icons/lib/arrows--vertical/32';\nimport ArrowDown32 from '@carbon/icons/lib/arrow--down/32';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport {\n TABLE_SORT_CYCLE,\n TABLE_SORT_CYCLES,\n TABLE_SORT_DIRECTION,\n} from './defs';\nimport styles from './data-table.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { TABLE_SORT_CYCLE, TABLE_SORT_CYCLES, TABLE_SORT_DIRECTION };\n\n/**\n * Data table header cell.\n *\n * @element cds-table-header-cell\n * @fires cds-table-header-cell-sort\n * The custom event fired before a new sort direction is set upon a user gesture.\n * Cancellation of this event stops the user-initiated change in sort direction.\n */\n@customElement(`${prefix}-table-header-cell`)\nclass CDSTableHeaderCell extends FocusMixin(LitElement) {\n /**\n * Handles `click` event on the sort button.\n *\n */\n private _handleClickSortButton(event) {\n if (\n !(event.target as HTMLElement).matches(\n (this.constructor as typeof CDSTableHeaderCell).slugItem\n )\n ) {\n const nextSortDirection = this._getNextSort();\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n oldSortDirection: this.sortDirection,\n sortDirection: nextSortDirection,\n },\n };\n const constructor = this.constructor as typeof CDSTableHeaderCell;\n if (\n this.dispatchEvent(new CustomEvent(constructor.eventBeforeSort, init))\n ) {\n this.sortActive = true;\n this.sortDirection = nextSortDirection;\n }\n }\n }\n\n /**\n * Handles `slotchange` event.\n *\n */\n private _handleSlotChange() {\n this.requestUpdate();\n }\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlugSlotChange({ 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 CDSTableHeaderCell).slugItem\n )\n : false\n );\n if (hasContent.length > 0) {\n this._hasSlug = Boolean(hasContent);\n (hasContent[0] as HTMLElement).setAttribute('size', 'mini');\n }\n\n this.requestUpdate();\n }\n\n /**\n * @returns The next sort direction.\n */\n private _getNextSort() {\n const {\n sortCycle = TABLE_SORT_CYCLE.TRI_STATES_FROM_ASCENDING,\n sortDirection,\n } = this;\n if (!sortDirection) {\n throw new TypeError(\n 'Table sort direction is not defined. ' +\n 'Likely that `_getNextSort()` is called with non-sorted table column, which should not happen in regular condition.'\n );\n }\n const directions = (this.constructor as typeof CDSTableHeaderCell)\n .TABLE_SORT_CYCLES[sortCycle];\n const index = directions.indexOf(sortDirection as TABLE_SORT_DIRECTION);\n if (index < 0) {\n if (sortDirection === TABLE_SORT_DIRECTION.NONE) {\n // If the current sort direction is `none` in bi-state sort cycle, returns the first one in the cycle\n return directions[0];\n }\n throw new RangeError(\n `The given sort state (${sortDirection}) is not found in the given table sort cycle: ${sortCycle}`\n );\n }\n return directions[(index + 1) % directions.length];\n }\n\n /**\n * `true` if there is a slug.\n */\n protected _hasSlug = false;\n\n /**\n * `true` if the table has expandable rows\n */\n @property({ type: Boolean, reflect: true, attribute: 'is-sortable' })\n isExpandable = false;\n\n /**\n * `true` if this table has selectable rows\n */\n @property({ type: Boolean, reflect: true, attribute: 'is-sortable' })\n isSelectable = false;\n /**\n * `true` if this table header column should be sortable\n */\n @property({ type: Boolean, reflect: true, attribute: 'is-sortable' })\n isSortable = false;\n\n /**\n * `true` if this table header cell is of a primary sorting column.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sort-active' })\n sortActive = false;\n\n /**\n * The table sort cycle in use.\n */\n @property({ reflect: true, attribute: 'sort-cycle' })\n sortCycle?: TABLE_SORT_CYCLE;\n\n /**\n * The table sort direction.\n * If present, this table header cell will have a sorting UI. Choose between `ascending` or `descending`.\n */\n @property({ reflect: true, attribute: 'sort-direction' })\n sortDirection?: TABLE_SORT_DIRECTION;\n\n /**\n * TODO: Uncomment when Carbon fully implements sticky header\n * Specify whether the header should be sticky.\n * Still experimental: may not work with every combination of table props\n */\n // @property({ type: Boolean, reflect: true, attribute: 'sticky-header' })\n // stickyHeader = false;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'columnheader');\n }\n\n super.connectedCallback();\n }\n\n updated(changedProperties) {\n if (\n this.isSortable &&\n !changedProperties.has('sortDirection') &&\n !this.sortDirection\n ) {\n this.sortDirection = TABLE_SORT_DIRECTION.NONE;\n }\n if (this._hasSlug) {\n this.setAttribute('slug', '');\n } else {\n this.removeAttribute('slug');\n }\n }\n\n render() {\n const { sortDirection } = this;\n const labelClasses = classMap({\n [`${prefix}--table-header-label`]: true,\n [`${prefix}--table-header-label--slug`]: this._hasSlug,\n });\n if (sortDirection) {\n const sortIcon =\n sortDirection === TABLE_SORT_DIRECTION.NONE\n ? ArrowsVertical32({\n part: 'sort-icon',\n class: `${prefix}--table-sort__icon-unsorted`,\n })\n : ArrowDown32({\n part: 'sort-icon',\n class: `${prefix}--table-sort__icon`,\n });\n return html`\n <button\n part=\"sort-button\"\n class=\"${prefix}--table-sort\"\n title=\"${this.textContent}\"\n @click=${this._handleClickSortButton}>\n <span class=\"${prefix}--table-sort__flex\">\n <span part=\"label-text\" class=\"${prefix}--table-header-label\"\n ><slot @slotchange=${this._handleSlotChange}></slot\n ></span>\n <slot\n name=\"slug\"\n @slotchange=\"${this._handleSlugSlotChange}\"></slot>\n ${sortIcon}\n </span>\n </button>\n `;\n }\n return html`<span part=\"label-text\" class=\"${labelClasses}\">\n <slot></slot\n ><slot name=\"slug\" @slotchange=\"${this._handleSlugSlotChange}\"></slot\n ></span> `;\n }\n /**\n * A selector that will return the slug item.\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n /**\n * The name of the custom event fired before a new sort direction is set upon a user gesture.\n * Cancellation of this event stops the user-initiated change in sort direction.\n */\n static get eventBeforeSort() {\n return `${prefix}-table-header-cell-sort`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n\n /**\n * Mapping of table sort cycles to table sort states.\n */\n static TABLE_SORT_CYCLES = TABLE_SORT_CYCLES;\n}\n\nexport default CDSTableHeaderCell;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,OAAOC,gBAAgB,MAAM,iCAAuC;AACpE,OAAOC,WAAW,MAAM,4BAAkC;AAC1D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,UAAU,MAAM,4BAA4B;AACnD,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,QACf,QAAQ;AACf,OAAOC,MAAM,MAAM,uBAAmB;AACtC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,SAASL,gBAAgB,EAAEC,iBAAiB,EAAEC,oBAAoB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IASMI,kBAAkB,GAAAC,SAAA,EADvBF,aAAa,CAAE,GAAEP,MAAO,oBAAmB,CAAC,aAAAU,WAAA,EAAAC,WAAA;EAA7C,MACMH,kBAAkB,SAAAG,WAAA,CAAgC;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAkOxD;EAAC;IAAAI,CAAA,EAlOKN,kBAAkB;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,KAAA;MACtB;AACF;AACA;AACA;MACE,SAAAC,uBAA+BC,K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AAC5D,sBAAsB,EACrBnB,MAAM,EACcA,MAAM,EAChB,IAAI,CAACqC,iBAAiB,EAI5B,IAAI,CAACE,qBAAqB,EACzCmC,QAAQ;QAIlB;QACA,OAAO/E,IAAI,CAAAqF,GAAA,KAAAA,GAAA,GAAAF,CAAC,kCAA+B,CAAe;AAC9D;AACA,wCAAsC,CAA6B;AACnE,cAAa,GAHoCL,YAAY,EAErB,IAAI,CAAClC,qBAAqB;MAEhE;MACA;AACF;AACA;IAFE;MAAAvB,IAAA;MAAAiE,MAAA;MAAAhE,GAAA;MAAAC,KAAA,EAGA,SAAAK,SAAA,EAAsB;QACpB,OAAQ,GAAEvB,MAAO,OAAM;MACzB;;MAEA;AACF;AACA;AACA;IAHE;MAAAgB,IAAA;MAAAiE,MAAA;MAAAhE,GAAA;MAAAC,KAAA,EAIA,SAAAiB,gBAAA,EAA6B;QAC3B,OAAQ,GAAEnC,MAAO,yBAAwB;MAC3C;IAAC;MAAAgB,IAAA;MAAAiE,MAAA;MAAAhE,GAAA;MAAAC,MAAA;QAAA,OAAAgE,aAAA,CAAAA,aAAA,KAGIxF,UAAU,CAACyF,iBAAiB;UAC/BC,cAAc,EAAE;QAAI;MAAA;IAAA;MAAApE,IAAA;MAAAiE,MAAA;MAAAhE,GAAA;MAAAC,MAAA;QAAA,OAENb,MAAM;MAAA;IAAA;MAAAW,IAAA;MAAAiE,MAAA;MAAAhE,GAAA;MAAAC,MAAA;QAAA,OAKKf,iBAAiB;MAAA;IAAA;EAAA;AAAA,GAjObF,UAAU,CAACP,UAAU,CAAC;AAoOvD,eAAec,kBAAkB"}
1
+ {"version":3,"file":"table-header-cell.js","names":["LitElement","html","property","classMap","ArrowsVertical32","ArrowDown32","prefix","FocusMixin","TABLE_SORT_CYCLE","TABLE_SORT_CYCLES","TABLE_SORT_DIRECTION","styles","carbonElement","customElement","CDSTableHeaderCell","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","key","value","_handleClickSortButton","event","target","matches","slugItem","nextSortDirection","_getNextSort","init","bubbles","cancelable","composed","detail","oldSortDirection","sortDirection","dispatchEvent","CustomEvent","eventBeforeSort","sortActive","_handleSlotChange","requestUpdate","_handleSlugSlotChange","hasContent","assignedNodes","filter","elem","undefined","length","_hasSlug","Boolean","setAttribute","sortCycle","TRI_STATES_FROM_ASCENDING","TypeError","directions","index","indexOf","NONE","RangeError","decorators","type","reflect","attribute","connectedCallback","hasAttribute","_get","_getPrototypeOf","prototype","call","updated","changedProperties","isSortable","has","removeAttribute","render","labelClasses","sortIcon","part","class","_t","_","textContent","_t2","static","_objectSpread","shadowRootOptions","delegatesFocus"],"sources":["components/data-table/table-header-cell.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\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 { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport ArrowsVertical32 from '@carbon/icons/lib/arrows--vertical/32';\nimport ArrowDown32 from '@carbon/icons/lib/arrow--down/32';\nimport { prefix } from '../../globals/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport {\n TABLE_SORT_CYCLE,\n TABLE_SORT_CYCLES,\n TABLE_SORT_DIRECTION,\n} from './defs';\nimport styles from './data-table.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { TABLE_SORT_CYCLE, TABLE_SORT_CYCLES, TABLE_SORT_DIRECTION };\n\n/**\n * Data table header cell.\n *\n * @element cds-table-header-cell\n * @fires cds-table-header-cell-sort\n * The custom event fired before a new sort direction is set upon a user gesture.\n * Cancellation of this event stops the user-initiated change in sort direction.\n */\n@customElement(`${prefix}-table-header-cell`)\nclass CDSTableHeaderCell extends FocusMixin(LitElement) {\n /**\n * Handles `click` event on the sort button.\n *\n */\n private _handleClickSortButton(event) {\n if (\n !(event.target as HTMLElement).matches(\n (this.constructor as typeof CDSTableHeaderCell).slugItem\n )\n ) {\n const nextSortDirection = this._getNextSort();\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n oldSortDirection: this.sortDirection,\n sortDirection: nextSortDirection,\n },\n };\n const constructor = this.constructor as typeof CDSTableHeaderCell;\n if (\n this.dispatchEvent(new CustomEvent(constructor.eventBeforeSort, init))\n ) {\n this.sortActive = true;\n this.sortDirection = nextSortDirection;\n }\n }\n }\n\n /**\n * Handles `slotchange` event.\n *\n */\n private _handleSlotChange() {\n this.requestUpdate();\n }\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlugSlotChange({ 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 CDSTableHeaderCell).slugItem\n )\n : false\n );\n if (hasContent.length > 0) {\n this._hasSlug = Boolean(hasContent);\n (hasContent[0] as HTMLElement).setAttribute('size', 'mini');\n }\n\n this.requestUpdate();\n }\n\n /**\n * @returns The next sort direction.\n */\n private _getNextSort() {\n const {\n sortCycle = TABLE_SORT_CYCLE.TRI_STATES_FROM_ASCENDING,\n sortDirection,\n } = this;\n if (!sortDirection) {\n throw new TypeError(\n 'Table sort direction is not defined. ' +\n 'Likely that `_getNextSort()` is called with non-sorted table column, which should not happen in regular condition.'\n );\n }\n const directions = (this.constructor as typeof CDSTableHeaderCell)\n .TABLE_SORT_CYCLES[sortCycle];\n const index = directions.indexOf(sortDirection as TABLE_SORT_DIRECTION);\n if (index < 0) {\n if (sortDirection === TABLE_SORT_DIRECTION.NONE) {\n // If the current sort direction is `none` in bi-state sort cycle, returns the first one in the cycle\n return directions[0];\n }\n throw new RangeError(\n `The given sort state (${sortDirection}) is not found in the given table sort cycle: ${sortCycle}`\n );\n }\n return directions[(index + 1) % directions.length];\n }\n\n /**\n * `true` if there is a slug.\n */\n protected _hasSlug = false;\n\n /**\n * `true` if the table has expandable rows\n */\n @property({ type: Boolean, reflect: true, attribute: 'expandable' })\n isExpandable = false;\n\n /**\n * `true` if this table has selectable rows\n */\n @property({ type: Boolean, reflect: true, attribute: 'is-selectable' })\n isSelectable = false;\n /**\n * `true` if this table header column should be sortable\n */\n @property({ type: Boolean, reflect: true, attribute: 'is-sortable' })\n isSortable = false;\n\n /**\n * `true` if this table header cell is of a primary sorting column.\n */\n @property({ type: Boolean, reflect: true, attribute: 'sort-active' })\n sortActive = false;\n\n /**\n * The table sort cycle in use.\n */\n @property({ reflect: true, attribute: 'sort-cycle' })\n sortCycle?: TABLE_SORT_CYCLE;\n\n /**\n * The table sort direction.\n * If present, this table header cell will have a sorting UI. Choose between `ascending` or `descending`.\n */\n @property({ reflect: true, attribute: 'sort-direction' })\n sortDirection?: TABLE_SORT_DIRECTION;\n\n /**\n * TODO: Uncomment when Carbon fully implements sticky header\n * Specify whether the header should be sticky.\n * Still experimental: may not work with every combination of table props\n */\n // @property({ type: Boolean, reflect: true, attribute: 'sticky-header' })\n // stickyHeader = false;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'columnheader');\n }\n\n super.connectedCallback();\n }\n\n updated(changedProperties) {\n if (\n this.isSortable &&\n !changedProperties.has('sortDirection') &&\n !this.sortDirection\n ) {\n this.sortDirection = TABLE_SORT_DIRECTION.NONE;\n }\n if (this._hasSlug) {\n this.setAttribute('slug', '');\n } else {\n this.removeAttribute('slug');\n }\n }\n\n render() {\n const { sortDirection } = this;\n const labelClasses = classMap({\n [`${prefix}--table-header-label`]: true,\n [`${prefix}--table-header-label--slug`]: this._hasSlug,\n });\n if (sortDirection) {\n const sortIcon =\n sortDirection === TABLE_SORT_DIRECTION.NONE\n ? ArrowsVertical32({\n part: 'sort-icon',\n class: `${prefix}--table-sort__icon-unsorted`,\n })\n : ArrowDown32({\n part: 'sort-icon',\n class: `${prefix}--table-sort__icon`,\n });\n return html`\n <button\n part=\"sort-button\"\n class=\"${prefix}--table-sort\"\n title=\"${this.textContent}\"\n @click=${this._handleClickSortButton}>\n <span class=\"${prefix}--table-sort__flex\">\n <span part=\"label-text\" class=\"${prefix}--table-header-label\"\n ><slot @slotchange=${this._handleSlotChange}></slot\n ></span>\n <slot\n name=\"slug\"\n @slotchange=\"${this._handleSlugSlotChange}\"></slot>\n ${sortIcon}\n </span>\n </button>\n `;\n }\n return html`<span part=\"label-text\" class=\"${labelClasses}\">\n <slot></slot\n ><slot name=\"slug\" @slotchange=\"${this._handleSlugSlotChange}\"></slot\n ></span> `;\n }\n /**\n * A selector that will return the slug item.\n */\n static get slugItem() {\n return `${prefix}-slug`;\n }\n\n /**\n * The name of the custom event fired before a new sort direction is set upon a user gesture.\n * Cancellation of this event stops the user-initiated change in sort direction.\n */\n static get eventBeforeSort() {\n return `${prefix}-table-header-cell-sort`;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n\n /**\n * Mapping of table sort cycles to table sort states.\n */\n static TABLE_SORT_CYCLES = TABLE_SORT_CYCLES;\n}\n\nexport default CDSTableHeaderCell;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,OAAOC,gBAAgB,MAAM,iCAAuC;AACpE,OAAOC,WAAW,MAAM,4BAAkC;AAC1D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,UAAU,MAAM,4BAA4B;AACnD,SACEC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,QACf,QAAQ;AACf,OAAOC,MAAM,MAAM,uBAAmB;AACtC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,SAASL,gBAAgB,EAAEC,iBAAiB,EAAEC,oBAAoB;;AAElE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IASMI,kBAAkB,GAAAC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,iBAAiB;MAAA;IAAA;EAAA;AAAA,GAjObF,UAAU,CAACP,UAAU,CAAC;AAoOvD,eAAec,kBAAkB"}
@@ -533,7 +533,13 @@ let CDSTable = _decorate([customElement(`${prefix}-table`)], function (_initiali
533
533
  }
534
534
  const columns = [...this._tableHeaderRow.children];
535
535
  const columnIndex = columns.indexOf(target);
536
- columns.forEach(e => e !== target && e.setAttribute('sort-direction', 'none'));
536
+ columns.forEach(e => {
537
+ if (e !== target && this.isSortable) {
538
+ e.setAttribute('sort-direction', 'none');
539
+ } else if (e.hasAttribute('is-sortable')) {
540
+ e.setAttribute('sort-direction', 'none');
541
+ }
542
+ });
537
543
  this._handleSortAction(columnIndex, sortDirection);
538
544
  const init = {
539
545
  bubbles: true,
@@ -904,7 +910,13 @@ let CDSTable = _decorate([customElement(`${prefix}-table`)], function (_initiali
904
910
  columnIndex = index;
905
911
  }
906
912
  });
907
- columns.forEach((e, index) => index !== columnIndex && e.setAttribute('sort-direction', 'none'));
913
+ columns.forEach((e, index) => {
914
+ if (index !== columnIndex && this.isSortable) {
915
+ e.setAttribute('sort-direction', 'none');
916
+ } else if (e.hasAttribute('is-sortable')) {
917
+ e.setAttribute('sort-direction', 'none');
918
+ }
919
+ });
908
920
  this._handleSortAction(columnIndex, sortDirection);
909
921
  }
910
922