Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
{
"version": 3,
"sources": ["../../../../src/renderer/directives/style-map.ts"],
"sourcesContent": ["// @ts-nocheck\n/* eslint-disable */\n/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * This is the original style-map.js directive from lit-html 2 with the only difference that \"render\" is not called even for the first rendering (update is used instead)\n */\n\nimport { noChange } from 'lit-html';\nimport { directive, Directive, PartType, } from 'lit-html/directive.js';\nclass StyleMapDirective extends Directive {\n\tconstructor(partInfo) {\n\t\tvar _a;\n\t\tsuper(partInfo);\n\t\tif (partInfo.type !== PartType.ATTRIBUTE ||\n\t\t\tpartInfo.name !== 'style' ||\n\t\t\t((_a = partInfo.strings) === null || _a === void 0 ? void 0 : _a.length) > 2) {\n\t\t\tthrow new Error('The `styleMap` directive must be used in the `style` attribute ' +\n\t\t\t\t'and must be the only part in the attribute.');\n\t\t}\n\t}\n\trender(styleInfo) {\n\t\treturn \"\";\n\t}\n\tupdate(part, [styleInfo]) {\n\t\tconst { style } = part.element;\n\t\tif (this._previousStyleProperties === undefined) {\n\t\t\tthis._previousStyleProperties = new Set();\n\t\t\tfor (const name in styleInfo) {\n\t\t\t\tthis._previousStyleProperties.add(name);\n\t\t\t}\n\t\t\t// return this.render(styleInfo);\n\t\t}\n\t\t// Remove old properties that no longer exist in styleInfo\n\t\t// We use forEach() instead of for-of so that re don't require down-level\n\t\t// iteration.\n\t\tthis._previousStyleProperties.forEach((name) => {\n\t\t\t// If the name isn't in styleInfo or it's null/undefined\n\t\t\tif (styleInfo[name] == null) {\n\t\t\t\tthis._previousStyleProperties.delete(name);\n\t\t\t\tif (name.includes('-')) {\n\t\t\t\t\tstyle.removeProperty(name);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Note reset using empty string (vs null) as IE11 does not always\n\t\t\t\t\t// reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tstyle[name] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t// Add or update properties\n\t\tfor (const name in styleInfo) {\n\t\t\tconst value = styleInfo[name];\n\t\t\tif (value != null) {\n\t\t\t\tthis._previousStyleProperties.add(name);\n\t\t\t\tif (name.includes('-')) {\n\t\t\t\t\tstyle.setProperty(name, value);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\tstyle[name] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn noChange;\n\t}\n}\n\nexport const styleMap = directive(StyleMapDirective);\n"],
"mappings": "aAEA;AAAA;AAAA;AAAA;AAAA,GAUA,OAAS,YAAAA,MAAgB,WACzB,OAAS,aAAAC,EAAW,aAAAC,EAAW,YAAAC,MAAiB,wBAChD,MAAMC,UAA0BF,CAAU,CACzC,YAAYG,EAAU,CACrB,IAAIC,EAEJ,GADA,MAAMD,CAAQ,EACVA,EAAS,OAASF,EAAS,WAC9BE,EAAS,OAAS,WAChBC,EAAKD,EAAS,WAAa,MAAQC,IAAO,OAAS,OAASA,EAAG,QAAU,EAC3E,MAAM,IAAI,MAAM,4GAC8B,CAEhD,CACA,OAAOC,EAAW,CACjB,MAAO,EACR,CACA,OAAOC,EAAM,CAACD,CAAS,EAAG,CACzB,KAAM,CAAE,MAAAE,CAAM,EAAID,EAAK,QACvB,GAAI,KAAK,2BAA6B,OAAW,CAChD,KAAK,yBAA2B,IAAI,IACpC,UAAWE,KAAQH,EAClB,KAAK,yBAAyB,IAAIG,CAAI,CAGxC,CAIA,KAAK,yBAAyB,QAASA,GAAS,CAE3CH,EAAUG,CAAI,GAAK,OACtB,KAAK,yBAAyB,OAAOA,CAAI,EACrCA,EAAK,SAAS,GAAG,EACpBD,EAAM,eAAeC,CAAI,EAMzBD,EAAMC,CAAI,EAAI,GAGjB,CAAC,EAED,UAAWA,KAAQH,EAAW,CAC7B,MAAMI,EAAQJ,EAAUG,CAAI,EACxBC,GAAS,OACZ,KAAK,yBAAyB,IAAID,CAAI,EAClCA,EAAK,SAAS,GAAG,EACpBD,EAAM,YAAYC,EAAMC,CAAK,EAI7BF,EAAMC,CAAI,EAAIC,EAGjB,CACA,OAAOX,CACR,CACD,CAEO,aAAM,SAAWC,EAAUG,CAAiB",
"names": ["noChange", "directive", "Directive", "PartType", "StyleMapDirective", "partInfo", "_a", "styleInfo", "part", "style", "name", "value"]
}