finpro
Version:
12 lines (10 loc) • 1.2 kB
JavaScript
import{a as u,b as a,c as l}from"./chunk-7GK5LKBV.js";import{c as o}from"./chunk-GBPY57YZ.js";var c="important",d=" !"+c,m=a(class extends l{constructor(r){var t;if(super(r),r.type!==u.ATTRIBUTE||r.name!=="style"||((t=r.strings)===null||t===void 0?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((t,s)=>{let e=r[s];return e==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(r,[t]){let{style:s}=r.element;if(this.ut===void 0){this.ut=new Set;for(let e in t)this.ut.add(e);return this.render(t)}this.ut.forEach(e=>{t[e]==null&&(this.ut.delete(e),e.includes("-")?s.removeProperty(e):s[e]="")});for(let e in t){let n=t[e];if(n!=null){this.ut.add(e);let i=typeof n=="string"&&n.endsWith(d);e.includes("-")||i?s.setProperty(e,i?n.slice(0,-11):n,i?c:""):s[e]=n}}return o}});export{m as a};
/*! Bundled license information:
lit-html/directives/style-map.js:
(**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*)
*/
//# sourceMappingURL=chunk-7MUSI6WV.js.map