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

package.dist.asset-registries.util.IconCollectionsByTheme.js.map Maven / Gradle / Ivy

{"version":3,"file":"IconCollectionsByTheme.js","sourceRoot":"","sources":["../../../src/asset-registries/util/IconCollectionsByTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,IAAK,wBAOJ;AAPD,WAAK,wBAAwB;IAC5B,uDAA2B,CAAA;IAC3B,uDAA2B,CAAA;IAC3B,oDAAwB,CAAA;IACxB,oDAAwB,CAAA;IACxB,8DAAkC,CAAA;IAClC,8DAAkC,CAAA;AACnC,CAAC,EAPI,wBAAwB,KAAxB,wBAAwB,QAO5B;AAID,MAAM,eAAe,GAAG,IAAI,GAAG,EAAgC,CAAC;AAChE,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE;IAChC,QAAQ,EAAE,wBAAwB,CAAC,UAAU;IAC7C,aAAa,EAAE,wBAAwB,CAAC,UAAU;CAClD,CAAC,CAAC;AACH,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE;IAC1B,QAAQ,EAAE,wBAAwB,CAAC,aAAa;IAChD,aAAa,EAAE,wBAAwB,CAAC,aAAa;CACrD,CAAC,CAAC;AACH,eAAe,CAAC,GAAG,CAAC,gBAAgB,EAAE;IACrC,QAAQ,EAAE,wBAAwB,CAAC,YAAY;IAC/C,aAAa,EAAE,wBAAwB,CAAC,YAAY;CACpD,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,8BAA8B,GAAG,CAAC,cAAsB,EAAE,kBAAwC,EAAE,EAAE;IAC3G,IAAI,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE;QACxC,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,GAAG,kBAAkB,EAAE,GAAG,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACvG,OAAO;KACP;IACD,eAAe,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;AACzD,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC5D,MAAM,WAAW,GAAG,mBAAmB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC;IACrE,OAAO,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,cAAc,CAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;AACjH,CAAC,CAAC;AAEF,OAAO,EACN,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,GACxB,CAAC","sourcesContent":["import { isLegacyThemeFamily } from \"../../config/Theme.js\";\n\nenum RegisteredIconCollection {\n\tSAPIconsV4 = \"SAP-icons-v4\",\n\tSAPIconsV5 = \"SAP-icons-v5\",\n\tSAPIconsTNTV2 = \"tnt-v2\",\n\tSAPIconsTNTV3 = \"tnt-v3\",\n\tSAPBSIconsV1 = \"business-suite-v1\",\n\tSAPBSIconsV2 = \"business-suite-v2\",\n}\n\ntype ThemeToCollectionMap = {[x: string]: string; };\n\nconst iconCollections = new Map();\niconCollections.set(\"SAP-icons\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsV4,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsV5,\n});\niconCollections.set(\"tnt\", {\n\t\"legacy\": RegisteredIconCollection.SAPIconsTNTV2,\n\t\"sap_horizon\": RegisteredIconCollection.SAPIconsTNTV3,\n});\niconCollections.set(\"business-suite\", {\n\t\"legacy\": RegisteredIconCollection.SAPBSIconsV1,\n\t\"sap_horizon\": RegisteredIconCollection.SAPBSIconsV2,\n});\n\n/**\n * Registers collection version per theme.\n * **For exmaple:** registerIconCollectionForTheme(\"my-custom-icons\", {\"sap_horizon\": \"my-custom-icons-v5\"})\n * @param { string } collectionName\n * @param { ThemeToCollectionMap } themeCollectionMap\n */\nconst registerIconCollectionForTheme = (collectionName: string, themeCollectionMap: ThemeToCollectionMap) => {\n\tif (iconCollections.has(collectionName)) {\n\t\ticonCollections.set(collectionName, { ...themeCollectionMap, ...iconCollections.get(collectionName) });\n\t\treturn;\n\t}\n\ticonCollections.set(collectionName, themeCollectionMap);\n};\n\nconst getIconCollectionForTheme = (collectionName: string) => {\n\tconst themeFamily = isLegacyThemeFamily() ? \"legacy\" : \"sap_horizon\";\n\treturn iconCollections.has(collectionName) ? iconCollections.get(collectionName)![themeFamily] : collectionName;\n};\n\nexport {\n\tregisterIconCollectionForTheme,\n\tgetIconCollectionForTheme,\n\tRegisteredIconCollection,\n};\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy