All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.theming.CustomStyle.js.map Maven / Gradle / Ivy

{"version":3,"file":"CustomStyle.js","sourceRoot":"","sources":["../../src/theming/CustomStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAC;AAIhD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,2BAA2B,EAAE,IAAI,aAAa,EAAgB,CAAC,CAAC;AACjH,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAE5C,MAAM,qBAAqB,GAAG,CAAC,QAAiC,EAAE,EAAE;IACnE,gBAAgB,EAAE,CAAC,WAAW,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,QAAiC,EAAE,EAAE;IACnE,gBAAgB,EAAE,CAAC,WAAW,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,GAAW,EAAE,EAAE;IAC3C,OAAO,gBAAgB,EAAE,CAAC,SAAS,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAgC,0BAA0B,EAAE,EAAE,CAAC,CAAC;AAE/G,yFAAyF;AACzF,mFAAmF;AACnF,yEAAyE;AACzE,IAAI,YAAqB,CAAC;AAC1B,qBAAqB,CAAC,CAAC,GAAW,EAAE,EAAE;IACrC,IAAI,CAAC,YAAY,EAAE;QAClB,sBAAsB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;KAChC;AACF,CAAC,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;IACjD,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE;QACvB,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;KACvB;IACD,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE5B,YAAY,GAAG,IAAI,CAAC;IACpB,IAAI;QACH,mFAAmF;QACnF,wGAAwG;QACxG,iEAAiE;QACjE,mBAAmB,CAAC,GAAG,CAAC,CAAC;KACzB;YAAS;QACT,YAAY,GAAG,KAAK,CAAC;KACrB;IAED,OAAO,sBAAsB,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE;IACpC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC,CAAC;AAEF,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,GACrB,CAAC","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"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy