@spectrum-web-components/table 0.0.2-table.2695 → 0.1.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 (146) hide show
  1. package/README.md +5 -5
  2. package/custom-elements.json +20 -0
  3. package/elements.dev.js +9 -0
  4. package/elements.dev.js.map +7 -0
  5. package/elements.js +2 -19
  6. package/elements.js.map +7 -1
  7. package/package.json +80 -18
  8. package/sp-table-body.dev.js +4 -0
  9. package/sp-table-body.dev.js.map +7 -0
  10. package/sp-table-body.js +2 -14
  11. package/sp-table-body.js.map +7 -1
  12. package/sp-table-cell.dev.js +4 -0
  13. package/sp-table-cell.dev.js.map +7 -0
  14. package/sp-table-cell.js +2 -14
  15. package/sp-table-cell.js.map +7 -1
  16. package/sp-table-checkbox-cell.dev.js +4 -0
  17. package/sp-table-checkbox-cell.dev.js.map +7 -0
  18. package/sp-table-checkbox-cell.js +2 -14
  19. package/sp-table-checkbox-cell.js.map +7 -1
  20. package/sp-table-head-cell.dev.js +4 -0
  21. package/sp-table-head-cell.dev.js.map +7 -0
  22. package/sp-table-head-cell.js +2 -14
  23. package/sp-table-head-cell.js.map +7 -1
  24. package/sp-table-head.dev.js +4 -0
  25. package/sp-table-head.dev.js.map +7 -0
  26. package/sp-table-head.js +2 -14
  27. package/sp-table-head.js.map +7 -1
  28. package/sp-table-row.dev.js +4 -0
  29. package/sp-table-row.dev.js.map +7 -0
  30. package/sp-table-row.js +2 -14
  31. package/sp-table-row.js.map +7 -1
  32. package/sp-table.dev.js +4 -0
  33. package/sp-table.dev.js.map +7 -0
  34. package/sp-table.js +2 -14
  35. package/sp-table.js.map +7 -1
  36. package/src/Table.d.ts +1 -0
  37. package/src/Table.dev.js +392 -0
  38. package/src/Table.dev.js.map +7 -0
  39. package/src/Table.js +13 -383
  40. package/src/Table.js.map +7 -1
  41. package/src/TableBody.d.ts +2 -0
  42. package/src/TableBody.dev.js +55 -0
  43. package/src/TableBody.dev.js.map +7 -0
  44. package/src/TableBody.js +3 -35
  45. package/src/TableBody.js.map +7 -1
  46. package/src/TableCell.dev.js +36 -0
  47. package/src/TableCell.dev.js.map +7 -0
  48. package/src/TableCell.js +3 -35
  49. package/src/TableCell.js.map +7 -1
  50. package/src/TableCheckboxCell.dev.js +71 -0
  51. package/src/TableCheckboxCell.dev.js.map +7 -0
  52. package/src/TableCheckboxCell.js +4 -62
  53. package/src/TableCheckboxCell.js.map +7 -1
  54. package/src/TableHead.dev.js +55 -0
  55. package/src/TableHead.dev.js.map +7 -0
  56. package/src/TableHead.js +3 -52
  57. package/src/TableHead.js.map +7 -1
  58. package/src/TableHeadCell.dev.js +93 -0
  59. package/src/TableHeadCell.dev.js.map +7 -0
  60. package/src/TableHeadCell.js +5 -92
  61. package/src/TableHeadCell.js.map +7 -1
  62. package/src/TableRow.dev.js +104 -0
  63. package/src/TableRow.dev.js.map +7 -0
  64. package/src/TableRow.js +3 -96
  65. package/src/TableRow.js.map +7 -1
  66. package/src/index.d.ts +6 -0
  67. package/src/index.dev.js +9 -0
  68. package/src/index.dev.js.map +7 -0
  69. package/src/index.js +2 -13
  70. package/src/index.js.map +7 -1
  71. package/src/spectrum-table-body.css.dev.js +17 -0
  72. package/src/spectrum-table-body.css.dev.js.map +7 -0
  73. package/src/spectrum-table-body.css.js +3 -16
  74. package/src/spectrum-table-body.css.js.map +7 -1
  75. package/src/spectrum-table-cell.css.dev.js +27 -0
  76. package/src/spectrum-table-cell.css.dev.js.map +7 -0
  77. package/src/spectrum-table-cell.css.js +3 -16
  78. package/src/spectrum-table-cell.css.js.map +7 -1
  79. package/src/spectrum-table-checkbox-cell.css.dev.js +13 -0
  80. package/src/spectrum-table-checkbox-cell.css.dev.js.map +7 -0
  81. package/src/spectrum-table-checkbox-cell.css.js +3 -16
  82. package/src/spectrum-table-checkbox-cell.css.js.map +7 -1
  83. package/src/spectrum-table-head-cell.css.dev.js +61 -0
  84. package/src/spectrum-table-head-cell.css.dev.js.map +7 -0
  85. package/src/spectrum-table-head-cell.css.js +3 -16
  86. package/src/spectrum-table-head-cell.css.js.map +7 -1
  87. package/src/spectrum-table-head.css.dev.js +7 -0
  88. package/src/spectrum-table-head.css.dev.js.map +7 -0
  89. package/src/spectrum-table-head.css.js +3 -16
  90. package/src/spectrum-table-head.css.js.map +7 -1
  91. package/src/spectrum-table-row.css.dev.js +33 -0
  92. package/src/spectrum-table-row.css.dev.js.map +7 -0
  93. package/src/spectrum-table-row.css.js +3 -16
  94. package/src/spectrum-table-row.css.js.map +7 -1
  95. package/src/spectrum-table.css.dev.js +513 -0
  96. package/src/spectrum-table.css.dev.js.map +7 -0
  97. package/src/spectrum-table.css.js +3 -16
  98. package/src/spectrum-table.css.js.map +7 -1
  99. package/src/table-body.css.dev.js +17 -0
  100. package/src/table-body.css.dev.js.map +7 -0
  101. package/src/table-body.css.js +4 -17
  102. package/src/table-body.css.js.map +7 -1
  103. package/src/table-cell.css.dev.js +27 -0
  104. package/src/table-cell.css.dev.js.map +7 -0
  105. package/src/table-cell.css.js +3 -16
  106. package/src/table-cell.css.js.map +7 -1
  107. package/src/table-checkbox-cell.css.dev.js +13 -0
  108. package/src/table-checkbox-cell.css.dev.js.map +7 -0
  109. package/src/table-checkbox-cell.css.js +3 -16
  110. package/src/table-checkbox-cell.css.js.map +7 -1
  111. package/src/table-head-cell.css.dev.js +61 -0
  112. package/src/table-head-cell.css.dev.js.map +7 -0
  113. package/src/table-head-cell.css.js +3 -16
  114. package/src/table-head-cell.css.js.map +7 -1
  115. package/src/table-head.css.dev.js +7 -0
  116. package/src/table-head.css.dev.js.map +7 -0
  117. package/src/table-head.css.js +3 -16
  118. package/src/table-head.css.js.map +7 -1
  119. package/src/table-row.css.dev.js +33 -0
  120. package/src/table-row.css.dev.js.map +7 -0
  121. package/src/table-row.css.js +3 -16
  122. package/src/table-row.css.js.map +7 -1
  123. package/src/table.css.dev.js +513 -0
  124. package/src/table.css.dev.js.map +7 -0
  125. package/src/table.css.js +4 -17
  126. package/src/table.css.js.map +7 -1
  127. package/stories/index.js +17 -27
  128. package/stories/index.js.map +7 -1
  129. package/stories/table-elements.stories.js +58 -102
  130. package/stories/table-elements.stories.js.map +7 -1
  131. package/stories/table-virtualized.stories.js +142 -128
  132. package/stories/table-virtualized.stories.js.map +7 -1
  133. package/test/benchmark/basic-test.js +7 -17
  134. package/test/benchmark/basic-test.js.map +7 -1
  135. package/test/table-elements.test-vrt.js +5 -15
  136. package/test/table-elements.test-vrt.js.map +7 -1
  137. package/test/table-selects.test.js +193 -170
  138. package/test/table-selects.test.js.map +7 -1
  139. package/test/table-virtualized.test-vrt.js +5 -15
  140. package/test/table-virtualized.test-vrt.js.map +7 -1
  141. package/test/table.test.js +117 -101
  142. package/test/table.test.js.map +7 -1
  143. package/test/virtualized-table-selects.test.js +386 -300
  144. package/test/virtualized-table-selects.test.js.map +7 -1
  145. package/test/virtualized-table.test.js +213 -182
  146. package/test/virtualized-table.test.js.map +7 -1
@@ -1,96 +1,9 @@
1
- import { __decorate } from "tslib";
2
- /*
3
- Copyright 2022 Adobe. All rights reserved.
4
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License. You may obtain a copy
6
- of the License at http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- Unless required by applicable law or agreed to in writing, software distributed under
9
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
10
- OF ANY KIND, either express or implied. See the License for the specific language
11
- governing permissions and limitations under the License.
12
- */
13
- import { html, SpectrumElement, } from '@spectrum-web-components/base';
14
- import { property } from '@spectrum-web-components/base/src/decorators.js';
15
- import '@spectrum-web-components/icons-ui/icons/sp-icon-arrow100.js';
16
- import styles from './table-head-cell.css.js';
17
- import arrowStyles from '@spectrum-web-components/icon/src/spectrum-icon-arrow.css.js';
18
- const ariaSortValue = (sortDirection) => {
19
- const values = {
20
- asc: 'ascending',
21
- desc: 'descending',
22
- };
23
- return values[sortDirection] || 'none';
24
- };
25
- /**
26
- * @element sp-table
27
- *
28
- * @fires sorted - Announces that the table head has been sorted and handles the sorted event
29
- */
30
- export class TableHeadCell extends SpectrumElement {
31
- constructor() {
32
- super(...arguments);
33
- this.role = 'columnheader';
34
- this.sortable = false;
35
- this.sortKey = '';
36
- }
37
- static get styles() {
38
- return [styles, arrowStyles];
39
- }
40
- handleClick() {
41
- if (!this.sortable)
42
- return;
43
- if (this.sortDirection) {
44
- this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
45
- }
46
- else {
47
- this.sortDirection = 'asc';
48
- }
49
- this.dispatchEvent(new CustomEvent('sorted', {
50
- bubbles: true,
51
- detail: {
52
- sortDirection: this.sortDirection,
53
- sortKey: this.sortKey,
54
- },
55
- }));
56
- }
57
- render() {
58
- const visiblySorted = this.sortable && !!this.sortDirection;
59
- return html `
1
+ "use strict";var l=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var o=(s,r,t,i)=>{for(var e=i>1?void 0:i?p(r,t):r,n=s.length-1,a;n>=0;n--)(a=s[n])&&(e=(i?a(r,t,e):a(e))||e);return i&&e&&l(r,t,e),e};import{html as d,SpectrumElement as u}from"@spectrum-web-components/base";import{property as c}from"@spectrum-web-components/base/src/decorators.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-arrow100.js";import h from"./table-head-cell.css.js";import m from"@spectrum-web-components/icon/src/spectrum-icon-arrow.css.js";const y=s=>({asc:"ascending",desc:"descending"})[s]||"none";export class TableHeadCell extends u{constructor(){super(...arguments);this.role="columnheader";this.sortable=!1;this.sortKey=""}static get styles(){return[h,m]}handleClick(){!this.sortable||(this.sortDirection?this.sortDirection=this.sortDirection==="asc"?"desc":"asc":this.sortDirection="asc",this.dispatchEvent(new CustomEvent("sorted",{bubbles:!0,detail:{sortDirection:this.sortDirection,sortKey:this.sortKey}})))}render(){const t=this.sortable&&!!this.sortDirection;return d`
60
2
  <slot></slot>
61
- ${visiblySorted
62
- ? html `
3
+ ${t?d`
63
4
  <sp-icon-arrow100
64
5
  class="sortedIcon spectrum-UIIcon-ArrowDown100"
65
6
  ></sp-icon-arrow100>
66
- `
67
- : html ``}
68
- `;
69
- }
70
- firstUpdated(changes) {
71
- super.firstUpdated(changes);
72
- this.addEventListener('click', this.handleClick);
73
- }
74
- update(changes) {
75
- if (changes.has('sorted')) {
76
- this.setAttribute('aria-sort', ariaSortValue(this.sortDirection));
77
- }
78
- if (changes.has('sortable')) {
79
- this.tabIndex = this.sortable ? 0 : -1;
80
- }
81
- super.update(changes);
82
- }
83
- }
84
- __decorate([
85
- property({ reflect: true })
86
- ], TableHeadCell.prototype, "role", void 0);
87
- __decorate([
88
- property({ type: Boolean, reflect: true })
89
- ], TableHeadCell.prototype, "sortable", void 0);
90
- __decorate([
91
- property({ reflect: true, attribute: 'sort-direction' })
92
- ], TableHeadCell.prototype, "sortDirection", void 0);
93
- __decorate([
94
- property({ attribute: 'sort-key' })
95
- ], TableHeadCell.prototype, "sortKey", void 0);
96
- //# sourceMappingURL=TableHeadCell.js.map
7
+ `:d``}
8
+ `}firstUpdated(t){super.firstUpdated(t),this.addEventListener("click",this.handleClick)}update(t){t.has("sortDirection")&&this.setAttribute("aria-sort",y(this.sortDirection)),t.has("sortable")&&(this.tabIndex=this.sortable?0:-1),super.update(t)}}o([c({reflect:!0})],TableHeadCell.prototype,"role",2),o([c({type:Boolean,reflect:!0})],TableHeadCell.prototype,"sortable",2),o([c({reflect:!0,attribute:"sort-direction"})],TableHeadCell.prototype,"sortDirection",2),o([c({attribute:"sort-key"})],TableHeadCell.prototype,"sortKey",2);
9
+ //# sourceMappingURL=TableHeadCell.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TableHeadCell.js","sourceRoot":"","sources":["TableHeadCell.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAEH,IAAI,EAEJ,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,6DAA6D,CAAC;AAErE,OAAO,MAAM,MAAM,0BAA0B,CAAC;AAC9C,OAAO,WAAW,MAAM,8DAA8D,CAAC;AAOvF,MAAM,aAAa,GAAG,CAAC,aAA8B,EAAU,EAAE;IAC7D,MAAM,MAAM,GAAG;QACX,GAAG,EAAE,WAAW;QAChB,IAAI,EAAE,YAAY;KACrB,CAAC;IACF,OAAO,MAAM,CAAC,aAA+B,CAAC,IAAI,MAAM,CAAC;AAC7D,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,eAAe;IAAlD;;QAMW,SAAI,GAAG,cAAc,CAAC;QAGtB,aAAQ,GAAG,KAAK,CAAC;QAMjB,YAAO,GAAG,EAAE,CAAC;IAgDxB,CAAC;IA9DU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACjC,CAAC;IAcS,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC3B,IAAI,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;SACtE;aAAM;YACH,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;SAC9B;QACD,IAAI,CAAC,aAAa,CACd,IAAI,WAAW,CAAqB,QAAQ,EAAE;YAC1C,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACJ,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,OAAO,EAAE,IAAI,CAAC,OAAO;aACxB;SACJ,CAAC,CACL,CAAC;IACN,CAAC;IAEkB,MAAM;QACrB,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;QAC5D,OAAO,IAAI,CAAA;;cAEL,aAAa;YACX,CAAC,CAAC,IAAI,CAAA;;;;mBAIH;YACH,CAAC,CAAC,IAAI,CAAA,EAAE;SACf,CAAC;IACN,CAAC;IAEkB,YAAY,CAAC,OAAuB;QACnD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,CAAC;IAEkB,MAAM,CAAC,OAAuB;QAC7C,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;YACvB,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;SACrE;QACD,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1C;QACD,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;CACJ;AAzDG;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACC;AAG7B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;oDACR;AAGjD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;8CAChB","sourcesContent":["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-arrow100.js';\n\nimport styles from './table-head-cell.css.js';\nimport arrowStyles from '@spectrum-web-components/icon/src/spectrum-icon-arrow.css.js';\n\nexport type SortedEventDetails = {\n sortDirection: 'asc' | 'desc';\n sortKey: string;\n};\n\nconst ariaSortValue = (sortDirection?: 'asc' | 'desc'): string => {\n const values = {\n asc: 'ascending',\n desc: 'descending',\n };\n return values[sortDirection as 'asc' | 'desc'] || 'none';\n};\n\n/**\n * @element sp-table\n *\n * @fires sorted - Announces that the table head has been sorted and handles the sorted event\n */\nexport class TableHeadCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles, arrowStyles];\n }\n\n @property({ reflect: true })\n public role = 'columnheader';\n\n @property({ type: Boolean, reflect: true })\n public sortable = false;\n\n @property({ reflect: true, attribute: 'sort-direction' })\n public sortDirection: 'asc' | 'desc' | undefined;\n\n @property({ attribute: 'sort-key' })\n public sortKey = '';\n\n protected handleClick(): void {\n if (!this.sortable) return;\n if (this.sortDirection) {\n this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';\n } else {\n this.sortDirection = 'asc';\n }\n this.dispatchEvent(\n new CustomEvent<SortedEventDetails>('sorted', {\n bubbles: true,\n detail: {\n sortDirection: this.sortDirection,\n sortKey: this.sortKey,\n },\n })\n );\n }\n\n protected override render(): TemplateResult {\n const visiblySorted = this.sortable && !!this.sortDirection;\n return html`\n <slot></slot>\n ${visiblySorted\n ? html`\n <sp-icon-arrow100\n class=\"sortedIcon spectrum-UIIcon-ArrowDown100\"\n ></sp-icon-arrow100>\n `\n : html``}\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.addEventListener('click', this.handleClick);\n }\n\n protected override update(changes: PropertyValues): void {\n if (changes.has('sorted')) {\n this.setAttribute('aria-sort', ariaSortValue(this.sortDirection));\n }\n if (changes.has('sortable')) {\n this.tabIndex = this.sortable ? 0 : -1;\n }\n super.update(changes);\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["TableHeadCell.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-arrow100.js';\n\nimport styles from './table-head-cell.css.js';\nimport arrowStyles from '@spectrum-web-components/icon/src/spectrum-icon-arrow.css.js';\n\nexport type SortedEventDetails = {\n sortDirection: 'asc' | 'desc';\n sortKey: string;\n};\n\nconst ariaSortValue = (sortDirection?: 'asc' | 'desc'): string => {\n const values = {\n asc: 'ascending',\n desc: 'descending',\n };\n return values[sortDirection as 'asc' | 'desc'] || 'none';\n};\n\n/**\n * @element sp-table\n *\n * @fires sorted - Announces that the table head has been sorted and handles the sorted event\n */\nexport class TableHeadCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles, arrowStyles];\n }\n\n @property({ reflect: true })\n public role = 'columnheader';\n\n @property({ type: Boolean, reflect: true })\n public sortable = false;\n\n @property({ reflect: true, attribute: 'sort-direction' })\n public sortDirection: 'asc' | 'desc' | undefined;\n\n @property({ attribute: 'sort-key' })\n public sortKey = '';\n\n protected handleClick(): void {\n if (!this.sortable) return;\n if (this.sortDirection) {\n this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';\n } else {\n this.sortDirection = 'asc';\n }\n this.dispatchEvent(\n new CustomEvent<SortedEventDetails>('sorted', {\n bubbles: true,\n detail: {\n sortDirection: this.sortDirection,\n sortKey: this.sortKey,\n },\n })\n );\n }\n\n protected override render(): TemplateResult {\n const visiblySorted = this.sortable && !!this.sortDirection;\n return html`\n <slot></slot>\n ${visiblySorted\n ? html`\n <sp-icon-arrow100\n class=\"sortedIcon spectrum-UIIcon-ArrowDown100\"\n ></sp-icon-arrow100>\n `\n : html``}\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.addEventListener('click', this.handleClick);\n }\n\n protected override update(changes: PropertyValues): void {\n if (changes.has('sortDirection')) {\n this.setAttribute('aria-sort', ariaSortValue(this.sortDirection));\n }\n if (changes.has('sortable')) {\n this.tabIndex = this.sortable ? 0 : -1;\n }\n super.update(changes);\n }\n}\n"],
5
+ "mappings": "qNAWA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,MAAO,8DAEP,OAAOC,MAAY,2BACnB,OAAOC,MAAiB,+DAOxB,MAAMC,EAAiBC,IACJ,CACX,IAAK,YACL,KAAM,YACV,GACcA,IAAoC,OAQ/C,aAAM,sBAAsBL,CAAgB,CAA5C,kCAMH,KAAO,KAAO,eAGd,KAAO,SAAW,GAMlB,KAAO,QAAU,GAdjB,WAA2B,QAAyB,CAChD,MAAO,CAACE,EAAQC,CAAW,CAC/B,CAcU,aAAoB,CACtB,CAAC,KAAK,WACN,KAAK,cACL,KAAK,cAAgB,KAAK,gBAAkB,MAAQ,OAAS,MAE7D,KAAK,cAAgB,MAEzB,KAAK,cACD,IAAI,YAAgC,SAAU,CAC1C,QAAS,GACT,OAAQ,CACJ,cAAe,KAAK,cACpB,QAAS,KAAK,OAClB,CACJ,CAAC,CACL,EACJ,CAEmB,QAAyB,CACxC,MAAMG,EAAgB,KAAK,UAAY,CAAC,CAAC,KAAK,cAC9C,OAAOP;AAAA;AAAA,cAEDO,EACIP;AAAA;AAAA;AAAA;AAAA,oBAKAA;AAAA,SAEd,CAEmB,aAAaQ,EAA+B,CAC3D,MAAM,aAAaA,CAAO,EAC1B,KAAK,iBAAiB,QAAS,KAAK,WAAW,CACnD,CAEmB,OAAOA,EAA+B,CACjDA,EAAQ,IAAI,eAAe,GAC3B,KAAK,aAAa,YAAaH,EAAc,KAAK,aAAa,CAAC,EAEhEG,EAAQ,IAAI,UAAU,IACtB,KAAK,SAAW,KAAK,SAAW,EAAI,IAExC,MAAM,OAAOA,CAAO,CACxB,CACJ,CAzDWC,EAAA,CADNP,EAAS,CAAE,QAAS,EAAK,CAAC,GALlB,cAMF,oBAGAO,EAAA,CADNP,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARjC,cASF,wBAGAO,EAAA,CADNP,EAAS,CAAE,QAAS,GAAM,UAAW,gBAAiB,CAAC,GAX/C,cAYF,6BAGAO,EAAA,CADNP,EAAS,CAAE,UAAW,UAAW,CAAC,GAd1B,cAeF",
6
+ "names": ["html", "SpectrumElement", "property", "styles", "arrowStyles", "ariaSortValue", "sortDirection", "visiblySorted", "changes", "__decorateClass"]
7
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __decorateClass = (decorators, target, key, kind) => {
5
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
6
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
7
+ if (decorator = decorators[i])
8
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9
+ if (kind && result)
10
+ __defProp(target, key, result);
11
+ return result;
12
+ };
13
+ import {
14
+ html,
15
+ SpectrumElement
16
+ } from "@spectrum-web-components/base";
17
+ import {
18
+ property,
19
+ queryAssignedElements
20
+ } from "@spectrum-web-components/base/src/decorators.js";
21
+ import styles from "./table-row.css.js";
22
+ export class TableRow extends SpectrumElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ this.role = "row";
26
+ this.selectable = false;
27
+ this.selected = false;
28
+ this.value = "";
29
+ }
30
+ static get styles() {
31
+ return [styles];
32
+ }
33
+ async handleChange(event) {
34
+ this.selected = event.target.checkbox.checked;
35
+ await 0;
36
+ if (event.defaultPrevented) {
37
+ this.selected = !this.selected;
38
+ }
39
+ }
40
+ handleSlotchange({
41
+ target
42
+ }) {
43
+ const assignedElements = target.assignedElements();
44
+ this.selectable = !!assignedElements.find(
45
+ (el) => el.localName === "sp-table-checkbox-cell"
46
+ );
47
+ }
48
+ manageSelected() {
49
+ const [checkboxCell] = this.checkboxCells;
50
+ if (!checkboxCell)
51
+ return;
52
+ checkboxCell.checked = this.selected;
53
+ }
54
+ handleClick(event) {
55
+ if (event.composedPath().find(
56
+ (node) => node.localName === "sp-checkbox"
57
+ )) {
58
+ return;
59
+ }
60
+ const [checkboxCell] = this.checkboxCells;
61
+ if (!checkboxCell)
62
+ return;
63
+ checkboxCell.click();
64
+ }
65
+ render() {
66
+ return html`
67
+ <slot
68
+ @change=${this.handleChange}
69
+ @slotchange=${this.handleSlotchange}
70
+ ></slot>
71
+ `;
72
+ }
73
+ willUpdate(changed) {
74
+ if (changed.has("selected")) {
75
+ this.manageSelected();
76
+ }
77
+ if (changed.has("selectable")) {
78
+ if (this.selectable) {
79
+ this.addEventListener("click", this.handleClick);
80
+ } else {
81
+ this.removeEventListener("click", this.handleClick);
82
+ }
83
+ }
84
+ }
85
+ }
86
+ __decorateClass([
87
+ queryAssignedElements({
88
+ selector: "sp-table-checkbox-cell",
89
+ flatten: true
90
+ })
91
+ ], TableRow.prototype, "checkboxCells", 2);
92
+ __decorateClass([
93
+ property({ reflect: true })
94
+ ], TableRow.prototype, "role", 2);
95
+ __decorateClass([
96
+ property({ type: Boolean })
97
+ ], TableRow.prototype, "selectable", 2);
98
+ __decorateClass([
99
+ property({ type: Boolean, reflect: true })
100
+ ], TableRow.prototype, "selected", 2);
101
+ __decorateClass([
102
+ property({ type: String })
103
+ ], TableRow.prototype, "value", 2);
104
+ //# sourceMappingURL=TableRow.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["TableRow.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n queryAssignedElements,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport styles from './table-row.css.js';\nimport { TableCheckboxCell } from './TableCheckboxCell.dev.js'\n\n/**\n * @element sp-table\n *\n * @fires sorted - Announces that `selected` of the table row has changed\n */\nexport class TableRow extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @queryAssignedElements({\n selector: 'sp-table-checkbox-cell',\n flatten: true,\n })\n checkboxCells!: TableCheckboxCell[];\n\n @property({ reflect: true })\n public role = 'row';\n\n @property({ type: Boolean })\n public selectable = false;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String })\n public value = '';\n\n protected async handleChange(\n event: Event & { target: TableCheckboxCell }\n ): Promise<void> {\n this.selected = event.target.checkbox.checked;\n\n await 0;\n\n if (event.defaultPrevented) {\n this.selected = !this.selected;\n }\n }\n\n protected handleSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n const assignedElements = target.assignedElements();\n this.selectable = !!assignedElements.find(\n (el) => el.localName === 'sp-table-checkbox-cell'\n );\n }\n\n protected manageSelected(): void {\n const [checkboxCell] = this.checkboxCells;\n if (!checkboxCell) return;\n checkboxCell.checked = this.selected;\n }\n\n protected handleClick(event: Event): void {\n if (\n event\n .composedPath()\n .find(\n (node) => (node as HTMLElement).localName === 'sp-checkbox'\n )\n ) {\n return;\n }\n const [checkboxCell] = this.checkboxCells;\n if (!checkboxCell) /* c8 ignore next */ return;\n checkboxCell.click();\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot\n @change=${this.handleChange}\n @slotchange=${this.handleSlotchange}\n ></slot>\n `;\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (changed.has('selected')) {\n this.manageSelected();\n }\n if (changed.has('selectable')) {\n if (this.selectable) {\n this.addEventListener('click', this.handleClick);\n } else {\n this.removeEventListener('click', this.handleClick);\n }\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,OAAO,YAAY;AAQZ,aAAM,iBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AAYH,SAAO,OAAO;AAGd,SAAO,aAAa;AAGpB,SAAO,WAAW;AAGlB,SAAO,QAAQ;AAAA;AAAA,EApBf,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAoBA,MAAgB,aACZ,OACa;AACb,SAAK,WAAW,MAAM,OAAO,SAAS;AAEtC,UAAM;AAEN,QAAI,MAAM,kBAAkB;AACxB,WAAK,WAAW,CAAC,KAAK;AAAA,IAC1B;AAAA,EACJ;AAAA,EAEU,iBAAiB;AAAA,IACvB;AAAA,EACJ,GAA8C;AAC1C,UAAM,mBAAmB,OAAO,iBAAiB;AACjD,SAAK,aAAa,CAAC,CAAC,iBAAiB;AAAA,MACjC,CAAC,OAAO,GAAG,cAAc;AAAA,IAC7B;AAAA,EACJ;AAAA,EAEU,iBAAuB;AAC7B,UAAM,CAAC,YAAY,IAAI,KAAK;AAC5B,QAAI,CAAC;AAAc;AACnB,iBAAa,UAAU,KAAK;AAAA,EAChC;AAAA,EAEU,YAAY,OAAoB;AACtC,QACI,MACK,aAAa,EACb;AAAA,MACG,CAAC,SAAU,KAAqB,cAAc;AAAA,IAClD,GACN;AACE;AAAA,IACJ;AACA,UAAM,CAAC,YAAY,IAAI,KAAK;AAC5B,QAAI,CAAC;AAAmC;AACxC,iBAAa,MAAM;AAAA,EACvB;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,0BAEW,KAAK;AAAA,8BACD,KAAK;AAAA;AAAA;AAAA,EAG/B;AAAA,EAEmB,WAAW,SAAqC;AAC/D,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,WAAK,eAAe;AAAA,IACxB;AACA,QAAI,QAAQ,IAAI,YAAY,GAAG;AAC3B,UAAI,KAAK,YAAY;AACjB,aAAK,iBAAiB,SAAS,KAAK,WAAW;AAAA,MACnD,OAAO;AACH,aAAK,oBAAoB,SAAS,KAAK,WAAW;AAAA,MACtD;AAAA,IACJ;AAAA,EACJ;AACJ;AA7EI;AAAA,EAJC,sBAAsB;AAAA,IACnB,UAAU;AAAA,IACV,SAAS;AAAA,EACb,CAAC;AAAA,GARQ,SAST;AAGO;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAXlB,SAYF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAdlB,SAeF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAjBjC,SAkBF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GApBjB,SAqBF;",
6
+ "names": []
7
+ }
package/src/TableRow.js CHANGED
@@ -1,100 +1,7 @@
1
- import { __decorate } from "tslib";
2
- /*
3
- Copyright 2022 Adobe. All rights reserved.
4
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
5
- you may not use this file except in compliance with the License. You may obtain a copy
6
- of the License at http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- Unless required by applicable law or agreed to in writing, software distributed under
9
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
10
- OF ANY KIND, either express or implied. See the License for the specific language
11
- governing permissions and limitations under the License.
12
- */
13
- import { html, SpectrumElement, } from '@spectrum-web-components/base';
14
- import { property, queryAssignedElements, } from '@spectrum-web-components/base/src/decorators.js';
15
- import styles from './table-row.css.js';
16
- /**
17
- * @element sp-table
18
- *
19
- * @fires sorted - Announces that `selected` of the table row has changed
20
- */
21
- export class TableRow extends SpectrumElement {
22
- constructor() {
23
- super(...arguments);
24
- this.role = 'row';
25
- this.selectable = false;
26
- this.selected = false;
27
- this.value = '';
28
- }
29
- static get styles() {
30
- return [styles];
31
- }
32
- async handleChange(event) {
33
- this.selected = event.target.checkbox.checked;
34
- await 0;
35
- if (event === null || event === void 0 ? void 0 : event.defaultPrevented) {
36
- this.selected = !this.selected;
37
- }
38
- }
39
- handleSlotchange({ target, }) {
40
- const assignedElements = target.assignedElements();
41
- this.selectable = !!assignedElements.find((el) => el.localName === 'sp-table-checkbox-cell');
42
- }
43
- manageSelected() {
44
- const [checkboxCell] = this.checkboxCells;
45
- if (!checkboxCell)
46
- return;
47
- checkboxCell.checked = this.selected;
48
- }
49
- handleClick(event) {
50
- if (event
51
- .composedPath()
52
- .find((node) => node.localName === 'sp-checkbox')) {
53
- return;
54
- }
55
- const [checkboxCell] = this.checkboxCells;
56
- if (!checkboxCell)
57
- return;
58
- checkboxCell.click();
59
- }
60
- render() {
61
- return html `
1
+ "use strict";var n=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var c=(i,s,e,l)=>{for(var t=l>1?void 0:l?h(s,e):s,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(l?a(s,e,t):a(t))||t);return l&&t&&n(s,e,t),t};import{html as d,SpectrumElement as p}from"@spectrum-web-components/base";import{property as r,queryAssignedElements as m}from"@spectrum-web-components/base/src/decorators.js";import u from"./table-row.css.js";export class TableRow extends p{constructor(){super(...arguments);this.role="row";this.selectable=!1;this.selected=!1;this.value=""}static get styles(){return[u]}async handleChange(e){this.selected=e.target.checkbox.checked,await 0,e.defaultPrevented&&(this.selected=!this.selected)}handleSlotchange({target:e}){const l=e.assignedElements();this.selectable=!!l.find(t=>t.localName==="sp-table-checkbox-cell")}manageSelected(){const[e]=this.checkboxCells;!e||(e.checked=this.selected)}handleClick(e){if(e.composedPath().find(t=>t.localName==="sp-checkbox"))return;const[l]=this.checkboxCells;!l||l.click()}render(){return d`
62
2
  <slot
63
3
  @change=${this.handleChange}
64
4
  @slotchange=${this.handleSlotchange}
65
5
  ></slot>
66
- `;
67
- }
68
- willUpdate(changed) {
69
- if (changed.has('selected')) {
70
- this.manageSelected();
71
- }
72
- if (changed.has('selectable')) {
73
- if (this.selectable) {
74
- this.addEventListener('click', this.handleClick);
75
- }
76
- else {
77
- this.removeEventListener('click', this.handleClick);
78
- }
79
- }
80
- }
81
- }
82
- __decorate([
83
- queryAssignedElements({
84
- selector: 'sp-table-checkbox-cell',
85
- flatten: true,
86
- })
87
- ], TableRow.prototype, "checkboxCells", void 0);
88
- __decorate([
89
- property({ reflect: true })
90
- ], TableRow.prototype, "role", void 0);
91
- __decorate([
92
- property({ type: Boolean })
93
- ], TableRow.prototype, "selectable", void 0);
94
- __decorate([
95
- property({ type: Boolean, reflect: true })
96
- ], TableRow.prototype, "selected", void 0);
97
- __decorate([
98
- property({ type: String })
99
- ], TableRow.prototype, "value", void 0);
100
- //# sourceMappingURL=TableRow.js.map
6
+ `}willUpdate(e){e.has("selected")&&this.manageSelected(),e.has("selectable")&&(this.selectable?this.addEventListener("click",this.handleClick):this.removeEventListener("click",this.handleClick))}}c([m({selector:"sp-table-checkbox-cell",flatten:!0})],TableRow.prototype,"checkboxCells",2),c([r({reflect:!0})],TableRow.prototype,"role",2),c([r({type:Boolean})],TableRow.prototype,"selectable",2),c([r({type:Boolean,reflect:!0})],TableRow.prototype,"selected",2),c([r({type:String})],TableRow.prototype,"value",2);
7
+ //# sourceMappingURL=TableRow.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"TableRow.js","sourceRoot":"","sources":["TableRow.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAEH,IAAI,EAEJ,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,QAAQ,EACR,qBAAqB,GACxB,MAAM,iDAAiD,CAAC;AACzD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAGxC;;;;GAIG;AACH,MAAM,OAAO,QAAS,SAAQ,eAAe;IAA7C;;QAYW,SAAI,GAAG,KAAK,CAAC;QAGb,eAAU,GAAG,KAAK,CAAC;QAGnB,aAAQ,GAAG,KAAK,CAAC;QAGjB,UAAK,GAAG,EAAE,CAAC;IAiEtB,CAAC;IArFU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAoBS,KAAK,CAAC,YAAY,CACxB,KAA4C;QAE5C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;QAE9C,MAAM,CAAC,CAAC;QAER,IAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,gBAAgB,EAAE;YACzB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;SAClC;IACL,CAAC;IAES,gBAAgB,CAAC,EACvB,MAAM,GAC4B;QAClC,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACnD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,gBAAgB,CAAC,IAAI,CACrC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,KAAK,wBAAwB,CACpD,CAAC;IACN,CAAC;IAES,cAAc;QACpB,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,YAAY;YAAE,OAAO;QAC1B,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;IACzC,CAAC;IAES,WAAW,CAAC,KAAY;QAC9B,IACI,KAAK;aACA,YAAY,EAAE;aACd,IAAI,CACD,CAAC,IAAI,EAAE,EAAE,CAAE,IAAoB,CAAC,SAAS,KAAK,aAAa,CAC9D,EACP;YACE,OAAO;SACV;QACD,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC1C,IAAI,CAAC,YAAY;YAAE,OAAO;QAC1B,YAAY,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;0BAEO,IAAI,CAAC,YAAY;8BACb,IAAI,CAAC,gBAAgB;;SAE1C,CAAC;IACN,CAAC;IAEkB,UAAU,CAAC,OAA6B;QACvD,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACzB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;QACD,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAC3B,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjB,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;aACpD;iBAAM;gBACH,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;aACvD;SACJ;IACL,CAAC;CACJ;AA7EG;IAJC,qBAAqB,CAAC;QACnB,QAAQ,EAAE,wBAAwB;QAClC,OAAO,EAAE,IAAI;KAChB,CAAC;+CACkC;AAGpC;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sCACR;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CACF;AAG1B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CACnB;AAGxB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACT","sourcesContent":["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n queryAssignedElements,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport styles from './table-row.css.js';\nimport { TableCheckboxCell } from './TableCheckboxCell.js';\n\n/**\n * @element sp-table\n *\n * @fires sorted - Announces that `selected` of the table row has changed\n */\nexport class TableRow extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @queryAssignedElements({\n selector: 'sp-table-checkbox-cell',\n flatten: true,\n })\n checkboxCells!: TableCheckboxCell[];\n\n @property({ reflect: true })\n public role = 'row';\n\n @property({ type: Boolean })\n public selectable = false;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String })\n public value = '';\n\n protected async handleChange(\n event: Event & { target: TableCheckboxCell }\n ): Promise<void> {\n this.selected = event.target.checkbox.checked;\n\n await 0;\n\n if (event?.defaultPrevented) {\n this.selected = !this.selected;\n }\n }\n\n protected handleSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n const assignedElements = target.assignedElements();\n this.selectable = !!assignedElements.find(\n (el) => el.localName === 'sp-table-checkbox-cell'\n );\n }\n\n protected manageSelected(): void {\n const [checkboxCell] = this.checkboxCells;\n if (!checkboxCell) return;\n checkboxCell.checked = this.selected;\n }\n\n protected handleClick(event: Event): void {\n if (\n event\n .composedPath()\n .find(\n (node) => (node as HTMLElement).localName === 'sp-checkbox'\n )\n ) {\n return;\n }\n const [checkboxCell] = this.checkboxCells;\n if (!checkboxCell) return;\n checkboxCell.click();\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot\n @change=${this.handleChange}\n @slotchange=${this.handleSlotchange}\n ></slot>\n `;\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (changed.has('selected')) {\n this.manageSelected();\n }\n if (changed.has('selectable')) {\n if (this.selectable) {\n this.addEventListener('click', this.handleClick);\n } else {\n this.removeEventListener('click', this.handleClick);\n }\n }\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["TableRow.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n queryAssignedElements,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport styles from './table-row.css.js';\nimport { TableCheckboxCell } from './TableCheckboxCell.js';\n\n/**\n * @element sp-table\n *\n * @fires sorted - Announces that `selected` of the table row has changed\n */\nexport class TableRow extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @queryAssignedElements({\n selector: 'sp-table-checkbox-cell',\n flatten: true,\n })\n checkboxCells!: TableCheckboxCell[];\n\n @property({ reflect: true })\n public role = 'row';\n\n @property({ type: Boolean })\n public selectable = false;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String })\n public value = '';\n\n protected async handleChange(\n event: Event & { target: TableCheckboxCell }\n ): Promise<void> {\n this.selected = event.target.checkbox.checked;\n\n await 0;\n\n if (event.defaultPrevented) {\n this.selected = !this.selected;\n }\n }\n\n protected handleSlotchange({\n target,\n }: Event & { target: HTMLSlotElement }): void {\n const assignedElements = target.assignedElements();\n this.selectable = !!assignedElements.find(\n (el) => el.localName === 'sp-table-checkbox-cell'\n );\n }\n\n protected manageSelected(): void {\n const [checkboxCell] = this.checkboxCells;\n if (!checkboxCell) return;\n checkboxCell.checked = this.selected;\n }\n\n protected handleClick(event: Event): void {\n if (\n event\n .composedPath()\n .find(\n (node) => (node as HTMLElement).localName === 'sp-checkbox'\n )\n ) {\n return;\n }\n const [checkboxCell] = this.checkboxCells;\n if (!checkboxCell) /* c8 ignore next */ return;\n checkboxCell.click();\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot\n @change=${this.handleChange}\n @slotchange=${this.handleSlotchange}\n ></slot>\n `;\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (changed.has('selected')) {\n this.manageSelected();\n }\n if (changed.has('selectable')) {\n if (this.selectable) {\n this.addEventListener('click', this.handleClick);\n } else {\n this.removeEventListener('click', this.handleClick);\n }\n }\n }\n}\n"],
5
+ "mappings": "qNAWA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OACI,YAAAC,EACA,yBAAAC,MACG,kDACP,OAAOC,MAAY,qBAQZ,aAAM,iBAAiBH,CAAgB,CAAvC,kCAYH,KAAO,KAAO,MAGd,KAAO,WAAa,GAGpB,KAAO,SAAW,GAGlB,KAAO,MAAQ,GApBf,WAA2B,QAAyB,CAChD,MAAO,CAACG,CAAM,CAClB,CAoBA,MAAgB,aACZC,EACa,CACb,KAAK,SAAWA,EAAM,OAAO,SAAS,QAEtC,KAAM,GAEFA,EAAM,mBACN,KAAK,SAAW,CAAC,KAAK,SAE9B,CAEU,iBAAiB,CACvB,OAAAC,CACJ,EAA8C,CAC1C,MAAMC,EAAmBD,EAAO,iBAAiB,EACjD,KAAK,WAAa,CAAC,CAACC,EAAiB,KAChCC,GAAOA,EAAG,YAAc,wBAC7B,CACJ,CAEU,gBAAuB,CAC7B,KAAM,CAACC,CAAY,EAAI,KAAK,cACxB,CAACA,IACLA,EAAa,QAAU,KAAK,SAChC,CAEU,YAAYJ,EAAoB,CACtC,GACIA,EACK,aAAa,EACb,KACIK,GAAUA,EAAqB,YAAc,aAClD,EAEJ,OAEJ,KAAM,CAACD,CAAY,EAAI,KAAK,cACxB,CAACA,GACLA,EAAa,MAAM,CACvB,CAEmB,QAAyB,CACxC,OAAOT;AAAA;AAAA,0BAEW,KAAK;AAAA,8BACD,KAAK;AAAA;AAAA,SAG/B,CAEmB,WAAWW,EAAqC,CAC3DA,EAAQ,IAAI,UAAU,GACtB,KAAK,eAAe,EAEpBA,EAAQ,IAAI,YAAY,IACpB,KAAK,WACL,KAAK,iBAAiB,QAAS,KAAK,WAAW,EAE/C,KAAK,oBAAoB,QAAS,KAAK,WAAW,EAG9D,CACJ,CA7EIC,EAAA,CAJCT,EAAsB,CACnB,SAAU,yBACV,QAAS,EACb,CAAC,GARQ,SAST,6BAGOS,EAAA,CADNV,EAAS,CAAE,QAAS,EAAK,CAAC,GAXlB,SAYF,oBAGAU,EAAA,CADNV,EAAS,CAAE,KAAM,OAAQ,CAAC,GAdlB,SAeF,0BAGAU,EAAA,CADNV,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAjBjC,SAkBF,wBAGAU,EAAA,CADNV,EAAS,CAAE,KAAM,MAAO,CAAC,GApBjB,SAqBF",
6
+ "names": ["html", "SpectrumElement", "property", "queryAssignedElements", "styles", "event", "target", "assignedElements", "el", "checkboxCell", "node", "changed", "__decorateClass"]
7
+ }
package/src/index.d.ts CHANGED
@@ -1 +1,7 @@
1
1
  export * from './Table.js';
2
+ export * from './TableBody.js';
3
+ export * from './TableCell.js';
4
+ export * from './TableCheckboxCell.js';
5
+ export * from './TableHead.js';
6
+ export * from './TableHeadCell.js';
7
+ export * from './TableRow.js';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ export * from "./Table.dev.js";
3
+ export * from "./TableBody.dev.js";
4
+ export * from "./TableCell.dev.js";
5
+ export * from "./TableCheckboxCell.dev.js";
6
+ export * from "./TableHead.dev.js";
7
+ export * from "./TableHeadCell.dev.js";
8
+ export * from "./TableRow.dev.js";
9
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './Table.dev.js'\nexport * from './TableBody.dev.js'\nexport * from './TableCell.dev.js'\nexport * from './TableCheckboxCell.dev.js'\nexport * from './TableHead.dev.js'\nexport * from './TableHeadCell.dev.js'\nexport * from './TableRow.dev.js'\n"],
5
+ "mappings": ";AAYA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
package/src/index.js CHANGED
@@ -1,13 +1,2 @@
1
- /*
2
- Copyright 2022 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- export * from './Table.js';
13
- //# sourceMappingURL=index.js.map
1
+ "use strict";export*from"./Table.js";export*from"./TableBody.js";export*from"./TableCell.js";export*from"./TableCheckboxCell.js";export*from"./TableHead.js";export*from"./TableHeadCell.js";export*from"./TableRow.js";
2
+ //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,cAAc,YAAY,CAAC","sourcesContent":["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nexport * from './Table.js';\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './Table.js';\nexport * from './TableBody.js';\nexport * from './TableCell.js';\nexport * from './TableCheckboxCell.js';\nexport * from './TableHead.js';\nexport * from './TableHeadCell.js';\nexport * from './TableRow.js';\n"],
5
+ "mappings": "aAYA,WAAc,aACd,WAAc,iBACd,WAAc,iBACd,WAAc,yBACd,WAAc,iBACd,WAAc,qBACd,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host([dir=ltr][drop-target]):before{left:0}:host([dir=rtl][drop-target]):before{right:0}:host([dir=ltr][drop-target]):before{right:0}:host([dir=rtl][drop-target]):before{left:0}:host([drop-target]):before{bottom:0;content:"";position:absolute;top:0;z-index:1}:host{border-radius:var(--spectrum-table-regular-border-radius);border-width:var(--spectrum-table-regular-border-size);overflow:auto;position:relative;vertical-align:var(--spectrum-table-regular-cell-vertical-alignment)}:host{background-color:var(
5
+ --spectrum-table-m-regular-background-color,var(--spectrum-global-color-gray-50)
6
+ );border-color:var(
7
+ --spectrum-table-m-regular-border-color,var(--spectrum-alias-border-color-mid)
8
+ );border-style:solid}:host([drop-target]){border-color:var(
9
+ --spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)
10
+ );box-shadow:0 0 0 1px var(
11
+ --spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)
12
+ )}:host([drop-target]):before{background-color:var(
13
+ --spectrum-alias-highlight-selected
14
+ )}
15
+ `;
16
+ export default styles;
17
+ //# sourceMappingURL=spectrum-table-body.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-table-body.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([dir=ltr][drop-target]):before{left:0}:host([dir=rtl][drop-target]):before{right:0}:host([dir=ltr][drop-target]):before{right:0}:host([dir=rtl][drop-target]):before{left:0}:host([drop-target]):before{bottom:0;content:\"\";position:absolute;top:0;z-index:1}:host{border-radius:var(--spectrum-table-regular-border-radius);border-width:var(--spectrum-table-regular-border-size);overflow:auto;position:relative;vertical-align:var(--spectrum-table-regular-cell-vertical-alignment)}:host{background-color:var(\n--spectrum-table-m-regular-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-table-m-regular-border-color,var(--spectrum-alias-border-color-mid)\n);border-style:solid}:host([drop-target]){border-color:var(\n--spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)\n);box-shadow:0 0 0 1px var(\n--spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)\n)}:host([drop-target]):before{background-color:var(\n--spectrum-alias-highlight-selected\n)}\n`;\nexport default styles;"],
5
+ "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaf,eAAe;",
6
+ "names": []
7
+ }
@@ -1,16 +1,4 @@
1
- /*
2
- Copyright 2022 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { css } from '@spectrum-web-components/base';
13
- const styles = css `
1
+ "use strict";import{css as r}from"@spectrum-web-components/base";const o=r`
14
2
  :host([dir=ltr][drop-target]):before{left:0}:host([dir=rtl][drop-target]):before{right:0}:host([dir=ltr][drop-target]):before{right:0}:host([dir=rtl][drop-target]):before{left:0}:host([drop-target]):before{bottom:0;content:"";position:absolute;top:0;z-index:1}:host{border-radius:var(--spectrum-table-regular-border-radius);border-width:var(--spectrum-table-regular-border-size);overflow:auto;position:relative;vertical-align:var(--spectrum-table-regular-cell-vertical-alignment)}:host{background-color:var(
15
3
  --spectrum-table-m-regular-background-color,var(--spectrum-global-color-gray-50)
16
4
  );border-color:var(
@@ -22,6 +10,5 @@ const styles = css `
22
10
  )}:host([drop-target]):before{background-color:var(
23
11
  --spectrum-alias-highlight-selected
24
12
  )}
25
- `;
26
- export default styles;
27
- //# sourceMappingURL=spectrum-table-body.css.js.map
13
+ `;export default o;
14
+ //# sourceMappingURL=spectrum-table-body.css.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"spectrum-table-body.css.js","sourceRoot":"","sources":["spectrum-table-body.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;CAYjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([dir=ltr][drop-target]):before{left:0}:host([dir=rtl][drop-target]):before{right:0}:host([dir=ltr][drop-target]):before{right:0}:host([dir=rtl][drop-target]):before{left:0}:host([drop-target]):before{bottom:0;content:\"\";position:absolute;top:0;z-index:1}:host{border-radius:var(--spectrum-table-regular-border-radius);border-width:var(--spectrum-table-regular-border-size);overflow:auto;position:relative;vertical-align:var(--spectrum-table-regular-cell-vertical-alignment)}:host{background-color:var(\n--spectrum-table-m-regular-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-table-m-regular-border-color,var(--spectrum-alias-border-color-mid)\n);border-style:solid}:host([drop-target]){border-color:var(\n--spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)\n);box-shadow:0 0 0 1px var(\n--spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)\n)}:host([drop-target]):before{background-color:var(\n--spectrum-alias-highlight-selected\n)}\n`;\nexport default styles;"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-table-body.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([dir=ltr][drop-target]):before{left:0}:host([dir=rtl][drop-target]):before{right:0}:host([dir=ltr][drop-target]):before{right:0}:host([dir=rtl][drop-target]):before{left:0}:host([drop-target]):before{bottom:0;content:\"\";position:absolute;top:0;z-index:1}:host{border-radius:var(--spectrum-table-regular-border-radius);border-width:var(--spectrum-table-regular-border-size);overflow:auto;position:relative;vertical-align:var(--spectrum-table-regular-cell-vertical-alignment)}:host{background-color:var(\n--spectrum-table-m-regular-background-color,var(--spectrum-global-color-gray-50)\n);border-color:var(\n--spectrum-table-m-regular-border-color,var(--spectrum-alias-border-color-mid)\n);border-style:solid}:host([drop-target]){border-color:var(\n--spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)\n);box-shadow:0 0 0 1px var(\n--spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)\n)}:host([drop-target]):before{background-color:var(\n--spectrum-alias-highlight-selected\n)}\n`;\nexport default styles;"],
5
+ "mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaf,eAAeC",
6
+ "names": ["css", "styles"]
7
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ import { css } from "@spectrum-web-components/base";
3
+ const styles = css`
4
+ :host([align=center]){text-align:center}:host([dir=ltr][align=end]){text-align:right}:host([dir=rtl][align=end]){text-align:left}:host([dir=ltr]){padding-left:var(
5
+ --spectrum-table-regular-cell-padding-left
6
+ );padding-right:var(--spectrum-table-regular-cell-padding-right)}:host([dir=rtl]){padding-left:var(--spectrum-table-regular-cell-padding-right);padding-right:var(
7
+ --spectrum-table-regular-cell-padding-left
8
+ )}:host{box-sizing:border-box;font-size:var(--spectrum-table-regular-cell-text-size);font-weight:var(--spectrum-table-regular-cell-text-font-weight);line-height:var(--spectrum-table-regular-cell-text-line-height);min-height:calc(var(--spectrum-table-regular-cell-min-height) - var(--spectrum-table-regular-cell-padding-top) - var(--spectrum-table-regular-cell-padding-bottom));padding-bottom:var(--spectrum-table-regular-cell-padding-bottom);padding-top:var(--spectrum-table-regular-cell-padding-top)}:host{position:relative}:host(.focus-visible),:host(.is-focused){outline:none}:host(.is-focused),:host(:focus-visible){outline:none}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr].focus-visible):before{right:0}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr]:focus-visible):before{right:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl].focus-visible):before{left:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl]:focus-visible):before{left:0}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr].focus-visible):before{left:0}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr]:focus-visible):before{left:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl].focus-visible):before{right:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl]:focus-visible):before{right:0}:host(.focus-visible):before,:host(.is-focused):before{border-radius:calc(var(--spectrum-table-regular-cell-border-radius-key-focus) - 1px);bottom:0;content:"";position:absolute;top:0;z-index:1}:host(.is-focused):before,:host(:focus-visible):before{border-radius:calc(var(--spectrum-table-regular-cell-border-radius-key-focus) - 1px);bottom:0;content:"";position:absolute;top:0;z-index:1}:host([dir=ltr]) .divider{border-right-width:var(
9
+ --spectrum-table-regular-divider-border-size
10
+ )}:host([dir=rtl]) .divider{border-left-width:var(
11
+ --spectrum-table-regular-divider-border-size
12
+ )}:host(.focus-visible):before,:host(.is-focused):before{box-shadow:inset 0 0 0 2px var(
13
+ --spectrum-table-m-regular-cell-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)
14
+ )}:host(.is-focused):before,:host(:focus-visible):before{box-shadow:inset 0 0 0 2px var(
15
+ --spectrum-table-m-regular-cell-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)
16
+ )}:host{background-color:var(
17
+ --spectrum-table-m-regular-cell-background-color,var(--spectrum-alias-background-color-transparent)
18
+ );color:var(
19
+ --spectrum-table-m-regular-cell-text-color,var(--spectrum-alias-text-color)
20
+ )}:host([dir=ltr]) .divider{border-right-style:solid}:host([dir=rtl]) .divider{border-left-style:solid}:host([dir=ltr]) .divider{border-right-color:var(
21
+ --spectrum-table-m-regular-divider-border-color,var(--spectrum-alias-border-color-mid)
22
+ )}:host([dir=rtl]) .divider{border-left-color:var(
23
+ --spectrum-table-m-regular-divider-border-color,var(--spectrum-alias-border-color-mid)
24
+ )}
25
+ `;
26
+ export default styles;
27
+ //# sourceMappingURL=spectrum-table-cell.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["spectrum-table-cell.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([align=center]){text-align:center}:host([dir=ltr][align=end]){text-align:right}:host([dir=rtl][align=end]){text-align:left}:host([dir=ltr]){padding-left:var(\n--spectrum-table-regular-cell-padding-left\n);padding-right:var(--spectrum-table-regular-cell-padding-right)}:host([dir=rtl]){padding-left:var(--spectrum-table-regular-cell-padding-right);padding-right:var(\n--spectrum-table-regular-cell-padding-left\n)}:host{box-sizing:border-box;font-size:var(--spectrum-table-regular-cell-text-size);font-weight:var(--spectrum-table-regular-cell-text-font-weight);line-height:var(--spectrum-table-regular-cell-text-line-height);min-height:calc(var(--spectrum-table-regular-cell-min-height) - var(--spectrum-table-regular-cell-padding-top) - var(--spectrum-table-regular-cell-padding-bottom));padding-bottom:var(--spectrum-table-regular-cell-padding-bottom);padding-top:var(--spectrum-table-regular-cell-padding-top)}:host{position:relative}:host(.focus-visible),:host(.is-focused){outline:none}:host(.is-focused),:host(:focus-visible){outline:none}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr].focus-visible):before{right:0}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr]:focus-visible):before{right:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl].focus-visible):before{left:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl]:focus-visible):before{left:0}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr].focus-visible):before{left:0}:host([dir=ltr]) .spectrum-Table-cell.is-focused:before,:host([dir=ltr]:focus-visible):before{left:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl].focus-visible):before{right:0}:host([dir=rtl]) .spectrum-Table-cell.is-focused:before,:host([dir=rtl]:focus-visible):before{right:0}:host(.focus-visible):before,:host(.is-focused):before{border-radius:calc(var(--spectrum-table-regular-cell-border-radius-key-focus) - 1px);bottom:0;content:\"\";position:absolute;top:0;z-index:1}:host(.is-focused):before,:host(:focus-visible):before{border-radius:calc(var(--spectrum-table-regular-cell-border-radius-key-focus) - 1px);bottom:0;content:\"\";position:absolute;top:0;z-index:1}:host([dir=ltr]) .divider{border-right-width:var(\n--spectrum-table-regular-divider-border-size\n)}:host([dir=rtl]) .divider{border-left-width:var(\n--spectrum-table-regular-divider-border-size\n)}:host(.focus-visible):before,:host(.is-focused):before{box-shadow:inset 0 0 0 2px var(\n--spectrum-table-m-regular-cell-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}:host(.is-focused):before,:host(:focus-visible):before{box-shadow:inset 0 0 0 2px var(\n--spectrum-table-m-regular-cell-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)\n)}:host{background-color:var(\n--spectrum-table-m-regular-cell-background-color,var(--spectrum-alias-background-color-transparent)\n);color:var(\n--spectrum-table-m-regular-cell-text-color,var(--spectrum-alias-text-color)\n)}:host([dir=ltr]) .divider{border-right-style:solid}:host([dir=rtl]) .divider{border-left-style:solid}:host([dir=ltr]) .divider{border-right-color:var(\n--spectrum-table-m-regular-divider-border-color,var(--spectrum-alias-border-color-mid)\n)}:host([dir=rtl]) .divider{border-left-color:var(\n--spectrum-table-m-regular-divider-border-color,var(--spectrum-alias-border-color-mid)\n)}\n`;\nexport default styles;"],
5
+ "mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBf,eAAe;",
6
+ "names": []
7
+ }
@@ -1,16 +1,4 @@
1
- /*
2
- Copyright 2022 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { css } from '@spectrum-web-components/base';
13
- const styles = css `
1
+ "use strict";import{css as e}from"@spectrum-web-components/base";const r=e`
14
2
  :host([align=center]){text-align:center}:host([dir=ltr][align=end]){text-align:right}:host([dir=rtl][align=end]){text-align:left}:host([dir=ltr]){padding-left:var(
15
3
  --spectrum-table-regular-cell-padding-left
16
4
  );padding-right:var(--spectrum-table-regular-cell-padding-right)}:host([dir=rtl]){padding-left:var(--spectrum-table-regular-cell-padding-right);padding-right:var(
@@ -32,6 +20,5 @@ const styles = css `
32
20
  )}:host([dir=rtl]) .divider{border-left-color:var(
33
21
  --spectrum-table-m-regular-divider-border-color,var(--spectrum-alias-border-color-mid)
34
22
  )}
35
- `;
36
- export default styles;
37
- //# sourceMappingURL=spectrum-table-cell.css.js.map
23
+ `;export default r;
24
+ //# sourceMappingURL=spectrum-table-cell.css.js.map