@spectrum-web-components/table 0.1.9-react.32 → 0.1.9-react.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/elements.d.ts +1 -1
- package/elements.dev.js +1 -1
- package/elements.dev.js.map +1 -1
- package/elements.js +1 -1
- package/elements.js.map +1 -1
- package/package.json +7 -7
- package/src/TableBody.d.ts +1 -1
- package/src/TableBody.dev.js.map +1 -1
- package/src/TableBody.js.map +1 -1
- package/src/TableCell.d.ts +1 -1
- package/src/TableCell.dev.js.map +1 -1
- package/src/TableCell.js.map +1 -1
- package/src/TableCheckboxCell.d.ts +1 -1
- package/src/TableCheckboxCell.dev.js.map +1 -1
- package/src/TableCheckboxCell.js.map +1 -1
- package/src/TableHead.d.ts +1 -1
- package/src/TableHead.dev.js.map +1 -1
- package/src/TableHead.js.map +1 -1
- package/src/TableHeadCell.d.ts +1 -1
- package/src/TableHeadCell.dev.js.map +1 -1
- package/src/TableHeadCell.js.map +1 -1
- package/src/TableRow.d.ts +1 -1
- package/src/TableRow.dev.js.map +1 -1
- package/src/TableRow.js.map +1 -1
- package/custom-elements.json +0 -1174
package/elements.d.ts
CHANGED
package/elements.dev.js
CHANGED
package/elements.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["elements.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\nimport './sp-table-body.dev.js'\nimport './sp-table-cell.dev.js'\nimport './sp-table-checkbox-cell.dev.js'\nimport './sp-table-head-cell.dev.js'\nimport './sp-table-head.dev.js'\nimport './sp-table-row.dev.js'\nimport './sp-table
|
|
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\nimport './sp-table-body.dev.js'\nimport './sp-table-cell.dev.js'\nimport './sp-table-checkbox-cell.dev.js'\nimport './sp-table-head-cell.dev.js'\nimport './sp-table-head.dev.js'\nimport './sp-table-row.dev.js'\nimport './sp-table.dev.js'\n"],
|
|
5
5
|
"mappings": ";AAYA,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/elements.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";import"./sp-table-body.js";import"./sp-table-cell.js";import"./sp-table-checkbox-cell.js";import"./sp-table-head-cell.js";import"./sp-table-head.js";import"./sp-table-row.js";import"./sp-table
|
|
1
|
+
"use strict";import"./sp-table-body.js";import"./sp-table-cell.js";import"./sp-table-checkbox-cell.js";import"./sp-table-head-cell.js";import"./sp-table-head.js";import"./sp-table-row.js";import"./sp-table.js";
|
|
2
2
|
//# sourceMappingURL=elements.js.map
|
package/elements.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["elements.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\nimport './sp-table-body.js';\nimport './sp-table-cell.js';\nimport './sp-table-checkbox-cell.js';\nimport './sp-table-head-cell.js';\nimport './sp-table-head.js';\nimport './sp-table-row.js';\nimport './sp-table
|
|
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\nimport './sp-table-body.js';\nimport './sp-table-cell.js';\nimport './sp-table-checkbox-cell.js';\nimport './sp-table-head-cell.js';\nimport './sp-table-head.js';\nimport './sp-table-row.js';\nimport './sp-table.js';\n"],
|
|
5
5
|
"mappings": "aAYA,MAAO,qBACP,MAAO,qBACP,MAAO,8BACP,MAAO,0BACP,MAAO,qBACP,MAAO,oBACP,MAAO",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/table",
|
|
3
|
-
"version": "0.1.9-react.
|
|
3
|
+
"version": "0.1.9-react.48+e4fada004",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -116,13 +116,13 @@
|
|
|
116
116
|
],
|
|
117
117
|
"dependencies": {
|
|
118
118
|
"@lit-labs/virtualizer": "^1.0.1",
|
|
119
|
-
"@spectrum-web-components/base": "^0.7.5-react.
|
|
120
|
-
"@spectrum-web-components/checkbox": "^0.14.9-react.
|
|
121
|
-
"@spectrum-web-components/icon": "^0.12.8-react.
|
|
122
|
-
"@spectrum-web-components/icons-ui": "^0.9.8-react.
|
|
119
|
+
"@spectrum-web-components/base": "^0.7.5-react.48+e4fada004",
|
|
120
|
+
"@spectrum-web-components/checkbox": "^0.14.9-react.48+e4fada004",
|
|
121
|
+
"@spectrum-web-components/icon": "^0.12.8-react.48+e4fada004",
|
|
122
|
+
"@spectrum-web-components/icons-ui": "^0.9.8-react.48+e4fada004"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
|
-
"@spectrum-css/table": "^4.0.
|
|
125
|
+
"@spectrum-css/table": "^4.0.23"
|
|
126
126
|
},
|
|
127
127
|
"types": "./src/index.d.ts",
|
|
128
128
|
"customElements": "custom-elements.json",
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"./elements.js",
|
|
132
132
|
"./**/*.dev.js"
|
|
133
133
|
],
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "e4fada0040dcaf1e1267f2159f366ec708cb2d09"
|
|
135
135
|
}
|
package/src/TableBody.d.ts
CHANGED
package/src/TableBody.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableBody.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport styles from './table-body.css.js';\nimport { MutationController } from '@lit-labs/observers/mutation_controller.js';\n\n/**\n * @element sp-table\n */\nexport class TableBody extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n constructor() {\n super();\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n requestAnimationFrame(() => {\n this.shouldHaveTabIndex();\n });\n },\n });\n }\n\n protected shouldHaveTabIndex(): void {\n if (this.offsetHeight < this.scrollHeight) {\n this.tabIndex = 0;\n } else {\n this.removeAttribute('tabindex');\n }\n }\n\n @property({ reflect: true })\n public role = 'rowgroup';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport styles from './table-body.css.js';\nimport { MutationController } from '@lit-labs/observers/mutation_controller.js';\n\n/**\n * @element sp-table-body\n */\nexport class TableBody extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n constructor() {\n super();\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n requestAnimationFrame(() => {\n this.shouldHaveTabIndex();\n });\n },\n });\n }\n\n protected shouldHaveTabIndex(): void {\n if (this.offsetHeight < this.scrollHeight) {\n this.tabIndex = 0;\n } else {\n this.removeAttribute('tabindex');\n }\n }\n\n @property({ reflect: true })\n public role = 'rowgroup';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,OAAO,YAAY;AACnB,SAAS,0BAA0B;AAK5B,aAAM,kBAAkB,gBAAgB;AAAA,EAK3C,cAAc;AACV,UAAM;AAuBV,SAAO,OAAO;AAtBV,QAAI,mBAAmB,MAAM;AAAA,MACzB,QAAQ;AAAA,QACJ,WAAW;AAAA,QACX,SAAS;AAAA,MACb;AAAA,MACA,UAAU,MAAM;AACZ,8BAAsB,MAAM;AACxB,eAAK,mBAAmB;AAAA,QAC5B,CAAC;AAAA,MACL;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAjBA,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAiBU,qBAA2B;AACjC,QAAI,KAAK,eAAe,KAAK,cAAc;AACvC,WAAK,WAAW;AAAA,IACpB,OAAO;AACH,WAAK,gBAAgB,UAAU;AAAA,IACnC;AAAA,EACJ;AAAA,EAKmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AACJ;AAPW;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GA5BlB,UA6BF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/TableBody.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableBody.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport styles from './table-body.css.js';\nimport { MutationController } from '@lit-labs/observers/mutation_controller.js';\n\n/**\n * @element sp-table\n */\nexport class TableBody extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n constructor() {\n super();\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n requestAnimationFrame(() => {\n this.shouldHaveTabIndex();\n });\n },\n });\n }\n\n protected shouldHaveTabIndex(): void {\n if (this.offsetHeight < this.scrollHeight) {\n this.tabIndex = 0;\n } else {\n this.removeAttribute('tabindex');\n }\n }\n\n @property({ reflect: true })\n public role = 'rowgroup';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport styles from './table-body.css.js';\nimport { MutationController } from '@lit-labs/observers/mutation_controller.js';\n\n/**\n * @element sp-table-body\n */\nexport class TableBody extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n constructor() {\n super();\n new MutationController(this, {\n config: {\n childList: true,\n subtree: true,\n },\n callback: () => {\n requestAnimationFrame(() => {\n this.shouldHaveTabIndex();\n });\n },\n });\n }\n\n protected shouldHaveTabIndex(): void {\n if (this.offsetHeight < this.scrollHeight) {\n this.tabIndex = 0;\n } else {\n this.removeAttribute('tabindex');\n }\n }\n\n @property({ reflect: true })\n public role = 'rowgroup';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
5
5
|
"mappings": "qNAWA,OAEI,QAAAA,EACA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAOC,MAAY,sBACnB,OAAS,sBAAAC,MAA0B,6CAK5B,aAAM,kBAAkBH,CAAgB,CAK3C,aAAc,CACV,MAAM,EAuBV,KAAO,KAAO,WAtBV,IAAIG,EAAmB,KAAM,CACzB,OAAQ,CACJ,UAAW,GACX,QAAS,EACb,EACA,SAAU,IAAM,CACZ,sBAAsB,IAAM,CACxB,KAAK,mBAAmB,CAC5B,CAAC,CACL,CACJ,CAAC,CACL,CAjBA,WAA2B,QAAyB,CAChD,MAAO,CAACD,CAAM,CAClB,CAiBU,oBAA2B,CAC7B,KAAK,aAAe,KAAK,aACzB,KAAK,SAAW,EAEhB,KAAK,gBAAgB,UAAU,CAEvC,CAKmB,QAAyB,CACxC,OAAOH;AAAA;AAAA,SAGX,CACJ,CAPWK,EAAA,CADNH,EAAS,CAAE,QAAS,EAAK,CAAC,GA5BlB,UA6BF",
|
|
6
6
|
"names": ["html", "SpectrumElement", "property", "styles", "MutationController", "__decorateClass"]
|
|
7
7
|
}
|
package/src/TableCell.d.ts
CHANGED
package/src/TableCell.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableCell.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport styles from './table-cell.css.js';\n\n/**\n * @element sp-table\n */\nexport class TableCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport styles from './table-cell.css.js';\n\n/**\n * @element sp-table-cell\n */\nexport class TableCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AAEzB,OAAO,YAAY;AAKZ,aAAM,kBAAkB,gBAAgB;AAAA,EAAxC;AAAA;AAMH,SAAO,OAAO;AAAA;AAAA,EALd,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAKmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AACJ;AAPW;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GALlB,UAMF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/TableCell.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableCell.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport styles from './table-cell.css.js';\n\n/**\n * @element sp-table\n */\nexport class TableCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport styles from './table-cell.css.js';\n\n/**\n * @element sp-table-cell\n */\nexport class TableCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
|
5
5
|
"mappings": "qNAWA,OAEI,QAAAA,EACA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDAEzB,OAAOC,MAAY,sBAKZ,aAAM,kBAAkBF,CAAgB,CAAxC,kCAMH,KAAO,KAAO,WALd,WAA2B,QAAyB,CAChD,MAAO,CAACE,CAAM,CAClB,CAKmB,QAAyB,CACxC,OAAOH;AAAA;AAAA,SAGX,CACJ,CAPWI,EAAA,CADNF,EAAS,CAAE,QAAS,EAAK,CAAC,GALlB,UAMF",
|
|
6
6
|
"names": ["html", "SpectrumElement", "property", "styles", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-c
|
|
|
2
2
|
import '@spectrum-web-components/checkbox/sp-checkbox.js';
|
|
3
3
|
import { Checkbox } from '@spectrum-web-components/checkbox';
|
|
4
4
|
/**
|
|
5
|
-
* @element sp-table
|
|
5
|
+
* @element sp-table-checkbox-cell
|
|
6
6
|
*/
|
|
7
7
|
export declare class TableCheckboxCell extends SpectrumElement {
|
|
8
8
|
static get styles(): CSSResultArray;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableCheckboxCell.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport '@spectrum-web-components/checkbox/sp-checkbox.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport cellStyles from './table-cell.css.js';\nimport headCellStyles from './table-head-cell.css.js';\nimport styles from './table-checkbox-cell.css.js';\nimport { Checkbox } from '@spectrum-web-components/checkbox';\n\n/**\n * @element sp-table\n */\nexport class TableCheckboxCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [cellStyles, headCellStyles, styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n @query('.checkbox')\n public checkbox!: Checkbox;\n\n @property({ type: Boolean })\n public indeterminate = false;\n\n @property({ type: Boolean })\n public checked = false;\n\n @property({ type: Boolean })\n public disabled = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'selects-single' })\n public selectsSingle = false;\n\n public override click(): void {\n this.checkbox.click();\n }\n\n protected override render(): TemplateResult {\n return html`\n <sp-checkbox\n ?checked=${this.checked}\n ?indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n aria-hidden=${ifDefined(this.selectsSingle)}\n class=\"checkbox\"\n ></sp-checkbox>\n `;\n }\n}\n"],
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport '@spectrum-web-components/checkbox/sp-checkbox.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport cellStyles from './table-cell.css.js';\nimport headCellStyles from './table-head-cell.css.js';\nimport styles from './table-checkbox-cell.css.js';\nimport { Checkbox } from '@spectrum-web-components/checkbox';\n\n/**\n * @element sp-table-checkbox-cell\n */\nexport class TableCheckboxCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [cellStyles, headCellStyles, styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n @query('.checkbox')\n public checkbox!: Checkbox;\n\n @property({ type: Boolean })\n public indeterminate = false;\n\n @property({ type: Boolean })\n public checked = false;\n\n @property({ type: Boolean })\n public disabled = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'selects-single' })\n public selectsSingle = false;\n\n public override click(): void {\n this.checkbox.click();\n }\n\n protected override render(): TemplateResult {\n return html`\n <sp-checkbox\n ?checked=${this.checked}\n ?indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n aria-hidden=${ifDefined(this.selectsSingle)}\n class=\"checkbox\"\n ></sp-checkbox>\n `;\n }\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,OAAO;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,iBAAiB;AAC1B,OAAO,gBAAgB;AACvB,OAAO,oBAAoB;AAC3B,OAAO,YAAY;AAMZ,aAAM,0BAA0B,gBAAgB;AAAA,EAAhD;AAAA;AAMH,SAAO,OAAO;AAMd,SAAO,gBAAgB;AAGvB,SAAO,UAAU;AAGjB,SAAO,WAAW;AAGlB,SAAO,gBAAgB;AAAA;AAAA,EApBvB,WAA2B,SAAyB;AAChD,WAAO,CAAC,YAAY,gBAAgB,MAAM;AAAA,EAC9C;AAAA,EAoBgB,QAAc;AAC1B,SAAK,SAAS,MAAM;AAAA,EACxB;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,2BAEY,KAAK;AAAA,iCACC,KAAK;AAAA,4BACV,KAAK;AAAA,8BACH,UAAU,KAAK,aAAa;AAAA;AAAA;AAAA;AAAA,EAItD;AACJ;AAhCW;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GALlB,kBAMF;AAGA;AAAA,EADN,MAAM,WAAW;AAAA,GART,kBASF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAXlB,kBAYF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAdlB,kBAeF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GAjBlB,kBAkBF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,MAAM,WAAW,iBAAiB,CAAC;AAAA,GApB9D,kBAqBF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableCheckboxCell.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport '@spectrum-web-components/checkbox/sp-checkbox.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport cellStyles from './table-cell.css.js';\nimport headCellStyles from './table-head-cell.css.js';\nimport styles from './table-checkbox-cell.css.js';\nimport { Checkbox } from '@spectrum-web-components/checkbox';\n\n/**\n * @element sp-table\n */\nexport class TableCheckboxCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [cellStyles, headCellStyles, styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n @query('.checkbox')\n public checkbox!: Checkbox;\n\n @property({ type: Boolean })\n public indeterminate = false;\n\n @property({ type: Boolean })\n public checked = false;\n\n @property({ type: Boolean })\n public disabled = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'selects-single' })\n public selectsSingle = false;\n\n public override click(): void {\n this.checkbox.click();\n }\n\n protected override render(): TemplateResult {\n return html`\n <sp-checkbox\n ?checked=${this.checked}\n ?indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n aria-hidden=${ifDefined(this.selectsSingle)}\n class=\"checkbox\"\n ></sp-checkbox>\n `;\n }\n}\n"],
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport '@spectrum-web-components/checkbox/sp-checkbox.js';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport cellStyles from './table-cell.css.js';\nimport headCellStyles from './table-head-cell.css.js';\nimport styles from './table-checkbox-cell.css.js';\nimport { Checkbox } from '@spectrum-web-components/checkbox';\n\n/**\n * @element sp-table-checkbox-cell\n */\nexport class TableCheckboxCell extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [cellStyles, headCellStyles, styles];\n }\n\n @property({ reflect: true })\n public role = 'gridcell';\n\n @query('.checkbox')\n public checkbox!: Checkbox;\n\n @property({ type: Boolean })\n public indeterminate = false;\n\n @property({ type: Boolean })\n public checked = false;\n\n @property({ type: Boolean })\n public disabled = false;\n\n @property({ type: Boolean, reflect: true, attribute: 'selects-single' })\n public selectsSingle = false;\n\n public override click(): void {\n this.checkbox.click();\n }\n\n protected override render(): TemplateResult {\n return html`\n <sp-checkbox\n ?checked=${this.checked}\n ?indeterminate=${this.indeterminate}\n ?disabled=${this.disabled}\n aria-hidden=${ifDefined(this.selectsSingle)}\n class=\"checkbox\"\n ></sp-checkbox>\n `;\n }\n}\n"],
|
|
5
5
|
"mappings": "qNAWA,OAEI,QAAAA,EACA,mBAAAC,MAEG,gCACP,MAAO,mDACP,OACI,YAAAC,EACA,SAAAC,MACG,kDACP,OAAS,aAAAC,MAAiB,kDAC1B,OAAOC,MAAgB,sBACvB,OAAOC,MAAoB,2BAC3B,OAAOC,MAAY,+BAMZ,aAAM,0BAA0BN,CAAgB,CAAhD,kCAMH,KAAO,KAAO,WAMd,KAAO,cAAgB,GAGvB,KAAO,QAAU,GAGjB,KAAO,SAAW,GAGlB,KAAO,cAAgB,GApBvB,WAA2B,QAAyB,CAChD,MAAO,CAACI,EAAYC,EAAgBC,CAAM,CAC9C,CAoBgB,OAAc,CAC1B,KAAK,SAAS,MAAM,CACxB,CAEmB,QAAyB,CACxC,OAAOP;AAAA;AAAA,2BAEY,KAAK;AAAA,iCACC,KAAK;AAAA,4BACV,KAAK;AAAA,8BACHI,EAAU,KAAK,aAAa;AAAA;AAAA;AAAA,SAItD,CACJ,CAhCWI,EAAA,CADNN,EAAS,CAAE,QAAS,EAAK,CAAC,GALlB,kBAMF,oBAGAM,EAAA,CADNL,EAAM,WAAW,GART,kBASF,wBAGAK,EAAA,CADNN,EAAS,CAAE,KAAM,OAAQ,CAAC,GAXlB,kBAYF,6BAGAM,EAAA,CADNN,EAAS,CAAE,KAAM,OAAQ,CAAC,GAdlB,kBAeF,uBAGAM,EAAA,CADNN,EAAS,CAAE,KAAM,OAAQ,CAAC,GAjBlB,kBAkBF,wBAGAM,EAAA,CADNN,EAAS,CAAE,KAAM,QAAS,QAAS,GAAM,UAAW,gBAAiB,CAAC,GApB9D,kBAqBF",
|
|
6
6
|
"names": ["html", "SpectrumElement", "property", "query", "ifDefined", "cellStyles", "headCellStyles", "styles", "__decorateClass"]
|
|
7
7
|
}
|
package/src/TableHead.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import { TableCheckboxCell } from './TableCheckboxCell.js';
|
|
3
3
|
/**
|
|
4
|
-
* @element sp-table
|
|
4
|
+
* @element sp-table-head
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
export declare class TableHead extends SpectrumElement {
|
package/src/TableHead.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableHead.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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type { TableHeadCell } from './TableHeadCell.dev.js'\nimport { TableCheckboxCell } from './TableCheckboxCell.dev.js'\n\nimport styles from './table-head.css.js';\n\n/**\n * @element sp-table\n *\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 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"],
|
|
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 SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport type { TableHeadCell } from './TableHeadCell.dev.js'\nimport { TableCheckboxCell } from './TableCheckboxCell.dev.js'\n\nimport styles from './table-head.css.js';\n\n/**\n * @element sp-table-head\n *\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 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"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AAIzB,OAAO,YAAY;AAMZ,aAAM,kBAAkB,gBAAgB;AAAA,EAAxC;AAAA;AAMH,SAAO,OAAO;AAAA;AAAA,EALd,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAQQ,aAAa,EAAE,OAAO,GAAgB;AAC1C,UAAM,aAAa,CAAC,GAAG,KAAK,QAAQ;AACpC,eAAW,QAAQ,CAAC,SAAS;AACzB,UAAI,SAAS,QAAQ;AACjB,aAAK,gBAAgB;AAAA,MACzB;AAAA,IACJ,CAAC;AAAA,EACL;AAAA,EAEU,aAAa;AAAA,IACnB,QAAQ;AAAA,EACZ,GAAgD;AAC5C,SAAK,WACD,aAAa,SAAS,WACtB,aAAa,SAAS;AAAA,EAC9B;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,0BAEW,KAAK;AAAA,0BACL,KAAK;AAAA;AAAA;AAAA,EAG3B;AACJ;AA9BW;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GALlB,UAMF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GARjC,UASF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/TableHead.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["TableHead.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 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 *\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 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"],
|
|
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 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-head\n *\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 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"],
|
|
5
5
|
"mappings": "qNAWA,OAEI,QAAAA,EACA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDAIzB,OAAOC,MAAY,sBAMZ,aAAM,kBAAkBF,CAAgB,CAAxC,kCAMH,KAAO,KAAO,MALd,WAA2B,QAAyB,CAChD,MAAO,CAACE,CAAM,CAClB,CAQQ,aAAa,CAAE,OAAAC,CAAO,EAAgB,CACvB,CAAC,GAAG,KAAK,QAAQ,EACzB,QAASC,GAAS,CACrBA,IAASD,IACTC,EAAK,cAAgB,OAE7B,CAAC,CACL,CAEU,aAAa,CACnB,OAAQC,CACZ,EAAgD,CAC5C,KAAK,SACDA,EAAa,SAAS,SACtBA,EAAa,SAAS,aAC9B,CAEmB,QAAyB,CACxC,OAAON;AAAA;AAAA,0BAEW,KAAK;AAAA,0BACL,KAAK;AAAA;AAAA,SAG3B,CACJ,CA9BWO,EAAA,CADNL,EAAS,CAAE,QAAS,EAAK,CAAC,GALlB,UAMF,oBAGAK,EAAA,CADNL,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARjC,UASF",
|
|
6
6
|
"names": ["html", "SpectrumElement", "property", "styles", "target", "cell", "checkboxCell", "__decorateClass"]
|
|
7
7
|
}
|
package/src/TableHeadCell.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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"],
|
|
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-head-cell\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
5
|
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,OAAO;AAEP,OAAO,YAAY;AACnB,OAAO,iBAAiB;AAOxB,MAAM,gBAAgB,CAAC,kBAA2C;AAC9D,QAAM,SAAS;AAAA,IACX,KAAK;AAAA,IACL,MAAM;AAAA,EACV;AACA,SAAO,OAAO,aAA+B,KAAK;AACtD;AAOO,aAAM,sBAAsB,gBAAgB;AAAA,EAA5C;AAAA;AAMH,SAAO,OAAO;AAGd,SAAO,WAAW;AAMlB,SAAO,UAAU;AAAA;AAAA,EAdjB,WAA2B,SAAyB;AAChD,WAAO,CAAC,QAAQ,WAAW;AAAA,EAC/B;AAAA,EAcU,cAAoB;AAC1B,QAAI,CAAC,KAAK;AAAU;AACpB,QAAI,KAAK,eAAe;AACpB,WAAK,gBAAgB,KAAK,kBAAkB,QAAQ,SAAS;AAAA,IACjE,OAAO;AACH,WAAK,gBAAgB;AAAA,IACzB;AACA,SAAK;AAAA,MACD,IAAI,YAAgC,UAAU;AAAA,QAC1C,SAAS;AAAA,QACT,QAAQ;AAAA,UACJ,eAAe,KAAK;AAAA,UACpB,SAAS,KAAK;AAAA,QAClB;AAAA,MACJ,CAAC;AAAA,IACL;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,UAAM,gBAAgB,KAAK,YAAY,CAAC,CAAC,KAAK;AAC9C,WAAO;AAAA;AAAA,cAED,gBACI;AAAA;AAAA;AAAA;AAAA,sBAKA;AAAA;AAAA,EAEd;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,SAAK,iBAAiB,SAAS,KAAK,WAAW;AAAA,EACnD;AAAA,EAEmB,OAAO,SAA+B;AACrD,QAAI,QAAQ,IAAI,eAAe,GAAG;AAC9B,WAAK,aAAa,aAAa,cAAc,KAAK,aAAa,CAAC;AAAA,IACpE;AACA,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,WAAK,WAAW,KAAK,WAAW,IAAI;AAAA,IACxC;AACA,UAAM,OAAO,OAAO;AAAA,EACxB;AACJ;AAzDW;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GALlB,cAMF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GARjC,cASF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,MAAM,WAAW,iBAAiB,CAAC;AAAA,GAX/C,cAYF;AAGA;AAAA,EADN,SAAS,EAAE,WAAW,WAAW,CAAC;AAAA,GAd1B,cAeF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/TableHeadCell.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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"],
|
|
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-head-cell\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
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,CAA+B,GAAK,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,CACrB,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
6
|
"names": ["html", "SpectrumElement", "property", "styles", "arrowStyles", "ariaSortValue", "sortDirection", "visiblySorted", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/TableRow.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
import { TableCheckboxCell } from './TableCheckboxCell.js';
|
|
3
3
|
/**
|
|
4
|
-
* @element sp-table
|
|
4
|
+
* @element sp-table-row
|
|
5
5
|
*
|
|
6
6
|
* @fires sorted - Announces that `selected` of the table row has changed
|
|
7
7
|
*/
|
package/src/TableRow.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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"],
|
|
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-row\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
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
6
|
"names": []
|
|
7
7
|
}
|
package/src/TableRow.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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"],
|
|
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-row\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
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,cACvBA,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,cACvBA,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
6
|
"names": ["html", "SpectrumElement", "property", "queryAssignedElements", "styles", "event", "target", "assignedElements", "el", "checkboxCell", "node", "changed", "__decorateClass"]
|
|
7
7
|
}
|