diff --git a/custom-elements-manifest.js b/custom-elements-manifest.js index 7162d8f5c..e68c8e791 100644 --- a/custom-elements-manifest.js +++ b/custom-elements-manifest.js @@ -28,7 +28,7 @@ export default { name: 'wa-package-data', packageLinkPhase({ customElementsManifest }) { customElementsManifest.package = { name, description, version, author, homepage, license }; - } + }, }, // Parse custom jsDoc tags @@ -83,13 +83,13 @@ export default { classDoc[t.tag].push({ name: t.name, description: t.description, - type: t.type || undefined + type: t.type || undefined, }); } }); } } - } + }, }, { @@ -109,7 +109,7 @@ export default { } } } - } + }, }, { @@ -127,7 +127,7 @@ export default { // const terms = [ { from: /^src\//, to: '' }, // Strip the src/ prefix - { from: /\.(t|j)sx?$/, to: '.js' } // Convert .ts to .js + { from: /\.(t|j)sx?$/, to: '.js' }, // Convert .ts to .js ]; mod.path = replace(mod.path, terms); @@ -146,7 +146,7 @@ export default { } } }); - } + }, }, // Generate custom VS Code data @@ -156,9 +156,9 @@ export default { referencesTemplate: (_, tag) => [ { name: 'Documentation', - url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}` - } - ] + url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}`, + }, + ], }), customElementJetBrainsPlugin({ @@ -168,10 +168,10 @@ export default { referencesTemplate: (_, tag) => { return { name: 'Documentation', - url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}` + url: `https://webawesome.com/docs/components/${tag.replace('wa-', '')}`, }; - } - }) + }, + }), // // TODO - figure out why this broke when events were updated @@ -181,5 +181,5 @@ export default { // fileName: 'index.d.ts', // componentTypePath: (_, tag) => `../../components/${tag.replace('wa-', '')}/${tag.replace('wa-', '')}.js` // }) - ] + ], }; diff --git a/docs/.eleventy.js b/docs/.eleventy.js index 11c6880fa..f4ac8e42b 100644 --- a/docs/.eleventy.js +++ b/docs/.eleventy.js @@ -71,8 +71,8 @@ export default function (eleventyConfig) { selector: 'h2, h3', ifEmpty: doc => { doc.querySelector('#outline')?.remove(); - } - }) + }, + }), ); // Add current link classes @@ -93,19 +93,19 @@ export default function (eleventyConfig) { // Replace [issue:1234] with a link to the issue on GitHub { replace: /\[pr:([0-9]+)\]/gs, - replaceWith: '#$1' + replaceWith: '#$1', }, // Replace [pr:1234] with a link to the pull request on GitHub { replace: /\[issue:([0-9]+)\]/gs, - replaceWith: '#$1' + replaceWith: '#$1', }, // Replace [discuss:1234] with a link to the discussion on GitHub { replace: /\[discuss:([0-9]+)\]/gs, - replaceWith: '#$1' - } - ]) + replaceWith: '#$1', + }, + ]), ); const omittedModules = []; @@ -124,7 +124,7 @@ export default function (eleventyConfig) { eleventyConfig.addPlugin(litPlugin, { mode: 'worker', - componentModules + componentModules, }); // Build the search index @@ -132,8 +132,8 @@ export default function (eleventyConfig) { searchPlugin({ filename: '', selectorsToIgnore: ['code.example'], - getContent: doc => doc.querySelector('#content')?.textContent ?? '' - }) + getContent: doc => doc.querySelector('#content')?.textContent ?? '', + }), ); // Production-only plugins @@ -149,8 +149,8 @@ export default function (eleventyConfig) { markdownTemplateEngine: 'njk', dir: { includes: '_includes', - layouts: '_layouts' + layouts: '_layouts', }, - templateFormats: ['njk', 'md'] + templateFormats: ['njk', 'md'], }; } diff --git a/docs/_data/componentList.js b/docs/_data/componentList.js index c0c981399..9148af311 100644 --- a/docs/_data/componentList.js +++ b/docs/_data/componentList.js @@ -36,7 +36,7 @@ const components = manifest.modules.flatMap(module => { slug: declaration.tagName.replace(/^wa-/, ''), methods, attributes, - properties + properties, }; }); }); diff --git a/docs/_data/componentsBy.js b/docs/_data/componentsBy.js index b116c0e88..a40340286 100644 --- a/docs/_data/componentsBy.js +++ b/docs/_data/componentsBy.js @@ -6,7 +6,7 @@ const by = { event: {}, method: {}, cssPart: {}, - cssProperty: {} + cssProperty: {}, }; function getAll(component, type) { diff --git a/docs/_utils/anchor-headings.js b/docs/_utils/anchor-headings.js index ec5bac928..88f861194 100644 --- a/docs/_utils/anchor-headings.js +++ b/docs/_utils/anchor-headings.js @@ -5,7 +5,7 @@ import { v4 as uuid } from 'uuid'; function createId(text) { let slug = slugify(String(text), { remove: /[^\w|\s]/g, - lower: true + lower: true, }); // ids must start with a letter @@ -24,7 +24,7 @@ export function anchorHeadingsPlugin(options = {}) { container: 'body', headingSelector: 'h2, h3, h4, h5, h6', anchorLabel: 'Jump to heading', - ...options + ...options, }; return function (eleventyConfig) { diff --git a/docs/_utils/code-examples.js b/docs/_utils/code-examples.js index 1aa336295..3b1750197 100644 --- a/docs/_utils/code-examples.js +++ b/docs/_utils/code-examples.js @@ -53,7 +53,7 @@ const templates = { attributes = { open, include: `link[rel=stylesheet][href^='/dist/']`, - ...attributes + ...attributes, }; const attributesString = Object.entries(attributes) @@ -93,7 +93,7 @@ const templates = { ${pre.outerHTML} `; - } + }, }; /** @@ -107,13 +107,13 @@ export function codeExamplesPlugin(eleventyConfig, options = {}) { outputPathIndex === 1 && // is first code.textContent.length < 500 ); // is short - } + }, }; options = { ...defaultOptions, ...options }; const stats = { inputPaths: {}, - outputPaths: {} + outputPaths: {}, }; eleventyConfig.addTransform('code-examples', function (content) { @@ -144,7 +144,7 @@ export function codeExamplesPlugin(eleventyConfig, options = {}) { edit: true, buttons: true, new: true, // comment this line to default back to the old demos - attributes: {} + attributes: {}, }; for (const prop of ['new', 'open', 'buttons', 'edit']) { @@ -174,7 +174,7 @@ export function codeExamplesPlugin(eleventyConfig, options = {}) { localOptions.open = localOptions.defaultOpen(code, { pre, inputPathIndex: stats.inputPaths[inputPath], - outputPathIndex: stats.outputPaths[outputPath] + outputPathIndex: stats.outputPaths[outputPath], }); } } diff --git a/docs/_utils/copy-code.js b/docs/_utils/copy-code.js index 0355f7370..19d04a958 100644 --- a/docs/_utils/copy-code.js +++ b/docs/_utils/copy-code.js @@ -6,7 +6,7 @@ import { parse } from 'node-html-parser'; export function copyCodePlugin(options = {}) { options = { container: 'body', - ...options + ...options, }; return function (eleventyConfig) { diff --git a/docs/_utils/current-link.js b/docs/_utils/current-link.js index 4568d58ac..d1de10324 100644 --- a/docs/_utils/current-link.js +++ b/docs/_utils/current-link.js @@ -28,7 +28,7 @@ export function currentLink(options = {}) { options = { container: 'body', className: 'current', - ...options + ...options, }; return function (eleventyConfig) { diff --git a/docs/_utils/format-code.js b/docs/_utils/format-code.js index ea047624e..e6775139b 100644 --- a/docs/_utils/format-code.js +++ b/docs/_utils/format-code.js @@ -11,7 +11,7 @@ import defaultOptions from '../../prettier.config.js'; export async function formatCode(string, options) { return await format(string, { ...defaultOptions, - ...options + ...options, }); } @@ -21,7 +21,7 @@ export async function formatCode(string, options) { export function formatCodePlugin(options = {}) { options = { parser: 'html', - ...options + ...options, }; return function (eleventyConfig) { diff --git a/docs/_utils/highlight-code.js b/docs/_utils/highlight-code.js index 8a48c0492..79def428a 100644 --- a/docs/_utils/highlight-code.js +++ b/docs/_utils/highlight-code.js @@ -40,7 +40,7 @@ export function highlightCode(code, language = 'plain') { export function highlightCodePlugin(options = {}) { options = { container: 'body', - ...options + ...options, }; return function (eleventyConfig) { diff --git a/docs/_utils/markdown.js b/docs/_utils/markdown.js index 4236d68fd..6f0fe1ab9 100644 --- a/docs/_utils/markdown.js +++ b/docs/_utils/markdown.js @@ -14,7 +14,7 @@ export const markdown = MarkdownIt({ breaks: false, langPrefix: 'language-', linkify: false, - typographer: false + typographer: false, }); markdown.use(markdownItIns); @@ -34,7 +34,7 @@ markdown.use(markdownItMark); `; } return '\n'; - } + }, }); }); @@ -44,7 +44,7 @@ markdown.use(markdownItContainer, 'aside', { return `\n'; - } + }, }); markdown.use(markdownItContainer, 'details', { @@ -55,9 +55,9 @@ markdown.use(markdownItContainer, 'details', { return `
\n${markdown.utils.escapeHtml(m[1])}\n`; } return '
\n'; - } + }, }); markdown.use(markdownItAttrs, { - allowedAttributes: [] + allowedAttributes: [], }); diff --git a/docs/_utils/outline.js b/docs/_utils/outline.js index 3b829f01d..0281ee66b 100644 --- a/docs/_utils/outline.js +++ b/docs/_utils/outline.js @@ -15,7 +15,7 @@ export function outlinePlugin(options = {}) { target: '.outline', selector: 'h2,h3', ifEmpty: () => null, - ...options + ...options, }; return function (eleventyConfig) { diff --git a/docs/_utils/remove-data-alpha-elements.js b/docs/_utils/remove-data-alpha-elements.js index 270235deb..b93f3d1f5 100644 --- a/docs/_utils/remove-data-alpha-elements.js +++ b/docs/_utils/remove-data-alpha-elements.js @@ -6,7 +6,7 @@ import { parse } from 'node-html-parser'; export function removeDataAlphaElements(options = {}) { options = { isAlpha: false, - ...options + ...options, }; return function (eleventyConfig) { diff --git a/docs/_utils/search.js b/docs/_utils/search.js index 5c583eb0c..1d5ac43a6 100644 --- a/docs/_utils/search.js +++ b/docs/_utils/search.js @@ -19,7 +19,7 @@ export function searchPlugin(options = {}) { getDescription: doc => doc.querySelector('meta[name="description"]')?.getAttribute('content') ?? '', getHeadings: doc => [...doc.querySelectorAll('h1, h2, h3, h4, h5, h6')].map(heading => heading.textContent ?? ''), getContent: doc => doc.querySelector('body')?.textContent ?? '', - ...options + ...options, }; return function (eleventyConfig) { @@ -32,8 +32,8 @@ export function searchPlugin(options = {}) { noscript: false, style: false, pre: false, - code: false - } + code: false, + }, }); // Remove content that shouldn't be searchable to reduce the index size @@ -46,7 +46,7 @@ export function searchPlugin(options = {}) { description: collapseWhitespace(options.getDescription(doc)), headings: options.getHeadings(doc).map(collapseWhitespace), content: collapseWhitespace(options.getContent(doc)), - url: this.page.url === '/' ? '/' : this.page.url.replace(/\/$/, '') + url: this.page.url === '/' ? '/' : this.page.url.replace(/\/$/, ''), }); return content; diff --git a/docs/assets/scripts/cheatsheet.js b/docs/assets/scripts/cheatsheet.js index 3a9cbc929..da8d71d25 100644 --- a/docs/assets/scripts/cheatsheet.js +++ b/docs/assets/scripts/cheatsheet.js @@ -13,7 +13,7 @@ const matchers = { regexp(textContent, query) { query.lastIndex = 0; return query.test(textContent); - } + }, }; matchers.iregexp = matchers.regexp; // i is baked into the query diff --git a/docs/assets/scripts/code-examples.js b/docs/assets/scripts/code-examples.js index 079893f49..e7c55fa16 100644 --- a/docs/assets/scripts/code-examples.js +++ b/docs/assets/scripts/code-examples.js @@ -43,7 +43,7 @@ document.addEventListener('click', event => { js_pre_processor: 'none', html, css, - js + js, }; const input = document.createElement('input'); diff --git a/docs/assets/scripts/hydration-errors.js b/docs/assets/scripts/hydration-errors.js index c6def88a8..67c6d0d1a 100644 --- a/docs/assets/scripts/hydration-errors.js +++ b/docs/assets/scripts/hydration-errors.js @@ -79,8 +79,8 @@ diffViewer.appendChild( createDiff({ serverHTML, - clientHTML - }) + clientHTML, + }), ); }); } @@ -88,7 +88,7 @@ function createDiff({ serverHTML, clientHTML }) { const diff = diffLines(serverHTML, clientHTML, { ignoreWhitespace: false, - newLineIsToken: true + newLineIsToken: true, }); const fragment = document.createDocumentFragment(); for (var i = 0; i < diff.length; i++) { diff --git a/docs/assets/scripts/preset-theme.js b/docs/assets/scripts/preset-theme.js index be36cce80..a1529eee5 100644 --- a/docs/assets/scripts/preset-theme.js +++ b/docs/assets/scripts/preset-theme.js @@ -11,7 +11,7 @@ const newStylesheet = Object.assign(document.createElement('link'), { href: `/dist/styles/themes/${presetTheme}.css`, rel: 'preload', - as: 'style' + as: 'style', }); newStylesheet.addEventListener( @@ -23,7 +23,7 @@ stylesheet.remove(); }); }, - { once: true } + { once: true }, ); document.head.append(newStylesheet); diff --git a/docs/assets/scripts/scroll.js b/docs/assets/scripts/scroll.js index 6591af482..e0c4c27e0 100644 --- a/docs/assets/scripts/scroll.js +++ b/docs/assets/scripts/scroll.js @@ -15,7 +15,7 @@ document.addEventListener('click', event => { event.preventDefault(); window.scroll({ top: target.offsetTop - headerHeight, - behavior: 'smooth' + behavior: 'smooth', }); history.pushState(undefined, undefined, `#${id}`); } diff --git a/docs/assets/scripts/search.js b/docs/assets/scripts/search.js index 8ffe500ae..82f99b465 100644 --- a/docs/assets/scripts/search.js +++ b/docs/assets/scripts/search.js @@ -9,7 +9,7 @@ const icons = { component: 'puzzle-piece', document: 'file', home: 'house', - theme: 'palette' + theme: 'palette', }; let searchTimeout; @@ -18,7 +18,7 @@ function getElements() { return { dialog: document.getElementById('site-search'), input: document.getElementById('site-search-input'), - results: document.getElementById('site-search-listbox') + results: document.getElementById('site-search-listbox'), }; } diff --git a/docs/assets/scripts/turbo.js b/docs/assets/scripts/turbo.js index ad76069be..fb1d0ea0f 100644 --- a/docs/assets/scripts/turbo.js +++ b/docs/assets/scripts/turbo.js @@ -9,7 +9,7 @@ function saveScrollPosition() { if (element.id) { positions[element.id] = { top: element.scrollTop, - left: element.scrollLeft + left: element.scrollLeft, }; } else { console.warn(`Can't save scroll position for elements without an id.`, el); diff --git a/lint-staged.config.js b/lint-staged.config.js index ffb71ffa6..a5042a645 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,5 +1,5 @@ export default { '*.{js,ts,json,html,xml,css,scss,sass,md}': 'cspell --no-must-find-files', 'src/**/*.{js,ts}': 'eslint --max-warnings 0 --fix', - '*': 'prettier --write --ignore-unknown' + '*': 'prettier --write --ignore-unknown', }; diff --git a/prettier.config.js b/prettier.config.js index 11a6f779a..b8b3d6270 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -13,10 +13,9 @@ const config = { semi: true, singleQuote: true, tabWidth: 2, - trailingComma: 'none', useTabs: false, organizeImportsSkipDestructiveCodeActions: true, - plugins: ['prettier-plugin-organize-imports'] + plugins: ['prettier-plugin-organize-imports'], }; export default config; diff --git a/scripts/build.js b/scripts/build.js index 914bed218..9968f4ea3 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -23,7 +23,7 @@ const packageData = JSON.parse(await readFile(join(rootDir, 'package.json'), 'ut const version = JSON.stringify(packageData.version.toString()); let buildContexts = { bundledContext: {}, - unbundledContext: {} + unbundledContext: {}, }; /** @@ -112,15 +112,15 @@ async function generateStyles() { 'themes/default.css', 'forms.css', 'utilities', - 'utilities.css' + 'utilities.css', ]; await Promise.all( alphaStyles.map(file => copy(join(rootDir, `src/styles/${file}`), join(cdnDir, `styles/${file}.css`), { - overwrite: true - }) - ) + overwrite: true, + }), + ), ); } else { await copy(join(rootDir, 'src/styles'), join(cdnDir, 'styles'), { overwrite: true }); @@ -172,20 +172,20 @@ async function generateBundle() { // Translations ...(await globby('./src/translations/**/*.ts')), // React wrappers - ...(await globby('./src/react/**/*.ts')) + ...(await globby('./src/react/**/*.ts')), ], outdir: cdnDir, chunkNames: 'chunks/[name].[hash]', define: { - 'process.env.NODE_ENV': '"production"' // required by Floating UI + 'process.env.NODE_ENV': '"production"', // required by Floating UI }, bundle: true, splitting: true, minify: false, plugins: [replace({ __WEBAWESOME_VERSION__: version }), litCssPlugin()], loader: { - '.css': 'text' - } + '.css': 'text', + }, }; const unbundledConfig = { @@ -194,7 +194,7 @@ async function generateBundle() { treeShaking: true, // Don't inline libraries like Lit etc. packages: 'external', - outdir: distDir + outdir: distDir, }; try { @@ -297,8 +297,8 @@ if (isDeveloping) { server: { baseDir: siteDir, routes: { - '/dist/': './dist-cdn/' - } + '/dist/': './dist-cdn/', + }, }, callbacks: { ready: (_err, instance) => { @@ -319,13 +319,13 @@ if (isDeveloping) { res.end(); }); - } - } + }, + }, }, () => { spinner.succeed(); console.log(`\nThe dev server is running at ${chalk.cyan(url)}\n`); - } + }, ); // Rebuild and reload when source files change diff --git a/scripts/docs.js b/scripts/docs.js index 11f20289a..f13187418 100644 --- a/scripts/docs.js +++ b/scripts/docs.js @@ -5,7 +5,7 @@ import { docsDir, siteDir } from './utils.js'; const elev = new Eleventy(docsDir, siteDir, { quietMode: true, - configPath: join(docsDir, '.eleventy.js') + configPath: join(docsDir, '.eleventy.js'), }); // Cleanup diff --git a/scripts/make-react.js b/scripts/make-react.js index 9d68b1f2e..54b90679a 100644 --- a/scripts/make-react.js +++ b/scripts/make-react.js @@ -65,8 +65,8 @@ for await (const component of components) { export default reactWrapper `, Object.assign(prettierConfig, { - parser: 'babel-ts' - }) + parser: 'babel-ts', + }), ); index.push(`export { default as ${component.name} } from './${tagWithoutPrefix}/index.js';`); diff --git a/scripts/plop/plopfile.js b/scripts/plop/plopfile.js index a71db26b2..48be12f1b 100644 --- a/scripts/plop/plopfile.js +++ b/scripts/plop/plopfile.js @@ -26,30 +26,30 @@ export default function (plop) { } return true; - } - } + }, + }, ], actions: [ { type: 'add', path: '../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.ts', - templateFile: 'templates/component/component.hbs' + templateFile: 'templates/component/component.hbs', }, { type: 'add', path: '../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.styles.ts', - templateFile: 'templates/component/styles.hbs' + templateFile: 'templates/component/styles.hbs', }, { type: 'add', path: '../../src/components/{{ tagWithoutPrefix tag }}/{{ tagWithoutPrefix tag }}.test.ts', - templateFile: 'templates/component/tests.hbs' + templateFile: 'templates/component/tests.hbs', }, { type: 'add', path: '../../docs/docs/components/{{ tagWithoutPrefix tag }}.md', - templateFile: 'templates/component/docs.hbs' - } - ] + templateFile: 'templates/component/docs.hbs', + }, + ], }); } diff --git a/src/components/animation/animation.test.ts b/src/components/animation/animation.test.ts index fbafdd4b6..6f825b2a9 100644 --- a/src/components/animation/animation.test.ts +++ b/src/components/animation/animation.test.ts @@ -14,7 +14,7 @@ describe('', () => { describe(`with "${fixture.type}" rendering`, () => { it('renders', async () => { const animationContainer = await fixture( - html`${unsafeHTML(boxToAnimate)}` + html`${unsafeHTML(boxToAnimate)}`, ); expect(animationContainer).to.exist; @@ -22,7 +22,7 @@ describe('', () => { it('is accessible', async () => { const animationContainer = await fixture( - html`${unsafeHTML(boxToAnimate)}` + html`${unsafeHTML(boxToAnimate)}`, ); await expect(animationContainer).to.be.accessible(); @@ -33,7 +33,7 @@ describe('', () => { const animationContainer = await fixture( html`${unsafeHTML(boxToAnimate)}` + >`, ); await aTimeout(0); @@ -44,7 +44,7 @@ describe('', () => { const animationContainer = await fixture( html`${unsafeHTML(boxToAnimate)}` + >`, ); const startPromise = oneEvent(animationContainer, 'wa-start'); @@ -56,7 +56,9 @@ describe('', () => { it('emits the correct event on animation end', async () => { const animationContainer = await fixture( - html`${unsafeHTML(boxToAnimate)}` + html`${unsafeHTML(boxToAnimate)}`, ); const endPromise = oneEvent(animationContainer, 'wa-finish'); @@ -69,7 +71,7 @@ describe('', () => { const animationContainer = await fixture( html`${unsafeHTML(boxToAnimate)}` + >`, ); const endPromise = oneEvent(animationContainer, 'wa-finish'); @@ -84,7 +86,9 @@ describe('', () => { it('can be cancelled', async () => { const animationContainer = await fixture( - html`${unsafeHTML(boxToAnimate)}` + html`${unsafeHTML(boxToAnimate)}`, ); let animationHasFinished = false; oneEvent(animationContainer, 'wa-finish').then(() => (animationHasFinished = true)); diff --git a/src/components/animation/animation.ts b/src/components/animation/animation.ts index f6acbd544..75c91f30f 100644 --- a/src/components/animation/animation.ts +++ b/src/components/animation/animation.ts @@ -136,7 +136,7 @@ export default class WaAnimation extends WebAwesomeElement { endDelay: this.endDelay, fill: this.fill, iterationStart: this.iterationStart, - iterations: this.iterations + iterations: this.iterations, }); this.animation.playbackRate = this.playbackRate; this.animation.addEventListener('cancel', this.handleAnimationCancel); @@ -171,7 +171,7 @@ export default class WaAnimation extends WebAwesomeElement { 'fill', 'iterations', 'iterationsStart', - 'keyframes' + 'keyframes', ]) handleAnimationChange() { if (!this.hasUpdated) { diff --git a/src/components/avatar/avatar.test.ts b/src/components/avatar/avatar.test.ts index 74de5b0c4..3ef57f7d2 100644 --- a/src/components/avatar/avatar.test.ts +++ b/src/components/avatar/avatar.test.ts @@ -82,7 +82,7 @@ describe('', () => { const label = 'Small transparent square'; beforeEach(async () => { el = await fixture( - html`` + html``, ); }); @@ -138,7 +138,7 @@ describe('', () => { describe('when passed a , on slot "icon"', () => { beforeEach(async () => { el = await fixture( - html`random content` + html`random content`, ); }); diff --git a/src/components/avatar/avatar.ts b/src/components/avatar/avatar.ts index 4d42881a8..b95c1354d 100644 --- a/src/components/avatar/avatar.ts +++ b/src/components/avatar/avatar.ts @@ -94,7 +94,7 @@ export default class WaAvatar extends WebAwesomeElement { avatar: true, 'avatar--circle': this.shape === 'circle', 'avatar--rounded': this.shape === 'rounded', - 'avatar--square': this.shape === 'square' + 'avatar--square': this.shape === 'square', })} role="img" aria-label=${this.label} diff --git a/src/components/badge/badge.ts b/src/components/badge/badge.ts index 068985895..dca1a1573 100644 --- a/src/components/badge/badge.ts +++ b/src/components/badge/badge.ts @@ -46,7 +46,7 @@ export default class WaBadge extends WebAwesomeElement { 'badge--warning': this.variant === 'warning', 'badge--danger': this.variant === 'danger', 'badge--pill': this.pill, - 'badge--pulse': this.pulse + 'badge--pulse': this.pulse, })} role="status" > diff --git a/src/components/breadcrumb/breadcrumb.ts b/src/components/breadcrumb/breadcrumb.ts index d0d1bef20..ff3b11843 100644 --- a/src/components/breadcrumb/breadcrumb.ts +++ b/src/components/breadcrumb/breadcrumb.ts @@ -50,7 +50,7 @@ export default class WaBreadcrumb extends WebAwesomeElement { private handleSlotChange() { const items = [...this.defaultSlot.assignedElements({ flatten: true })].filter( - item => item.tagName.toLowerCase() === 'wa-breadcrumb-item' + item => item.tagName.toLowerCase() === 'wa-breadcrumb-item', ) as WaBreadcrumbItem[]; items.forEach((item, index) => { diff --git a/src/components/button-group/button-group.test.ts b/src/components/button-group/button-group.test.ts index 758b3df5b..00b3a01ed 100644 --- a/src/components/button-group/button-group.test.ts +++ b/src/components/button-group/button-group.test.ts @@ -41,7 +41,7 @@ describe('', () => { const allButtons = group.querySelectorAll('wa-button'); const hasGroupClass = Array.from(allButtons).every(button => - button.classList.contains('wa-button-group__button') + button.classList.contains('wa-button-group__button'), ); expect(hasGroupClass).to.be.true; diff --git a/src/components/button/button.test.ts b/src/components/button/button.test.ts index 1f29517d5..78cb5b870 100644 --- a/src/components/button/button.test.ts +++ b/src/components/button/button.test.ts @@ -14,7 +14,7 @@ describe('', () => { init: (control: WaButton) => { control.type = 'button'; - } + }, }); runFormControlBaseTests({ tagName: 'wa-button', @@ -22,7 +22,7 @@ describe('', () => { init: (control: WaButton) => { control.type = 'submit'; - } + }, }); runFormControlBaseTests({ tagName: 'wa-button', @@ -30,7 +30,7 @@ describe('', () => { init: (control: WaButton) => { control.href = 'some-url'; - } + }, }); for (const fixture of fixtures) { @@ -282,7 +282,7 @@ describe('', () => { html`
Button 1 Button 2 -
` + `, ); let formData = new FormData(form); diff --git a/src/components/button/button.ts b/src/components/button/button.ts index f3994775c..7b1f1fd0a 100644 --- a/src/components/button/button.ts +++ b/src/components/button/button.ts @@ -264,7 +264,7 @@ export default class WaButton extends WebAwesomeFormAssociatedElement { 'button--text': this.appearance === 'text', 'button--pill': this.pill, 'button--rtl': this.localize.dir() === 'rtl', - 'button--visually-hidden-label': this.visuallyHiddenLabel + 'button--visually-hidden-label': this.visuallyHiddenLabel, })} ?disabled=${ifDefined(isLink ? undefined : this.disabled)} type=${ifDefined(isLink ? undefined : this.type)} diff --git a/src/components/card/card.test.ts b/src/components/card/card.test.ts index 06d88d887..943953ddf 100644 --- a/src/components/card/card.test.ts +++ b/src/components/card/card.test.ts @@ -12,7 +12,7 @@ describe('', () => { This is just a basic card. No image, no header, and no footer. Just your content. `); expect(el.innerText).to.eq( - 'This is just a basic card. No image, no header, and no footer. Just your content.' + 'This is just a basic card. No image, no header, and no footer. Just your content.', ); }); @@ -38,7 +38,7 @@ describe('', () => { html`
Header Title
This card has a header. You can put all sorts of things in it! -
` +
`, ); await expect(el).to.be.accessible(); }); @@ -48,7 +48,7 @@ describe('', () => { html`
Header Title
This card has a header. You can put all sorts of things in it! -
` +
`, ); expect(el.innerText).to.contain('This card has a header. You can put all sorts of things in it!'); }); @@ -58,7 +58,7 @@ describe('', () => { html`
Header Title
This card has a header. You can put all sorts of things in it! -
` +
`, ); const header = el.querySelector('div[slot=header]')!; expect(header.innerText).eq('Header Title'); @@ -69,7 +69,7 @@ describe('', () => { html`
Header Title
This card has a header. You can put all sorts of things in it! -
` +
`, ); const slot = el.shadowRoot!.querySelector('slot[name=header]')!; const childNodes = slot.assignedNodes({ flatten: true }); @@ -82,7 +82,7 @@ describe('', () => { html`
Header Title
This card has a header. You can put all sorts of things in it! -
` +
`, ); const card = el.shadowRoot!.querySelector('.card')!; expect(card.classList.value.trim()).to.eq('card card--has-header'); @@ -96,7 +96,7 @@ describe('', () => { This card has a footer. You can put all sorts of things in it!
Footer Content
-
` +
`, ); await expect(el).to.be.accessible(); }); @@ -107,7 +107,7 @@ describe('', () => { This card has a footer. You can put all sorts of things in it!
Footer Content
-
` + `, ); expect(el.innerText).to.contain('This card has a footer. You can put all sorts of things in it!'); }); @@ -118,7 +118,7 @@ describe('', () => { This card has a footer. You can put all sorts of things in it!
Footer Content
-
` + `, ); const footer = el.querySelector('div[slot=footer]')!; expect(footer.innerText).eq('Footer Content'); @@ -130,7 +130,7 @@ describe('', () => { This card has a footer. You can put all sorts of things in it!
Footer Content
-
` + `, ); const slot = el.shadowRoot!.querySelector('slot[name=footer]')!; const childNodes = slot.assignedNodes({ flatten: true }); @@ -144,7 +144,7 @@ describe('', () => { This card has a footer. You can put all sorts of things in it!
Footer Content
-
` + `, ); const card = el.shadowRoot!.querySelector('.card')!; @@ -162,7 +162,7 @@ describe('', () => { alt="A kitten walks towards camera on top of pallet." /> This is a kitten, but not just any kitten. This kitten likes walking along pallets. - ` + `, ); await expect(el).to.be.accessible(); @@ -177,11 +177,11 @@ describe('', () => { alt="A kitten walks towards camera on top of pallet." /> This is a kitten, but not just any kitten. This kitten likes walking along pallets. - ` + `, ); expect(el.innerText).to.contain( - 'This is a kitten, but not just any kitten. This kitten likes walking along pallets.' + 'This is a kitten, but not just any kitten. This kitten likes walking along pallets.', ); }); @@ -194,7 +194,7 @@ describe('', () => { alt="A kitten walks towards camera on top of pallet." /> This is a kitten, but not just any kitten. This kitten likes walking along pallets. - ` + `, ); const slot = el.shadowRoot!.querySelector('slot[name=image]')!; const childNodes = slot.assignedNodes({ flatten: true }); @@ -211,7 +211,7 @@ describe('', () => { alt="A kitten walks towards camera on top of pallet." /> This is a kitten, but not just any kitten. This kitten likes walking along pallets. - ` + `, ); const card = el.shadowRoot!.querySelector('.card')!; diff --git a/src/components/card/card.ts b/src/components/card/card.ts index 152a48036..289f2d32d 100644 --- a/src/components/card/card.ts +++ b/src/components/card/card.ts @@ -50,7 +50,7 @@ export default class WaCard extends WebAwesomeElement { card: true, 'card--has-footer': this.withFooter, 'card--has-image': this.withImage, - 'card--has-header': this.withHeader + 'card--has-header': this.withHeader, })} > diff --git a/src/components/carousel/carousel.test.ts b/src/components/carousel/carousel.test.ts index 30ebff69b..0ba85c379 100644 --- a/src/components/carousel/carousel.test.ts +++ b/src/components/carousel/carousel.test.ts @@ -63,7 +63,7 @@ describe('', () => { beforeEach(() => { clock = sandbox.useFakeTimers({ - now: new Date() + now: new Date(), }); }); @@ -262,7 +262,7 @@ describe('', () => { [10, 2, 2, false, 5], [7, 2, 1, true, 7], [5, 3, 3, true, 2], - [10, 2, 2, true, 5] + [10, 2, 2, true, 5], ].forEach( ([slides, slidesPerPage, slidesPerMove, loop, expected]: [number, number, number, boolean, number]) => { it(`should display ${expected} pages for ${slides} slides grouped by ${slidesPerPage} and scrolled by ${slidesPerMove}${ @@ -285,7 +285,7 @@ describe('', () => { const paginationItems = el.shadowRoot!.querySelectorAll('.carousel__pagination-item'); expect(paginationItems.length).to.equal(expected); }); - } + }, ); }); @@ -622,7 +622,7 @@ describe('', () => { `); const previousButton: HTMLElement = el.shadowRoot!.querySelector( - '.carousel__navigation-button--previous' + '.carousel__navigation-button--previous', )!; sandbox.stub(el, 'previous'); await el.updateComplete; @@ -648,7 +648,7 @@ describe('', () => { `); const previousButton: HTMLElement = el.shadowRoot!.querySelector( - '.carousel__navigation-button--previous' + '.carousel__navigation-button--previous', )!; await el.updateComplete; diff --git a/src/components/carousel/carousel.ts b/src/components/carousel/carousel.ts index 9604882d2..7634f7b25 100644 --- a/src/components/carousel/carousel.ts +++ b/src/components/carousel/carousel.ts @@ -119,7 +119,7 @@ export default class WaCarousel extends WebAwesomeElement { this.mutationObserver = new MutationObserver(this.handleSlotChange); this.mutationObserver.observe(this, { childList: true, - subtree: true + subtree: true, }); } @@ -154,7 +154,7 @@ export default class WaCarousel extends WebAwesomeElement { /** @internal Gets all carousel items. */ private getSlides({ excludeClones = true }: { excludeClones?: boolean } = {}) { return [...this.children].filter( - (el: HTMLElement) => this.isCarouselItem(el) && (!excludeClones || !el.hasAttribute('data-clone')) + (el: HTMLElement) => this.isCarouselItem(el) && (!excludeClones || !el.hasAttribute('data-clone')), ) as WaCarouselItem[]; } @@ -203,7 +203,7 @@ export default class WaCarousel extends WebAwesomeElement { if (isFocusInPagination) { this.updateComplete.then(() => { const activePaginationItem = this.shadowRoot?.querySelector( - '[part~="pagination-item--active"]' + '[part~="pagination-item--active"]', ); if (activePaginationItem) { @@ -235,7 +235,7 @@ export default class WaCarousel extends WebAwesomeElement { this.scrollContainer.scrollBy({ left: -event.movementX, top: -event.movementY, - behavior: 'instant' + behavior: 'instant', }); }; @@ -269,7 +269,7 @@ export default class WaCarousel extends WebAwesomeElement { scrollContainer.scrollTo({ left: finalLeft, top: finalTop, - behavior: prefersReducedMotion() ? 'auto' : 'smooth' + behavior: prefersReducedMotion() ? 'auto' : 'smooth', }); await waitForEvent(scrollContainer, 'scrollend'); } @@ -333,8 +333,8 @@ export default class WaCarousel extends WebAwesomeElement { }, { root: this.scrollContainer, - threshold: 0.6 - } + threshold: 0.6, + }, ); this.getSlides({ excludeClones: false }).forEach(slide => { @@ -359,8 +359,8 @@ export default class WaCarousel extends WebAwesomeElement { private handleSlotChange = (mutations: MutationRecord[]) => { const needsInitialization = mutations.some(mutation => [...mutation.addedNodes, ...mutation.removedNodes].some( - (el: HTMLElement) => this.isCarouselItem(el) && !el.hasAttribute('data-clone') - ) + (el: HTMLElement) => this.isCarouselItem(el) && !el.hasAttribute('data-clone'), + ), ); // Reinitialize the carousel if a carousel item has been added or removed @@ -430,8 +430,8 @@ export default class WaCarousel extends WebAwesomeElement { this.dispatchEvent( new WaSlideChangeEvent({ index: this.activeSlide, - slide: slides[this.activeSlide] - }) + slide: slides[this.activeSlide], + }), ); } } @@ -508,7 +508,7 @@ export default class WaCarousel extends WebAwesomeElement { const nextSlideIndex = clamp( index + (loop ? slidesPerPage : 0) + (isRtl ? slidesPerPage - 1 : 0), 0, - slidesWithClones.length - 1 + slidesWithClones.length - 1, ); const nextSlide = slidesWithClones[nextSlideIndex]; @@ -541,7 +541,7 @@ export default class WaCarousel extends WebAwesomeElement { scrollContainer.scrollTo({ left: nextLeft + scrollContainer.scrollLeft, top: nextTop + scrollContainer.scrollTop, - behavior + behavior, }); } else { this.pendingSlideChange = false; @@ -577,7 +577,7 @@ export default class WaCarousel extends WebAwesomeElement { carousel__slides: true, 'carousel__slides--horizontal': this.orientation === 'horizontal', 'carousel__slides--vertical': this.orientation === 'vertical', - 'carousel__slides--dragging': this.dragging + 'carousel__slides--dragging': this.dragging, })}" style="--slides-per-page: ${this.slidesPerPage};" aria-busy="${scrolling ? 'true' : 'false'}" @@ -600,7 +600,7 @@ export default class WaCarousel extends WebAwesomeElement { class="${classMap({ 'carousel__navigation-button': true, 'carousel__navigation-button--previous': true, - 'carousel__navigation-button--disabled': !prevEnabled + 'carousel__navigation-button--disabled': !prevEnabled, })}" aria-label="${this.localize.term('previousSlide')}" aria-controls="scroll-container" @@ -617,7 +617,7 @@ export default class WaCarousel extends WebAwesomeElement { class=${classMap({ 'carousel__navigation-button': true, 'carousel__navigation-button--next': true, - 'carousel__navigation-button--disabled': !nextEnabled + 'carousel__navigation-button--disabled': !nextEnabled, })} aria-label="${this.localize.term('nextSlide')}" aria-controls="scroll-container" @@ -641,7 +641,7 @@ export default class WaCarousel extends WebAwesomeElement { part="pagination-item ${isActive ? 'pagination-item--active' : ''}" class="${classMap({ 'carousel__pagination-item': true, - 'carousel__pagination-item--active': isActive + 'carousel__pagination-item--active': isActive, })}" role="tab" aria-selected="${isActive ? 'true' : 'false'}" diff --git a/src/components/carousel/scroll-controller.ts b/src/components/carousel/scroll-controller.ts index 38718dad8..9ccf3bec7 100644 --- a/src/components/carousel/scroll-controller.ts +++ b/src/components/carousel/scroll-controller.ts @@ -104,7 +104,7 @@ export class ScrollController implements ReactiveControlle handleDrag(event: PointerEvent) { this.host.scrollContainer.scrollBy({ left: -event.movementX, - top: -event.movementY + top: -event.movementY, }); } diff --git a/src/components/checkbox/checkbox.test.ts b/src/components/checkbox/checkbox.test.ts index 12556db62..9dcb01e1a 100644 --- a/src/components/checkbox/checkbox.test.ts +++ b/src/components/checkbox/checkbox.test.ts @@ -122,7 +122,7 @@ describe('', () => { it('Should keep its form value when going from checked -> unchecked -> checked', async () => { const form = await fixture( - html`
Checked
` + html`
Checked
`, ); const checkbox = form.querySelector('wa-checkbox')!; diff --git a/src/components/checkbox/checkbox.ts b/src/components/checkbox/checkbox.ts index 6b3f8557a..312a76093 100644 --- a/src/components/checkbox/checkbox.ts +++ b/src/components/checkbox/checkbox.ts @@ -69,9 +69,9 @@ export default class WaCheckbox extends WebAwesomeFormAssociatedElement { // Use a checkbox so we get "free" translation strings. validationElement: Object.assign(document.createElement('input'), { type: 'checkbox', - required: true - }) - }) + required: true, + }), + }), ]; return [...super.validators, ...validators]; } @@ -223,7 +223,7 @@ export default class WaCheckbox extends WebAwesomeFormAssociatedElement {
@@ -1157,10 +1157,10 @@ export default class WaColorPicker extends WebAwesomeFormAssociatedElement { 'color-dropdown__trigger--empty': this.isEmpty, 'color-dropdown__trigger--focused': this.hasFocus, 'color-picker__transparent-bg': true, - 'form-control-input': true + 'form-control-input': true, })} style=${styleMap({ - color: this.getHexString(this.hue, this.saturation, this.brightness, this.alpha) + color: this.getHexString(this.hue, this.saturation, this.brightness, this.alpha), })} type="button" aria-labelledby="form-control-label" @@ -1171,7 +1171,7 @@ export default class WaColorPicker extends WebAwesomeFormAssociatedElement { name="hint" part="hint" class=${classMap({ - 'has-slotted': hasHint + 'has-slotted': hasHint, })} >${this.hint} diff --git a/src/components/copy-button/copy-button.ts b/src/components/copy-button/copy-button.ts index 472d14a5a..d70780f0d 100644 --- a/src/components/copy-button/copy-button.ts +++ b/src/components/copy-button/copy-button.ts @@ -215,7 +215,7 @@ export default class WaCopyButton extends WebAwesomeElement { class=${classMap({ 'copy-button': true, 'copy-button--success': this.status === 'success', - 'copy-button--error': this.status === 'error' + 'copy-button--error': this.status === 'error', })} for="copy-button" placement=${this.tooltipPlacement} diff --git a/src/components/details/details.ts b/src/components/details/details.ts index 933ed46df..d09b0b250 100644 --- a/src/components/details/details.ts +++ b/src/components/details/details.ts @@ -150,12 +150,12 @@ export default class WaDetails extends WebAwesomeElement { this.body, [ { height: '0', opacity: '0' }, - { height: `${this.body.scrollHeight}px`, opacity: '1' } + { height: `${this.body.scrollHeight}px`, opacity: '1' }, ], { duration, - easing: 'linear' - } + easing: 'linear', + }, ); this.body.style.height = 'auto'; @@ -176,9 +176,9 @@ export default class WaDetails extends WebAwesomeElement { this.body, [ { height: `${this.body.scrollHeight}px`, opacity: '1' }, - { height: '0', opacity: '0' } + { height: '0', opacity: '0' }, ], - { duration, easing: 'linear' } + { duration, easing: 'linear' }, ); this.body.style.height = 'auto'; @@ -217,7 +217,7 @@ export default class WaDetails extends WebAwesomeElement { details: true, 'details--open': this.open, 'details--disabled': this.disabled, - 'details--rtl': isRtl + 'details--rtl': isRtl, })} > ', () => { value: 12, short: '12 byte', long: '12 bytes', - narrow: '12B' + narrow: '12B', }, { value: 1200, short: '1.2 kB', long: '1.2 kilobytes', - narrow: '1.2kB' + narrow: '1.2kB', }, { value: 1200000, short: '1.2 MB', long: '1.2 megabytes', - narrow: '1.2MB' + narrow: '1.2MB', }, { value: 1200000000, short: '1.2 GB', long: '1.2 gigabytes', - narrow: '1.2GB' - } + narrow: '1.2GB', + }, ]; results.forEach(expected => { @@ -74,26 +74,26 @@ describe('', () => { value: 12, short: '12 bit', long: '12 bits', - narrow: '12bit' + narrow: '12bit', }, { value: 1200, short: '1.2 kb', long: '1.2 kilobits', - narrow: '1.2kb' + narrow: '1.2kb', }, { value: 1200000, short: '1.2 Mb', long: '1.2 megabits', - narrow: '1.2Mb' + narrow: '1.2Mb', }, { value: 1200000000, short: '1.2 Gb', long: '1.2 gigabits', - narrow: '1.2Gb' - } + narrow: '1.2Gb', + }, ]; results.forEach(expected => { diff --git a/src/components/format-bytes/format-bytes.ts b/src/components/format-bytes/format-bytes.ts index 96ce9536f..71ab333ff 100644 --- a/src/components/format-bytes/format-bytes.ts +++ b/src/components/format-bytes/format-bytes.ts @@ -36,7 +36,7 @@ export default class WaFormatBytes extends WebAwesomeElement { return this.localize.number(valueToFormat, { style: 'unit', unit, - unitDisplay: this.display + unitDisplay: this.display, }); } } diff --git a/src/components/format-date/format-date.test.ts b/src/components/format-date/format-date.test.ts index acebe4a30..efdd92dcf 100644 --- a/src/components/format-date/format-date.test.ts +++ b/src/components/format-date/format-date.test.ts @@ -13,7 +13,7 @@ describe('', () => { beforeEach(() => { // fake timer so `new Date()` can be tested clock = sinon.useFakeTimers({ - now: new Date() + now: new Date(), }); }); @@ -51,7 +51,7 @@ describe('', () => { { lang: 'nl', result: `1-1-${new Date().getFullYear()}` }, { lang: 'pl', result: `1.01.${new Date().getFullYear()}` }, { lang: 'pt', result: `01/01/${new Date().getFullYear()}` }, - { lang: 'ru', result: `01.01.${new Date().getFullYear()}` } + { lang: 'ru', result: `01.01.${new Date().getFullYear()}` }, ]; results.forEach(setup => { it(`date has correct language format: ${setup.lang}`, async () => { @@ -75,7 +75,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { weekday: weekdayFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -91,7 +91,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { era: eraFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -107,7 +107,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { year: yearFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -126,7 +126,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { month: monthFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -142,7 +142,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { day: dayFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -158,7 +158,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { hour: hourFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -177,7 +177,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { minute: minuteFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); // @TODO: Some weird browser / Node issue only in firefox. @@ -202,7 +202,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { second: secondFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); // @TODO: Some weird browser / Node issue only in firefox. @@ -226,7 +226,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { timeZoneName: timeZoneNameFormat }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -245,7 +245,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { timeZone: timeZone }).format( - new Date(new Date().getFullYear(), 0, 1) + new Date(new Date().getFullYear(), 0, 1), ); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); @@ -264,7 +264,7 @@ describe('', () => { `); const expected = new Intl.DateTimeFormat('en-US', { - hour12: hourFormatValue === 'auto' ? undefined : hourFormatValue === '12' + hour12: hourFormatValue === 'auto' ? undefined : hourFormatValue === '12', }).format(new Date(new Date().getFullYear(), 0, 1)); expect(el.shadowRoot?.textContent?.trim()).to.equal(expected); }); diff --git a/src/components/format-date/format-date.ts b/src/components/format-date/format-date.ts index 3e297d4b5..91bffd9be 100644 --- a/src/components/format-date/format-date.ts +++ b/src/components/format-date/format-date.ts @@ -75,7 +75,7 @@ export default class WaFormatDate extends WebAwesomeElement { second: this.second, timeZoneName: this.timeZoneName, timeZone: this.timeZone, - hour12: hour12 + hour12: hour12, })} `; diff --git a/src/components/format-number/format-number.test.ts b/src/components/format-number/format-number.test.ts index 8badd4840..a414ee152 100644 --- a/src/components/format-number/format-number.test.ts +++ b/src/components/format-number/format-number.test.ts @@ -84,7 +84,7 @@ describe('', () => { `); const expected = new Intl.NumberFormat('en-US', { style: 'decimal', - currencyDisplay: currencyDisplay + currencyDisplay: currencyDisplay, }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); @@ -100,7 +100,7 @@ describe('', () => { const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', - minimumIntegerDigits: minDigits + minimumIntegerDigits: minDigits, }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); @@ -116,7 +116,7 @@ describe('', () => { const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', - minimumFractionDigits: minFractionDigits + minimumFractionDigits: minFractionDigits, }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); @@ -132,7 +132,7 @@ describe('', () => { const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', - maximumFractionDigits: maxFractionDigits + maximumFractionDigits: maxFractionDigits, }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); @@ -148,7 +148,7 @@ describe('', () => { const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', - minimumSignificantDigits: minSignificantDigits + minimumSignificantDigits: minSignificantDigits, }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); @@ -164,7 +164,7 @@ describe('', () => { const expected = new Intl.NumberFormat('en-US', { style: 'decimal', currencyDisplay: 'symbol', - maximumSignificantDigits: maxSignificantDigits + maximumSignificantDigits: maxSignificantDigits, }).format(1000); expect(el.shadowRoot?.textContent).to.equal(expected); }); diff --git a/src/components/format-number/format-number.ts b/src/components/format-number/format-number.ts index a975005bb..ba527dc4c 100644 --- a/src/components/format-number/format-number.ts +++ b/src/components/format-number/format-number.ts @@ -56,7 +56,7 @@ export default class WaFormatNumber extends WebAwesomeElement { minimumFractionDigits: this.minimumFractionDigits, maximumFractionDigits: this.maximumFractionDigits, minimumSignificantDigits: this.minimumSignificantDigits, - maximumSignificantDigits: this.maximumSignificantDigits + maximumSignificantDigits: this.maximumSignificantDigits, }); } } diff --git a/src/components/icon-button/icon-button.ts b/src/components/icon-button/icon-button.ts index f2a163e0f..6556c02d4 100644 --- a/src/components/icon-button/icon-button.ts +++ b/src/components/icon-button/icon-button.ts @@ -116,7 +116,7 @@ export default class WaIconButton extends WebAwesomeFormAssociatedElement { class=${classMap({ 'icon-button': true, 'icon-button--disabled': !isLink && this.disabled, - 'icon-button--focused': this.hasFocus + 'icon-button--focused': this.hasFocus, })} ?disabled=${ifDefined(isLink ? undefined : this.disabled)} type=${ifDefined(isLink ? undefined : 'button')} diff --git a/src/components/icon/icon.test.ts b/src/components/icon/icon.test.ts index 27cc2c41c..117e271ef 100644 --- a/src/components/icon/icon.test.ts +++ b/src/components/icon/icon.test.ts @@ -19,7 +19,7 @@ const testLibraryIcons = { `, - 'bad-icon': `
` + 'bad-icon': `
`, }; describe('', () => { @@ -36,7 +36,7 @@ describe('', () => { } return ''; }, - mutator: (svg: SVGElement) => svg.setAttribute('fill', 'currentColor') + mutator: (svg: SVGElement) => svg.setAttribute('fill', 'currentColor'), }); }); @@ -177,7 +177,7 @@ describe('', () => { registerIconLibrary('sprite', { resolver: name => `/docs/assets/images/sprite.svg#${name}`, mutator: svg => svg.setAttribute('fill', 'currentColor'), - spriteSheet: true + spriteSheet: true, }); const el = await fixture(html``); @@ -204,7 +204,7 @@ describe('', () => { registerIconLibrary('sprite', { resolver: name => `/docs/assets/images/sprite.svg#${name}`, mutator: svg => svg.setAttribute('fill', 'currentColor'), - spriteSheet: true + spriteSheet: true, }); const el = await fixture(html``); @@ -235,7 +235,7 @@ describe('', () => { mutator(svg) { return svg.setAttribute('fill', 'currentColor'); }, - spriteSheet: true + spriteSheet: true, }); const el = await fixture(html``); diff --git a/src/components/icon/icon.ts b/src/components/icon/icon.ts index 23cd614fe..b01a23c92 100644 --- a/src/components/icon/icon.ts +++ b/src/components/icon/icon.ts @@ -102,13 +102,13 @@ export default class WaIcon extends WebAwesomeElement { if (this.name && library) { return { url: library.resolver(this.name, this.family, this.variant), - fromLibrary: true + fromLibrary: true, }; } return { url: this.src, - fromLibrary: false + fromLibrary: false, }; } diff --git a/src/components/icon/library.default.ts b/src/components/icon/library.default.ts index 391af9aef..23d6847d7 100644 --- a/src/components/icon/library.default.ts +++ b/src/components/icon/library.default.ts @@ -42,7 +42,7 @@ const library: IconLibrary = { name: 'default', resolver: (name: string, family = 'classic', variant = 'solid') => { return getIconUrl(name, family, variant); - } + }, }; export default library; diff --git a/src/components/icon/library.system.ts b/src/components/icon/library.system.ts index a08cd9882..35aec1c10 100644 --- a/src/components/icon/library.system.ts +++ b/src/components/icon/library.system.ts @@ -19,37 +19,37 @@ const systemLibrary: IconLibrary = { switch (name) { case 'check': return dataUri( - `` + ``, ); case 'chevron-down': return dataUri( - `` + ``, ); case 'chevron-left': return dataUri( - `` + ``, ); case 'chevron-right': return dataUri( - `` + ``, ); case 'circle': return dataUri( - `` + ``, ); case 'eye-dropper': return dataUri( - `` + ``, ); case 'grip-vertical': return dataUri( - `` + ``, ); case 'indeterminate': @@ -59,32 +59,32 @@ const systemLibrary: IconLibrary = { case 'minus': return dataUri( - `` + ``, ); case 'pause': return dataUri( - `` + ``, ); case 'play': return dataUri( - `` + ``, ); case 'star': return dataUri( - `` + ``, ); case 'user': return dataUri( - `` + ``, ); case 'xmark': return dataUri( - `` + ``, ); case 'copy': return dataUri( - `` + ``, ); case 'eye': return dataUri( - `` + ``, ); case 'eye-slash': return dataUri( - `` + ``, ); } } return ''; - } + }, }; export default systemLibrary; diff --git a/src/components/icon/library.ts b/src/components/icon/library.ts index e034c48eb..09838aff9 100644 --- a/src/components/icon/library.ts +++ b/src/components/icon/library.ts @@ -36,7 +36,7 @@ export function registerIconLibrary(name: string, options: Omit', () => { base.dispatchEvent( new KeyboardEvent('keydown', { - key: 'ArrowRight' - }) + key: 'ArrowRight', + }), ); await el.updateComplete; @@ -77,8 +77,8 @@ describe('', () => { base.dispatchEvent( new KeyboardEvent('keydown', { - key: 'ArrowLeft' - }) + key: 'ArrowLeft', + }), ); await el.updateComplete; @@ -97,8 +97,8 @@ describe('', () => { base.dispatchEvent( new KeyboardEvent('keydown', { - key: 'Home' - }) + key: 'Home', + }), ); await el.updateComplete; @@ -117,8 +117,8 @@ describe('', () => { base.dispatchEvent( new KeyboardEvent('keydown', { - key: 'End' - }) + key: 'End', + }), ); await el.updateComplete; @@ -140,8 +140,8 @@ describe('', () => { base.dispatchEvent( new KeyboardEvent('keydown', { - key: 'ArrowLeft' - }) + key: 'ArrowLeft', + }), ); await el.updateComplete; @@ -163,8 +163,8 @@ describe('', () => { base.dispatchEvent( new KeyboardEvent('keydown', { - key: 'ArrowRight' - }) + key: 'ArrowRight', + }), ); await el.updateComplete; @@ -184,8 +184,8 @@ describe('', () => { base.dispatchEvent( new KeyboardEvent('keydown', { key: 'ArrowRight', - shiftKey: true - }) + shiftKey: true, + }), ); await el.updateComplete; @@ -205,8 +205,8 @@ describe('', () => { base.dispatchEvent( new KeyboardEvent('keydown', { key: 'ArrowLeft', - shiftKey: true - }) + shiftKey: true, + }), ); await el.updateComplete; @@ -242,8 +242,8 @@ describe('', () => { document.dispatchEvent( new PointerEvent('pointermove', { clientX: offsetX + 20, - clientY: offsetY - }) + clientY: offsetY, + }), ); document.dispatchEvent(new PointerEvent('pointerup')); diff --git a/src/components/image-comparer/image-comparer.ts b/src/components/image-comparer/image-comparer.ts index 66bb9916f..3e82b74d2 100644 --- a/src/components/image-comparer/image-comparer.ts +++ b/src/components/image-comparer/image-comparer.ts @@ -59,7 +59,7 @@ export default class WaImageComparer extends WebAwesomeElement { this.position = parseFloat(clamp((x / width) * 100, 0, 100).toFixed(2)); if (isRtl) this.position = 100 - this.position; }, - initialEvent: event + initialEvent: event, }); } @@ -105,7 +105,7 @@ export default class WaImageComparer extends WebAwesomeElement { id="image-comparer" class=${classMap({ 'image-comparer': true, - 'image-comparer--rtl': isRtl + 'image-comparer--rtl': isRtl, })} @keydown=${this.handleKeyDown} > @@ -118,7 +118,7 @@ export default class WaImageComparer extends WebAwesomeElement { part="after" class="image-comparer__after" style=${styleMap({ - clipPath: isRtl ? `inset(0 0 0 ${100 - this.position}%)` : `inset(0 ${100 - this.position}% 0 0)` + clipPath: isRtl ? `inset(0 0 0 ${100 - this.position}%)` : `inset(0 ${100 - this.position}% 0 0)`, })} > @@ -129,7 +129,7 @@ export default class WaImageComparer extends WebAwesomeElement { part="divider" class="image-comparer__divider" style=${styleMap({ - left: isRtl ? `${100 - this.position}%` : `${this.position}%` + left: isRtl ? `${100 - this.position}%` : `${this.position}%`, })} @mousedown=${this.handleDrag} @touchstart=${this.handleDrag} diff --git a/src/components/include/include.test.ts b/src/components/include/include.test.ts index 71ae98579..6f69e906a 100644 --- a/src/components/include/include.test.ts +++ b/src/components/include/include.test.ts @@ -19,7 +19,7 @@ const stubbedFetchResponse: Response = { formData: sinon.fake(), bodyUsed: false, body: null, - clone: sinon.fake() + clone: sinon.fake(), }; async function delayResolve(resolveValue: string) { @@ -40,7 +40,7 @@ describe('', () => { ...stubbedFetchResponse, ok: true, status: 200, - text: () => delayResolve('"id": 1') + text: () => delayResolve('"id": 1'), }); const loadHandler = sinon.spy(); document.addEventListener('wa-load', loadHandler); @@ -59,7 +59,7 @@ describe('', () => { ...stubbedFetchResponse, ok: false, status: 404, - text: () => delayResolve('{}') + text: () => delayResolve('{}'), }); const loadHandler = sinon.spy(); document.addEventListener('wa-include-error', loadHandler); diff --git a/src/components/include/request.ts b/src/components/include/request.ts index 8985b6a92..37616a524 100644 --- a/src/components/include/request.ts +++ b/src/components/include/request.ts @@ -17,7 +17,7 @@ export function requestInclude(src: string, mode: 'cors' | 'no-cors' | 'same-ori const res = { ok: response.ok, status: response.status, - html: await response.text() + html: await response.text(), }; // Replace the cached promise with its result to avoid having buggy browser Promises retain memory as mentioned in #1284 and #1249 includeFiles.set(src, res); diff --git a/src/components/input/input.test.ts b/src/components/input/input.test.ts index 4748d7e19..219587092 100644 --- a/src/components/input/input.test.ts +++ b/src/components/input/input.test.ts @@ -105,7 +105,7 @@ describe('', () => { it('should not add a value to the form if disabled', async () => { const form = await fixture( - html`
` + html`
`, ); const el = form.querySelector('wa-input')!; el.value = 'blah'; diff --git a/src/components/input/input.ts b/src/components/input/input.ts index ae499bca1..41c8fdbb5 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -206,8 +206,8 @@ export default class WaInput extends WebAwesomeFormAssociatedElement { converter: { // Allow "true|false" attribute values but keep the property boolean fromAttribute: value => (!value || value === 'false' ? false : true), - toAttribute: value => (value ? 'true' : 'false') - } + toAttribute: value => (value ? 'true' : 'false'), + }, }) spellcheck = true; @@ -289,7 +289,7 @@ export default class WaInput extends WebAwesomeFormAssociatedElement { } const button = formElements.find( - (el: HTMLButtonElement) => el.type === 'submit' && !el.matches(':disabled') + (el: HTMLButtonElement) => el.type === 'submit' && !el.matches(':disabled'), ) as undefined | HTMLButtonElement | WaButton; // No button found, don't submit. @@ -339,7 +339,7 @@ export default class WaInput extends WebAwesomeFormAssociatedElement { setSelectionRange( selectionStart: number, selectionEnd: number, - selectionDirection: 'forward' | 'backward' | 'none' = 'none' + selectionDirection: 'forward' | 'backward' | 'none' = 'none', ) { this.input.setSelectionRange(selectionStart, selectionEnd, selectionDirection); } @@ -349,7 +349,7 @@ export default class WaInput extends WebAwesomeFormAssociatedElement { replacement: string, start?: number, end?: number, - selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve' + selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve', ) { const selectionStart = start ?? this.input.selectionStart!; const selectionEnd = end ?? this.input.selectionEnd!; @@ -440,7 +440,7 @@ export default class WaInput extends WebAwesomeFormAssociatedElement { 'input--disabled': this.disabled, 'input--focused': this.hasFocus, 'input--empty': !this.value, - 'input--no-spin-buttons': this.noSpinButtons + 'input--no-spin-buttons': this.noSpinButtons, })} > @@ -531,7 +531,7 @@ export default class WaInput extends WebAwesomeFormAssociatedElement { name="hint" part="hint" class=${classMap({ - 'has-slotted': hasHint + 'has-slotted': hasHint, })} aria-hidden=${hasHint ? 'false' : 'true'} >${this.hint}
{ return value.join(' '); - } - } + }, + }, }) flipFallbackPlacements = ''; @@ -312,7 +312,7 @@ export default class WaPopup extends WebAwesomeElement { // const middleware = [ // The offset middleware goes first - offset({ mainAxis: this.distance, crossAxis: this.skidding }) + offset({ mainAxis: this.distance, crossAxis: this.skidding }), ]; // First we sync width/height @@ -324,8 +324,8 @@ export default class WaPopup extends WebAwesomeElement { const syncHeight = this.sync === 'height' || this.sync === 'both'; this.popup.style.width = syncWidth ? `${rects.reference.width}px` : ''; this.popup.style.height = syncHeight ? `${rects.reference.height}px` : ''; - } - }) + }, + }), ); } else { // Cleanup styles if we're not matching width/height @@ -341,8 +341,8 @@ export default class WaPopup extends WebAwesomeElement { // @ts-expect-error - We're converting a string attribute to an array here fallbackPlacements: this.flipFallbackPlacements, fallbackStrategy: this.flipFallbackStrategy === 'best-fit' ? 'bestFit' : 'initialPlacement', - padding: this.flipPadding - }) + padding: this.flipPadding, + }), ); } @@ -351,8 +351,8 @@ export default class WaPopup extends WebAwesomeElement { middleware.push( shift({ boundary: this.shiftBoundary, - padding: this.shiftPadding - }) + padding: this.shiftPadding, + }), ); } @@ -374,8 +374,8 @@ export default class WaPopup extends WebAwesomeElement { } else { this.style.removeProperty('--auto-size-available-width'); } - } - }) + }, + }), ); } else { // Cleanup styles if we're no longer using auto-size @@ -388,8 +388,8 @@ export default class WaPopup extends WebAwesomeElement { middleware.push( arrow({ element: this.arrowEl, - padding: this.arrowPadding - }) + padding: this.arrowPadding, + }), ); } @@ -409,8 +409,8 @@ export default class WaPopup extends WebAwesomeElement { strategy: this.strategy, platform: { ...platform, - getOffsetParent - } + getOffsetParent, + }, }).then(({ x, y, middlewareData, placement }) => { // // Even though we have our own localization utility, it uses different heuristics to determine RTL. Because of @@ -425,7 +425,7 @@ export default class WaPopup extends WebAwesomeElement { Object.assign(this.popup.style, { left: `${x}px`, - top: `${y}px` + top: `${y}px`, }); if (this.arrow) { @@ -463,7 +463,7 @@ export default class WaPopup extends WebAwesomeElement { right, bottom, left, - [staticSide]: 'calc(var(--arrow-size-diagonal) * -1)' + [staticSide]: 'calc(var(--arrow-size-diagonal) * -1)', }); } }); @@ -557,7 +557,7 @@ export default class WaPopup extends WebAwesomeElement { part="hover-bridge" class=${classMap({ 'popup-hover-bridge': true, - 'popup-hover-bridge--visible': this.hoverBridge && this.active + 'popup-hover-bridge--visible': this.hoverBridge && this.active, })} > @@ -567,7 +567,7 @@ export default class WaPopup extends WebAwesomeElement { popup: true, 'popup--active': this.active, 'popup--fixed': this.strategy === 'fixed', - 'popup--has-arrow': this.arrow + 'popup--has-arrow': this.arrow, })} > diff --git a/src/components/progress-bar/progress-bar.test.ts b/src/components/progress-bar/progress-bar.test.ts index b03195f91..b30b31ad2 100644 --- a/src/components/progress-bar/progress-bar.test.ts +++ b/src/components/progress-bar/progress-bar.test.ts @@ -24,7 +24,7 @@ describe('', () => { beforeEach(async () => { el = await fixture( - html`` + html``, ); base = el.shadowRoot!.querySelector('[part~="base"]')!; indicator = el.shadowRoot!.querySelector('[part~="indicator"]')!; @@ -48,7 +48,7 @@ describe('', () => { beforeEach(async () => { el = await fixture( - html`` + html``, ); base = el.shadowRoot!.querySelector('[part~="base"]')!; }); @@ -65,7 +65,7 @@ describe('', () => { describe('when provided a ariaLabel, and value parameter', () => { beforeEach(async () => { el = await fixture( - html`` + html``, ); }); diff --git a/src/components/progress-bar/progress-bar.ts b/src/components/progress-bar/progress-bar.ts index 9d706099d..db57468d2 100644 --- a/src/components/progress-bar/progress-bar.ts +++ b/src/components/progress-bar/progress-bar.ts @@ -46,7 +46,7 @@ export default class WaProgressBar extends WebAwesomeElement { class=${classMap({ 'progress-bar': true, 'progress-bar--indeterminate': this.indeterminate, - 'progress-bar--rtl': this.localize.dir() === 'rtl' + 'progress-bar--rtl': this.localize.dir() === 'rtl', })} role="progressbar" title=${ifDefined(this.title)} diff --git a/src/components/progress-ring/progress-ring.test.ts b/src/components/progress-ring/progress-ring.test.ts index e521890fb..e3041d044 100644 --- a/src/components/progress-ring/progress-ring.test.ts +++ b/src/components/progress-ring/progress-ring.test.ts @@ -23,7 +23,7 @@ describe('', () => { beforeEach(async () => { el = await fixture( - html`` + html``, ); base = el.shadowRoot!.querySelector('[part~="base"]')!; }); @@ -44,7 +44,7 @@ describe('', () => { describe('when provided a ariaLabel, and value parameter', () => { beforeEach(async () => { el = await fixture( - html`` + html``, ); }); diff --git a/src/components/qr-code/qr-code.test.ts b/src/components/qr-code/qr-code.test.ts index 4e3e186c1..36c4375b4 100644 --- a/src/components/qr-code/qr-code.test.ts +++ b/src/components/qr-code/qr-code.test.ts @@ -49,7 +49,7 @@ const getColorFromPixel = (colorArray: Uint8ClampedArray, pixelNumber: number): colorArray[startEntryNumber], colorArray[startEntryNumber + 1], colorArray[startEntryNumber + 2], - colorArray[startEntryNumber + 3] + colorArray[startEntryNumber + 3], ); }; @@ -71,7 +71,7 @@ const getQrCodeColors = (qrCode: WaQrCode): QrCodeColors => { } return { foreground: foregroundColor, - background: backgroundColor! + background: backgroundColor!, }; }; @@ -130,7 +130,7 @@ describe('', () => { it('sets the correct background for the qr code', async () => { const qrCode = await fixture( - html` ` + html` `, ); expectQrCodeColorsToBe(qrCode, { foreground: red, background: blue }); diff --git a/src/components/qr-code/qr-code.ts b/src/components/qr-code/qr-code.ts index 25bd1c698..efa181afa 100644 --- a/src/components/qr-code/qr-code.ts +++ b/src/components/qr-code/qr-code.ts @@ -82,9 +82,9 @@ export default class WaQrCode extends WebAwesomeElement { fill: this.fill, background: this.background, // We draw the canvas larger and scale its container down to avoid blurring on high-density displays - size: this.size * 2 + size: this.size * 2, }, - this.canvas + this.canvas, ); this.generated = true; diff --git a/src/components/radio-button/radio-button.test.ts b/src/components/radio-button/radio-button.test.ts index 87a6aca41..972a61a30 100644 --- a/src/components/radio-button/radio-button.test.ts +++ b/src/components/radio-button/radio-button.test.ts @@ -40,7 +40,7 @@ describe('', () => { radioGroup.updateComplete, radio1.updateComplete, radio2.updateComplete, - radio3.updateComplete + radio3.updateComplete, ]); expect(radio1.classList.contains('wa-button-group__button')).to.be.true; diff --git a/src/components/radio-button/radio-button.ts b/src/components/radio-button/radio-button.ts index 869d67615..698c90305 100644 --- a/src/components/radio-button/radio-button.ts +++ b/src/components/radio-button/radio-button.ts @@ -166,7 +166,7 @@ export default class WaRadioButton extends WebAwesomeFormAssociatedElement { 'button--pill': this.pill, 'button--has-label': hasLabel, 'button--has-prefix': hasPrefix, - 'button--has-suffix': hasSuffix + 'button--has-suffix': hasSuffix, })} aria-disabled=${this.disabled} type="button" diff --git a/src/components/radio-group/radio-group.test.ts b/src/components/radio-group/radio-group.test.ts index 16798a96c..a12fc3086 100644 --- a/src/components/radio-group/radio-group.test.ts +++ b/src/components/radio-group/radio-group.test.ts @@ -326,7 +326,7 @@ describe('', () => { const validFocusHandler = sinon.spy(); Array.from(el.querySelectorAll('wa-radio')).forEach(radio => - radio.addEventListener('wa-focus', validFocusHandler) + radio.addEventListener('wa-focus', validFocusHandler), ); expect(validFocusHandler).to.not.have.been.called; diff --git a/src/components/radio-group/radio-group.ts b/src/components/radio-group/radio-group.ts index 48f25816e..ccdf10b0f 100644 --- a/src/components/radio-group/radio-group.ts +++ b/src/components/radio-group/radio-group.ts @@ -52,9 +52,9 @@ export default class WaRadioGroup extends WebAwesomeFormAssociatedElement { required: true, type: 'radio', // we need an id that's guaranteed to be unique; users will never see this - name: uniqueId('__wa-radio') - }) - }) + name: uniqueId('__wa-radio'), + }), + }), ]; return [...super.validators, ...validators]; } @@ -185,7 +185,7 @@ export default class WaRadioGroup extends WebAwesomeFormAssociatedElement { } else { radio.checked = false; } - }) + }), ); this.hasButtonGroup = radios.some(radio => radio.tagName.toLowerCase() === 'wa-radio-button'); @@ -356,7 +356,7 @@ export default class WaRadioGroup extends WebAwesomeFormAssociatedElement { name="hint" part="hint" class=${classMap({ - 'has-slotted': hasHint + 'has-slotted': hasHint, })} aria-hidden=${hasHint ? 'false' : 'true'} >${this.hint} { - this.hasFocus = false; this.dispatchEvent(new WaBlurEvent()); }; private handleFocus = () => { - this.hasFocus = true; this.dispatchEvent(new WaFocusEvent()); }; @@ -124,10 +122,6 @@ export default class WaRadio extends WebAwesomeFormAssociatedElement { radio: true, 'radio--checked': this.checked, 'radio--disabled': this.disabled, - 'radio--focused': this.hasFocus, - 'radio--small': this.size === 'small', - 'radio--medium': this.size === 'medium', - 'radio--large': this.size === 'large' })} > diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 50023e9f9..ff805d56a 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -284,7 +284,7 @@ export default class WaRange extends WebAwesomeFormAssociatedElement { class=${classMap({ 'form-control': true, 'form-control--medium': true, // range only has one size - 'form-control--has-label': hasLabel + 'form-control--has-label': hasLabel, })} >