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,61 +4,55 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /* eslint-disable no-multi-assign */
var _ExtractedModule = require('./ExtractedModule');
var _ExtractedModule2 = _interopRequireDefault(_ExtractedModule);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ExtractTextPluginCompilation = function () {
function ExtractTextPluginCompilation() {
_classCallCheck(this, ExtractTextPluginCompilation);
class ExtractTextPluginCompilation {
constructor() {
this.modulesByIdentifier = {};
}
_createClass(ExtractTextPluginCompilation, [{
key: 'addModule',
value: function addModule(identifier, originalModule, source, additionalInformation, sourceMap, prevModules) {
var m = void 0;
if (!this.modulesByIdentifier[identifier]) {
m = this.modulesByIdentifier[identifier] = new _ExtractedModule2.default(identifier, originalModule, source, sourceMap, additionalInformation, prevModules);
} else {
m = this.modulesByIdentifier[identifier];
m.addPrevModules(prevModules);
if (originalModule.index2 < m.getOriginalModule().index2) {
m.setOriginalModule(originalModule);
}
addModule(identifier, originalModule, source, additionalInformation, sourceMap, prevModules) {
let m;
if (!this.modulesByIdentifier[identifier]) {
m = this.modulesByIdentifier[identifier] = new _ExtractedModule2.default(identifier, originalModule, source, sourceMap, additionalInformation, prevModules);
} else {
m = this.modulesByIdentifier[identifier];
m.addPrevModules(prevModules);
if (originalModule.index2 < m.getOriginalModule().index2) {
m.setOriginalModule(originalModule);
}
return m;
}
}, {
key: 'addResultToChunk',
value: function addResultToChunk(identifier, result, originalModule, extractedChunk) {
var _this = this;
if (!Array.isArray(result)) {
result = [[identifier, result]];
}
var counterMap = {};
var prevModules = [];
result.forEach(function (item) {
var c = counterMap[item[0]];
var module = _this.addModule.call(_this, item[0] + (c || ''), originalModule, item[1], item[2], item[3], prevModules.slice());
extractedChunk.addModule(module);
module.addChunk(extractedChunk);
counterMap[item[0]] = (c || 0) + 1;
prevModules.push(module);
}, this);
return m;
}
addResultToChunk(identifier, result, originalModule, extractedChunk) {
if (!Array.isArray(result)) {
result = [[identifier, result]];
}
}]);
return ExtractTextPluginCompilation;
}();
const counterMap = {};
const prevModules = [];
result.forEach(item => {
const c = counterMap[item[0]];
const module = this.addModule.call(this, item[0] + (c || ''), originalModule, item[1], item[2], item[3], prevModules.slice());
extractedChunk.addModule(module);
// extractedChunk.removeModule(originalModule);
module.addChunk(extractedChunk);
counterMap[item[0]] = (c || 0) + 1;
prevModules.push(module);
}, this);
}
} /* eslint-disable
no-multi-assign,
no-param-reassign
*/
exports.default = ExtractTextPluginCompilation;

View File

@@ -4,97 +4,74 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _webpackSources = require('webpack-sources');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ExtractedModule = function () {
function ExtractedModule(identifier, originalModule, source, sourceMap, addtitionalInformation, prevModules) {
_classCallCheck(this, ExtractedModule);
class ExtractedModule {
constructor(identifier, originalModule, source, sourceMap, additionalInformation, prevModules) {
this._identifier = identifier;
this._originalModule = originalModule;
this._source = source;
this._sourceMap = sourceMap;
this._prevModules = prevModules;
this.addtitionalInformation = addtitionalInformation;
this.additionalInformation = additionalInformation;
this.chunks = [];
}
_createClass(ExtractedModule, [{
key: 'getOrder',
value: function getOrder() {
// http://stackoverflow.com/a/14676665/1458162
return (/^@import url/.test(this._source) ? 0 : 1
);
}
}, {
key: 'addChunk',
value: function addChunk(chunk) {
var idx = this.chunks.indexOf(chunk);
if (idx < 0) {
this.chunks.push(chunk);
}
}
}, {
key: 'removeChunk',
value: function removeChunk(chunk) {
var idx = this.chunks.indexOf(chunk);
if (idx >= 0) {
this.chunks.splice(idx, 1);
chunk.removeModule(this);
return true;
}
return false;
}
}, {
key: 'rewriteChunkInReasons',
value: function rewriteChunkInReasons(oldChunk, newChunks) {} // eslint-disable-line
getOrder() {
// http://stackoverflow.com/a/14676665/1458162
return (/^@import url/.test(this._source) ? 0 : 1
);
}
}, {
key: 'identifier',
value: function identifier() {
return this._identifier;
addChunk(chunk) {
const idx = this.chunks.indexOf(chunk);
if (idx < 0) {
this.chunks.push(chunk);
}
}, {
key: 'source',
value: function source() {
if (this._sourceMap) {
return new _webpackSources.SourceMapSource(this._source, null, this._sourceMap);
}
removeChunk(chunk) {
const idx = this.chunks.indexOf(chunk);
if (idx >= 0) {
this.chunks.splice(idx, 1);
chunk.removeModule(this);
return true;
}
return false;
}
rewriteChunkInReasons(oldChunk, newChunks) {} // eslint-disable-line
identifier() {
return this._identifier;
}
source() {
if (this._sourceMap) {
return new _webpackSources.SourceMapSource(this._source, null, this._sourceMap);
}
return new _webpackSources.RawSource(this._source);
}
getOriginalModule() {
return this._originalModule;
}
getPrevModules() {
return this._prevModules;
}
addPrevModules(prevModules) {
prevModules.forEach(m => {
if (this._prevModules.indexOf(m) < 0) {
this._prevModules.push(m);
}
return new _webpackSources.RawSource(this._source);
}
}, {
key: 'getOriginalModule',
value: function getOriginalModule() {
return this._originalModule;
}
}, {
key: 'getPrevModules',
value: function getPrevModules() {
return this._prevModules;
}
}, {
key: 'addPrevModules',
value: function addPrevModules(prevModules) {
var _this = this;
}, this);
}
prevModules.forEach(function (m) {
if (_this._prevModules.indexOf(m) < 0) {
_this._prevModules.push(m);
}
}, this);
}
}, {
key: 'setOriginalModule',
value: function setOriginalModule(originalModule) {
this._originalModule = originalModule;
}
}]);
return ExtractedModule;
}();
setOriginalModule(originalModule) {
this._originalModule = originalModule;
}
}
exports.default = ExtractedModule;

View File

@@ -11,33 +11,80 @@ exports.mergeOptions = mergeOptions;
exports.isString = isString;
exports.isFunction = isFunction;
exports.isType = isType;
/* eslint-disable
no-param-reassign
*/
function isInitialOrHasNoParents(chunk) {
return chunk.isInitial() || chunk.parents.length === 0;
let parentCount = 0;
for (const chunkGroup of chunk.groupsIterable) {
parentCount += chunkGroup.getNumberOfParents();
}
return chunk.isOnlyInitial() || parentCount === 0;
}
function isInvalidOrder(a, b) {
var bBeforeA = a.getPrevModules().indexOf(b) >= 0;
var aBeforeB = b.getPrevModules().indexOf(a) >= 0;
return aBeforeB && bBeforeA;
// Async chunks' modules don't get turned into ExtractedModule
// instances for some reason. This is a temporary fix that
// moves the isInvalidOrder check inside a condition.
if (a.getPrevModules && b.getPrevModules) {
const bBeforeA = a.getPrevModules().indexOf(b) >= 0;
const aBeforeB = b.getPrevModules().indexOf(a) >= 0;
return aBeforeB && bBeforeA;
}
return false;
}
function getOrder(a, b) {
var aOrder = a.getOrder();
var bOrder = b.getOrder();
if (aOrder < bOrder) return -1;
if (aOrder > bOrder) return 1;
var aIndex = a.getOriginalModule().index2;
var bIndex = b.getOriginalModule().index2;
if (aIndex < bIndex) return -1;
if (aIndex > bIndex) return 1;
var bBeforeA = a.getPrevModules().indexOf(b) >= 0;
var aBeforeB = b.getPrevModules().indexOf(a) >= 0;
if (aBeforeB && !bBeforeA) return -1;
if (!aBeforeB && bBeforeA) return 1;
var ai = a.identifier();
var bi = b.identifier();
// Async chunks' modules don't get turned into ExtractedModule
// instances for some reason. This is a temporary fix that
// moves the custom sorting logic inside a condition.
if (a.getOriginalModule && b.getOriginalModule) {
const aOrder = a.getOrder();
const bOrder = b.getOrder();
if (aOrder < bOrder) return -1;
if (aOrder > bOrder) return 1;
// We are trying to use the underlying index2 property
// of the original module, but this property seems
// to be set to null most of the time. It makes
// sorting with it pointless. We should look
// into saving the index, index2 and depth
// props (maybe inside ExtractedModule).
const aIndex = a.getOriginalModule().index2;
const bIndex = b.getOriginalModule().index2;
if (aIndex < bIndex) return -1;
if (aIndex > bIndex) return 1;
const bBeforeA = a.getPrevModules().indexOf(b) >= 0;
const aBeforeB = b.getPrevModules().indexOf(a) >= 0;
if (aBeforeB && !bBeforeA) return -1;
if (!aBeforeB && bBeforeA) return 1;
// Sorting by id is the default behavior of webpack
// and it keeps the modules in the correct order,
// except for async imports. That's the reason
// it is inside the conditional branch
if (a.id < b.id) return -1;
if (a.id > b.id) return 1;
}
// Sorting by identifier breaks the order of async imported
// modules either because webpack sorts them by default,
// or because they are processed in the correct order
// in the first place, or maybe because the modules
// aren't ExtractedModule instances in this case.
// Returning 0 keeps the already correct order.
/*
const ai = a.identifier();
const bi = b.identifier();
if (ai < bi) return -1;
if (ai > bi) return 1;
*/
return 0;
}
@@ -50,7 +97,7 @@ function getLoaderObject(loader) {
function mergeOptions(a, b) {
if (!b) return a;
Object.keys(b).forEach(function (key) {
Object.keys(b).forEach(key => {
a[key] = b[key];
});
return a;