View UI v4 文档辅助

(原iView)隐藏文档中菜单项:Pro、物料

  1. // ==UserScript==
  2. // @name View UI v4 文档辅助
  3. // @version 1.0.4
  4. // @description (原iView)隐藏文档中菜单项:Pro、物料
  5. // @author sakura-flutter
  6. // @namespace https://github.com/sakura-flutter/tampermonkey-scripts
  7. // @license GPL-3.0
  8. // @compatible chrome Latest
  9. // @compatible firefox Latest
  10. // @compatible edge Latest
  11. // @match *://v4.iviewui.com/*
  12. // @grant GM_setValue
  13. // @grant GM_getValue
  14. // @grant GM_addValueChangeListener
  15. // @grant GM_removeValueChangeListener
  16. // @require https://cdn.jsdelivr.net/npm/vue@3/dist/vue.runtime.global.prod.min.js
  17. // ==/UserScript==
  18.  
  19. /******/ (() => { // webpackBootstrap
  20. /******/ "use strict";
  21. /******/ var __webpack_modules__ = ({
  22.  
  23. /***/ 5482:
  24. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  25.  
  26. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  27. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  28. /* harmony export */ });
  29. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8081);
  30. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  31. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3645);
  32. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  33. // Imports
  34.  
  35.  
  36. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  37. // Module
  38. ___CSS_LOADER_EXPORT___.push([module.id, ".skr-button{border:1px solid;border-radius:2px;box-shadow:var(--skr-button-box-shadow);cursor:pointer;line-height:1.5715;transition:var(--skr-button-transition)}.skr-button:hover{filter:brightness(1.15)}.skr-button:focus:not(:focus-visible){outline:0}.skr-button--primary{background-color:var(--skr-primary-color);border-color:var(--skr-primary-color);color:var(--skr-text-inverse-color)}.skr-button--default{background-color:var(--skr-white-color);border-color:var(--skr-border-color);color:var(--skr-text-primary-color)}.skr-button--default:hover{border-color:currentcolor;color:var(--skr-primary-color);filter:brightness(1)}.skr-button--round{border-radius:50%}.skr-button--shadow{box-shadow:var(--skr-box-shadow-normal)}.skr-button--mini{font-size:12px;padding:2px 7px}.skr-button--small{font-size:12px;padding:4px 8px}.skr-button--normal{font-size:14px;padding:4px 15px}.skr-button--large{font-size:15px;padding:10px 20px}", ""]);
  39. // Exports
  40. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  41.  
  42.  
  43. /***/ }),
  44.  
  45. /***/ 8443:
  46. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  47.  
  48. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  49. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  50. /* harmony export */ });
  51. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8081);
  52. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  53. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3645);
  54. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  55. // Imports
  56.  
  57.  
  58. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  59. // Module
  60. ___CSS_LOADER_EXPORT___.push([module.id, ".skr-ripple-container{border-radius:inherit !important;bottom:0;contain:strict;left:0;margin:0 !important;overflow:hidden;padding:0 !important;pointer-events:none !important;position:absolute;right:0;top:0}.skr-ripple{animation:skr-ripple forwards cubic-bezier(0.23, 1, 0.32, 1);background:var(--skr-ripple-color);border-radius:100%;contain:layout;margin:0 !important;padding:0 !important;pointer-events:none;position:absolute;transform:scale(0);transition:opacity 2s cubic-bezier(0.23, 1, 0.32, 1)}@keyframes skr-ripple{to{transform:scale(3)}}", ""]);
  61. // Exports
  62. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  63.  
  64.  
  65. /***/ }),
  66.  
  67. /***/ 8850:
  68. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  69.  
  70. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  71. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  72. /* harmony export */ });
  73. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8081);
  74. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  75. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3645);
  76. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  77. // Imports
  78.  
  79.  
  80. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  81. // Module
  82. ___CSS_LOADER_EXPORT___.push([module.id, ".app-left .ivu-menu .ivu-menu-item[data-visible=hidden]{display:none}", ""]);
  83. // Exports
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  85.  
  86.  
  87. /***/ }),
  88.  
  89. /***/ 848:
  90. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  91.  
  92. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  93. /* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
  94. /* harmony export */ });
  95. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8081);
  96. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  97. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3645);
  98. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  99. // Imports
  100.  
  101.  
  102. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  103. // Module
  104. ___CSS_LOADER_EXPORT___.push([module.id, ":root{--skr-primary-color: #2878ff;--skr-primary-lighten-color: rgb(24 144 255 / 20%);--skr-white-color: #fff;--skr-transition-duration-fast: 0.1s;--skr-transition-duration-normal: 0.3s;--skr-box-shadow-lighten: 0 1px 6px rgb(0 0 0 / 15%);--skr-box-shadow-normal: 0 1px 6px rgb(0 0 0 / 20%);--skr-border-color: #d9d9d9;--skr-text-primary-color: #303133;--skr-text-regular-color: #666;--skr-text-secondary-color: #909399;--skr-text-inverse-color: var(--skr-white-color);--skr-button-transition: all var(--skr-transition-duration-normal);--skr-button-box-shadow: 0 2px 0 rgb(0 0 0 / 4.5%);--skr-ripple-color: rgb(138 218 255 / 20%)}#hide-menu-control-js{bottom:40px;contain:content;left:0;padding:10px 0;position:fixed;z-index:50}#hide-menu-control-js p{writing-mode:vertical-lr}", ""]);
  105. // Exports
  106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  107.  
  108.  
  109. /***/ }),
  110.  
  111. /***/ 3645:
  112. /***/ ((module) => {
  113.  
  114.  
  115.  
  116. /*
  117. MIT License http://www.opensource.org/licenses/mit-license.php
  118. Author Tobias Koppers @sokra
  119. */
  120. module.exports = function (cssWithMappingToString) {
  121. var list = []; // return the list of modules as css string
  122.  
  123. list.toString = function toString() {
  124. return this.map(function (item) {
  125. var content = "";
  126. var needLayer = typeof item[5] !== "undefined";
  127.  
  128. if (item[4]) {
  129. content += "@supports (".concat(item[4], ") {");
  130. }
  131.  
  132. if (item[2]) {
  133. content += "@media ".concat(item[2], " {");
  134. }
  135.  
  136. if (needLayer) {
  137. content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
  138. }
  139.  
  140. content += cssWithMappingToString(item);
  141.  
  142. if (needLayer) {
  143. content += "}";
  144. }
  145.  
  146. if (item[2]) {
  147. content += "}";
  148. }
  149.  
  150. if (item[4]) {
  151. content += "}";
  152. }
  153.  
  154. return content;
  155. }).join("");
  156. }; // import a list of modules into the list
  157.  
  158.  
  159. list.i = function i(modules, media, dedupe, supports, layer) {
  160. if (typeof modules === "string") {
  161. modules = [[null, modules, undefined]];
  162. }
  163.  
  164. var alreadyImportedModules = {};
  165.  
  166. if (dedupe) {
  167. for (var k = 0; k < this.length; k++) {
  168. var id = this[k][0];
  169.  
  170. if (id != null) {
  171. alreadyImportedModules[id] = true;
  172. }
  173. }
  174. }
  175.  
  176. for (var _k = 0; _k < modules.length; _k++) {
  177. var item = [].concat(modules[_k]);
  178.  
  179. if (dedupe && alreadyImportedModules[item[0]]) {
  180. continue;
  181. }
  182.  
  183. if (typeof layer !== "undefined") {
  184. if (typeof item[5] === "undefined") {
  185. item[5] = layer;
  186. } else {
  187. item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
  188. item[5] = layer;
  189. }
  190. }
  191.  
  192. if (media) {
  193. if (!item[2]) {
  194. item[2] = media;
  195. } else {
  196. item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
  197. item[2] = media;
  198. }
  199. }
  200.  
  201. if (supports) {
  202. if (!item[4]) {
  203. item[4] = "".concat(supports);
  204. } else {
  205. item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
  206. item[4] = supports;
  207. }
  208. }
  209.  
  210. list.push(item);
  211. }
  212. };
  213.  
  214. return list;
  215. };
  216.  
  217. /***/ }),
  218.  
  219. /***/ 8081:
  220. /***/ ((module) => {
  221.  
  222.  
  223.  
  224. module.exports = function (i) {
  225. return i[1];
  226. };
  227.  
  228. /***/ }),
  229.  
  230. /***/ 3379:
  231. /***/ ((module) => {
  232.  
  233.  
  234.  
  235. var stylesInDOM = [];
  236.  
  237. function getIndexByIdentifier(identifier) {
  238. var result = -1;
  239.  
  240. for (var i = 0; i < stylesInDOM.length; i++) {
  241. if (stylesInDOM[i].identifier === identifier) {
  242. result = i;
  243. break;
  244. }
  245. }
  246.  
  247. return result;
  248. }
  249.  
  250. function modulesToDom(list, options) {
  251. var idCountMap = {};
  252. var identifiers = [];
  253.  
  254. for (var i = 0; i < list.length; i++) {
  255. var item = list[i];
  256. var id = options.base ? item[0] + options.base : item[0];
  257. var count = idCountMap[id] || 0;
  258. var identifier = "".concat(id, " ").concat(count);
  259. idCountMap[id] = count + 1;
  260. var indexByIdentifier = getIndexByIdentifier(identifier);
  261. var obj = {
  262. css: item[1],
  263. media: item[2],
  264. sourceMap: item[3],
  265. supports: item[4],
  266. layer: item[5]
  267. };
  268.  
  269. if (indexByIdentifier !== -1) {
  270. stylesInDOM[indexByIdentifier].references++;
  271. stylesInDOM[indexByIdentifier].updater(obj);
  272. } else {
  273. var updater = addElementStyle(obj, options);
  274. options.byIndex = i;
  275. stylesInDOM.splice(i, 0, {
  276. identifier: identifier,
  277. updater: updater,
  278. references: 1
  279. });
  280. }
  281.  
  282. identifiers.push(identifier);
  283. }
  284.  
  285. return identifiers;
  286. }
  287.  
  288. function addElementStyle(obj, options) {
  289. var api = options.domAPI(options);
  290. api.update(obj);
  291.  
  292. var updater = function updater(newObj) {
  293. if (newObj) {
  294. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
  295. return;
  296. }
  297.  
  298. api.update(obj = newObj);
  299. } else {
  300. api.remove();
  301. }
  302. };
  303.  
  304. return updater;
  305. }
  306.  
  307. module.exports = function (list, options) {
  308. options = options || {};
  309. list = list || [];
  310. var lastIdentifiers = modulesToDom(list, options);
  311. return function update(newList) {
  312. newList = newList || [];
  313.  
  314. for (var i = 0; i < lastIdentifiers.length; i++) {
  315. var identifier = lastIdentifiers[i];
  316. var index = getIndexByIdentifier(identifier);
  317. stylesInDOM[index].references--;
  318. }
  319.  
  320. var newLastIdentifiers = modulesToDom(newList, options);
  321.  
  322. for (var _i = 0; _i < lastIdentifiers.length; _i++) {
  323. var _identifier = lastIdentifiers[_i];
  324.  
  325. var _index = getIndexByIdentifier(_identifier);
  326.  
  327. if (stylesInDOM[_index].references === 0) {
  328. stylesInDOM[_index].updater();
  329.  
  330. stylesInDOM.splice(_index, 1);
  331. }
  332. }
  333.  
  334. lastIdentifiers = newLastIdentifiers;
  335. };
  336. };
  337.  
  338. /***/ }),
  339.  
  340. /***/ 569:
  341. /***/ ((module) => {
  342.  
  343.  
  344.  
  345. var memo = {};
  346. /* istanbul ignore next */
  347.  
  348. function getTarget(target) {
  349. if (typeof memo[target] === "undefined") {
  350. var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
  351.  
  352. if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
  353. try {
  354. // This will throw an exception if access to iframe is blocked
  355. // due to cross-origin restrictions
  356. styleTarget = styleTarget.contentDocument.head;
  357. } catch (e) {
  358. // istanbul ignore next
  359. styleTarget = null;
  360. }
  361. }
  362.  
  363. memo[target] = styleTarget;
  364. }
  365.  
  366. return memo[target];
  367. }
  368. /* istanbul ignore next */
  369.  
  370.  
  371. function insertBySelector(insert, style) {
  372. var target = getTarget(insert);
  373.  
  374. if (!target) {
  375. throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  376. }
  377.  
  378. target.appendChild(style);
  379. }
  380.  
  381. module.exports = insertBySelector;
  382.  
  383. /***/ }),
  384.  
  385. /***/ 9216:
  386. /***/ ((module) => {
  387.  
  388.  
  389.  
  390. /* istanbul ignore next */
  391. function insertStyleElement(options) {
  392. var element = document.createElement("style");
  393. options.setAttributes(element, options.attributes);
  394. options.insert(element, options.options);
  395. return element;
  396. }
  397.  
  398. module.exports = insertStyleElement;
  399.  
  400. /***/ }),
  401.  
  402. /***/ 3565:
  403. /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
  404.  
  405.  
  406.  
  407. /* istanbul ignore next */
  408. function setAttributesWithoutAttributes(styleElement) {
  409. var nonce = true ? __webpack_require__.nc : 0;
  410.  
  411. if (nonce) {
  412. styleElement.setAttribute("nonce", nonce);
  413. }
  414. }
  415.  
  416. module.exports = setAttributesWithoutAttributes;
  417.  
  418. /***/ }),
  419.  
  420. /***/ 7795:
  421. /***/ ((module) => {
  422.  
  423.  
  424.  
  425. /* istanbul ignore next */
  426. function apply(styleElement, options, obj) {
  427. var css = "";
  428.  
  429. if (obj.supports) {
  430. css += "@supports (".concat(obj.supports, ") {");
  431. }
  432.  
  433. if (obj.media) {
  434. css += "@media ".concat(obj.media, " {");
  435. }
  436.  
  437. var needLayer = typeof obj.layer !== "undefined";
  438.  
  439. if (needLayer) {
  440. css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  441. }
  442.  
  443. css += obj.css;
  444.  
  445. if (needLayer) {
  446. css += "}";
  447. }
  448.  
  449. if (obj.media) {
  450. css += "}";
  451. }
  452.  
  453. if (obj.supports) {
  454. css += "}";
  455. }
  456.  
  457. var sourceMap = obj.sourceMap;
  458.  
  459. if (sourceMap && typeof btoa !== "undefined") {
  460. css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  461. } // For old IE
  462.  
  463. /* istanbul ignore if */
  464.  
  465.  
  466. options.styleTagTransform(css, styleElement, options.options);
  467. }
  468.  
  469. function removeStyleElement(styleElement) {
  470. // istanbul ignore if
  471. if (styleElement.parentNode === null) {
  472. return false;
  473. }
  474.  
  475. styleElement.parentNode.removeChild(styleElement);
  476. }
  477. /* istanbul ignore next */
  478.  
  479.  
  480. function domAPI(options) {
  481. var styleElement = options.insertStyleElement(options);
  482. return {
  483. update: function update(obj) {
  484. apply(styleElement, options, obj);
  485. },
  486. remove: function remove() {
  487. removeStyleElement(styleElement);
  488. }
  489. };
  490. }
  491.  
  492. module.exports = domAPI;
  493.  
  494. /***/ }),
  495.  
  496. /***/ 4589:
  497. /***/ ((module) => {
  498.  
  499.  
  500.  
  501. /* istanbul ignore next */
  502. function styleTagTransform(css, styleElement) {
  503. if (styleElement.styleSheet) {
  504. styleElement.styleSheet.cssText = css;
  505. } else {
  506. while (styleElement.firstChild) {
  507. styleElement.removeChild(styleElement.firstChild);
  508. }
  509.  
  510. styleElement.appendChild(document.createTextNode(css));
  511. }
  512. }
  513.  
  514. module.exports = styleTagTransform;
  515.  
  516. /***/ })
  517.  
  518. /******/ });
  519. /************************************************************************/
  520. /******/ // The module cache
  521. /******/ var __webpack_module_cache__ = {};
  522. /******/
  523. /******/ // The require function
  524. /******/ function __webpack_require__(moduleId) {
  525. /******/ // Check if module is in cache
  526. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  527. /******/ if (cachedModule !== undefined) {
  528. /******/ return cachedModule.exports;
  529. /******/ }
  530. /******/ // Create a new module (and put it into the cache)
  531. /******/ var module = __webpack_module_cache__[moduleId] = {
  532. /******/ id: moduleId,
  533. /******/ // no module.loaded needed
  534. /******/ exports: {}
  535. /******/ };
  536. /******/
  537. /******/ // Execute the module function
  538. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  539. /******/
  540. /******/ // Return the exports of the module
  541. /******/ return module.exports;
  542. /******/ }
  543. /******/
  544. /************************************************************************/
  545. /******/ /* webpack/runtime/compat get default export */
  546. /******/ (() => {
  547. /******/ // getDefaultExport function for compatibility with non-harmony modules
  548. /******/ __webpack_require__.n = (module) => {
  549. /******/ var getter = module && module.__esModule ?
  550. /******/ () => (module['default']) :
  551. /******/ () => (module);
  552. /******/ __webpack_require__.d(getter, { a: getter });
  553. /******/ return getter;
  554. /******/ };
  555. /******/ })();
  556. /******/
  557. /******/ /* webpack/runtime/define property getters */
  558. /******/ (() => {
  559. /******/ // define getter functions for harmony exports
  560. /******/ __webpack_require__.d = (exports, definition) => {
  561. /******/ for(var key in definition) {
  562. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  563. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  564. /******/ }
  565. /******/ }
  566. /******/ };
  567. /******/ })();
  568. /******/
  569. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  570. /******/ (() => {
  571. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  572. /******/ })();
  573. /******/
  574. /******/ /* webpack/runtime/nonce */
  575. /******/ (() => {
  576. /******/ __webpack_require__.nc = undefined;
  577. /******/ })();
  578. /******/
  579. /************************************************************************/
  580. var __webpack_exports__ = {};
  581. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  582. (() => {
  583.  
  584. ;// CONCATENATED MODULE: ./src/utils/log.ts
  585. const isDebug = "production" !== 'production';
  586.  
  587. function warn(...args) {
  588. isDebug && console.warn('%c warn ', 'background: #ffa500; padding: 1px; color: #fff;', ...args);
  589. }
  590.  
  591. function table(...args) {
  592. isDebug && console.table(...args);
  593. }
  594.  
  595.  
  596. ;// CONCATENATED MODULE: ./src/utils/selector.ts
  597. const $ = document.querySelector.bind(document);
  598. const $$ = document.querySelectorAll.bind(document);
  599. ;// CONCATENATED MODULE: external "Vue"
  600. const external_Vue_namespaceObject = Vue;
  601. ;// CONCATENATED MODULE: ./src/utils/mount-component.ts
  602. /*
  603. 引用:https://github.com/youzan/vant/blob/dev/src/utils/mount-component.ts
  604. */
  605.  
  606.  
  607. function append(el) {
  608. document.body ? document.body.appendChild(el) : window.addEventListener('DOMContentLoaded', () => append(el));
  609. }
  610.  
  611. function mountComponent(RootComponent) {
  612. const app = (0,external_Vue_namespaceObject.createApp)(RootComponent);
  613. const root = document.createElement('div');
  614. append(root);
  615. return {
  616. instance: app.mount(root),
  617.  
  618. unmount() {
  619. app.unmount();
  620. document.body.removeChild(root);
  621. }
  622.  
  623. };
  624. }
  625. ;// CONCATENATED MODULE: ./src/composables/use-gm-value.ts
  626.  
  627. /**
  628. * 同 GM_getValue、GM_setValue
  629. */
  630.  
  631. function useGMvalue(name, defaultValue, _options) {
  632. const {
  633. listening,
  634. deep
  635. } = Object.assign({
  636. listening: typeof _options === 'boolean' ? _options : true,
  637. deep: false
  638. }, _options);
  639. const value = (0,external_Vue_namespaceObject.ref)(GM_getValue(name, defaultValue));
  640. (0,external_Vue_namespaceObject.watch)(value, () => {
  641. GM_setValue(name, value.value);
  642. }, {
  643. deep
  644. });
  645.  
  646. if (listening) {
  647. (0,external_Vue_namespaceObject.onUnmounted)(() => {
  648. GM_removeValueChangeListener(id);
  649. });
  650. const id = GM_addValueChangeListener(name, (name, oldVal, newVal) => {
  651. value.value = newVal;
  652. });
  653. }
  654.  
  655. return value;
  656. }
  657. ;// CONCATENATED MODULE: ./src/directives/v-ripple/utils.ts
  658. /**
  659. * 计算一个点离矩形中心点的距离
  660. * @param width 矩形宽
  661. * @param height 矩形高
  662. * @return (left top 在矩形内点的坐标) => {} => () => {} 距离
  663. */
  664. function calcDiagInRect(width, height) {
  665. const halfWidth = width / 2;
  666. const halfHeight = height / 2;
  667. return function (left, top) {
  668. const a = left <= halfWidth ? halfWidth - left : left - halfWidth;
  669. const b = top <= halfHeight ? halfHeight - top : top - halfHeight;
  670. const c = Math.sqrt(a * a + b * b);
  671. return c;
  672. };
  673. }
  674. /**
  675. * 计算当前值离总值中心的位置 越靠近中心值为1,远离中心值为0
  676. * @param value 当前值
  677. * @param extent 总值
  678. * @return 取值 0-1
  679. * @example value:50 extent:100 则计算 50 在 0-100 中的位置返回 1
  680. * value:0 或 100 extent:100 返回 0
  681. */
  682.  
  683. function closeness(value, extent) {
  684. if (!value || !extent) return 0;
  685. const half = extent / 2;
  686. return value <= half ? value / half : 1 - value / extent;
  687. }
  688. // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js
  689. var injectStylesIntoStyleTag = __webpack_require__(3379);
  690. var injectStylesIntoStyleTag_default = /*#__PURE__*/__webpack_require__.n(injectStylesIntoStyleTag);
  691. // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleDomAPI.js
  692. var styleDomAPI = __webpack_require__(7795);
  693. var styleDomAPI_default = /*#__PURE__*/__webpack_require__.n(styleDomAPI);
  694. // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertBySelector.js
  695. var insertBySelector = __webpack_require__(569);
  696. var insertBySelector_default = /*#__PURE__*/__webpack_require__.n(insertBySelector);
  697. // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js
  698. var setAttributesWithoutAttributes = __webpack_require__(3565);
  699. var setAttributesWithoutAttributes_default = /*#__PURE__*/__webpack_require__.n(setAttributesWithoutAttributes);
  700. // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/insertStyleElement.js
  701. var insertStyleElement = __webpack_require__(9216);
  702. var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleElement);
  703. // EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js
  704. var styleTagTransform = __webpack_require__(4589);
  705. var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
  706. // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/directives/v-ripple/index.scss
  707. var v_ripple = __webpack_require__(8443);
  708. ;// CONCATENATED MODULE: ./src/directives/v-ripple/index.scss
  709.  
  710.  
  711. var options = {};
  712.  
  713. options.styleTagTransform = (styleTagTransform_default());
  714. options.setAttributes = (setAttributesWithoutAttributes_default());
  715.  
  716. options.insert = insertBySelector_default().bind(null, "head");
  717. options.domAPI = (styleDomAPI_default());
  718. options.insertStyleElement = (insertStyleElement_default());
  719.  
  720. var update = injectStylesIntoStyleTag_default()(v_ripple/* default */.Z, options);
  721.  
  722.  
  723.  
  724.  
  725. /* harmony default export */ const directives_v_ripple = (v_ripple/* default */.Z && v_ripple/* default.locals */.Z.locals ? v_ripple/* default.locals */.Z.locals : undefined);
  726.  
  727. ;// CONCATENATED MODULE: ./src/directives/v-ripple/index.ts
  728.  
  729.  
  730. const containerClassname = 'skr-ripple-container';
  731. const rippleClassname = 'skr-ripple';
  732. const weakmap = new WeakMap();
  733.  
  734. /**
  735. * 创建容器元素
  736. */
  737. function createRippleContainer() {
  738. const div = document.createElement('div');
  739. div.classList.add(containerClassname);
  740. return div;
  741. }
  742. /**
  743. * 创建涟漪元素
  744. */
  745.  
  746.  
  747. function createRippleEl() {
  748. const span = document.createElement('div');
  749. span.classList.add(rippleClassname);
  750. return span;
  751. }
  752.  
  753. function normalizeOptions(options) {
  754. if (typeof options === 'boolean') {
  755. return {
  756. disabled: !options
  757. };
  758. }
  759.  
  760. return options;
  761. }
  762. /**
  763. * 添加涟漪效果
  764. */
  765.  
  766.  
  767. const addRippleEffect = function (_options = {}) {
  768. let options = normalizeOptions(_options); // 涟漪个数
  769.  
  770. let count = 0;
  771.  
  772. function listener(event) {
  773. if (options.disabled) return;
  774. const currentTarget = event.currentTarget; // 优化: 处理过后不再调用getComputedStyle
  775.  
  776. if (weakmap.get(currentTarget).position === false) {
  777. weakmap.get(currentTarget).position = true; // 注意:会改变当前元素定位方式
  778.  
  779. if (getComputedStyle(currentTarget).position === 'static') {
  780. currentTarget.style.position = 'relative';
  781. }
  782. }
  783.  
  784. const rect = currentTarget.getBoundingClientRect();
  785. const rippleEl = createRippleEl(); // 取元素长的一边作为涟漪的周长
  786.  
  787. const side = Math.max(rect.width, rect.height);
  788. const radius = side / 2; // 鼠标在元素中的坐标
  789.  
  790. const left = event.pageX - rect.left - window.scrollX;
  791. const top = event.pageY - rect.top - window.scrollY; // 选项加入到元素中
  792.  
  793. options.color && (rippleEl.style.background = options.color);
  794. rippleEl.style.width = side + 'px';
  795. rippleEl.style.height = side + 'px'; // 元素定位再各减自身的宽高一半
  796.  
  797. rippleEl.style.top = top - radius + 'px';
  798. rippleEl.style.left = left - radius + 'px'; // 动画在元素中间扩散时基础时长1.5s,当点击范围处于元素边缘时,动画扩散比在元素中间位置要长,所以要加快动画进行
  799.  
  800. const base = 1.5;
  801. const diagonal = calcDiagInRect(rect.width, rect.height)(left, top);
  802. rippleEl.style.animationDuration = base - base * diagonal / side + 's';
  803. let container = currentTarget.querySelector(`.${containerClassname}`);
  804.  
  805. if (!container) {
  806. container = createRippleContainer();
  807. currentTarget.appendChild(container);
  808. }
  809.  
  810. container.appendChild(rippleEl);
  811. count++;
  812.  
  813. const unlisten = (() => {
  814. const leaveEvents = ['mouseup', 'mouseleave'];
  815.  
  816. const listener = () => {
  817. // 为了尽量能看清动画效果,延时一下再进行透明
  818. setTimeout(() => {
  819. rippleEl.style.opacity = '0';
  820. }, 100);
  821. };
  822.  
  823. leaveEvents.forEach(eventname => currentTarget.addEventListener(eventname, listener));
  824. return () => {
  825. leaveEvents.forEach(eventname => currentTarget.removeEventListener(eventname, listener));
  826. };
  827. })(); // 移除涟漪元素
  828.  
  829.  
  830. rippleEl.addEventListener('transitionend', transEvent => {
  831. if (transEvent.propertyName === 'opacity') {
  832. unlisten();
  833. rippleEl.remove(); // 没有涟漪元素时移除容器
  834.  
  835. if (--count <= 0) {
  836. container?.remove();
  837. }
  838. }
  839. });
  840. } // 更新配置项
  841.  
  842.  
  843. function update(newOpts) {
  844. options = Object.assign({}, options, normalizeOptions(newOpts));
  845. }
  846.  
  847. return {
  848. listener,
  849. update
  850. };
  851. };
  852.  
  853. const vRipple = {
  854. mounted(el, binding) {
  855. const {
  856. listener,
  857. update
  858. } = addRippleEffect(binding.value);
  859. weakmap.set(el, {
  860. listener,
  861. update,
  862. // 更新配置项函数
  863. position: false // 是否已经改变了 el 的定位方式
  864.  
  865. });
  866. el.addEventListener('mousedown', listener, false);
  867. },
  868.  
  869. updated(el, binding) {
  870. const val = weakmap.get(el);
  871. val.update(binding.value);
  872. }
  873.  
  874. };
  875. /* harmony default export */ const src_directives_v_ripple = (vRipple);
  876. ;// CONCATENATED MODULE: ./src/directives/index.ts
  877.  
  878.  
  879. // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/button/index.scss
  880. var components_button = __webpack_require__(5482);
  881. ;// CONCATENATED MODULE: ./src/components/button/index.scss
  882.  
  883.  
  884. var button_options = {};
  885.  
  886. button_options.styleTagTransform = (styleTagTransform_default());
  887. button_options.setAttributes = (setAttributesWithoutAttributes_default());
  888.  
  889. button_options.insert = insertBySelector_default().bind(null, "head");
  890. button_options.domAPI = (styleDomAPI_default());
  891. button_options.insertStyleElement = (insertStyleElement_default());
  892.  
  893. var button_update = injectStylesIntoStyleTag_default()(components_button/* default */.Z, button_options);
  894.  
  895.  
  896.  
  897.  
  898. /* harmony default export */ const src_components_button = (components_button/* default */.Z && components_button/* default.locals */.Z.locals ? components_button/* default.locals */.Z.locals : undefined);
  899.  
  900. ;// CONCATENATED MODULE: ./src/components/button/index.tsx
  901.  
  902.  
  903.  
  904.  
  905. const prefixCls = 'skr-button'; // button type 非 default 时覆盖一层白色
  906.  
  907. const rippleColor = 'rgb(255 255 255 / 15%)';
  908. const Button = (0,external_Vue_namespaceObject.defineComponent)({
  909. name: 'SkrButton',
  910. directives: {
  911. ripple: src_directives_v_ripple
  912. },
  913. props: {
  914. type: {
  915. type: String,
  916. validator: value => ['primary', 'info', 'warning', 'danger', 'default'].includes(value),
  917. default: 'default'
  918. },
  919. plain: {
  920. type: Boolean,
  921. default: false
  922. },
  923. round: {
  924. type: Boolean,
  925. default: false
  926. },
  927. shadow: {
  928. type: Boolean,
  929. default: false
  930. },
  931. size: {
  932. type: String,
  933. validator: value => ['mini', 'small', 'normal', 'large'].includes(value),
  934. default: 'normal'
  935. },
  936. // 涟漪效果 object 时参数会透传给 ripple
  937. ripple: {
  938. type: [Boolean, Object],
  939. default: true
  940. }
  941. },
  942.  
  943. setup(props, {
  944. slots
  945. }) {
  946. const rippleOptions = (0,external_Vue_namespaceObject.computed)(() => {
  947. return Object.assign({}, {
  948. color: props.type === 'default' ? undefined : rippleColor
  949. }, typeof props.ripple === 'boolean' ? {
  950. disabled: !props.ripple
  951. } : props.ripple);
  952. });
  953. return () => (0,external_Vue_namespaceObject.withDirectives)((0,external_Vue_namespaceObject.createVNode)("button", {
  954. "class": [prefixCls, `${prefixCls}--${props.type}`, {
  955. [`${prefixCls}--round`]: props.round,
  956. [`${prefixCls}--shadow`]: props.shadow
  957. }, `${prefixCls}--${props.size}`]
  958. }, [slots.default?.()]), [[(0,external_Vue_namespaceObject.resolveDirective)("ripple"), rippleOptions.value]]);
  959. }
  960.  
  961. });
  962. /* harmony default export */ const src_components_button_0 = (Button);
  963. // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/scripts/view-ui/hide.lazy.scss
  964. var hide_lazy = __webpack_require__(8850);
  965. ;// CONCATENATED MODULE: ./src/scripts/view-ui/hide.lazy.scss
  966.  
  967. var exported = {};
  968.  
  969. if (hide_lazy/* default */.Z && hide_lazy/* default.locals */.Z.locals) {
  970. exported.locals = hide_lazy/* default.locals */.Z.locals;
  971. }
  972.  
  973. var refs = 0;
  974. var hide_lazy_update;
  975. var hide_lazy_options = {};
  976.  
  977. hide_lazy_options.styleTagTransform = (styleTagTransform_default());
  978. hide_lazy_options.setAttributes = (setAttributesWithoutAttributes_default());
  979.  
  980. hide_lazy_options.insert = insertBySelector_default().bind(null, "head");
  981. hide_lazy_options.domAPI = (styleDomAPI_default());
  982. hide_lazy_options.insertStyleElement = (insertStyleElement_default());
  983.  
  984. exported.use = function(insertOptions) {
  985. hide_lazy_options.options = insertOptions || {};
  986.  
  987. if (!(refs++)) {
  988. hide_lazy_update = injectStylesIntoStyleTag_default()(hide_lazy/* default */.Z, hide_lazy_options);
  989. }
  990.  
  991. return exported;
  992. };
  993. exported.unuse = function() {
  994. if (refs > 0 && !--refs) {
  995. hide_lazy_update();
  996. hide_lazy_update = null;
  997. }
  998. };
  999.  
  1000.  
  1001.  
  1002.  
  1003. /* harmony default export */ const view_ui_hide_lazy = (exported);
  1004.  
  1005. // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/scripts/view-ui/ui.scss
  1006. var ui = __webpack_require__(848);
  1007. ;// CONCATENATED MODULE: ./src/scripts/view-ui/ui.scss
  1008.  
  1009.  
  1010. var ui_options = {};
  1011.  
  1012. ui_options.styleTagTransform = (styleTagTransform_default());
  1013. ui_options.setAttributes = (setAttributesWithoutAttributes_default());
  1014.  
  1015. ui_options.insert = insertBySelector_default().bind(null, "head");
  1016. ui_options.domAPI = (styleDomAPI_default());
  1017. ui_options.insertStyleElement = (insertStyleElement_default());
  1018.  
  1019. var ui_update = injectStylesIntoStyleTag_default()(ui/* default */.Z, ui_options);
  1020.  
  1021.  
  1022.  
  1023.  
  1024. /* harmony default export */ const view_ui_ui = (ui/* default */.Z && ui/* default.locals */.Z.locals ? ui/* default.locals */.Z.locals : undefined);
  1025.  
  1026. ;// CONCATENATED MODULE: ./src/scripts/view-ui/ui.tsx
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034. mountComponent({
  1035. setup() {
  1036. const hidden = useGMvalue('menu_hidden', false);
  1037. (0,external_Vue_namespaceObject.watchEffect)(() => {
  1038. hidden.value ? view_ui_hide_lazy.use() : view_ui_hide_lazy.unuse();
  1039. });
  1040.  
  1041. function toggle() {
  1042. hidden.value = !hidden.value;
  1043. }
  1044.  
  1045. return () => (0,external_Vue_namespaceObject.createVNode)(src_components_button_0, {
  1046. "id": "hide-menu-control-js",
  1047. "size": "mini",
  1048. "shadow": true,
  1049. "onClick": toggle
  1050. }, {
  1051. default: () => [(0,external_Vue_namespaceObject.createVNode)("p", null, [(0,external_Vue_namespaceObject.createTextVNode)("\u5207\u6362")])]
  1052. });
  1053. }
  1054.  
  1055. });
  1056. ;// CONCATENATED MODULE: ./src/scripts/view-ui/index.ts
  1057.  
  1058.  
  1059.  
  1060.  
  1061. function main() {
  1062. // 物料
  1063. const storeBadge = '.navigate-item-badge-store'; // pro
  1064.  
  1065. const proBadge = '.navigate-item-badge-pro';
  1066. const prefixSelector = '.app-left .ivu-menu ';
  1067. const selector = Array.from([storeBadge, proBadge], item => prefixSelector + item).join();
  1068. const badgeEls = $$(selector);
  1069. warn(selector, badgeEls);
  1070. badgeEls.forEach(el => {
  1071. let {
  1072. parentElement
  1073. } = el;
  1074.  
  1075. while (parentElement) {
  1076. const {
  1077. tagName
  1078. } = parentElement;
  1079.  
  1080. if (tagName === 'A' && parentElement.classList.contains('ivu-menu-item')) {
  1081. // 添加标记
  1082. parentElement.dataset.visible = 'hidden';
  1083. break;
  1084. }
  1085.  
  1086. if (tagName === 'BODY') break;
  1087. parentElement = parentElement.parentElement;
  1088. }
  1089. });
  1090. }
  1091.  
  1092. setTimeout(main, 500);
  1093. })();
  1094.  
  1095. /******/ })()
  1096. ;