@spectrum-web-components/button 0.18.2-devmode2.0 → 0.19.1
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/package.json +8 -8
- package/sp-button.dev.js +1 -0
- package/sp-button.dev.js.map +1 -1
- package/sp-button.js +1 -2
- package/sp-button.js.map +2 -2
- package/sp-clear-button.dev.js +1 -0
- package/sp-clear-button.dev.js.map +1 -1
- package/sp-clear-button.js +1 -2
- package/sp-clear-button.js.map +2 -2
- package/sp-close-button.dev.js +1 -0
- package/sp-close-button.dev.js.map +1 -1
- package/sp-close-button.js +1 -2
- package/sp-close-button.js.map +2 -2
- package/src/Button.dev.js +1 -0
- package/src/Button.dev.js.map +1 -1
- package/src/Button.js +1 -78
- package/src/Button.js.map +2 -2
- package/src/ButtonBase.dev.js +8 -2
- package/src/ButtonBase.dev.js.map +1 -1
- package/src/ButtonBase.js +6 -205
- package/src/ButtonBase.js.map +2 -2
- package/src/ClearButton.dev.js +1 -0
- package/src/ClearButton.dev.js.map +1 -1
- package/src/ClearButton.js +6 -52
- package/src/ClearButton.js.map +2 -2
- package/src/CloseButton.dev.js +1 -0
- package/src/CloseButton.dev.js.map +1 -1
- package/src/CloseButton.js +5 -48
- package/src/CloseButton.js.map +2 -2
- package/src/StyledButton.dev.js +1 -0
- package/src/StyledButton.dev.js.map +1 -1
- package/src/StyledButton.js +1 -7
- package/src/StyledButton.js.map +2 -2
- package/src/button-base.css.dev.js +1 -0
- package/src/button-base.css.dev.js.map +1 -1
- package/src/button-base.css.js +2 -4
- package/src/button-base.css.js.map +2 -2
- package/src/button.css.dev.js +1 -0
- package/src/button.css.dev.js.map +1 -1
- package/src/button.css.js +2 -4
- package/src/button.css.js.map +2 -2
- package/src/index.dev.js +1 -0
- package/src/index.dev.js.map +1 -1
- package/src/index.js +1 -5
- package/src/index.js.map +1 -1
- package/src/spectrum-button-base.css.dev.js +1 -0
- package/src/spectrum-button-base.css.dev.js.map +1 -1
- package/src/spectrum-button-base.css.js +2 -4
- package/src/spectrum-button-base.css.js.map +2 -2
- package/src/spectrum-button.css.dev.js +1 -0
- package/src/spectrum-button.css.dev.js.map +1 -1
- package/src/spectrum-button.css.js +2 -4
- package/src/spectrum-button.css.js.map +2 -2
- package/stories/button-accent-fill-sizes.stories.js +1 -0
- package/stories/button-accent-fill-sizes.stories.js.map +2 -2
- package/stories/button-accent-fill.stories.js +1 -0
- package/stories/button-accent-fill.stories.js.map +1 -1
- package/stories/button-accent-outline-sizes.stories.js +1 -0
- package/stories/button-accent-outline-sizes.stories.js.map +2 -2
- package/stories/button-accent-outline.stories.js +1 -0
- package/stories/button-accent-outline.stories.js.map +1 -1
- package/stories/button-black-fill-sizes.stories.js +1 -0
- package/stories/button-black-fill-sizes.stories.js.map +2 -2
- package/stories/button-black-fill.stories.js +1 -0
- package/stories/button-black-fill.stories.js.map +1 -1
- package/stories/button-black-outline-sizes.stories.js +1 -0
- package/stories/button-black-outline-sizes.stories.js.map +2 -2
- package/stories/button-black-outline.stories.js +1 -0
- package/stories/button-black-outline.stories.js.map +1 -1
- package/stories/button-negative-fill-sizes.stories.js +1 -0
- package/stories/button-negative-fill-sizes.stories.js.map +2 -2
- package/stories/button-negative-fill.stories.js +1 -0
- package/stories/button-negative-fill.stories.js.map +1 -1
- package/stories/button-negative-outline-sizes.stories.js +1 -0
- package/stories/button-negative-outline-sizes.stories.js.map +2 -2
- package/stories/button-negative-outline.stories.js +1 -0
- package/stories/button-negative-outline.stories.js.map +1 -1
- package/stories/button-primary-fill-sizes.stories.js +1 -0
- package/stories/button-primary-fill-sizes.stories.js.map +2 -2
- package/stories/button-primary-fill.stories.js +1 -0
- package/stories/button-primary-fill.stories.js.map +1 -1
- package/stories/button-primary-outline-sizes.stories.js +1 -0
- package/stories/button-primary-outline-sizes.stories.js.map +2 -2
- package/stories/button-primary-outline.stories.js +1 -0
- package/stories/button-primary-outline.stories.js.map +1 -1
- package/stories/button-secondary-fill-sizes.stories.js +1 -0
- package/stories/button-secondary-fill-sizes.stories.js.map +2 -2
- package/stories/button-secondary-fill.stories.js +1 -0
- package/stories/button-secondary-fill.stories.js.map +1 -1
- package/stories/button-secondary-outline-sizes.stories.js +1 -0
- package/stories/button-secondary-outline-sizes.stories.js.map +2 -2
- package/stories/button-secondary-outline.stories.js +1 -0
- package/stories/button-secondary-outline.stories.js.map +1 -1
- package/stories/button-white-fill-sizes.stories.js +1 -0
- package/stories/button-white-fill-sizes.stories.js.map +2 -2
- package/stories/button-white-fill.stories.js +1 -0
- package/stories/button-white-fill.stories.js.map +1 -1
- package/stories/button-white-outline-sizes.stories.js +1 -0
- package/stories/button-white-outline-sizes.stories.js.map +2 -2
- package/stories/button-white-outline.stories.js +1 -0
- package/stories/button-white-outline.stories.js.map +1 -1
- package/stories/index.js +1 -0
- package/stories/index.js.map +1 -1
- package/test/benchmark/test-basic.js +1 -0
- package/test/benchmark/test-basic.js.map +1 -1
- package/test/button-accent-fill-sizes.test-vrt.js +1 -0
- package/test/button-accent-fill-sizes.test-vrt.js.map +1 -1
- package/test/button-accent-fill.test-vrt.js +1 -0
- package/test/button-accent-fill.test-vrt.js.map +1 -1
- package/test/button-accent-outline-sizes.test-vrt.js +1 -0
- package/test/button-accent-outline-sizes.test-vrt.js.map +1 -1
- package/test/button-accent-outline.test-vrt.js +1 -0
- package/test/button-accent-outline.test-vrt.js.map +1 -1
- package/test/button-black-fill-sizes.test-vrt.js +1 -0
- package/test/button-black-fill-sizes.test-vrt.js.map +1 -1
- package/test/button-black-fill.test-vrt.js +1 -0
- package/test/button-black-fill.test-vrt.js.map +1 -1
- package/test/button-black-outline-sizes.test-vrt.js +1 -0
- package/test/button-black-outline-sizes.test-vrt.js.map +1 -1
- package/test/button-black-outline.test-vrt.js +1 -0
- package/test/button-black-outline.test-vrt.js.map +1 -1
- package/test/button-negative-fill-sizes.test-vrt.js +1 -0
- package/test/button-negative-fill-sizes.test-vrt.js.map +1 -1
- package/test/button-negative-fill.test-vrt.js +1 -0
- package/test/button-negative-fill.test-vrt.js.map +1 -1
- package/test/button-negative-outline-sizes.test-vrt.js +1 -0
- package/test/button-negative-outline-sizes.test-vrt.js.map +1 -1
- package/test/button-negative-outline.test-vrt.js +1 -0
- package/test/button-negative-outline.test-vrt.js.map +1 -1
- package/test/button-primary-fill-sizes.test-vrt.js +1 -0
- package/test/button-primary-fill-sizes.test-vrt.js.map +1 -1
- package/test/button-primary-fill.test-vrt.js +1 -0
- package/test/button-primary-fill.test-vrt.js.map +1 -1
- package/test/button-primary-outline-sizes.test-vrt.js +1 -0
- package/test/button-primary-outline-sizes.test-vrt.js.map +1 -1
- package/test/button-primary-outline.test-vrt.js +1 -0
- package/test/button-primary-outline.test-vrt.js.map +1 -1
- package/test/button-secondary-fill-sizes.test-vrt.js +1 -0
- package/test/button-secondary-fill-sizes.test-vrt.js.map +1 -1
- package/test/button-secondary-fill.test-vrt.js +1 -0
- package/test/button-secondary-fill.test-vrt.js.map +1 -1
- package/test/button-secondary-outline-sizes.test-vrt.js +1 -0
- package/test/button-secondary-outline-sizes.test-vrt.js.map +1 -1
- package/test/button-secondary-outline.test-vrt.js +1 -0
- package/test/button-secondary-outline.test-vrt.js.map +1 -1
- package/test/button-white-fill-sizes.test-vrt.js +1 -0
- package/test/button-white-fill-sizes.test-vrt.js.map +1 -1
- package/test/button-white-fill.test-vrt.js +1 -0
- package/test/button-white-fill.test-vrt.js.map +1 -1
- package/test/button-white-outline-sizes.test-vrt.js +1 -0
- package/test/button-white-outline-sizes.test-vrt.js.map +1 -1
- package/test/button-white-outline.test-vrt.js +1 -0
- package/test/button-white-outline.test-vrt.js.map +1 -1
- package/test/button.test.js +188 -121
- package/test/button.test.js.map +1 -1
- package/test/clear-button.test.js +11 -4
- package/test/clear-button.test.js.map +1 -1
- package/test/close-button.test.js +11 -4
- package/test/close-button.test.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/button",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"lit-html"
|
|
83
83
|
],
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@spectrum-web-components/base": "^0.
|
|
86
|
-
"@spectrum-web-components/clear-button": "^0.
|
|
87
|
-
"@spectrum-web-components/close-button": "^0.
|
|
88
|
-
"@spectrum-web-components/icon": "^0.
|
|
89
|
-
"@spectrum-web-components/icons-ui": "^0.
|
|
90
|
-
"@spectrum-web-components/shared": "^0.
|
|
85
|
+
"@spectrum-web-components/base": "^0.7.0",
|
|
86
|
+
"@spectrum-web-components/clear-button": "^0.2.0",
|
|
87
|
+
"@spectrum-web-components/close-button": "^0.3.1",
|
|
88
|
+
"@spectrum-web-components/icon": "^0.12.0",
|
|
89
|
+
"@spectrum-web-components/icons-ui": "^0.9.0",
|
|
90
|
+
"@spectrum-web-components/shared": "^0.15.0",
|
|
91
91
|
"tslib": "^2.0.0"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"./sp-*.js",
|
|
100
100
|
"./**/*.dev.js"
|
|
101
101
|
],
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "1cfea66c39440232b9982509573801b8e3a9f692"
|
|
103
103
|
}
|
package/sp-button.dev.js
CHANGED
package/sp-button.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-button.ts"],
|
|
4
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*/\nimport { Button } from './src/Button.dev.js'\n\ncustomElements.define('sp-button', Button);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button': Button;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,cAAc;AAEvB,eAAe,OAAO,aAAa,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-button.js
CHANGED
package/sp-button.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-button.ts"],
|
|
4
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*/\nimport { Button } from './src/Button.js';\n\ncustomElements.define('sp-button', Button);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button': Button;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,UAAAA,MAAc,kBAEvB,eAAe,OAAO,YAAaA,CAAM",
|
|
6
|
+
"names": ["Button"]
|
|
7
7
|
}
|
package/sp-clear-button.dev.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-clear-button.ts"],
|
|
4
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*/\nimport { ClearButton } from './src/ClearButton.dev.js'\n\ncustomElements.define('sp-clear-button', ClearButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-clear-button': ClearButton;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAWA;
|
|
5
|
+
"mappings": ";AAWA,SAAS,mBAAmB;AAE5B,eAAe,OAAO,mBAAmB,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-clear-button.js
CHANGED
package/sp-clear-button.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-clear-button.ts"],
|
|
4
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*/\nimport { ClearButton } from './src/ClearButton.js';\n\ncustomElements.define('sp-clear-button', ClearButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-clear-button': ClearButton;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAWA,OAAS,eAAAA,MAAmB,uBAE5B,eAAe,OAAO,kBAAmBA,CAAW",
|
|
6
|
+
"names": ["ClearButton"]
|
|
7
7
|
}
|
package/sp-close-button.dev.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-close-button.ts"],
|
|
4
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 { CloseButton } from './src/CloseButton.dev.js'\n\ncustomElements.define('sp-close-button', CloseButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-close-button': CloseButton;\n }\n}\n"],
|
|
5
|
-
"mappings": "AAYA;
|
|
5
|
+
"mappings": ";AAYA,SAAS,mBAAmB;AAE5B,eAAe,OAAO,mBAAmB,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/sp-close-button.js
CHANGED
package/sp-close-button.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["sp-close-button.ts"],
|
|
4
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 { CloseButton } from './src/CloseButton.js';\n\ncustomElements.define('sp-close-button', CloseButton);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-close-button': CloseButton;\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "aAYA,OAAS,eAAAA,MAAmB,uBAE5B,eAAe,OAAO,kBAAmBA,CAAW",
|
|
6
|
+
"names": ["CloseButton"]
|
|
7
7
|
}
|
package/src/Button.dev.js
CHANGED
package/src/Button.dev.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Button.ts"],
|
|
4
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 PropertyValues,\n SizedMixin,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.dev.js'\nimport buttonStyles from './button.css.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(StyledButton) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n break;\n case 'overBackground':\n this._variant = 'white';\n this.treatment = 'outline';\n break;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EAGI;AAAA,OACG;AACP,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,OAAO,kBAAkB;AAWlB,aAAM,iBAAiB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAUO,aAAM,eAAe,WAAW,YAAY,EAAE;AAAA,EAA9C;AAAA;AAkCH,SAAQ,WAA2B;AAMnC,SAAO,YAA8B;AAAA;AAAA,EAvCrC,WAA2B,SAAyB;AAChD,WAAO,CAAC,GAAG,MAAM,QAAQ,YAAY;AAAA,EACzC;AAAA,EAMA,IAAW,UAA0B;AACjC,WAAO,KAAK;AAAA,EAChB;AAAA,EACA,IAAW,QAAQ,SAAyB;AACxC,QAAI,YAAY,KAAK;AAAS;AAE9B,SAAK,cAAc,WAAW,KAAK,OAAO;AAC1C,YAAQ;AAAA,WACC;AACD,aAAK,WAAW;AAChB;AAAA,WACC;AACD,aAAK,WAAW;AAChB,aAAK,YAAY;AACjB;AAAA;AAEA,YAAI,CAAC,eAAe,SAAS,OAAO,GAAG;AACnC,eAAK,WAAW;AAAA,QACpB,OAAO;AACH,eAAK,WAAW;AAAA,QACpB;AACA;AAAA;AAER,SAAK,aAAa,WAAW,KAAK,OAAO;AAAA,EAC7C;AAAA,EAaA,IAAW,MAAM,OAAgB;AAC7B,SAAK,YAAY,QAAQ,YAAY;AAAA,EACzC;AAAA,EAEmB,aAAa,SAAqC;AACjE,UAAM,aAAa,OAAO;AAC1B,QAAI,CAAC,KAAK,aAAa,SAAS,GAAG;AAC/B,WAAK,aAAa,WAAW,KAAK,OAAO;AAAA,IAC7C;AAAA,EACJ;AACJ;AA/Ce;AAAA,EADV,SAAS;AAAA,GARD,OASE;AA+BJ;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAvClB,OAwCF;AAMI;AAAA,EADV,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,GA7ClB,OA8CE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Button.js
CHANGED
|
@@ -1,79 +1,2 @@
|
|
|
1
|
-
var
|
|
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
|
-
SizedMixin
|
|
14
|
-
} from "@spectrum-web-components/base";
|
|
15
|
-
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
16
|
-
import { StyledButton } from "./StyledButton.js";
|
|
17
|
-
import buttonStyles from "./button.css.js";
|
|
18
|
-
export const VALID_VARIANTS = [
|
|
19
|
-
"accent",
|
|
20
|
-
"primary",
|
|
21
|
-
"secondary",
|
|
22
|
-
"negative",
|
|
23
|
-
"white",
|
|
24
|
-
"black"
|
|
25
|
-
];
|
|
26
|
-
export class Button extends SizedMixin(StyledButton) {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
this._variant = "accent";
|
|
30
|
-
this.treatment = "fill";
|
|
31
|
-
}
|
|
32
|
-
static get styles() {
|
|
33
|
-
return [...super.styles, buttonStyles];
|
|
34
|
-
}
|
|
35
|
-
get variant() {
|
|
36
|
-
return this._variant;
|
|
37
|
-
}
|
|
38
|
-
set variant(variant) {
|
|
39
|
-
if (variant === this.variant)
|
|
40
|
-
return;
|
|
41
|
-
this.requestUpdate("variant", this.variant);
|
|
42
|
-
switch (variant) {
|
|
43
|
-
case "cta":
|
|
44
|
-
this._variant = "accent";
|
|
45
|
-
break;
|
|
46
|
-
case "overBackground":
|
|
47
|
-
this._variant = "white";
|
|
48
|
-
this.treatment = "outline";
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
if (!VALID_VARIANTS.includes(variant)) {
|
|
52
|
-
this._variant = "accent";
|
|
53
|
-
} else {
|
|
54
|
-
this._variant = variant;
|
|
55
|
-
}
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
this.setAttribute("variant", this.variant);
|
|
59
|
-
}
|
|
60
|
-
set quiet(quiet) {
|
|
61
|
-
this.treatment = quiet ? "outline" : "fill";
|
|
62
|
-
}
|
|
63
|
-
firstUpdated(changes) {
|
|
64
|
-
super.firstUpdated(changes);
|
|
65
|
-
if (!this.hasAttribute("variant")) {
|
|
66
|
-
this.setAttribute("variant", this.variant);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
__decorateClass([
|
|
71
|
-
property()
|
|
72
|
-
], Button.prototype, "variant", 1);
|
|
73
|
-
__decorateClass([
|
|
74
|
-
property({ reflect: true })
|
|
75
|
-
], Button.prototype, "treatment", 2);
|
|
76
|
-
__decorateClass([
|
|
77
|
-
property({ type: Boolean })
|
|
78
|
-
], Button.prototype, "quiet", 1);
|
|
1
|
+
"use strict";var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var i=(n,r,t,a)=>{for(var e=a>1?void 0:a?p(r,t):r,s=n.length-1,o;s>=0;s--)(o=n[s])&&(e=(a?o(r,t,e):o(e))||e);return a&&e&&c(r,t,e),e};import{SizedMixin as l}from"@spectrum-web-components/base";import{property as u}from"@spectrum-web-components/base/src/decorators.js";import{StyledButton as h}from"./StyledButton.js";import v from"./button.css.js";export const VALID_VARIANTS=["accent","primary","secondary","negative","white","black"];export class Button extends l(h){constructor(){super(...arguments);this._variant="accent";this.treatment="fill"}static get styles(){return[...super.styles,v]}get variant(){return this._variant}set variant(t){if(t!==this.variant){switch(this.requestUpdate("variant",this.variant),t){case"cta":this._variant="accent";break;case"overBackground":this._variant="white",this.treatment="outline";break;default:VALID_VARIANTS.includes(t)?this._variant=t:this._variant="accent";break}this.setAttribute("variant",this.variant)}}set quiet(t){this.treatment=t?"outline":"fill"}firstUpdated(t){super.firstUpdated(t),this.hasAttribute("variant")||this.setAttribute("variant",this.variant)}}i([u()],Button.prototype,"variant",1),i([u({reflect:!0})],Button.prototype,"treatment",2),i([u({type:Boolean})],Button.prototype,"quiet",1);
|
|
79
2
|
//# sourceMappingURL=Button.js.map
|
package/src/Button.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Button.ts"],
|
|
4
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 PropertyValues,\n SizedMixin,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from './button.css.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(StyledButton) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property()\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n break;\n case 'overBackground':\n this._variant = 'white';\n this.treatment = 'outline';\n break;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n protected override firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "qNAYA,OAGI,cAAAA,MACG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,gBAAAC,MAAoB,oBAC7B,OAAOC,MAAkB,kBAWlB,aAAM,eAAiB,CAC1B,SACA,UACA,YACA,WACA,QACA,OACJ,EAUO,aAAM,eAAeH,EAAWE,CAAY,CAAE,CAA9C,kCAkCH,KAAQ,SAA2B,SAMnC,KAAO,UAA8B,OAvCrC,WAA2B,QAAyB,CAChD,MAAO,CAAC,GAAG,MAAM,OAAQC,CAAY,CACzC,CAMA,IAAW,SAA0B,CACjC,OAAO,KAAK,QAChB,CACA,IAAW,QAAQC,EAAyB,CACxC,GAAIA,IAAY,KAAK,QAGrB,QADA,KAAK,cAAc,UAAW,KAAK,OAAO,EAClCA,OACC,MACD,KAAK,SAAW,SAChB,UACC,iBACD,KAAK,SAAW,QAChB,KAAK,UAAY,UACjB,cAEK,eAAe,SAASA,CAAO,EAGhC,KAAK,SAAWA,EAFhB,KAAK,SAAW,SAIpB,MAER,KAAK,aAAa,UAAW,KAAK,OAAO,EAC7C,CAaA,IAAW,MAAMC,EAAgB,CAC7B,KAAK,UAAYA,EAAQ,UAAY,MACzC,CAEmB,aAAaC,EAAqC,CACjE,MAAM,aAAaA,CAAO,EACrB,KAAK,aAAa,SAAS,GAC5B,KAAK,aAAa,UAAW,KAAK,OAAO,CAEjD,CACJ,CA/CeC,EAAA,CADVN,EAAS,GARD,OASE,uBA+BJM,EAAA,CADNN,EAAS,CAAE,QAAS,EAAK,CAAC,GAvClB,OAwCF,yBAMIM,EAAA,CADVN,EAAS,CAAE,KAAM,OAAQ,CAAC,GA7ClB,OA8CE",
|
|
6
|
+
"names": ["SizedMixin", "property", "StyledButton", "buttonStyles", "variant", "quiet", "changes", "__decorateClass"]
|
|
7
7
|
}
|
package/src/ButtonBase.dev.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -22,7 +23,9 @@ import {
|
|
|
22
23
|
ObserveSlotPresence,
|
|
23
24
|
ObserveSlotText
|
|
24
25
|
} from "@spectrum-web-components/shared";
|
|
25
|
-
export class ButtonBase extends LikeAnchor(
|
|
26
|
+
export class ButtonBase extends LikeAnchor(
|
|
27
|
+
ObserveSlotText(ObserveSlotPresence(Focusable, '[slot="icon"]'))
|
|
28
|
+
) {
|
|
26
29
|
constructor() {
|
|
27
30
|
super();
|
|
28
31
|
this.active = false;
|
|
@@ -194,7 +197,10 @@ export class ButtonBase extends LikeAnchor(ObserveSlotText(ObserveSlotPresence(F
|
|
|
194
197
|
} else {
|
|
195
198
|
this.removeEventListener("focusout", this.handleRemoveActive);
|
|
196
199
|
this.removeEventListener("pointerup", this.handleRemoveActive);
|
|
197
|
-
this.removeEventListener(
|
|
200
|
+
this.removeEventListener(
|
|
201
|
+
"pointerleave",
|
|
202
|
+
this.handleRemoveActive
|
|
203
|
+
);
|
|
198
204
|
}
|
|
199
205
|
}
|
|
200
206
|
if (this.anchorElement) {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ButtonBase.ts"],
|
|
4
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 html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport {\n ObserveSlotPresence,\n ObserveSlotText,\n} from '@spectrum-web-components/shared';\n\n/**\n * @slot - text content to be displayed in the Button element\n * @slot icon - icon element(s) to display at the start of the button\n */\nexport class ButtonBase extends LikeAnchor(\n ObserveSlotText(ObserveSlotPresence(Focusable, '[slot=\"icon\"]'))\n) {\n protected get hasIcon(): boolean {\n return this.slotContentIsPresent;\n }\n\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n @property({ type: String })\n public type: 'button' | 'submit' | 'reset' = 'button';\n\n protected get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n @query('.anchor')\n private anchorElement!: HTMLButtonElement;\n\n public override get focusElement(): HTMLElement {\n return this;\n }\n\n protected get buttonContent(): TemplateResult[] {\n const content = [\n html`\n <div id=\"label\" ?hidden=${!this.hasLabel}>\n <slot\n id=\"slot\"\n @slotchange=${this.manageTextObservedSlot}\n ></slot>\n </div>\n `,\n ];\n if (this.hasIcon) {\n content.unshift(html`\n <slot name=\"icon\" ?icon-only=${!this.hasLabel}></slot>\n `);\n }\n return content;\n }\n\n constructor() {\n super();\n this.proxyFocus = this.proxyFocus.bind(this);\n\n this.addEventListener('click', this.handleClickCapture, {\n capture: true,\n });\n }\n\n public override click(): void {\n if (this.disabled) {\n return;\n }\n\n if (this.shouldProxyClick()) {\n return;\n }\n\n super.click();\n }\n\n private handleClickCapture(event: Event): void | boolean {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n return false;\n }\n }\n\n private proxyFocus(): void {\n this.focus();\n }\n\n private shouldProxyClick(): boolean {\n let handled = false;\n if (this.anchorElement) {\n this.anchorElement.click();\n handled = true;\n } else if (this.type !== 'button') {\n const proxy = document.createElement('button');\n proxy.type = this.type;\n this.insertAdjacentElement('afterend', proxy);\n proxy.click();\n proxy.remove();\n handled = true;\n }\n return handled;\n }\n\n public override renderAnchor(): TemplateResult {\n return html`\n ${this.buttonContent}\n ${super.renderAnchor({\n id: 'button',\n ariaHidden: true,\n className: 'button anchor hidden',\n })}\n `;\n }\n\n protected renderButton(): TemplateResult {\n return html`\n ${this.buttonContent}\n `;\n }\n\n protected override render(): TemplateResult {\n return this.href && this.href.length > 0\n ? this.renderAnchor()\n : this.renderButton();\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n switch (code) {\n case 'Space':\n event.preventDefault();\n if (typeof this.href === 'undefined') {\n this.addEventListener('keyup', this.handleKeyup);\n this.active = true;\n }\n break;\n default:\n break;\n }\n }\n\n private handleKeypress(event: KeyboardEvent): void {\n const { code } = event;\n switch (code) {\n case 'Enter':\n case 'NumpadEnter':\n this.click();\n break;\n default:\n break;\n }\n }\n\n protected handleKeyup(event: KeyboardEvent): void {\n const { code } = event;\n switch (code) {\n case 'Space':\n this.removeEventListener('keyup', this.handleKeyup);\n this.active = false;\n this.click();\n break;\n default:\n break;\n }\n }\n\n private handleRemoveActive(): void {\n this.active = false;\n }\n\n private handlePointerdown(): void {\n this.active = true;\n }\n\n private manageAnchor(): void {\n if (this.href && this.href.length > 0) {\n if (this.getAttribute('role') === 'button') {\n this.setAttribute('role', 'link');\n }\n this.removeEventListener('click', this.shouldProxyClick);\n } else {\n if (\n !this.hasAttribute('role') ||\n this.getAttribute('role') === 'link'\n ) {\n this.setAttribute('role', 'button');\n }\n this.addEventListener('click', this.shouldProxyClick);\n }\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n this.manageAnchor();\n this.addEventListener('keydown', this.handleKeydown);\n this.addEventListener('keypress', this.handleKeypress);\n this.addEventListener('pointerdown', this.handlePointerdown);\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n if (changed.has('href')) {\n this.manageAnchor();\n }\n if (changed.has('label')) {\n this.setAttribute('aria-label', this.label || '');\n }\n if (changed.has('active')) {\n if (this.active) {\n this.addEventListener('focusout', this.handleRemoveActive);\n this.addEventListener('pointerup', this.handleRemoveActive);\n this.addEventListener('pointerleave', this.handleRemoveActive);\n } else {\n this.removeEventListener('focusout', this.handleRemoveActive);\n this.removeEventListener('pointerup', this.handleRemoveActive);\n this.removeEventListener(\n 'pointerleave',\n this.handleRemoveActive\n );\n }\n }\n if (this.anchorElement) {\n this.anchorElement.addEventListener('focus', this.proxyFocus);\n this.anchorElement.tabIndex = -1;\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAYA;AAAA,EACI;AAAA,OAGG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AACP,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAMA,aAAM,mBAAmB;AAAA,EAC5B,gBAAgB,oBAAoB,WAAW,eAAe,CAAC;AACnE,EAAE;AAAA,EAyCE,cAAc;AACV,UAAM;AApCV,SAAO,SAAS;AAGhB,SAAO,OAAsC;AAkCzC,SAAK,aAAa,KAAK,WAAW,KAAK,IAAI;AAE3C,SAAK,iBAAiB,SAAS,KAAK,oBAAoB;AAAA,MACpD,SAAS;AAAA,IACb,CAAC;AAAA,EACL;AAAA,EA/CA,IAAc,UAAmB;AAC7B,WAAO,KAAK;AAAA,EAChB;AAAA,EAQA,IAAc,WAAoB;AAC9B,WAAO,KAAK;AAAA,EAChB;AAAA,EAKA,IAAoB,eAA4B;AAC5C,WAAO;AAAA,EACX;AAAA,EAEA,IAAc,gBAAkC;AAC5C,UAAM,UAAU;AAAA,MACZ;AAAA,0CAC8B,CAAC,KAAK;AAAA;AAAA;AAAA,sCAGV,KAAK;AAAA;AAAA;AAAA;AAAA,IAInC;AACA,QAAI,KAAK,SAAS;AACd,cAAQ,QAAQ;AAAA,+CACmB,CAAC,KAAK;AAAA,aACxC;AAAA,IACL;AACA,WAAO;AAAA,EACX;AAAA,EAWgB,QAAc;AAC1B,QAAI,KAAK,UAAU;AACf;AAAA,IACJ;AAEA,QAAI,KAAK,iBAAiB,GAAG;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AAQ,IAAI,QAAQ,GAAG;AACvB,UAAI,KAAK,QAAQ;AACb,aAAK,iBAAiB,YAAY,KAAK,kBAAkB;AACzD,aAAK,iBAAiB,aAAa,KAAK,kBAAkB;AAC1D,aAAK,iBAAiB,gBAAgB,KAAK,kBAAkB;AAAA,MACjE,OAAO;AACH,aAAK,oBAAoB,YAAY,KAAK,kBAAkB;AAC5D,aAAK,oBAAoB,aAAa,KAAK,kBAAkB;AAC7D,aAAK;AAAA,UACD;AAAA,UACA,KAAK;AAAA,QACT;AAAA,MACJ;AAAA,IACJ;AACA,QAAI,KAAK,eAAe;AACpB,WAAK,cAAc,iBAAiB,SAAS,KAAK,UAAU;AAC5D,WAAK,cAAc,WAAW;AAAA,IAClC;AAAA,EACJ;AACJ;AAnNW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAPjC,WAQF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAVjB,WAWF;AAOC;AAAA,EADP,MAAM,SAAS;AAAA,GAjBP,WAkBD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/ButtonBase.js
CHANGED
|
@@ -1,215 +1,16 @@
|
|
|
1
|
-
var
|
|
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
|
-
} from "@spectrum-web-components/base";
|
|
15
|
-
import {
|
|
16
|
-
property,
|
|
17
|
-
query
|
|
18
|
-
} from "@spectrum-web-components/base/src/decorators.js";
|
|
19
|
-
import { LikeAnchor } from "@spectrum-web-components/shared/src/like-anchor.js";
|
|
20
|
-
import { Focusable } from "@spectrum-web-components/shared/src/focusable.js";
|
|
21
|
-
import {
|
|
22
|
-
ObserveSlotPresence,
|
|
23
|
-
ObserveSlotText
|
|
24
|
-
} from "@spectrum-web-components/shared";
|
|
25
|
-
export class ButtonBase extends LikeAnchor(ObserveSlotText(ObserveSlotPresence(Focusable, '[slot="icon"]'))) {
|
|
26
|
-
constructor() {
|
|
27
|
-
super();
|
|
28
|
-
this.active = false;
|
|
29
|
-
this.type = "button";
|
|
30
|
-
this.proxyFocus = this.proxyFocus.bind(this);
|
|
31
|
-
this.addEventListener("click", this.handleClickCapture, {
|
|
32
|
-
capture: true
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
get hasIcon() {
|
|
36
|
-
return this.slotContentIsPresent;
|
|
37
|
-
}
|
|
38
|
-
get hasLabel() {
|
|
39
|
-
return this.slotHasContent;
|
|
40
|
-
}
|
|
41
|
-
get focusElement() {
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
get buttonContent() {
|
|
45
|
-
const content = [
|
|
46
|
-
html`
|
|
1
|
+
"use strict";var d=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var s=(n,r,e,t)=>{for(var i=t>1?void 0:t?c(r,e):r,a=n.length-1,h;a>=0;a--)(h=n[a])&&(i=(t?h(r,e,i):h(i))||i);return t&&i&&d(r,e,i),i};import{html as o}from"@spectrum-web-components/base";import{property as l,query as u}from"@spectrum-web-components/base/src/decorators.js";import{LikeAnchor as p}from"@spectrum-web-components/shared/src/like-anchor.js";import{Focusable as v}from"@spectrum-web-components/shared/src/focusable.js";import{ObserveSlotPresence as b,ObserveSlotText as m}from"@spectrum-web-components/shared";export class ButtonBase extends p(m(b(v,'[slot="icon"]'))){constructor(){super();this.active=!1;this.type="button";this.proxyFocus=this.proxyFocus.bind(this),this.addEventListener("click",this.handleClickCapture,{capture:!0})}get hasIcon(){return this.slotContentIsPresent}get hasLabel(){return this.slotHasContent}get focusElement(){return this}get buttonContent(){const e=[o`
|
|
47
2
|
<div id="label" ?hidden=${!this.hasLabel}>
|
|
48
3
|
<slot
|
|
49
4
|
id="slot"
|
|
50
5
|
@slotchange=${this.manageTextObservedSlot}
|
|
51
6
|
></slot>
|
|
52
7
|
</div>
|
|
53
|
-
`
|
|
54
|
-
];
|
|
55
|
-
if (this.hasIcon) {
|
|
56
|
-
content.unshift(html`
|
|
8
|
+
`];return this.hasIcon&&e.unshift(o`
|
|
57
9
|
<slot name="icon" ?icon-only=${!this.hasLabel}></slot>
|
|
58
|
-
`);
|
|
59
|
-
}
|
|
60
|
-
return content;
|
|
61
|
-
}
|
|
62
|
-
click() {
|
|
63
|
-
if (this.disabled) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (this.shouldProxyClick()) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
super.click();
|
|
70
|
-
}
|
|
71
|
-
handleClickCapture(event) {
|
|
72
|
-
if (this.disabled) {
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
event.stopImmediatePropagation();
|
|
75
|
-
event.stopPropagation();
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
proxyFocus() {
|
|
80
|
-
this.focus();
|
|
81
|
-
}
|
|
82
|
-
shouldProxyClick() {
|
|
83
|
-
let handled = false;
|
|
84
|
-
if (this.anchorElement) {
|
|
85
|
-
this.anchorElement.click();
|
|
86
|
-
handled = true;
|
|
87
|
-
} else if (this.type !== "button") {
|
|
88
|
-
const proxy = document.createElement("button");
|
|
89
|
-
proxy.type = this.type;
|
|
90
|
-
this.insertAdjacentElement("afterend", proxy);
|
|
91
|
-
proxy.click();
|
|
92
|
-
proxy.remove();
|
|
93
|
-
handled = true;
|
|
94
|
-
}
|
|
95
|
-
return handled;
|
|
96
|
-
}
|
|
97
|
-
renderAnchor() {
|
|
98
|
-
return html`
|
|
10
|
+
`),e}click(){this.disabled||this.shouldProxyClick()||super.click()}handleClickCapture(e){if(this.disabled)return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),!1}proxyFocus(){this.focus()}shouldProxyClick(){let e=!1;if(this.anchorElement)this.anchorElement.click(),e=!0;else if(this.type!=="button"){const t=document.createElement("button");t.type=this.type,this.insertAdjacentElement("afterend",t),t.click(),t.remove(),e=!0}return e}renderAnchor(){return o`
|
|
99
11
|
${this.buttonContent}
|
|
100
|
-
${super.renderAnchor({
|
|
101
|
-
|
|
102
|
-
ariaHidden: true,
|
|
103
|
-
className: "button anchor hidden"
|
|
104
|
-
})}
|
|
105
|
-
`;
|
|
106
|
-
}
|
|
107
|
-
renderButton() {
|
|
108
|
-
return html`
|
|
12
|
+
${super.renderAnchor({id:"button",ariaHidden:!0,className:"button anchor hidden"})}
|
|
13
|
+
`}renderButton(){return o`
|
|
109
14
|
${this.buttonContent}
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
render() {
|
|
113
|
-
return this.href && this.href.length > 0 ? this.renderAnchor() : this.renderButton();
|
|
114
|
-
}
|
|
115
|
-
handleKeydown(event) {
|
|
116
|
-
const { code } = event;
|
|
117
|
-
switch (code) {
|
|
118
|
-
case "Space":
|
|
119
|
-
event.preventDefault();
|
|
120
|
-
if (typeof this.href === "undefined") {
|
|
121
|
-
this.addEventListener("keyup", this.handleKeyup);
|
|
122
|
-
this.active = true;
|
|
123
|
-
}
|
|
124
|
-
break;
|
|
125
|
-
default:
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
handleKeypress(event) {
|
|
130
|
-
const { code } = event;
|
|
131
|
-
switch (code) {
|
|
132
|
-
case "Enter":
|
|
133
|
-
case "NumpadEnter":
|
|
134
|
-
this.click();
|
|
135
|
-
break;
|
|
136
|
-
default:
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
handleKeyup(event) {
|
|
141
|
-
const { code } = event;
|
|
142
|
-
switch (code) {
|
|
143
|
-
case "Space":
|
|
144
|
-
this.removeEventListener("keyup", this.handleKeyup);
|
|
145
|
-
this.active = false;
|
|
146
|
-
this.click();
|
|
147
|
-
break;
|
|
148
|
-
default:
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
handleRemoveActive() {
|
|
153
|
-
this.active = false;
|
|
154
|
-
}
|
|
155
|
-
handlePointerdown() {
|
|
156
|
-
this.active = true;
|
|
157
|
-
}
|
|
158
|
-
manageAnchor() {
|
|
159
|
-
if (this.href && this.href.length > 0) {
|
|
160
|
-
if (this.getAttribute("role") === "button") {
|
|
161
|
-
this.setAttribute("role", "link");
|
|
162
|
-
}
|
|
163
|
-
this.removeEventListener("click", this.shouldProxyClick);
|
|
164
|
-
} else {
|
|
165
|
-
if (!this.hasAttribute("role") || this.getAttribute("role") === "link") {
|
|
166
|
-
this.setAttribute("role", "button");
|
|
167
|
-
}
|
|
168
|
-
this.addEventListener("click", this.shouldProxyClick);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
firstUpdated(changed) {
|
|
172
|
-
super.firstUpdated(changed);
|
|
173
|
-
if (!this.hasAttribute("tabindex")) {
|
|
174
|
-
this.tabIndex = 0;
|
|
175
|
-
}
|
|
176
|
-
this.manageAnchor();
|
|
177
|
-
this.addEventListener("keydown", this.handleKeydown);
|
|
178
|
-
this.addEventListener("keypress", this.handleKeypress);
|
|
179
|
-
this.addEventListener("pointerdown", this.handlePointerdown);
|
|
180
|
-
}
|
|
181
|
-
updated(changed) {
|
|
182
|
-
super.updated(changed);
|
|
183
|
-
if (changed.has("href")) {
|
|
184
|
-
this.manageAnchor();
|
|
185
|
-
}
|
|
186
|
-
if (changed.has("label")) {
|
|
187
|
-
this.setAttribute("aria-label", this.label || "");
|
|
188
|
-
}
|
|
189
|
-
if (changed.has("active")) {
|
|
190
|
-
if (this.active) {
|
|
191
|
-
this.addEventListener("focusout", this.handleRemoveActive);
|
|
192
|
-
this.addEventListener("pointerup", this.handleRemoveActive);
|
|
193
|
-
this.addEventListener("pointerleave", this.handleRemoveActive);
|
|
194
|
-
} else {
|
|
195
|
-
this.removeEventListener("focusout", this.handleRemoveActive);
|
|
196
|
-
this.removeEventListener("pointerup", this.handleRemoveActive);
|
|
197
|
-
this.removeEventListener("pointerleave", this.handleRemoveActive);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
if (this.anchorElement) {
|
|
201
|
-
this.anchorElement.addEventListener("focus", this.proxyFocus);
|
|
202
|
-
this.anchorElement.tabIndex = -1;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
__decorateClass([
|
|
207
|
-
property({ type: Boolean, reflect: true })
|
|
208
|
-
], ButtonBase.prototype, "active", 2);
|
|
209
|
-
__decorateClass([
|
|
210
|
-
property({ type: String })
|
|
211
|
-
], ButtonBase.prototype, "type", 2);
|
|
212
|
-
__decorateClass([
|
|
213
|
-
query(".anchor")
|
|
214
|
-
], ButtonBase.prototype, "anchorElement", 2);
|
|
15
|
+
`}render(){return this.href&&this.href.length>0?this.renderAnchor():this.renderButton()}handleKeydown(e){const{code:t}=e;switch(t){case"Space":e.preventDefault(),typeof this.href=="undefined"&&(this.addEventListener("keyup",this.handleKeyup),this.active=!0);break;default:break}}handleKeypress(e){const{code:t}=e;switch(t){case"Enter":case"NumpadEnter":this.click();break;default:break}}handleKeyup(e){const{code:t}=e;switch(t){case"Space":this.removeEventListener("keyup",this.handleKeyup),this.active=!1,this.click();break;default:break}}handleRemoveActive(){this.active=!1}handlePointerdown(){this.active=!0}manageAnchor(){this.href&&this.href.length>0?(this.getAttribute("role")==="button"&&this.setAttribute("role","link"),this.removeEventListener("click",this.shouldProxyClick)):((!this.hasAttribute("role")||this.getAttribute("role")==="link")&&this.setAttribute("role","button"),this.addEventListener("click",this.shouldProxyClick))}firstUpdated(e){super.firstUpdated(e),this.hasAttribute("tabindex")||(this.tabIndex=0),this.manageAnchor(),this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keypress",this.handleKeypress),this.addEventListener("pointerdown",this.handlePointerdown)}updated(e){super.updated(e),e.has("href")&&this.manageAnchor(),e.has("label")&&this.setAttribute("aria-label",this.label||""),e.has("active")&&(this.active?(this.addEventListener("focusout",this.handleRemoveActive),this.addEventListener("pointerup",this.handleRemoveActive),this.addEventListener("pointerleave",this.handleRemoveActive)):(this.removeEventListener("focusout",this.handleRemoveActive),this.removeEventListener("pointerup",this.handleRemoveActive),this.removeEventListener("pointerleave",this.handleRemoveActive))),this.anchorElement&&(this.anchorElement.addEventListener("focus",this.proxyFocus),this.anchorElement.tabIndex=-1)}}s([l({type:Boolean,reflect:!0})],ButtonBase.prototype,"active",2),s([l({type:String})],ButtonBase.prototype,"type",2),s([u(".anchor")],ButtonBase.prototype,"anchorElement",2);
|
|
215
16
|
//# sourceMappingURL=ButtonBase.js.map
|
package/src/ButtonBase.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["ButtonBase.ts"],
|
|
4
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 html,\n PropertyValues,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport { Focusable } from '@spectrum-web-components/shared/src/focusable.js';\nimport {\n ObserveSlotPresence,\n ObserveSlotText,\n} from '@spectrum-web-components/shared';\n\n/**\n * @slot - text content to be displayed in the Button element\n * @slot icon - icon element(s) to display at the start of the button\n */\nexport class ButtonBase extends LikeAnchor(\n ObserveSlotText(ObserveSlotPresence(Focusable, '[slot=\"icon\"]'))\n) {\n protected get hasIcon(): boolean {\n return this.slotContentIsPresent;\n }\n\n @property({ type: Boolean, reflect: true })\n public active = false;\n\n @property({ type: String })\n public type: 'button' | 'submit' | 'reset' = 'button';\n\n protected get hasLabel(): boolean {\n return this.slotHasContent;\n }\n\n @query('.anchor')\n private anchorElement!: HTMLButtonElement;\n\n public override get focusElement(): HTMLElement {\n return this;\n }\n\n protected get buttonContent(): TemplateResult[] {\n const content = [\n html`\n <div id=\"label\" ?hidden=${!this.hasLabel}>\n <slot\n id=\"slot\"\n @slotchange=${this.manageTextObservedSlot}\n ></slot>\n </div>\n `,\n ];\n if (this.hasIcon) {\n content.unshift(html`\n <slot name=\"icon\" ?icon-only=${!this.hasLabel}></slot>\n `);\n }\n return content;\n }\n\n constructor() {\n super();\n this.proxyFocus = this.proxyFocus.bind(this);\n\n this.addEventListener('click', this.handleClickCapture, {\n capture: true,\n });\n }\n\n public override click(): void {\n if (this.disabled) {\n return;\n }\n\n if (this.shouldProxyClick()) {\n return;\n }\n\n super.click();\n }\n\n private handleClickCapture(event: Event): void | boolean {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n return false;\n }\n }\n\n private proxyFocus(): void {\n this.focus();\n }\n\n private shouldProxyClick(): boolean {\n let handled = false;\n if (this.anchorElement) {\n this.anchorElement.click();\n handled = true;\n } else if (this.type !== 'button') {\n const proxy = document.createElement('button');\n proxy.type = this.type;\n this.insertAdjacentElement('afterend', proxy);\n proxy.click();\n proxy.remove();\n handled = true;\n }\n return handled;\n }\n\n public override renderAnchor(): TemplateResult {\n return html`\n ${this.buttonContent}\n ${super.renderAnchor({\n id: 'button',\n ariaHidden: true,\n className: 'button anchor hidden',\n })}\n `;\n }\n\n protected renderButton(): TemplateResult {\n return html`\n ${this.buttonContent}\n `;\n }\n\n protected override render(): TemplateResult {\n return this.href && this.href.length > 0\n ? this.renderAnchor()\n : this.renderButton();\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n const { code } = event;\n switch (code) {\n case 'Space':\n event.preventDefault();\n if (typeof this.href === 'undefined') {\n this.addEventListener('keyup', this.handleKeyup);\n this.active = true;\n }\n break;\n default:\n break;\n }\n }\n\n private handleKeypress(event: KeyboardEvent): void {\n const { code } = event;\n switch (code) {\n case 'Enter':\n case 'NumpadEnter':\n this.click();\n break;\n default:\n break;\n }\n }\n\n protected handleKeyup(event: KeyboardEvent): void {\n const { code } = event;\n switch (code) {\n case 'Space':\n this.removeEventListener('keyup', this.handleKeyup);\n this.active = false;\n this.click();\n break;\n default:\n break;\n }\n }\n\n private handleRemoveActive(): void {\n this.active = false;\n }\n\n private handlePointerdown(): void {\n this.active = true;\n }\n\n private manageAnchor(): void {\n if (this.href && this.href.length > 0) {\n if (this.getAttribute('role') === 'button') {\n this.setAttribute('role', 'link');\n }\n this.removeEventListener('click', this.shouldProxyClick);\n } else {\n if (\n !this.hasAttribute('role') ||\n this.getAttribute('role') === 'link'\n ) {\n this.setAttribute('role', 'button');\n }\n this.addEventListener('click', this.shouldProxyClick);\n }\n }\n\n protected override firstUpdated(changed: PropertyValues): void {\n super.firstUpdated(changed);\n if (!this.hasAttribute('tabindex')) {\n this.tabIndex = 0;\n }\n this.manageAnchor();\n this.addEventListener('keydown', this.handleKeydown);\n this.addEventListener('keypress', this.handleKeypress);\n this.addEventListener('pointerdown', this.handlePointerdown);\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n if (changed.has('href')) {\n this.manageAnchor();\n }\n if (changed.has('label')) {\n this.setAttribute('aria-label', this.label || '');\n }\n if (changed.has('active')) {\n if (this.active) {\n this.addEventListener('focusout', this.handleRemoveActive);\n this.addEventListener('pointerup', this.handleRemoveActive);\n this.addEventListener('pointerleave', this.handleRemoveActive);\n } else {\n this.removeEventListener('focusout', this.handleRemoveActive);\n this.removeEventListener('pointerup', this.handleRemoveActive);\n this.removeEventListener(\n 'pointerleave',\n this.handleRemoveActive\n );\n }\n }\n if (this.anchorElement) {\n this.anchorElement.addEventListener('focus', this.proxyFocus);\n this.anchorElement.tabIndex = -1;\n }\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "qNAYA,OACI,QAAAA,MAGG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDACP,OAAS,cAAAC,MAAkB,qDAC3B,OAAS,aAAAC,MAAiB,mDAC1B,OACI,uBAAAC,EACA,mBAAAC,MACG,kCAMA,aAAM,mBAAmBH,EAC5BG,EAAgBD,EAAoBD,EAAW,eAAe,CAAC,CACnE,CAAE,CAyCE,aAAc,CACV,MAAM,EApCV,KAAO,OAAS,GAGhB,KAAO,KAAsC,SAkCzC,KAAK,WAAa,KAAK,WAAW,KAAK,IAAI,EAE3C,KAAK,iBAAiB,QAAS,KAAK,mBAAoB,CACpD,QAAS,EACb,CAAC,CACL,CA/CA,IAAc,SAAmB,CAC7B,OAAO,KAAK,oBAChB,CAQA,IAAc,UAAoB,CAC9B,OAAO,KAAK,cAChB,CAKA,IAAoB,cAA4B,CAC5C,OAAO,IACX,CAEA,IAAc,eAAkC,CAC5C,MAAMG,EAAU,CACZP;AAAA,0CAC8B,CAAC,KAAK;AAAA;AAAA;AAAA,sCAGV,KAAK;AAAA;AAAA;AAAA,aAInC,EACA,OAAI,KAAK,SACLO,EAAQ,QAAQP;AAAA,+CACmB,CAAC,KAAK;AAAA,aACxC,EAEEO,CACX,CAWgB,OAAc,CACtB,KAAK,UAIL,KAAK,iBAAiB,GAI1B,MAAM,MAAM,CAChB,CAEQ,mBAAmBC,EAA8B,CACrD,GAAI,KAAK,SACL,OAAAA,EAAM,eAAe,EACrBA,EAAM,yBAAyB,EAC/BA,EAAM,gBAAgB,EACf,EAEf,CAEQ,YAAmB,CACvB,KAAK,MAAM,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Presence", "ObserveSlotText", "content", "event", "handled", "proxy", "code", "changed", "__decorateClass"]
|
|
7
7
|
}
|