Răsfoiți Sursa

增加ant的js文件,UPS那边说有冲突,需要替换mode_modules中的原文件

LeiGuoXian 3 ani în urmă
părinte
comite
46cce90f89

+ 63 - 0
bug-fixed/node_modules/@ant-design/icons-vue/es/insert-css.js

@@ -0,0 +1,63 @@
+// https://github.com/substack/insert-css
+var containers = []; // will store container HTMLElement references
+
+var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
+
+var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
+
+function createStyleElement() {
+  var styleElement = document.createElement('style');
+  styleElement.setAttribute('type', 'text/css');
+  return styleElement;
+} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+
+
+function insertCss(css, options) {
+  options = options || {};
+
+  if (css === undefined) {
+    throw new Error(usage);
+  }
+
+  var position = options.prepend === true ? 'prepend' : 'append';
+  var container = options.container !== undefined ? options.container : document.querySelector('head');
+  var containerId = containers.indexOf(container); // first time we see this container, create the necessary entries
+
+  if (containerId === -1) {
+    containerId = containers.push(container) - 1;
+    styleElements[containerId] = {};
+  } // try to get the correponding container + position styleElement, create it otherwise
+
+
+  var styleElement;
+
+  if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
+    styleElement = styleElements[containerId][position];
+  } else {
+    styleElement = styleElements[containerId][position] = createStyleElement();
+
+    if (position === 'prepend') {
+      // toggled by jack, violate csp
+      //container.insertBefore(styleElement, container.childNodes[0]);
+    } else {
+      container.appendChild(styleElement);
+    }
+  } // strip potential UTF-8 BOM if css was read from a file
+
+
+  if (css.charCodeAt(0) === 0xfeff) {
+    css = css.substr(1, css.length);
+  } // actually add the stylesheet
+
+
+  if (styleElement.styleSheet) {
+    // toggled by jack, violate csp
+    //styleElement.styleSheet.cssText += css;
+  } else {
+    styleElement.textContent += css;
+  }
+
+  return styleElement;
+}
+
+export default insertCss;

+ 70 - 0
bug-fixed/node_modules/@ant-design/icons-vue/lib/insert-css.js

@@ -0,0 +1,70 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+  value: true
+});
+exports["default"] = void 0;
+// https://github.com/substack/insert-css
+var containers = []; // will store container HTMLElement references
+
+var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
+
+var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
+
+function createStyleElement() {
+  var styleElement = document.createElement('style');
+  styleElement.setAttribute('type', 'text/css');
+  return styleElement;
+} // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+
+
+function insertCss(css, options) {
+  options = options || {};
+
+  if (css === undefined) {
+    throw new Error(usage);
+  }
+
+  var position = options.prepend === true ? 'prepend' : 'append';
+  var container = options.container !== undefined ? options.container : document.querySelector('head');
+  var containerId = containers.indexOf(container); // first time we see this container, create the necessary entries
+
+  if (containerId === -1) {
+    containerId = containers.push(container) - 1;
+    styleElements[containerId] = {};
+  } // try to get the correponding container + position styleElement, create it otherwise
+
+
+  var styleElement;
+
+  if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
+    styleElement = styleElements[containerId][position];
+  } else {
+    styleElement = styleElements[containerId][position] = createStyleElement();
+
+    if (position === 'prepend') {
+      // toggled by jack, violate csp
+      //container.insertBefore(styleElement, container.childNodes[0]);
+    } else {
+      container.appendChild(styleElement);
+    }
+  } // strip potential UTF-8 BOM if css was read from a file
+
+
+  if (css.charCodeAt(0) === 0xfeff) {
+    css = css.substr(1, css.length);
+  } // actually add the stylesheet
+
+
+  if (styleElement.styleSheet) {
+    // toggled by jack, violate csp
+    //styleElement.styleSheet.cssText += css;
+  } else {
+    styleElement.textContent += css;
+  }
+
+  return styleElement;
+}
+
+var _default = insertCss;
+exports["default"] = _default;