This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/es5/services/theme/index.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
11 KiB
Text

{"version":3,"sources":["../../../src/services/theme/index.ts"],"names":[],"mappings":";;;;;;;AAEA;;AAGA;;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQa,K;;;;;AAoCX,mBAAuD;AAAA;;AAAA,QAA1C,OAA0C,uEAAF,EAAE;;AAAA;;AACrD;AAlCK,UAAA,QAAA,GAAW,KAAX;AAMA,UAAA,MAAA,GAAwB;AAC7B,MAAA,KAAK,EAAE;AACL,QAAA,OAAO,EAAE,SADJ;AAEL,QAAA,SAAS,EAAE,SAFN;AAGL,QAAA,MAAM,EAAE,SAHH;AAIL,QAAA,KAAK,EAAE,SAJF;AAKL,QAAA,IAAI,EAAE,SALD;AAML,QAAA,OAAO,EAAE,SANJ;AAOL,QAAA,OAAO,EAAE;AAPJ,OADsB;AAU7B,MAAA,IAAI,EAAE;AACJ,QAAA,OAAO,EAAE,SADL;AAEJ,QAAA,SAAS,EAAE,SAFP;AAGJ,QAAA,MAAM,EAAE,SAHJ;AAIJ,QAAA,KAAK,EAAE,SAJH;AAKJ,QAAA,IAAI,EAAE,SALF;AAMJ,QAAA,OAAO,EAAE,SANL;AAOJ,QAAA,OAAO,EAAE;AAPL;AAVuB,KAAxB;AAqBA,UAAA,QAAA,GAA0B,MAAK,MAA/B;AAEC,UAAA,MAAA,GAAS,IAAT;AAEA,UAAA,WAAA,GAAc,IAAd;;AAIN,QAAI,OAAO,CAAC,OAAZ,EAAqB;AACnB,YAAK,QAAL,GAAgB,IAAhB;AAEA;AACD;;AAED,UAAK,OAAL,qBACK,MAAK,OADV,MAEK,OAAO,CAAC,OAFb;AAKA,UAAK,IAAL,GAAY,OAAO,CAAC,OAAO,CAAC,IAAT,CAAnB;AACA,QAAM,MAAM,GAAG,OAAO,CAAC,MAAR,IAAkB,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nB;AACA;;AACA,UAAM,OAAO,GAAG,KAAK,OAAL,IAAgB,EAAhC;AACA,UAAI,GAAJ;;AAEA,UAAI,OAAO,CAAC,UAAR,IAAsB,IAA1B,EAAgC;AAC9B,QAAA,GAAG,GAAG,OAAO,CAAC,UAAR,CAAmB,GAAnB,CAAuB,KAAvB,CAAN;AACA;;AACA,YAAI,GAAG,IAAI,IAAX,EAAiB,OAAO,GAAP;AAClB;;AAED,MAAA,GAAG,GAAG,UAAU,CAAC,SAAX,CAAqB,KAArB,EAA4B,OAAO,CAAC,gBAApC,CAAN;;AAEA,UAAI,OAAO,CAAC,WAAR,IAAuB,IAA3B,EAAiC;AAC/B,QAAA,GAAG,GAAG,OAAO,CAAC,WAAR,CAAoB,GAApB,CAAN;AACD;;AAED,UAAI,OAAO,CAAC,UAAR,IAAsB,IAA1B,EAAgC;AAC9B,QAAA,OAAO,CAAC,UAAR,CAAmB,GAAnB,CAAuB,KAAvB,EAA8B,GAA9B;AACD;;AAED,aAAO,GAAP;AACD;;;wBAEc;AACb;AACA,UAAM,KAAK,GAAG,KAAK,YAAL,IAAqB,EAAnC;AACA,aAAO,UAAU,CAAC,KAAX,CAAiB,KAAjB,CAAP;AACD;;;;EAvPwB,gB;;;AAClB,KAAA,CAAA,QAAA,GAAW,OAAX","sourcesContent":["/* eslint-disable no-multi-spaces */\n// Extensions\nimport { Service } from '../service'\n\n// Utilities\nimport * as ThemeUtils from './utils'\n\n// Types\nimport Vue from 'vue'\nimport {\n VuetifyParsedTheme,\n VuetifyThemeOptions,\n VuetifyThemes,\n VuetifyThemeVariant,\n} from 'vuetify/types/services/theme'\n\nexport class Theme extends Service {\n static property = 'theme'\n\n public disabled = false\n\n public options: VuetifyThemeOptions['options']\n\n public styleEl?: HTMLStyleElement\n\n public themes: VuetifyThemes = {\n light: {\n primary: '#1976D2', // blue.darken2\n secondary: '#424242', // grey.darken3\n accent: '#82B1FF', // blue.accent1\n error: '#FF5252', // red.accent2\n info: '#2196F3', // blue.base\n success: '#4CAF50', // green.base\n warning: '#FB8C00', // amber.base\n },\n dark: {\n primary: '#2196F3', // blue.base\n secondary: '#424242', // grey.darken3\n accent: '#FF4081', // pink.accent-2\n error: '#FF5252', // red.accent2\n info: '#2196F3', // blue.base\n success: '#4CAF50', // green.base\n warning: '#FB8C00', // amber.base\n },\n }\n\n public defaults: VuetifyThemes = this.themes\n\n private isDark = null as boolean | null\n\n private vueInstance = null as Vue | null\n\n constructor (options: Partial<VuetifyThemeOptions> = {}) {\n super()\n if (options.disable) {\n this.disabled = true\n\n return\n }\n\n this.options = {\n ...this.options,\n ...options.options,\n }\n\n this.dark = Boolean(options.dark)\n const themes = options.themes || {}\n\n this.themes = {\n dark: this.fillVariant(themes.dark, true),\n light: this.fillVariant(themes.light, false),\n }\n }\n\n // When setting css, check for element\n // and apply new values\n set css (val: string) {\n this.checkOrCreateStyleElement() && (this.styleEl!.innerHTML = val)\n }\n\n set dark (val: boolean) {\n const oldDark = this.isDark\n\n this.isDark = val\n // Only apply theme after dark\n // has already been set before\n oldDark != null && this.applyTheme()\n }\n\n get dark () {\n return Boolean(this.isDark)\n }\n\n // Apply current theme default\n // only called on client side\n public applyTheme (): void {\n if (this.disabled) return this.clearCss()\n\n this.css = this.generatedStyles\n }\n\n public clearCss (): void {\n this.css = ''\n }\n\n // Initialize theme for SSR and SPA\n // Attach to ssrContext head or\n // apply new theme to document\n public init (root: Vue, ssrContext?: any): void {\n if (this.disabled) return\n\n const meta = Boolean((root as any).$meta) // TODO: don't import public types from /src\n const ssr = Boolean(ssrContext)\n\n /* istanbul ignore else */\n if (meta) {\n this.initNuxt(root)\n } else if (ssr) {\n this.initSSR(ssrContext)\n }\n\n this.initTheme()\n }\n\n // Allows for you to set target theme\n public setTheme (theme: 'light' | 'dark', value: object) {\n this.themes[theme] = Object.assign(this.themes[theme], value)\n this.applyTheme()\n }\n\n // Reset theme defaults\n public resetThemes () {\n this.themes.light = Object.assign({}, this.defaults.light)\n this.themes.dark = Object.assign({}, this.defaults.dark)\n this.applyTheme()\n }\n\n // Check for existence of style element\n private checkOrCreateStyleElement (): boolean {\n this.styleEl = document.getElementById('vuetify-theme-stylesheet') as HTMLStyleElement\n\n /* istanbul ignore next */\n if (this.styleEl) return true\n\n this.genStyleElement() // If doesn't have it, create it\n\n return Boolean(this.styleEl)\n }\n\n private fillVariant (\n theme: Partial<VuetifyThemeVariant> = {},\n dark: boolean\n ): VuetifyThemeVariant {\n const defaultTheme = this.themes[dark ? 'dark' : 'light']\n\n return Object.assign({},\n defaultTheme,\n theme\n )\n }\n\n // Generate the style element\n // if applicable\n private genStyleElement (): void {\n if (typeof document === 'undefined') return\n\n /* istanbul ignore next */\n const options = this.options || {}\n\n this.styleEl = document.createElement('style')\n this.styleEl.type = 'text/css'\n this.styleEl.id = 'vuetify-theme-stylesheet'\n\n if (options.cspNonce) {\n this.styleEl.setAttribute('nonce', options.cspNonce)\n }\n\n document.head.appendChild(this.styleEl)\n }\n\n private initNuxt (root: Vue) {\n const options = this.options || {}\n root.$children.push(new Vue({\n head: {\n style: [\n {\n cssText: this.generatedStyles,\n type: 'text/css',\n id: 'vuetify-theme-stylesheet',\n nonce: options.cspNonce,\n },\n ],\n },\n } as any))\n }\n\n private initSSR (ssrContext?: any) {\n const options = this.options || {}\n // SSR\n const nonce = options.cspNonce ? ` nonce=\"${options.cspNonce}\"` : ''\n ssrContext.head = ssrContext.head || ''\n ssrContext.head += `<style type=\"text/css\" id=\"vuetify-theme-stylesheet\"${nonce}>${this.generatedStyles}</style>`\n }\n\n private initTheme () {\n // Only watch for reactivity on client side\n if (typeof document === 'undefined') return\n\n // If we get here somehow, ensure\n // existing instance is removed\n if (this.vueInstance) this.vueInstance.$destroy()\n\n // Use Vue instance to track reactivity\n // TODO: Update to use RFC if merged\n // https://github.com/vuejs/rfcs/blob/advanced-reactivity-api/active-rfcs/0000-advanced-reactivity-api.md\n this.vueInstance = new Vue({\n data: { themes: this.themes },\n\n watch: {\n themes: {\n immediate: true,\n deep: true,\n handler: () => this.applyTheme(),\n },\n },\n })\n }\n\n get currentTheme () {\n const target = this.dark ? 'dark' : 'light'\n\n return this.themes[target]\n }\n\n get generatedStyles (): string {\n const theme = this.parsedTheme\n /* istanbul ignore next */\n const options = this.options || {}\n let css\n\n if (options.themeCache != null) {\n css = options.themeCache.get(theme)\n /* istanbul ignore if */\n if (css != null) return css\n }\n\n css = ThemeUtils.genStyles(theme, options.customProperties)\n\n if (options.minifyTheme != null) {\n css = options.minifyTheme(css)\n }\n\n if (options.themeCache != null) {\n options.themeCache.set(theme, css)\n }\n\n return css\n }\n\n get parsedTheme (): VuetifyParsedTheme {\n /* istanbul ignore next */\n const theme = this.currentTheme || {}\n return ThemeUtils.parse(theme)\n }\n}\n"],"sourceRoot":"","file":"index.js"}