@spectrum-web-components/table 0.0.2-table.2609

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 (108) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +364 -0
  3. package/custom-elements.json +1083 -0
  4. package/package.json +74 -0
  5. package/sp-table-body.d.ts +6 -0
  6. package/sp-table-body.js +14 -0
  7. package/sp-table-body.js.map +1 -0
  8. package/sp-table-cell.d.ts +6 -0
  9. package/sp-table-cell.js +14 -0
  10. package/sp-table-cell.js.map +1 -0
  11. package/sp-table-checkbox-cell.d.ts +6 -0
  12. package/sp-table-checkbox-cell.js +14 -0
  13. package/sp-table-checkbox-cell.js.map +1 -0
  14. package/sp-table-head-cell.d.ts +6 -0
  15. package/sp-table-head-cell.js +14 -0
  16. package/sp-table-head-cell.js.map +1 -0
  17. package/sp-table-head.d.ts +6 -0
  18. package/sp-table-head.js +14 -0
  19. package/sp-table-head.js.map +1 -0
  20. package/sp-table-row.d.ts +6 -0
  21. package/sp-table-row.js +14 -0
  22. package/sp-table-row.js.map +1 -0
  23. package/sp-table.d.ts +6 -0
  24. package/sp-table.js +14 -0
  25. package/sp-table.js.map +1 -0
  26. package/src/Table.d.ts +42 -0
  27. package/src/Table.js +363 -0
  28. package/src/Table.js.map +1 -0
  29. package/src/TableBody.d.ts +9 -0
  30. package/src/TableBody.js +36 -0
  31. package/src/TableBody.js.map +1 -0
  32. package/src/TableCell.d.ts +10 -0
  33. package/src/TableCell.js +40 -0
  34. package/src/TableCell.js.map +1 -0
  35. package/src/TableCheckboxCell.d.ts +17 -0
  36. package/src/TableCheckboxCell.js +76 -0
  37. package/src/TableCheckboxCell.js.map +1 -0
  38. package/src/TableHead.d.ts +15 -0
  39. package/src/TableHead.js +56 -0
  40. package/src/TableHead.js.map +1 -0
  41. package/src/TableHeadCell.d.ts +21 -0
  42. package/src/TableHeadCell.js +98 -0
  43. package/src/TableHeadCell.js.map +1 -0
  44. package/src/TableRow.d.ts +18 -0
  45. package/src/TableRow.js +64 -0
  46. package/src/TableRow.js.map +1 -0
  47. package/src/index.d.ts +1 -0
  48. package/src/index.js +13 -0
  49. package/src/index.js.map +1 -0
  50. package/src/spectrum-config.js +245 -0
  51. package/src/spectrum-table-body.css.d.ts +2 -0
  52. package/src/spectrum-table-body.css.js +27 -0
  53. package/src/spectrum-table-body.css.js.map +1 -0
  54. package/src/spectrum-table-cell.css.d.ts +2 -0
  55. package/src/spectrum-table-cell.css.js +37 -0
  56. package/src/spectrum-table-cell.css.js.map +1 -0
  57. package/src/spectrum-table-checkbox-cell.css.d.ts +2 -0
  58. package/src/spectrum-table-checkbox-cell.css.js +23 -0
  59. package/src/spectrum-table-checkbox-cell.css.js.map +1 -0
  60. package/src/spectrum-table-head-cell.css.d.ts +2 -0
  61. package/src/spectrum-table-head-cell.css.js +71 -0
  62. package/src/spectrum-table-head-cell.css.js.map +1 -0
  63. package/src/spectrum-table-head.css.d.ts +2 -0
  64. package/src/spectrum-table-head.css.js +17 -0
  65. package/src/spectrum-table-head.css.js.map +1 -0
  66. package/src/spectrum-table-row.css.d.ts +2 -0
  67. package/src/spectrum-table-row.css.js +43 -0
  68. package/src/spectrum-table-row.css.js.map +1 -0
  69. package/src/spectrum-table.css.d.ts +2 -0
  70. package/src/spectrum-table.css.js +543 -0
  71. package/src/spectrum-table.css.js.map +1 -0
  72. package/src/table-body.css.d.ts +2 -0
  73. package/src/table-body.css.js +27 -0
  74. package/src/table-body.css.js.map +1 -0
  75. package/src/table-cell.css.d.ts +2 -0
  76. package/src/table-cell.css.js +37 -0
  77. package/src/table-cell.css.js.map +1 -0
  78. package/src/table-checkbox-cell.css.d.ts +2 -0
  79. package/src/table-checkbox-cell.css.js +23 -0
  80. package/src/table-checkbox-cell.css.js.map +1 -0
  81. package/src/table-head-cell.css.d.ts +2 -0
  82. package/src/table-head-cell.css.js +71 -0
  83. package/src/table-head-cell.css.js.map +1 -0
  84. package/src/table-head.css.d.ts +2 -0
  85. package/src/table-head.css.js +17 -0
  86. package/src/table-head.css.js.map +1 -0
  87. package/src/table-row.css.d.ts +2 -0
  88. package/src/table-row.css.js +43 -0
  89. package/src/table-row.css.js.map +1 -0
  90. package/src/table.css.d.ts +2 -0
  91. package/src/table.css.js +543 -0
  92. package/src/table.css.js.map +1 -0
  93. package/stories/index.js +44 -0
  94. package/stories/index.js.map +1 -0
  95. package/stories/table-elements.stories.js +237 -0
  96. package/stories/table-elements.stories.js.map +1 -0
  97. package/stories/table-virtualized.stories.js +221 -0
  98. package/stories/table-virtualized.stories.js.map +1 -0
  99. package/stories/table.stories.js.map +1 -0
  100. package/test/benchmark/basic-test.js +18 -0
  101. package/test/benchmark/basic-test.js.map +1 -0
  102. package/test/table-elements.test-vrt.js +15 -0
  103. package/test/table-elements.test-vrt.js.map +1 -0
  104. package/test/table-virtualized.test-vrt.js +15 -0
  105. package/test/table-virtualized.test-vrt.js.map +1 -0
  106. package/test/table.test-vrt.js.map +1 -0
  107. package/test/table.test.js +870 -0
  108. package/test/table.test.js.map +1 -0
@@ -0,0 +1,56 @@
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 styles from './table-head.css.js';
16
+ /**
17
+ * @element sp-table
18
+ */
19
+ export class TableHead extends SpectrumElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.role = 'row';
23
+ }
24
+ static get styles() {
25
+ return [styles];
26
+ }
27
+ handleSorted({ target }) {
28
+ const childCells = [...this.children];
29
+ // Not sure this is in the right place.
30
+ childCells.forEach((cell) => {
31
+ if (cell !== target) {
32
+ cell.sortDirection = undefined;
33
+ }
34
+ });
35
+ }
36
+ handleChange({ target: checkboxCell, }) {
37
+ this.selected =
38
+ checkboxCell.checkbox.checked ||
39
+ checkboxCell.checkbox.indeterminate;
40
+ }
41
+ render() {
42
+ return html `
43
+ <slot
44
+ @sorted=${this.handleSorted}
45
+ @change=${this.handleChange}
46
+ ></slot>
47
+ `;
48
+ }
49
+ }
50
+ __decorate([
51
+ property({ reflect: true })
52
+ ], TableHead.prototype, "role", void 0);
53
+ __decorate([
54
+ property({ type: Boolean, reflect: true })
55
+ ], TableHead.prototype, "selected", void 0);
56
+ //# sourceMappingURL=TableHead.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHead.js","sourceRoot":"","sources":["TableHead.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAEH,IAAI,EACJ,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAI3E,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,eAAe;IAA9C;;QAMW,SAAI,GAAG,KAAK,CAAC;IA+BxB,CAAC;IApCU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAQO,YAAY,CAAC,EAAE,MAAM,EAAS;QAClC,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAoB,CAAC;QACzD,uCAAuC;QACvC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACxB,IAAI,IAAI,KAAK,MAAM,EAAE;gBACjB,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;aAClC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAES,YAAY,CAAC,EACnB,MAAM,EAAE,YAAY,GACgB;QACpC,IAAI,CAAC,QAAQ;YACT,YAAY,CAAC,QAAQ,CAAC,OAAO;gBAC7B,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC5C,CAAC;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;;0BAEO,IAAI,CAAC,YAAY;0BACjB,IAAI,CAAC,YAAY;;SAElC,CAAC;IACN,CAAC;CACJ;AA/BG;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uCACR;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CACjB","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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type { TableHeadCell } from './TableHeadCell.js';\nimport { TableCheckboxCell } from './TableCheckboxCell.js';\n\nimport styles from './table-head.css.js';\n\n/**\n * @element sp-table\n */\nexport class TableHead extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ reflect: true })\n public role = 'row';\n\n @property({ type: Boolean, reflect: true })\n public selected?: boolean;\n\n private handleSorted({ target }: Event): void {\n const childCells = [...this.children] as TableHeadCell[];\n // Not sure this is in the right place.\n childCells.forEach((cell) => {\n if (cell !== target) {\n cell.sortDirection = undefined;\n }\n });\n }\n\n protected handleChange({\n target: checkboxCell,\n }: Event & { target: TableCheckboxCell }): void {\n this.selected =\n checkboxCell.checkbox.checked ||\n checkboxCell.checkbox.indeterminate;\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot\n @sorted=${this.handleSorted}\n @change=${this.handleChange}\n ></slot>\n `;\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
2
+ import '@spectrum-web-components/icons-ui/icons/sp-icon-arrow100.js';
3
+ export declare type SortedEventDetails = {
4
+ sortDirection: 'asc' | 'desc';
5
+ sortKey: string;
6
+ };
7
+ /**
8
+ * @element sp-table
9
+ */
10
+ export declare class TableHeadCell extends SpectrumElement {
11
+ static get styles(): CSSResultArray;
12
+ role: string;
13
+ sortable: boolean;
14
+ sortDirection: 'asc' | 'desc' | undefined;
15
+ sortKey: string;
16
+ tabIndex: number;
17
+ protected handleClick(): void;
18
+ protected render(): TemplateResult;
19
+ protected firstUpdated(changes: PropertyValues): void;
20
+ protected update(changes: PropertyValues): void;
21
+ }
@@ -0,0 +1,98 @@
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
+ export class TableHeadCell extends SpectrumElement {
29
+ constructor() {
30
+ super(...arguments);
31
+ this.role = 'columnheader';
32
+ this.sortable = false;
33
+ this.sortKey = '';
34
+ this.tabIndex = -1;
35
+ }
36
+ static get styles() {
37
+ return [styles, arrowStyles];
38
+ }
39
+ handleClick() {
40
+ if (!this.sortable)
41
+ return;
42
+ if (this.sortDirection) {
43
+ this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
44
+ }
45
+ else {
46
+ this.sortDirection = 'asc';
47
+ }
48
+ this.dispatchEvent(new CustomEvent('sorted', {
49
+ bubbles: true,
50
+ detail: {
51
+ sortDirection: this.sortDirection,
52
+ sortKey: this.sortKey,
53
+ },
54
+ }));
55
+ }
56
+ render() {
57
+ const visiblySorted = this.sortable && !!this.sortDirection;
58
+ return html `
59
+ <slot></slot>
60
+ ${visiblySorted
61
+ ? html `
62
+ <sp-icon-arrow100
63
+ class="sortedIcon spectrum-UIIcon-ArrowDown100"
64
+ ></sp-icon-arrow100>
65
+ `
66
+ : html ``}
67
+ `;
68
+ }
69
+ firstUpdated(changes) {
70
+ super.firstUpdated(changes);
71
+ this.addEventListener('click', this.handleClick);
72
+ }
73
+ update(changes) {
74
+ if (changes.has('sorted')) {
75
+ this.setAttribute('aria-sort', ariaSortValue(this.sortDirection));
76
+ }
77
+ if (changes.has('sortable')) {
78
+ this.tabIndex = this.sortable ? 0 : -1;
79
+ }
80
+ super.update(changes);
81
+ }
82
+ }
83
+ __decorate([
84
+ property({ reflect: true })
85
+ ], TableHeadCell.prototype, "role", void 0);
86
+ __decorate([
87
+ property({ type: Boolean, reflect: true })
88
+ ], TableHeadCell.prototype, "sortable", void 0);
89
+ __decorate([
90
+ property({ reflect: true, attribute: 'sort-direction' })
91
+ ], TableHeadCell.prototype, "sortDirection", void 0);
92
+ __decorate([
93
+ property({ attribute: 'sort-key' })
94
+ ], TableHeadCell.prototype, "sortKey", void 0);
95
+ __decorate([
96
+ property({ type: Number, reflect: true })
97
+ ], TableHeadCell.prototype, "tabIndex", void 0);
98
+ //# sourceMappingURL=TableHeadCell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeadCell.js","sourceRoot":"","sources":["TableHeadCell.ts"],"names":[],"mappings":"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","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 */\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 @property({ type: Number, reflect: true })\n public override tabIndex = -1;\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"]}
@@ -0,0 +1,18 @@
1
+ import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
2
+ import { TableCheckboxCell } from './TableCheckboxCell.js';
3
+ /**
4
+ * @element sp-table
5
+ */
6
+ export declare class TableRow extends SpectrumElement {
7
+ static get styles(): CSSResultArray;
8
+ checkboxCells: TableCheckboxCell[];
9
+ role: string;
10
+ selected: boolean;
11
+ value: string;
12
+ protected handleChange({ target: checkboxCell, }: Event & {
13
+ target: TableCheckboxCell;
14
+ }): void;
15
+ protected manageSelected(): void;
16
+ protected render(): TemplateResult;
17
+ protected willUpdate(changed: PropertyValues<this>): void;
18
+ }
@@ -0,0 +1,64 @@
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
+ export class TableRow extends SpectrumElement {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.role = 'row';
23
+ this.selected = false;
24
+ this.value = '';
25
+ }
26
+ static get styles() {
27
+ return [styles];
28
+ }
29
+ handleChange({ target: checkboxCell, }) {
30
+ this.selected = checkboxCell.checkbox.checked;
31
+ }
32
+ manageSelected() {
33
+ const [checkboxCell] = this.checkboxCells;
34
+ if (!checkboxCell)
35
+ return;
36
+ checkboxCell.checked = this.selected;
37
+ }
38
+ render() {
39
+ return html `
40
+ <slot @change=${this.handleChange}></slot>
41
+ `;
42
+ }
43
+ willUpdate(changed) {
44
+ if (changed.has('selected')) {
45
+ this.manageSelected();
46
+ }
47
+ }
48
+ }
49
+ __decorate([
50
+ queryAssignedElements({
51
+ selector: 'sp-table-checkbox-cell',
52
+ flatten: true,
53
+ })
54
+ ], TableRow.prototype, "checkboxCells", void 0);
55
+ __decorate([
56
+ property({ reflect: true })
57
+ ], TableRow.prototype, "role", void 0);
58
+ __decorate([
59
+ property({ type: Boolean, reflect: true })
60
+ ], TableRow.prototype, "selected", void 0);
61
+ __decorate([
62
+ property({ type: String })
63
+ ], TableRow.prototype, "value", void 0);
64
+ //# sourceMappingURL=TableRow.js.map
@@ -0,0 +1 @@
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;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,eAAe;IAA7C;;QAYW,SAAI,GAAG,KAAK,CAAC;QAGb,aAAQ,GAAG,KAAK,CAAC;QAGjB,UAAK,GAAG,EAAE,CAAC;IAyBtB,CAAC;IA1CU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAiBS,YAAY,CAAC,EACnB,MAAM,EAAE,YAAY,GACgB;QACpC,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC;IAClD,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;IAEkB,MAAM;QACrB,OAAO,IAAI,CAAA;4BACS,IAAI,CAAC,YAAY;SACpC,CAAC;IACN,CAAC;IAEkB,UAAU,CAAC,OAA6B;QACvD,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACzB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;IACL,CAAC;CACJ;AAlCG;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,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 */\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, reflect: true })\n public selected = false;\n\n @property({ type: String })\n public value = '';\n\n protected handleChange({\n target: checkboxCell,\n }: Event & { target: TableCheckboxCell }): void {\n this.selected = checkboxCell.checkbox.checked;\n }\n\n protected manageSelected(): void {\n const [checkboxCell] = this.checkboxCells;\n if (!checkboxCell) return;\n checkboxCell.checked = this.selected;\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot @change=${this.handleChange}></slot>\n `;\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (changed.has('selected')) {\n this.manageSelected();\n }\n }\n}\n"]}
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './Table.js';
package/src/index.js ADDED
@@ -0,0 +1,13 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,245 @@
1
+ /* sepctrum config
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
+ const config = {
13
+ spectrum: 'table',
14
+ components: [
15
+ {
16
+ name: 'table',
17
+ host: {
18
+ selector: '.spectrum-Table',
19
+ },
20
+ attributes: [
21
+ {
22
+ type: 'enum',
23
+ name: 'size',
24
+ values: [
25
+ {
26
+ name: 's',
27
+ selector: '.spectrum-Table--sizeS',
28
+ },
29
+ {
30
+ name: 'm',
31
+ selector: '.spectrum-Table--sizeM',
32
+ },
33
+ ],
34
+ },
35
+ {
36
+ type: 'enum',
37
+ name: 'density', // is this the right naming?
38
+ values: [
39
+ {
40
+ name: 'compact',
41
+ selector: '.spectrum-Table--compact',
42
+ },
43
+ {
44
+ name: 'spacious',
45
+ selector: '.spectrum-Table--spacious',
46
+ },
47
+ ],
48
+ },
49
+ ],
50
+ slots: [
51
+ {
52
+ contents: 'sp-table-body',
53
+ selector: '.spectrum-Table-body',
54
+ },
55
+ ],
56
+ exclude: [/\.spectrum-Table-sortedIcon/],
57
+ },
58
+ {
59
+ name: 'table-body',
60
+ host: {
61
+ selector: '.spectrum-Table-body',
62
+ },
63
+ attributes: [
64
+ {
65
+ type: 'boolean',
66
+ selector: '.is-drop-target',
67
+ name: 'drop-target',
68
+ },
69
+ ],
70
+ exclude: [
71
+ /\.spectrum-Table--spacious/,
72
+ /\.spectrum-Table--compact/,
73
+ /\.spectrum-Table-sortedIcon/,
74
+ /\.spectrum-Table-headCell/,
75
+ /\.spectrum-Table-cell--alignRight/,
76
+ /\.spectrum-Table-row/,
77
+ /\.spectrum-Table-cell/,
78
+ /\.spectrum-Table-checkboxCell/,
79
+ ],
80
+ },
81
+ {
82
+ name: 'table-cell',
83
+ host: {
84
+ selector: '.spectrum-Table-cell',
85
+ },
86
+ attributes: [
87
+ {
88
+ type: 'enum',
89
+ name: 'align',
90
+ values: [
91
+ {
92
+ name: 'center',
93
+ selector: '.spectrum-Table-cell--alignCenter',
94
+ },
95
+ {
96
+ name: 'end',
97
+ selector: '.spectrum-Table-cell--alignRight',
98
+ },
99
+ ],
100
+ },
101
+ ],
102
+ classes: [
103
+ {
104
+ name: 'divider',
105
+ selector: '.spectrum-Table-cell--divider',
106
+ },
107
+ ],
108
+ exclude: [
109
+ /\.spectrum-Table-row/,
110
+ /\.spectrum-Table-body/,
111
+ /\.spectrum-Table-headCell/,
112
+ /\.spectrum-Table-checkboxCell/,
113
+ /\.spectrum-Table--spacious/,
114
+ /\.spectrum-Table--compact/,
115
+ /\.spectrum-Table-sortedIcon/,
116
+ ],
117
+ },
118
+ {
119
+ name: 'table-checkbox-cell',
120
+ host: {
121
+ selector: '.spectrum-Table',
122
+ },
123
+ complexSelectors: [
124
+ {
125
+ replacement: ':host([dir=ltr])',
126
+ selector:
127
+ '.spectrum-Table[dir=ltr] .spectrum-Table-checkboxCell',
128
+ },
129
+ {
130
+ replacement: ':host([dir=rtl])',
131
+ selector:
132
+ '.spectrum-Table[dir=rtl] .spectrum-Table-checkboxCell',
133
+ },
134
+ {
135
+ replacement: ':host',
136
+ selector: '.spectrum-Table-checkboxCell',
137
+ },
138
+ {
139
+ replacement: '.checkbox',
140
+ selector: /.spectrum-Table-checkbox(?!Cell)/,
141
+ },
142
+ ],
143
+ exclude: [/\.spectrum-Table(?!-checkbox)/],
144
+ },
145
+ {
146
+ name: 'table-head',
147
+ host: {
148
+ selector: '.spectrum-Table-head',
149
+ },
150
+ exclude: [
151
+ /\.spectrum-Table-sortedIcon/,
152
+ /\.spectrum-Table-body/,
153
+ /\.spectrum-Table-headCell/,
154
+ /\.spectrum-Table-cell/,
155
+ /\.spectrum-Table-checkboxCell/,
156
+ /\.spectrum-Table-row/,
157
+ ],
158
+ },
159
+ {
160
+ name: 'table-head-cell',
161
+ host: {
162
+ selector: '.spectrum-Table-headCell',
163
+ },
164
+ attributes: [
165
+ {
166
+ type: 'boolean',
167
+ name: 'sortable',
168
+ selector: '.is-sortable',
169
+ },
170
+ {
171
+ type: 'enum',
172
+ name: 'sorted',
173
+ values: [
174
+ {
175
+ name: 'asc',
176
+ selector: '.is-sorted-asc',
177
+ },
178
+ {
179
+ name: 'desc',
180
+ selector: '.is-sorted-desc',
181
+ },
182
+ ],
183
+ },
184
+ {
185
+ type: 'boolean',
186
+ name: 'focused',
187
+ selector: '.is-focused',
188
+ },
189
+ {
190
+ type: 'boolean',
191
+ name: 'active',
192
+ selector: ':active',
193
+ },
194
+ ],
195
+ classes: [
196
+ {
197
+ name: 'sortedIcon',
198
+ selector: '.spectrum-Table-sortedIcon',
199
+ },
200
+ ],
201
+ exclude: [
202
+ /\.spectrum-Table-row/,
203
+ /\.spectrum-Table-body/,
204
+ /\.spectrum-Table-cell/,
205
+ /\.spectrum-Table-checkboxCell/,
206
+ /\.spectrum-Table--spacious/,
207
+ /\.spectrum-Table--compact/,
208
+ ],
209
+ },
210
+ {
211
+ name: 'table-row',
212
+ host: {
213
+ selector: '.spectrum-Table-row',
214
+ },
215
+ attributes: [
216
+ {
217
+ type: 'boolean',
218
+ name: 'drop-target',
219
+ selector: '.is-drop-target',
220
+ },
221
+ {
222
+ type: 'boolean',
223
+ name: 'selected',
224
+ selector: '.is-selected',
225
+ },
226
+ {
227
+ type: 'boolean',
228
+ name: 'focused',
229
+ selector: '.is-focused',
230
+ },
231
+ ],
232
+ exclude: [
233
+ /\.spectrum-Table-sortedIcon/,
234
+ /\.spectrum-Table-headCell/,
235
+ /\.spectrum-Table-cell--/,
236
+ /tbody/,
237
+ /\.spectrum-Table-body/,
238
+ /\.spectrum-Table--/,
239
+ /\.spectrum-Table-cell/,
240
+ ],
241
+ },
242
+ ],
243
+ };
244
+
245
+ export default config;
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,27 @@
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 `
14
+ :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
+ --spectrum-table-m-regular-background-color,var(--spectrum-global-color-gray-50)
16
+ );border-color:var(
17
+ --spectrum-table-m-regular-border-color,var(--spectrum-alias-border-color-mid)
18
+ );border-style:solid}:host([drop-target]){border-color:var(
19
+ --spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)
20
+ );box-shadow:0 0 0 1px var(
21
+ --spectrum-alias-border-color-key-focus,var(--spectrum-global-color-blue-400)
22
+ )}:host([drop-target]):before{background-color:var(
23
+ --spectrum-alias-highlight-selected
24
+ )}
25
+ `;
26
+ export default styles;
27
+ //# sourceMappingURL=spectrum-table-body.css.js.map
@@ -0,0 +1 @@
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;"]}
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -0,0 +1,37 @@
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 `
14
+ :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
+ --spectrum-table-regular-cell-padding-left
16
+ );padding-right:var(--spectrum-table-regular-cell-padding-right)}:host([dir=rtl]){padding-left:var(--spectrum-table-regular-cell-padding-right);padding-right:var(
17
+ --spectrum-table-regular-cell-padding-left
18
+ )}: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(
19
+ --spectrum-table-regular-divider-border-size
20
+ )}:host([dir=rtl]) .divider{border-left-width:var(
21
+ --spectrum-table-regular-divider-border-size
22
+ )}:host(.focus-visible):before,:host(.is-focused):before{box-shadow:inset 0 0 0 2px var(
23
+ --spectrum-table-m-regular-cell-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)
24
+ )}:host(.is-focused):before,:host(:focus-visible):before{box-shadow:inset 0 0 0 2px var(
25
+ --spectrum-table-m-regular-cell-border-color-key-focus,var(--spectrum-alias-border-color-key-focus)
26
+ )}:host{background-color:var(
27
+ --spectrum-table-m-regular-cell-background-color,var(--spectrum-alias-background-color-transparent)
28
+ );color:var(
29
+ --spectrum-table-m-regular-cell-text-color,var(--spectrum-alias-text-color)
30
+ )}:host([dir=ltr]) .divider{border-right-style:solid}:host([dir=rtl]) .divider{border-left-style:solid}:host([dir=ltr]) .divider{border-right-color:var(
31
+ --spectrum-table-m-regular-divider-border-color,var(--spectrum-alias-border-color-mid)
32
+ )}:host([dir=rtl]) .divider{border-left-color:var(
33
+ --spectrum-table-m-regular-divider-border-color,var(--spectrum-alias-border-color-mid)
34
+ )}
35
+ `;
36
+ export default styles;
37
+ //# sourceMappingURL=spectrum-table-cell.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spectrum-table-cell.css.js","sourceRoot":"","sources":["spectrum-table-cell.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;CAsBjB,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([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;"]}