nav tabs on admin dashboard

This commit is contained in:
2019-03-07 00:20:34 -06:00
parent f73d6ae228
commit e4f473f376
11661 changed files with 216240 additions and 1544253 deletions

View File

@@ -4,33 +4,42 @@
*/
"use strict";
const { OriginalSource, RawSource } = require("webpack-sources");
const Module = require("./Module");
const OriginalSource = require("webpack-sources").OriginalSource;
const RawSource = require("webpack-sources").RawSource;
const WebpackMissingModule = require("./dependencies/WebpackMissingModule");
const DelegatedSourceDependency = require("./dependencies/DelegatedSourceDependency");
const DelegatedExportsDependency = require("./dependencies/DelegatedExportsDependency");
/** @typedef {import("./dependencies/ModuleDependency")} ModuleDependency */
/** @typedef {import("./util/createHash").Hash} Hash */
class DelegatedModule extends Module {
constructor(sourceRequest, data, type, userRequest, originalRequest) {
super();
super("javascript/dynamic", null);
// Info from Factory
this.sourceRequest = sourceRequest;
this.request = data.id;
this.meta = data.meta;
this.type = type;
this.originalRequest = originalRequest;
this.userRequest = userRequest;
this.built = false;
this.delegated = true;
this.originalRequest = originalRequest;
this.delegateData = data;
// Build info
this.delegatedSourceDependency = undefined;
}
libIdent(options) {
return typeof this.originalRequest === "string" ? this.originalRequest : this.originalRequest.libIdent(options);
return typeof this.originalRequest === "string"
? this.originalRequest
: this.originalRequest.libIdent(options);
}
identifier() {
return `delegated ${JSON.stringify(this.request)} from ${this.sourceRequest}`;
return `delegated ${JSON.stringify(this.request)} from ${
this.sourceRequest
}`;
}
readableIdentifier() {
@@ -43,29 +52,32 @@ class DelegatedModule extends Module {
build(options, compilation, resolver, fs, callback) {
this.built = true;
this.builtTime = Date.now();
this.cacheable = true;
this.dependencies.length = 0;
this.addDependency(new DelegatedSourceDependency(this.sourceRequest));
this.addDependency(new DelegatedExportsDependency(this, this.delegateData.exports || true));
this.buildMeta = Object.assign({}, this.delegateData.buildMeta);
this.buildInfo = {};
this.delegatedSourceDependency = new DelegatedSourceDependency(
this.sourceRequest
);
this.addDependency(this.delegatedSourceDependency);
this.addDependency(
new DelegatedExportsDependency(this, this.delegateData.exports || true)
);
callback();
}
unbuild() {
this.built = false;
super.unbuild();
}
source() {
const sourceModule = this.dependencies[0].module;
source(depTemplates, runtime) {
const dep = /** @type {DelegatedSourceDependency} */ (this.dependencies[0]);
const sourceModule = dep.module;
let str;
if(!sourceModule) {
if (!sourceModule) {
str = WebpackMissingModule.moduleCode(this.sourceRequest);
} else {
str = `module.exports = (__webpack_require__(${JSON.stringify(sourceModule.id)}))`;
str = `module.exports = (${runtime.moduleExports({
module: sourceModule,
request: dep.request
})})`;
switch(this.type) {
switch (this.type) {
case "require":
str += `(${JSON.stringify(this.request)})`;
break;
@@ -77,7 +89,7 @@ class DelegatedModule extends Module {
str += ";";
}
if(this.useSourceMap) {
if (this.useSourceMap) {
return new OriginalSource(str, this.identifier());
} else {
return new RawSource(str);
@@ -88,6 +100,10 @@ class DelegatedModule extends Module {
return 42;
}
/**
* @param {Hash} hash the hash used to track dependencies
* @returns {void}
*/
updateHash(hash) {
hash.update(this.type);
hash.update(JSON.stringify(this.request));