@spectrum-web-components/tabs 0.8.14 → 0.8.15

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 (73) hide show
  1. package/custom-elements.json +15 -9
  2. package/package.json +41 -14
  3. package/sp-tab-panel.dev.js +3 -0
  4. package/sp-tab-panel.dev.js.map +7 -0
  5. package/sp-tab-panel.js +3 -14
  6. package/sp-tab-panel.js.map +7 -1
  7. package/sp-tab.dev.js +3 -0
  8. package/sp-tab.dev.js.map +7 -0
  9. package/sp-tab.js +3 -14
  10. package/sp-tab.js.map +7 -1
  11. package/sp-tabs.dev.js +3 -0
  12. package/sp-tabs.dev.js.map +7 -0
  13. package/sp-tabs.js +3 -14
  14. package/sp-tabs.js.map +7 -1
  15. package/src/Tab.dev.js +101 -0
  16. package/src/Tab.dev.js.map +7 -0
  17. package/src/Tab.js +92 -103
  18. package/src/Tab.js.map +7 -1
  19. package/src/TabPanel.dev.js +58 -0
  20. package/src/TabPanel.dev.js.map +7 -0
  21. package/src/TabPanel.js +51 -57
  22. package/src/TabPanel.js.map +7 -1
  23. package/src/Tabs.d.ts +1 -0
  24. package/src/Tabs.dev.js +304 -0
  25. package/src/Tabs.dev.js.map +7 -0
  26. package/src/Tabs.js +275 -302
  27. package/src/Tabs.js.map +7 -1
  28. package/src/index.dev.js +4 -0
  29. package/src/index.dev.js.map +7 -0
  30. package/src/index.js +4 -15
  31. package/src/index.js.map +7 -1
  32. package/src/spectrum-tab.css.dev.js +40 -0
  33. package/src/spectrum-tab.css.dev.js.map +7 -0
  34. package/src/spectrum-tab.css.js +3 -14
  35. package/src/spectrum-tab.css.js.map +7 -1
  36. package/src/spectrum-tabs.css.dev.js +392 -0
  37. package/src/spectrum-tabs.css.dev.js.map +7 -0
  38. package/src/spectrum-tabs.css.js +3 -14
  39. package/src/spectrum-tabs.css.js.map +7 -1
  40. package/src/tab-panel.css.dev.js +6 -0
  41. package/src/tab-panel.css.dev.js.map +7 -0
  42. package/src/tab-panel.css.js +3 -14
  43. package/src/tab-panel.css.js.map +7 -1
  44. package/src/tab.css.dev.js +54 -0
  45. package/src/tab.css.dev.js.map +7 -0
  46. package/src/tab.css.js +3 -14
  47. package/src/tab.css.js.map +7 -1
  48. package/src/tabs.css.dev.js +412 -0
  49. package/src/tabs.css.dev.js.map +7 -0
  50. package/src/tabs.css.js +12 -17
  51. package/src/tabs.css.js.map +7 -1
  52. package/stories/tabs-horizontal-sizes.stories.js +53 -64
  53. package/stories/tabs-horizontal-sizes.stories.js.map +7 -1
  54. package/stories/tabs-vertical-right-sizes.stories.js +50 -61
  55. package/stories/tabs-vertical-right-sizes.stories.js.map +7 -1
  56. package/stories/tabs-vertical-sizes.stories.js +50 -61
  57. package/stories/tabs-vertical-sizes.stories.js.map +7 -1
  58. package/stories/tabs.stories.js +79 -81
  59. package/stories/tabs.stories.js.map +7 -1
  60. package/test/benchmark/basic-test.js +6 -17
  61. package/test/benchmark/basic-test.js.map +7 -1
  62. package/test/tab.test.js +27 -34
  63. package/test/tab.test.js.map +7 -1
  64. package/test/tabs-horizontal-sizes.test-vrt.js +4 -15
  65. package/test/tabs-horizontal-sizes.test-vrt.js.map +7 -1
  66. package/test/tabs-vertical-right-sizes.test-vrt.js +4 -15
  67. package/test/tabs-vertical-right-sizes.test-vrt.js.map +7 -1
  68. package/test/tabs-vertical-sizes.test-vrt.js +4 -15
  69. package/test/tabs-vertical-sizes.test-vrt.js.map +7 -1
  70. package/test/tabs.test-vrt.js +4 -15
  71. package/test/tabs.test-vrt.js.map +7 -1
  72. package/test/tabs.test.js +375 -383
  73. package/test/tabs.test.js.map +7 -1
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "kind": "javascript-module",
7
- "path": "sp-tab-panel.ts",
7
+ "path": "sp-tab-panel.js",
8
8
  "declarations": [],
9
9
  "exports": [
10
10
  {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  {
21
21
  "kind": "javascript-module",
22
- "path": "sp-tab.ts",
22
+ "path": "sp-tab.js",
23
23
  "declarations": [],
24
24
  "exports": [
25
25
  {
@@ -34,7 +34,7 @@
34
34
  },
35
35
  {
36
36
  "kind": "javascript-module",
37
- "path": "sp-tabs.ts",
37
+ "path": "sp-tabs.js",
38
38
  "declarations": [],
39
39
  "exports": [
40
40
  {
@@ -49,7 +49,7 @@
49
49
  },
50
50
  {
51
51
  "kind": "javascript-module",
52
- "path": "src/Tab.ts",
52
+ "path": "src/Tab.js",
53
53
  "declarations": [
54
54
  {
55
55
  "kind": "class",
@@ -237,14 +237,14 @@
237
237
  "name": "Tab",
238
238
  "declaration": {
239
239
  "name": "Tab",
240
- "module": "src/Tab.ts"
240
+ "module": "src/Tab.js"
241
241
  }
242
242
  }
243
243
  ]
244
244
  },
245
245
  {
246
246
  "kind": "javascript-module",
247
- "path": "src/TabPanel.ts",
247
+ "path": "src/TabPanel.js",
248
248
  "declarations": [
249
249
  {
250
250
  "kind": "class",
@@ -322,19 +322,25 @@
322
322
  "name": "TabPanel",
323
323
  "declaration": {
324
324
  "name": "TabPanel",
325
- "module": "src/TabPanel.ts"
325
+ "module": "src/TabPanel.js"
326
326
  }
327
327
  }
328
328
  ]
329
329
  },
330
330
  {
331
331
  "kind": "javascript-module",
332
- "path": "src/Tabs.ts",
332
+ "path": "src/Tabs.js",
333
333
  "declarations": [
334
334
  {
335
335
  "kind": "class",
336
336
  "description": "",
337
337
  "name": "Tabs",
338
+ "cssParts": [
339
+ {
340
+ "description": "Container element for the slotted sp-tab elements",
341
+ "name": "tablist"
342
+ }
343
+ ],
338
344
  "slots": [
339
345
  {
340
346
  "description": "Tab elements to manage as a group",
@@ -660,7 +666,7 @@
660
666
  "name": "Tabs",
661
667
  "declaration": {
662
668
  "name": "Tabs",
663
- "module": "src/Tabs.ts"
669
+ "module": "src/Tabs.js"
664
670
  }
665
671
  }
666
672
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/tabs",
3
- "version": "0.8.14",
3
+ "version": "0.8.15",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,15 +20,42 @@
20
20
  "module": "./src/index.js",
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": "./src/index.js",
24
- "./src/*": "./src/*",
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
25
27
  "./package.json": "./package.json",
26
- "./sp-tabs": "./sp-tabs.js",
27
- "./sp-tabs.js": "./sp-tabs.js",
28
- "./sp-tab": "./sp-tab.js",
29
- "./sp-tab.js": "./sp-tab.js",
30
- "./sp-tab-panel": "./sp-tab-panel.js",
31
- "./sp-tab-panel.js": "./sp-tab-panel.js"
28
+ "./src/Tab.js": {
29
+ "development": "./src/Tab.dev.js",
30
+ "default": "./src/Tab.js"
31
+ },
32
+ "./src/TabPanel.js": {
33
+ "development": "./src/TabPanel.dev.js",
34
+ "default": "./src/TabPanel.js"
35
+ },
36
+ "./src/Tabs.js": {
37
+ "development": "./src/Tabs.dev.js",
38
+ "default": "./src/Tabs.js"
39
+ },
40
+ "./src/index.js": {
41
+ "development": "./src/index.dev.js",
42
+ "default": "./src/index.js"
43
+ },
44
+ "./src/tab-panel.css.js": "./src/tab-panel.css.js",
45
+ "./src/tab.css.js": "./src/tab.css.js",
46
+ "./src/tabs.css.js": "./src/tabs.css.js",
47
+ "./sp-tabs.js": {
48
+ "development": "./sp-tabs.dev.js",
49
+ "default": "./sp-tabs.js"
50
+ },
51
+ "./sp-tab.js": {
52
+ "development": "./sp-tab.dev.js",
53
+ "default": "./sp-tab.js"
54
+ },
55
+ "./sp-tab-panel.js": {
56
+ "development": "./sp-tab-panel.dev.js",
57
+ "default": "./sp-tab-panel.js"
58
+ }
32
59
  },
33
60
  "scripts": {
34
61
  "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
@@ -48,18 +75,18 @@
48
75
  "lit-html"
49
76
  ],
50
77
  "dependencies": {
51
- "@spectrum-web-components/base": "^0.5.8",
52
- "@spectrum-web-components/reactive-controllers": "^0.2.4",
53
- "@spectrum-web-components/shared": "^0.14.4",
78
+ "@spectrum-web-components/base": "^0.6.0",
79
+ "@spectrum-web-components/reactive-controllers": "^0.2.5",
80
+ "@spectrum-web-components/shared": "^0.14.5",
54
81
  "tslib": "^2.0.0"
55
82
  },
56
83
  "devDependencies": {
57
- "@spectrum-css/tabs": "^3.2.18"
84
+ "@spectrum-css/tabs": "^3.2.19"
58
85
  },
59
86
  "types": "./src/index.d.ts",
60
87
  "customElements": "custom-elements.json",
61
88
  "sideEffects": [
62
89
  "./sp-*.js"
63
90
  ],
64
- "gitHead": "3be62133721efba844cd7032566a2c49ed6d9875"
91
+ "gitHead": "50cac779bbb0d6735c2061f1eceb86b9daf9b22b"
65
92
  }
@@ -0,0 +1,3 @@
1
+ import { TabPanel } from "./src/TabPanel.dev.js";
2
+ customElements.define("sp-tab-panel", TabPanel);
3
+ //# sourceMappingURL=sp-tab-panel.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-tab-panel.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 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 { TabPanel } from './src/TabPanel.dev.js'\n\ncustomElements.define('sp-tab-panel', TabPanel);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tab-panel': TabPanel;\n }\n}\n"],
5
+ "mappings": "AAYA;AAEA,eAAe,OAAO,gBAAgB,QAAQ;",
6
+ "names": []
7
+ }
package/sp-tab-panel.js CHANGED
@@ -1,14 +1,3 @@
1
- /*
2
- Copyright 2020 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 { TabPanel } from './src/TabPanel.js';
13
- customElements.define('sp-tab-panel', TabPanel);
14
- //# sourceMappingURL=sp-tab-panel.js.map
1
+ import { TabPanel } from "./src/TabPanel.js";
2
+ customElements.define("sp-tab-panel", TabPanel);
3
+ //# sourceMappingURL=sp-tab-panel.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-tab-panel.js","sourceRoot":"","sources":["sp-tab-panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 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 { TabPanel } from './src/TabPanel.js';\n\ncustomElements.define('sp-tab-panel', TabPanel);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tab-panel': TabPanel;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-tab-panel.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 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 { TabPanel } from './src/TabPanel.js';\n\ncustomElements.define('sp-tab-panel', TabPanel);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tab-panel': TabPanel;\n }\n}\n"],
5
+ "mappings": "AAYA;AAEA,eAAe,OAAO,gBAAgB,QAAQ;",
6
+ "names": []
7
+ }
package/sp-tab.dev.js ADDED
@@ -0,0 +1,3 @@
1
+ import { Tab } from "./src/Tab.dev.js";
2
+ customElements.define("sp-tab", Tab);
3
+ //# sourceMappingURL=sp-tab.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-tab.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 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 { Tab } from './src/Tab.dev.js'\n\ncustomElements.define('sp-tab', Tab);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tab': Tab;\n }\n}\n"],
5
+ "mappings": "AAYA;AAEA,eAAe,OAAO,UAAU,GAAG;",
6
+ "names": []
7
+ }
package/sp-tab.js CHANGED
@@ -1,14 +1,3 @@
1
- /*
2
- Copyright 2020 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 { Tab } from './src/Tab.js';
13
- customElements.define('sp-tab', Tab);
14
- //# sourceMappingURL=sp-tab.js.map
1
+ import { Tab } from "./src/Tab.js";
2
+ customElements.define("sp-tab", Tab);
3
+ //# sourceMappingURL=sp-tab.js.map
package/sp-tab.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-tab.js","sourceRoot":"","sources":["sp-tab.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 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 { Tab } from './src/Tab.js';\n\ncustomElements.define('sp-tab', Tab);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tab': Tab;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-tab.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 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 { Tab } from './src/Tab.js';\n\ncustomElements.define('sp-tab', Tab);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tab': Tab;\n }\n}\n"],
5
+ "mappings": "AAYA;AAEA,eAAe,OAAO,UAAU,GAAG;",
6
+ "names": []
7
+ }
package/sp-tabs.dev.js ADDED
@@ -0,0 +1,3 @@
1
+ import { Tabs } from "./src/Tabs.dev.js";
2
+ customElements.define("sp-tabs", Tabs);
3
+ //# sourceMappingURL=sp-tabs.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-tabs.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 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 { Tabs } from './src/Tabs.dev.js'\n\ncustomElements.define('sp-tabs', Tabs);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tabs': Tabs;\n }\n}\n"],
5
+ "mappings": "AAYA;AAEA,eAAe,OAAO,WAAW,IAAI;",
6
+ "names": []
7
+ }
package/sp-tabs.js CHANGED
@@ -1,14 +1,3 @@
1
- /*
2
- Copyright 2020 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 { Tabs } from './src/Tabs.js';
13
- customElements.define('sp-tabs', Tabs);
14
- //# sourceMappingURL=sp-tabs.js.map
1
+ import { Tabs } from "./src/Tabs.js";
2
+ customElements.define("sp-tabs", Tabs);
3
+ //# sourceMappingURL=sp-tabs.js.map
package/sp-tabs.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-tabs.js","sourceRoot":"","sources":["sp-tabs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC","sourcesContent":["/*\nCopyright 2020 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 { Tabs } from './src/Tabs.js';\n\ncustomElements.define('sp-tabs', Tabs);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tabs': Tabs;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-tabs.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 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 { Tabs } from './src/Tabs.js';\n\ncustomElements.define('sp-tabs', Tabs);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-tabs': Tabs;\n }\n}\n"],
5
+ "mappings": "AAYA;AAEA,eAAe,OAAO,WAAW,IAAI;",
6
+ "names": []
7
+ }
package/src/Tab.dev.js ADDED
@@ -0,0 +1,101 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ SpectrumElement
15
+ } from "@spectrum-web-components/base";
16
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import {
18
+ FocusVisiblePolyfillMixin,
19
+ ObserveSlotPresence,
20
+ ObserveSlotText
21
+ } from "@spectrum-web-components/shared";
22
+ import tabItemStyles from "./tab.css.js";
23
+ const _Tab = class extends FocusVisiblePolyfillMixin(ObserveSlotText(ObserveSlotPresence(SpectrumElement, '[slot="icon"]'), "")) {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.disabled = false;
27
+ this.label = "";
28
+ this.selected = false;
29
+ this.vertical = false;
30
+ this.value = "";
31
+ }
32
+ static get styles() {
33
+ return [tabItemStyles];
34
+ }
35
+ get hasIcon() {
36
+ return this.slotContentIsPresent;
37
+ }
38
+ get hasLabel() {
39
+ return !!this.label || this.slotHasContent;
40
+ }
41
+ handleContentChange() {
42
+ this.dispatchEvent(new Event("sp-tab-contentchange", {
43
+ bubbles: true,
44
+ composed: true
45
+ }));
46
+ }
47
+ render() {
48
+ return html`
49
+ ${this.hasIcon ? html`
50
+ <slot name="icon"></slot>
51
+ ` : html``}
52
+ <label id="item-label" ?hidden=${!this.hasLabel}>
53
+ ${this.slotHasContent ? html`` : this.label}
54
+ <slot>${this.label}</slot>
55
+ </label>
56
+ `;
57
+ }
58
+ firstUpdated(changes) {
59
+ super.firstUpdated(changes);
60
+ this.setAttribute("role", "tab");
61
+ if (!this.hasAttribute("id")) {
62
+ this.id = `sp-tab-${_Tab.instanceCount++}`;
63
+ }
64
+ this.shadowRoot.addEventListener("slotchange", this.handleContentChange);
65
+ }
66
+ updated(changes) {
67
+ super.updated(changes);
68
+ if (changes.has("label") && typeof changes.get("label") !== "undefined") {
69
+ this.handleContentChange();
70
+ }
71
+ if (changes.has("selected")) {
72
+ this.setAttribute("aria-selected", this.selected ? "true" : "false");
73
+ this.setAttribute("tabindex", this.selected ? "0" : "-1");
74
+ }
75
+ if (changes.has("disabled")) {
76
+ if (this.disabled) {
77
+ this.setAttribute("aria-disabled", "true");
78
+ } else {
79
+ this.removeAttribute("aria-disabled");
80
+ }
81
+ }
82
+ }
83
+ };
84
+ export let Tab = _Tab;
85
+ Tab.instanceCount = 0;
86
+ __decorateClass([
87
+ property({ type: Boolean, reflect: true })
88
+ ], Tab.prototype, "disabled", 2);
89
+ __decorateClass([
90
+ property({ reflect: true })
91
+ ], Tab.prototype, "label", 2);
92
+ __decorateClass([
93
+ property({ type: Boolean, reflect: true })
94
+ ], Tab.prototype, "selected", 2);
95
+ __decorateClass([
96
+ property({ type: Boolean, reflect: true })
97
+ ], Tab.prototype, "vertical", 2);
98
+ __decorateClass([
99
+ property({ type: String, reflect: true })
100
+ ], Tab.prototype, "value", 2);
101
+ //# sourceMappingURL=Tab.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Tab.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 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 {\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 {\n FocusVisiblePolyfillMixin,\n ObserveSlotPresence,\n ObserveSlotText,\n} from '@spectrum-web-components/shared';\n\nimport tabItemStyles from './tab.css.js';\n\n/**\n * @element sp-tab\n *\n * @slot - text label of the Tab\n * @slot icon - The icon that appears on the left of the label\n */\nexport class Tab extends FocusVisiblePolyfillMixin(\n ObserveSlotText(ObserveSlotPresence(SpectrumElement, '[slot=\"icon\"]'), '')\n) {\n public static override get styles(): CSSResultArray {\n return [tabItemStyles];\n }\n\n /**\n * @private\n */\n static instanceCount = 0;\n\n protected get hasIcon(): boolean {\n return this.slotContentIsPresent;\n }\n\n protected get hasLabel(): boolean {\n return !!this.label || this.slotHasContent;\n }\n\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n @property({ reflect: true })\n public label = '';\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @property({ type: String, reflect: true })\n public value = '';\n\n protected handleContentChange(): void {\n /**\n * When the content in a tab has changed, JS powered layout related to that content may also need to be changed.\n */\n this.dispatchEvent(\n new Event('sp-tab-contentchange', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n protected override render(): TemplateResult {\n return html`\n ${this.hasIcon\n ? html`\n <slot name=\"icon\"></slot>\n `\n : html``}\n <label id=\"item-label\" ?hidden=${!this.hasLabel}>\n ${this.slotHasContent ? html`` : this.label}\n <slot>${this.label}</slot>\n </label>\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n this.setAttribute('role', 'tab');\n if (!this.hasAttribute('id')) {\n this.id = `sp-tab-${Tab.instanceCount++}`;\n }\n // @TODO - refactor this as a ResizeObserver up to `sp-tabs` so that it can be more\n // resiliant to Tab content changes, as well as other content slotted into the \"tablist\".\n this.shadowRoot.addEventListener(\n 'slotchange',\n this.handleContentChange\n );\n }\n\n protected override updated(changes: PropertyValues): void {\n super.updated(changes);\n if (\n changes.has('label') &&\n typeof changes.get('label') !== 'undefined'\n ) {\n this.handleContentChange();\n }\n if (changes.has('selected')) {\n this.setAttribute(\n 'aria-selected',\n this.selected ? 'true' : 'false'\n );\n this.setAttribute('tabindex', this.selected ? '0' : '-1');\n }\n if (changes.has('disabled')) {\n if (this.disabled) {\n this.setAttribute('aria-disabled', 'true');\n } else {\n this.removeAttribute('aria-disabled');\n }\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAOA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA;AAQO,2BAAkB,0BACrB,gBAAgB,oBAAoB,iBAAiB,eAAe,GAAG,EAAE,CAC7E,EAAE;AAAA,EAFK;AAAA;AAqBI,oBAAW;AAGX,iBAAQ;AAGR,oBAAW;AAGX,oBAAW;AAGX,iBAAQ;AAAA;AAAA,aA9BY,SAAyB;AAChD,WAAO,CAAC,aAAa;AAAA,EACzB;AAAA,MAOc,UAAmB;AAC7B,WAAO,KAAK;AAAA,EAChB;AAAA,MAEc,WAAoB;AAC9B,WAAO,CAAC,CAAC,KAAK,SAAS,KAAK;AAAA,EAChC;AAAA,EAiBU,sBAA4B;AAIlC,SAAK,cACD,IAAI,MAAM,wBAAwB;AAAA,MAC9B,SAAS;AAAA,MACT,UAAU;AAAA,IACd,CAAC,CACL;AAAA,EACJ;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,cACD,KAAK,UACD;AAAA;AAAA,sBAGA;AAAA,6CAC2B,CAAC,KAAK;AAAA,kBACjC,KAAK,iBAAiB,SAAS,KAAK;AAAA,wBAC9B,KAAK;AAAA;AAAA;AAAA,EAGzB;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,SAAK,aAAa,QAAQ,KAAK;AAC/B,QAAI,CAAC,KAAK,aAAa,IAAI,GAAG;AAC1B,WAAK,KAAK,UAAU,KAAI;AAAA,IAC5B;AAGA,SAAK,WAAW,iBACZ,cACA,KAAK,mBACT;AAAA,EACJ;AAAA,EAEmB,QAAQ,SAA+B;AACtD,UAAM,QAAQ,OAAO;AACrB,QACI,QAAQ,IAAI,OAAO,KACnB,OAAO,QAAQ,IAAI,OAAO,MAAM,aAClC;AACE,WAAK,oBAAoB;AAAA,IAC7B;AACA,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,WAAK,aACD,iBACA,KAAK,WAAW,SAAS,OAC7B;AACA,WAAK,aAAa,YAAY,KAAK,WAAW,MAAM,IAAI;AAAA,IAC5D;AACA,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,UAAI,KAAK,UAAU;AACf,aAAK,aAAa,iBAAiB,MAAM;AAAA,MAC7C,OAAO;AACH,aAAK,gBAAgB,eAAe;AAAA,MACxC;AAAA,IACJ;AAAA,EACJ;AACJ;AAlGO;AAUI,AAVJ,IAUI,gBAAgB;AAWhB;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AArBJ,IAqBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GACpB,AAxBJ,IAwBI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AA3BJ,IA2BI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GACnC,AA9BJ,IA8BI;AAGA;AAAA,EADP,AAAC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAClC,AAjCJ,IAiCI;",
6
+ "names": []
7
+ }
package/src/Tab.js CHANGED
@@ -1,112 +1,101 @@
1
- /*
2
- Copyright 2020 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 { __decorate } from "tslib";
13
- import { html, SpectrumElement, } from '@spectrum-web-components/base';
14
- import { property } from '@spectrum-web-components/base/src/decorators.js';
15
- import { FocusVisiblePolyfillMixin, ObserveSlotPresence, ObserveSlotText, } from '@spectrum-web-components/shared';
16
- import tabItemStyles from './tab.css.js';
17
- /**
18
- * @element sp-tab
19
- *
20
- * @slot - text label of the Tab
21
- * @slot icon - The icon that appears on the left of the label
22
- */
23
- export class Tab extends FocusVisiblePolyfillMixin(ObserveSlotText(ObserveSlotPresence(SpectrumElement, '[slot="icon"]'), '')) {
24
- constructor() {
25
- super(...arguments);
26
- this.disabled = false;
27
- this.label = '';
28
- this.selected = false;
29
- this.vertical = false;
30
- this.value = '';
31
- }
32
- static get styles() {
33
- return [tabItemStyles];
34
- }
35
- get hasIcon() {
36
- return this.slotContentIsPresent;
37
- }
38
- get hasLabel() {
39
- return !!this.label || this.slotHasContent;
40
- }
41
- handleContentChange() {
42
- /**
43
- * When the content in a tab has changed, JS powered layout related to that content may also need to be changed.
44
- */
45
- this.dispatchEvent(new Event('sp-tab-contentchange', {
46
- bubbles: true,
47
- composed: true,
48
- }));
49
- }
50
- render() {
51
- return html `
52
- ${this.hasIcon
53
- ? html `
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ SpectrumElement
15
+ } from "@spectrum-web-components/base";
16
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import {
18
+ FocusVisiblePolyfillMixin,
19
+ ObserveSlotPresence,
20
+ ObserveSlotText
21
+ } from "@spectrum-web-components/shared";
22
+ import tabItemStyles from "./tab.css.js";
23
+ const _Tab = class extends FocusVisiblePolyfillMixin(ObserveSlotText(ObserveSlotPresence(SpectrumElement, '[slot="icon"]'), "")) {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.disabled = false;
27
+ this.label = "";
28
+ this.selected = false;
29
+ this.vertical = false;
30
+ this.value = "";
31
+ }
32
+ static get styles() {
33
+ return [tabItemStyles];
34
+ }
35
+ get hasIcon() {
36
+ return this.slotContentIsPresent;
37
+ }
38
+ get hasLabel() {
39
+ return !!this.label || this.slotHasContent;
40
+ }
41
+ handleContentChange() {
42
+ this.dispatchEvent(new Event("sp-tab-contentchange", {
43
+ bubbles: true,
44
+ composed: true
45
+ }));
46
+ }
47
+ render() {
48
+ return html`
49
+ ${this.hasIcon ? html`
54
50
  <slot name="icon"></slot>
55
- `
56
- : html ``}
51
+ ` : html``}
57
52
  <label id="item-label" ?hidden=${!this.hasLabel}>
58
- ${this.slotHasContent ? html `` : this.label}
53
+ ${this.slotHasContent ? html`` : this.label}
59
54
  <slot>${this.label}</slot>
60
55
  </label>
61
56
  `;
57
+ }
58
+ firstUpdated(changes) {
59
+ super.firstUpdated(changes);
60
+ this.setAttribute("role", "tab");
61
+ if (!this.hasAttribute("id")) {
62
+ this.id = `sp-tab-${_Tab.instanceCount++}`;
63
+ }
64
+ this.shadowRoot.addEventListener("slotchange", this.handleContentChange);
65
+ }
66
+ updated(changes) {
67
+ super.updated(changes);
68
+ if (changes.has("label") && typeof changes.get("label") !== "undefined") {
69
+ this.handleContentChange();
62
70
  }
63
- firstUpdated(changes) {
64
- super.firstUpdated(changes);
65
- this.setAttribute('role', 'tab');
66
- if (!this.hasAttribute('id')) {
67
- this.id = `sp-tab-${Tab.instanceCount++}`;
68
- }
69
- // @TODO - refactor this as a ResizeObserver up to `sp-tabs` so that it can be more
70
- // resiliant to Tab content changes, as well as other content slotted into the "tablist".
71
- this.shadowRoot.addEventListener('slotchange', this.handleContentChange);
71
+ if (changes.has("selected")) {
72
+ this.setAttribute("aria-selected", this.selected ? "true" : "false");
73
+ this.setAttribute("tabindex", this.selected ? "0" : "-1");
72
74
  }
73
- updated(changes) {
74
- super.updated(changes);
75
- if (changes.has('label') &&
76
- typeof changes.get('label') !== 'undefined') {
77
- this.handleContentChange();
78
- }
79
- if (changes.has('selected')) {
80
- this.setAttribute('aria-selected', this.selected ? 'true' : 'false');
81
- this.setAttribute('tabindex', this.selected ? '0' : '-1');
82
- }
83
- if (changes.has('disabled')) {
84
- if (this.disabled) {
85
- this.setAttribute('aria-disabled', 'true');
86
- }
87
- else {
88
- this.removeAttribute('aria-disabled');
89
- }
90
- }
75
+ if (changes.has("disabled")) {
76
+ if (this.disabled) {
77
+ this.setAttribute("aria-disabled", "true");
78
+ } else {
79
+ this.removeAttribute("aria-disabled");
80
+ }
91
81
  }
92
- }
93
- /**
94
- * @private
95
- */
82
+ }
83
+ };
84
+ export let Tab = _Tab;
96
85
  Tab.instanceCount = 0;
97
- __decorate([
98
- property({ type: Boolean, reflect: true })
99
- ], Tab.prototype, "disabled", void 0);
100
- __decorate([
101
- property({ reflect: true })
102
- ], Tab.prototype, "label", void 0);
103
- __decorate([
104
- property({ type: Boolean, reflect: true })
105
- ], Tab.prototype, "selected", void 0);
106
- __decorate([
107
- property({ type: Boolean, reflect: true })
108
- ], Tab.prototype, "vertical", void 0);
109
- __decorate([
110
- property({ type: String, reflect: true })
111
- ], Tab.prototype, "value", void 0);
112
- //# sourceMappingURL=Tab.js.map
86
+ __decorateClass([
87
+ property({ type: Boolean, reflect: true })
88
+ ], Tab.prototype, "disabled", 2);
89
+ __decorateClass([
90
+ property({ reflect: true })
91
+ ], Tab.prototype, "label", 2);
92
+ __decorateClass([
93
+ property({ type: Boolean, reflect: true })
94
+ ], Tab.prototype, "selected", 2);
95
+ __decorateClass([
96
+ property({ type: Boolean, reflect: true })
97
+ ], Tab.prototype, "vertical", 2);
98
+ __decorateClass([
99
+ property({ type: String, reflect: true })
100
+ ], Tab.prototype, "value", 2);
101
+ //# sourceMappingURL=Tab.js.map