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,"file":"style-map.js","sourceRoot":"","sources":["../../../src/renderer/directives/style-map.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,oBAAoB;AACpB;;;;GAIG;AAEH;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,MAAM,uBAAuB,CAAC;AACxE,MAAM,iBAAkB,SAAQ,SAAS;IACxC,YAAY,QAAQ;QACnB,IAAI,EAAE,CAAC;QACP,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,SAAS;YACvC,QAAQ,CAAC,IAAI,KAAK,OAAO;YACzB,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC9E,MAAM,IAAI,KAAK,CAAC,iEAAiE;gBAChF,6CAA6C,CAAC,CAAC;SAChD;IACF,CAAC;IACD,MAAM,CAAC,SAAS;QACf,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAC/B,IAAI,IAAI,CAAC,wBAAwB,KAAK,SAAS,EAAE;YAChD,IAAI,CAAC,wBAAwB,GAAG,IAAI,GAAG,EAAE,CAAC;YAC1C,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;gBAC7B,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;aACxC;YACD,iCAAiC;SACjC;QACD,0DAA0D;QAC1D,yEAAyE;QACzE,aAAa;QACb,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9C,wDAAwD;YACxD,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE;gBAC5B,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACvB,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;iBAC3B;qBACI;oBACJ,kEAAkE;oBAClE,+GAA+G;oBAC/G,8DAA8D;oBAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;iBACjB;aACD;QACF,CAAC,CAAC,CAAC;QACH,2BAA2B;QAC3B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;YAC7B,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC9B,IAAI,KAAK,IAAI,IAAI,EAAE;gBAClB,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACxC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;oBACvB,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;iBAC/B;qBACI;oBACJ,8DAA8D;oBAC9D,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;iBACpB;aACD;SACD;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC","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"]}