UNPKG

1.3 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":";;;AAAA,mCAA4C;AAG5C,+BAAqC;AAErC,IAAM,YAAY,GAAG,IAAA,kBAAW,EAAC,EAAE,CAAC,CAAC;AAErC,YAAY;AACZ,IAAM,MAAM,GAAgC;IAC1C,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF;;;GAGG;AACH,SAAgB,QAAQ,CAAC,KAAc;IACrC,OAAO,IAAA,UAAG,EAAC,MAAM,EAAE,IAAA,gBAAS,EAAC,KAAK,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACvD,CAAC;AAFD,4BAEC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,KAAa,EAAE,KAAkB;IAC7D,MAAM,CAAC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,GAAG,IAAA,kBAAW,EAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAFD,sCAEC","sourcesContent":["import { get, lowerCase } from '@antv/util';\nimport { LooseObject } from '../interface';\n\nimport { createTheme } from './util';\n\nconst defaultTheme = createTheme({});\n\n// 所有已经存在的主题\nconst Themes: Record<string, LooseObject> = {\n default: defaultTheme,\n};\n\n/**\n * 获取主题配置信息。\n * @param theme 主题名\n */\nexport function getTheme(theme?: string): LooseObject {\n return get(Themes, lowerCase(theme), Themes.default);\n}\n\n/**\n * 注册新的主题配置信息。\n * @param theme 主题名。\n * @param value 具体的主题配置。\n */\nexport function registerTheme(theme: string, value: LooseObject) {\n Themes[lowerCase(theme)] = createTheme(value);\n}\n"]}
\No newline at end of file