This commit is contained in:
darenhsu
2022-07-17 13:16:16 +08:00
parent 84759556ff
commit befd344ab0
28070 changed files with 4008428 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
// Preset
import { preset as Preset } from '../../presets/default'; // Utilities
import { consoleWarn } from '../../util/console';
import { mergeDeep } from '../../util/helpers';
import { Service } from '../service';
export class Presets extends Service {
constructor(parentPreset, parent) {
super(); // The default preset
const defaultPreset = mergeDeep({}, Preset); // The user provided preset
const {
userPreset
} = parent; // The user provided global preset
const {
preset: globalPreset = {},
...preset
} = userPreset;
if (globalPreset.preset != null) {
consoleWarn('Global presets do not support the **preset** option, it can be safely omitted');
}
parent.preset = mergeDeep(mergeDeep(defaultPreset, globalPreset), preset);
}
}
Presets.property = 'presets';
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/services/presets/index.ts"],"names":[],"mappings":"AAAA;AACA,SAAS,MAAM,IAAI,MAAnB,QAAiC,uBAAjC,C,CAEA;;AACA,SAAS,WAAT,QAA4B,oBAA5B;AACA,SAAS,SAAT,QAA0B,oBAA1B;AAIA,SAAS,OAAT,QAAwB,YAAxB;AAMA,OAAM,MAAO,OAAP,SAAuB,OAAvB,CAA8B;AAGlC,EAAA,WAAA,CACE,YADF,EAEE,MAFF,EAEwC;AAEtC,YAFsC,CAItC;;AACA,UAAM,aAAa,GAAG,SAAS,CAAC,EAAD,EAAK,MAAL,CAA/B,CALsC,CAMtC;;AACA,UAAM;AAAE,MAAA;AAAF,QAAiB,MAAvB,CAPsC,CAQtC;;AACA,UAAM;AACJ,MAAA,MAAM,EAAE,YAAY,GAAG,EADnB;AAEJ,SAAG;AAFC,QAGF,UAHJ;;AAKA,QAAI,YAAY,CAAC,MAAb,IAAuB,IAA3B,EAAiC;AAC/B,MAAA,WAAW,CAAC,+EAAD,CAAX;AACD;;AAED,IAAA,MAAM,CAAC,MAAP,GAAgB,SAAS,CACvB,SAAS,CAAC,aAAD,EAAgB,YAAhB,CADc,EAEvB,MAFuB,CAAzB;AAID;;AA3BiC;AAC3B,OAAA,CAAA,QAAA,GAAsB,SAAtB","sourcesContent":["// Preset\nimport { preset as Preset } from '../../presets/default'\n\n// Utilities\nimport { consoleWarn } from '../../util/console'\nimport { mergeDeep } from '../../util/helpers'\n\n// Types\nimport Framework from 'vuetify/types'\nimport { Service } from '../service'\nimport {\n UserVuetifyPreset,\n VuetifyPreset,\n} from 'vuetify/types/services/presets'\n\nexport class Presets extends Service {\n static property: 'presets' = 'presets'\n\n constructor (\n parentPreset: Partial<UserVuetifyPreset>,\n parent: InstanceType<typeof Framework>,\n ) {\n super()\n\n // The default preset\n const defaultPreset = mergeDeep({}, Preset)\n // The user provided preset\n const { userPreset } = parent\n // The user provided global preset\n const {\n preset: globalPreset = {},\n ...preset\n } = userPreset\n\n if (globalPreset.preset != null) {\n consoleWarn('Global presets do not support the **preset** option, it can be safely omitted')\n }\n\n parent.preset = mergeDeep(\n mergeDeep(defaultPreset, globalPreset),\n preset\n ) as VuetifyPreset\n }\n}\n"],"sourceRoot":"","file":"index.js"}