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/theming/CustomStyle.ts"],
"sourcesContent": ["import { reRenderAllUI5Elements } from \"../Render.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport EventProvider from \"../EventProvider.js\";\n\ntype CustomCSSChangeCallback = (tag: string) => void;\n\nconst getEventProvider = () => getSharedResource(\"CustomStyle.eventProvider\", new EventProvider());\nconst CUSTOM_CSS_CHANGE = \"CustomCSSChange\";\n\nconst attachCustomCSSChange = (listener: CustomCSSChangeCallback) => {\n\tgetEventProvider().attachEvent(CUSTOM_CSS_CHANGE, listener);\n};\n\nconst detachCustomCSSChange = (listener: CustomCSSChangeCallback) => {\n\tgetEventProvider().detachEvent(CUSTOM_CSS_CHANGE, listener);\n};\n\nconst fireCustomCSSChange = (tag: string) => {\n\treturn getEventProvider().fireEvent(CUSTOM_CSS_CHANGE, tag);\n};\n\nconst getCustomCSSFor = () => getSharedResource>>(\"CustomStyle.customCSSFor\", {});\n\n// Listen to the eventProvider, in case other copies of this CustomStyle module fire this\n// event, and this copy would therefore need to reRender the ui5 webcomponents; but\n// don't reRender if it was this copy that fired the event to begin with.\nlet skipRerender: boolean;\nattachCustomCSSChange((tag: string) => {\n\tif (!skipRerender) {\n\t\treRenderAllUI5Elements({ tag });\n\t}\n});\n\nconst addCustomCSS = (tag: string, css: string) => {\n\tconst customCSSFor = getCustomCSSFor();\n\tif (!customCSSFor[tag]) {\n\t\tcustomCSSFor[tag] = [];\n\t}\n\tcustomCSSFor[tag].push(css);\n\n\tskipRerender = true;\n\ttry {\n\t\t// The event is fired and the attached event listeners are all called synchronously\n\t\t// The skipRerender flag will be used to avoid calling reRenderAllUI5Elements twice when it is this copy\n\t\t// of CustomStyle.js which is firing the `CustomCSSChange` event.\n\t\tfireCustomCSSChange(tag);\n\t} finally {\n\t\tskipRerender = false;\n\t}\n\n\treturn reRenderAllUI5Elements({ tag });\n};\n\nconst getCustomCSS = (tag: string) => {\n\tconst customCSSFor = getCustomCSSFor();\n\treturn customCSSFor[tag] ? customCSSFor[tag].join(\"\") : \"\";\n};\n\nexport {\n\taddCustomCSS,\n\tgetCustomCSS,\n\tattachCustomCSSChange,\n\tdetachCustomCSSChange,\n};\n"],
"mappings": "aAAA,OAAS,0BAAAA,MAA8B,eACvC,OAAOC,MAAuB,0BAC9B,OAAOC,MAAmB,sBAI1B,MAAMC,EAAmB,IAAMF,EAAkB,4BAA6B,IAAIC,CAA6B,EACzGE,EAAoB,kBAEpBC,EAAyBC,GAAsC,CACpEH,EAAiB,EAAE,YAAYC,EAAmBE,CAAQ,CAC3D,EAEMC,EAAyBD,GAAsC,CACpEH,EAAiB,EAAE,YAAYC,EAAmBE,CAAQ,CAC3D,EAEME,EAAuBC,GACrBN,EAAiB,EAAE,UAAUC,EAAmBK,CAAG,EAGrDC,EAAkB,IAAMT,EAAiD,2BAA4B,CAAC,CAAC,EAK7G,IAAIU,EACJN,EAAuBI,GAAgB,CACjCE,GACJX,EAAuB,CAAE,IAAAS,CAAI,CAAC,CAEhC,CAAC,EAED,MAAMG,EAAe,CAACH,EAAaI,IAAgB,CAClD,MAAMC,EAAeJ,EAAgB,EAChCI,EAAaL,CAAG,IACpBK,EAAaL,CAAG,EAAI,CAAC,GAEtBK,EAAaL,CAAG,EAAE,KAAKI,CAAG,EAE1BF,EAAe,GACf,GAAI,CAIHH,EAAoBC,CAAG,CACxB,QAAE,CACDE,EAAe,EAChB,CAEA,OAAOX,EAAuB,CAAE,IAAAS,CAAI,CAAC,CACtC,EAEMM,EAAgBN,GAAgB,CACrC,MAAMK,EAAeJ,EAAgB,EACrC,OAAOI,EAAaL,CAAG,EAAIK,EAAaL,CAAG,EAAE,KAAK,EAAE,EAAI,EACzD,EAEA,OACCG,KAAA,aACAG,KAAA,aACAV,KAAA,sBACAE,KAAA",
"names": ["reRenderAllUI5Elements", "getSharedResource", "EventProvider", "getEventProvider", "CUSTOM_CSS_CHANGE", "attachCustomCSSChange", "listener", "detachCustomCSSChange", "fireCustomCSSChange", "tag", "getCustomCSSFor", "skipRerender", "addCustomCSS", "css", "customCSSFor", "getCustomCSS"]
}