vuetify eingebunden + erster Versuch Combobox
This commit is contained in:
1 parent
24642ca1a8
commit
56f4a3f940
1846 files changed
+219701
-53848
No files matched your search
+107
@@ -0,0 +1,107 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _theme = require('../../../util/theme');
|
||||
|
||||
var Theme = _interopRequireWildcard(_theme);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
exports.default = {
|
||||
data: function data() {
|
||||
return {
|
||||
style: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
parsedTheme: function parsedTheme() {
|
||||
return Theme.parse(this.$vuetify.theme);
|
||||
},
|
||||
|
||||
/** @return string */
|
||||
generatedStyles: function generatedStyles() {
|
||||
var theme = this.parsedTheme;
|
||||
var css = void 0;
|
||||
if (this.$vuetify.options.themeCache != null) {
|
||||
css = this.$vuetify.options.themeCache.get(theme);
|
||||
if (css != null) return css;
|
||||
}
|
||||
css = Theme.genStyles(theme, this.$vuetify.options.customProperties);
|
||||
if (this.$vuetify.options.minifyTheme != null) {
|
||||
css = this.$vuetify.options.minifyTheme(css);
|
||||
}
|
||||
if (this.$vuetify.options.themeCache != null) {
|
||||
this.$vuetify.options.themeCache.set(theme, css);
|
||||
}
|
||||
return css;
|
||||
},
|
||||
vueMeta: function vueMeta() {
|
||||
if (this.$vuetify.theme === false) return {};
|
||||
var options = {
|
||||
cssText: this.generatedStyles,
|
||||
id: 'vuetify-theme-stylesheet',
|
||||
type: 'text/css'
|
||||
};
|
||||
if (this.$vuetify.options.cspNonce) {
|
||||
options.nonce = this.$vuetify.options.cspNonce;
|
||||
}
|
||||
return {
|
||||
style: [options]
|
||||
};
|
||||
}
|
||||
},
|
||||
// Regular vue-meta
|
||||
metaInfo: function metaInfo() {
|
||||
return this.vueMeta;
|
||||
},
|
||||
|
||||
// Nuxt
|
||||
head: function head() {
|
||||
return this.vueMeta;
|
||||
},
|
||||
|
||||
watch: {
|
||||
generatedStyles: function generatedStyles() {
|
||||
!this.meta && this.applyTheme();
|
||||
}
|
||||
},
|
||||
created: function created() {
|
||||
if (this.$vuetify.theme === false) return;
|
||||
if (this.$meta) {
|
||||
// Vue-meta
|
||||
// Handled by metaInfo()/nuxt()
|
||||
} else if (typeof document === 'undefined' && this.$ssrContext) {
|
||||
// SSR
|
||||
var nonce = this.$vuetify.options.cspNonce ? ' nonce="' + this.$vuetify.options.cspNonce + '"' : '';
|
||||
this.$ssrContext.head = this.$ssrContext.head || '';
|
||||
this.$ssrContext.head += '<style type="text/css" id="vuetify-theme-stylesheet"' + nonce + '>' + this.generatedStyles + '</style>';
|
||||
} else if (typeof document !== 'undefined') {
|
||||
// Client-side
|
||||
this.genStyle();
|
||||
this.applyTheme();
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
applyTheme: function applyTheme() {
|
||||
if (this.style) this.style.innerHTML = this.generatedStyles;
|
||||
},
|
||||
genStyle: function genStyle() {
|
||||
var style = document.getElementById('vuetify-theme-stylesheet');
|
||||
if (!style) {
|
||||
style = document.createElement('style');
|
||||
style.type = 'text/css';
|
||||
style.id = 'vuetify-theme-stylesheet';
|
||||
if (this.$vuetify.options.cspNonce) {
|
||||
style.setAttribute('nonce', this.$vuetify.options.cspNonce);
|
||||
}
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
this.style = style;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=app-theme.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../src/components/VApp/mixins/app-theme.js"],"names":[],"mappings":";;;;;;;;IAAY,K;;;;kBAEG;AACb,UAAM;AAAA,eAAO;AACX,mBAAO;AADI,SAAP;AAAA,KADO;AAKb,cAAU;AACR,mBADQ,yBACG;AACT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BAAS,IAAT,CAAc,WAAd,CAA0B,KAA1B;AACD;AAED,iBAAK,KAAL,GAAa,KAAb;AACD;AAlBM;AAtFI,C","sourcesContent":["import * as Theme from '../../../util/theme'\n\nexport default {\n data: () => ({\n style: null\n }),\n\n computed: {\n parsedTheme () {\n return Theme.parse(this.$vuetify.theme)\n },\n /** @return string */\n generatedStyles () {\n const theme = this.parsedTheme\n let css\n\n if (this.$vuetify.options.themeCache != null) {\n css = this.$vuetify.options.themeCache.get(theme)\n if (css != null) return css\n }\n\n css = Theme.genStyles(theme, this.$vuetify.options.customProperties)\n\n if (this.$vuetify.options.minifyTheme != null) {\n css = this.$vuetify.options.minifyTheme(css)\n }\n\n if (this.$vuetify.options.themeCache != null) {\n this.$vuetify.options.themeCache.set(theme, css)\n }\n\n return css\n },\n vueMeta () {\n if (this.$vuetify.theme === false) return {}\n\n const options = {\n cssText: this.generatedStyles,\n id: 'vuetify-theme-stylesheet',\n type: 'text/css'\n }\n\n if (this.$vuetify.options.cspNonce) {\n options.nonce = this.$vuetify.options.cspNonce\n }\n\n return {\n style: [options]\n }\n }\n },\n\n // Regular vue-meta\n metaInfo () {\n return this.vueMeta\n },\n\n // Nuxt\n head () {\n return this.vueMeta\n },\n\n watch: {\n generatedStyles () {\n !this.meta && this.applyTheme()\n }\n },\n\n created () {\n if (this.$vuetify.theme === false) return\n\n if (this.$meta) {\n // Vue-meta\n // Handled by metaInfo()/nuxt()\n } else if (typeof document === 'undefined' && this.$ssrContext) {\n // SSR\n const nonce = this.$vuetify.options.cspNonce\n ? ` nonce=\"${this.$vuetify.options.cspNonce}\"`\n : ''\n this.$ssrContext.head = this.$ssrContext.head || ''\n this.$ssrContext.head += `<style type=\"text/css\" id=\"vuetify-theme-stylesheet\"${nonce}>${this.generatedStyles}</style>`\n } else if (typeof document !== 'undefined') {\n // Client-side\n this.genStyle()\n this.applyTheme()\n }\n },\n\n methods: {\n applyTheme () {\n if (this.style) this.style.innerHTML = this.generatedStyles\n },\n genStyle () {\n let style = document.getElementById('vuetify-theme-stylesheet')\n\n if (!style) {\n style = document.createElement('style')\n style.type = 'text/css'\n style.id = 'vuetify-theme-stylesheet'\n if (this.$vuetify.options.cspNonce) {\n style.setAttribute('nonce', this.$vuetify.options.cspNonce)\n Line truncated
|
||||
Reference in new issue
Block a user