@spectrum-web-components/base
Version:
The `SpectrumElement` base class as created by mixing `SpectrumMixin` onto `LitElement` adopts `dir` values from the `document` at connection time with a fallback to `lrt`. In a TypeScript context, it also enforces the presence of `this.shadowRoot` on ext
3 lines (2 loc) • 513 B
JavaScript
;export function conditionAttributeWithoutId(t,i,n){const e=t.getAttribute(i);let r=e?e.split(/\s+/):[];r=r.filter(s=>!n.find(o=>s===o)),r.length?t.setAttribute(i,r.join(" ")):t.removeAttribute(i)}export function conditionAttributeWithId(t,i,n){const e=Array.isArray(n)?n:[n],r=t.getAttribute(i),s=r?r.split(/\s+/):[];return e.every(d=>s.indexOf(d)>-1)?()=>{}:(s.push(...e),t.setAttribute(i,s.join(" ")),()=>conditionAttributeWithoutId(t,i,e))}
//# sourceMappingURL=condition-attribute-with-id.js.map