app模板、应用模板、组件模板、widget模板
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

635 lines
19 KiB

4 years ago
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 527);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 159:
  90. /***/ (function(module, exports) {
  91. module.exports = require("tis-ui/lib/utils/after-leave");
  92. /***/ }),
  93. /***/ 2:
  94. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95. "use strict";
  96. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  97. /* globals __VUE_SSR_CONTEXT__ */
  98. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  99. // This module is a runtime utility for cleaner component module output and will
  100. // be included in the final webpack user bundle.
  101. function normalizeComponent (
  102. scriptExports,
  103. render,
  104. staticRenderFns,
  105. functionalTemplate,
  106. injectStyles,
  107. scopeId,
  108. moduleIdentifier, /* server only */
  109. shadowMode /* vue-cli only */
  110. ) {
  111. // Vue.extend constructor export interop
  112. var options = typeof scriptExports === 'function'
  113. ? scriptExports.options
  114. : scriptExports
  115. // render functions
  116. if (render) {
  117. options.render = render
  118. options.staticRenderFns = staticRenderFns
  119. options._compiled = true
  120. }
  121. // functional template
  122. if (functionalTemplate) {
  123. options.functional = true
  124. }
  125. // scopedId
  126. if (scopeId) {
  127. options._scopeId = 'data-v-' + scopeId
  128. }
  129. var hook
  130. if (moduleIdentifier) { // server build
  131. hook = function (context) {
  132. // 2.3 injection
  133. context =
  134. context || // cached call
  135. (this.$vnode && this.$vnode.ssrContext) || // stateful
  136. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  137. // 2.2 with runInNewContext: true
  138. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  139. context = __VUE_SSR_CONTEXT__
  140. }
  141. // inject component styles
  142. if (injectStyles) {
  143. injectStyles.call(this, context)
  144. }
  145. // register component module identifier for async chunk inferrence
  146. if (context && context._registeredComponents) {
  147. context._registeredComponents.add(moduleIdentifier)
  148. }
  149. }
  150. // used by ssr in case component is cached and beforeCreate
  151. // never gets called
  152. options._ssrRegister = hook
  153. } else if (injectStyles) {
  154. hook = shadowMode
  155. ? function () {
  156. injectStyles.call(
  157. this,
  158. (options.functional ? this.parent : this).$root.$options.shadowRoot
  159. )
  160. }
  161. : injectStyles
  162. }
  163. if (hook) {
  164. if (options.functional) {
  165. // for template-only hot-reload because in that case the render fn doesn't
  166. // go through the normalizer
  167. options._injectStyles = hook
  168. // register for functional component in vue file
  169. var originalRender = options.render
  170. options.render = function renderWithStyleInjection (h, context) {
  171. hook.call(context)
  172. return originalRender(h, context)
  173. }
  174. } else {
  175. // inject component registration as beforeCreate hook
  176. var existing = options.beforeCreate
  177. options.beforeCreate = existing
  178. ? [].concat(existing, hook)
  179. : [hook]
  180. }
  181. }
  182. return {
  183. exports: scriptExports,
  184. options: options
  185. }
  186. }
  187. /***/ }),
  188. /***/ 33:
  189. /***/ (function(module, exports) {
  190. module.exports = require("tis-ui/lib/utils/merge");
  191. /***/ }),
  192. /***/ 4:
  193. /***/ (function(module, exports) {
  194. module.exports = require("vue");
  195. /***/ }),
  196. /***/ 527:
  197. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  198. "use strict";
  199. // ESM COMPAT FLAG
  200. __webpack_require__.r(__webpack_exports__);
  201. // EXTERNAL MODULE: external "vue"
  202. var external_vue_ = __webpack_require__(4);
  203. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  204. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/loading/src/loading.vue?vue&type=template&id=eee0a7ac&
  205. var render = function() {
  206. var _vm = this
  207. var _h = _vm.$createElement
  208. var _c = _vm._self._c || _h
  209. return _c(
  210. "transition",
  211. {
  212. attrs: { name: "el-loading-fade" },
  213. on: { "after-leave": _vm.handleAfterLeave }
  214. },
  215. [
  216. _c(
  217. "div",
  218. {
  219. directives: [
  220. {
  221. name: "show",
  222. rawName: "v-show",
  223. value: _vm.visible,
  224. expression: "visible"
  225. }
  226. ],
  227. staticClass: "el-loading-mask",
  228. class: [_vm.customClass, { "is-fullscreen": _vm.fullscreen }],
  229. style: { backgroundColor: _vm.background || "" }
  230. },
  231. [
  232. _c("div", { staticClass: "el-loading-spinner" }, [
  233. !_vm.spinner
  234. ? _c(
  235. "svg",
  236. {
  237. staticClass: "circular",
  238. attrs: { viewBox: "25 25 50 50" }
  239. },
  240. [
  241. _c("circle", {
  242. staticClass: "path",
  243. attrs: { cx: "50", cy: "50", r: "20", fill: "none" }
  244. })
  245. ]
  246. )
  247. : _c("i", { class: _vm.spinner }),
  248. _vm.text
  249. ? _c("p", { staticClass: "el-loading-text" }, [
  250. _vm._v(_vm._s(_vm.text))
  251. ])
  252. : _vm._e()
  253. ])
  254. ]
  255. )
  256. ]
  257. )
  258. }
  259. var staticRenderFns = []
  260. render._withStripped = true
  261. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=template&id=eee0a7ac&
  262. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/loading/src/loading.vue?vue&type=script&lang=js&
  263. //
  264. //
  265. //
  266. //
  267. //
  268. //
  269. //
  270. //
  271. //
  272. //
  273. //
  274. //
  275. //
  276. //
  277. //
  278. //
  279. //
  280. //
  281. /* harmony default export */ var loadingvue_type_script_lang_js_ = ({
  282. data: function data() {
  283. return {
  284. text: null,
  285. spinner: null,
  286. background: null,
  287. fullscreen: true,
  288. visible: false,
  289. customClass: ''
  290. };
  291. },
  292. methods: {
  293. handleAfterLeave: function handleAfterLeave() {
  294. this.$emit('after-leave');
  295. },
  296. setText: function setText(text) {
  297. this.text = text;
  298. }
  299. }
  300. });
  301. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=script&lang=js&
  302. /* harmony default export */ var src_loadingvue_type_script_lang_js_ = (loadingvue_type_script_lang_js_);
  303. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  304. var componentNormalizer = __webpack_require__(2);
  305. // CONCATENATED MODULE: ./packages/loading/src/loading.vue
  306. /* normalize component */
  307. var component = Object(componentNormalizer["a" /* default */])(
  308. src_loadingvue_type_script_lang_js_,
  309. render,
  310. staticRenderFns,
  311. false,
  312. null,
  313. null,
  314. null
  315. )
  316. /* hot reload */
  317. if (false) { var api; }
  318. component.options.__file = "packages/loading/src/loading.vue"
  319. /* harmony default export */ var loading = (component.exports);
  320. // EXTERNAL MODULE: external "tis-ui/lib/utils/dom"
  321. var dom_ = __webpack_require__(7);
  322. // EXTERNAL MODULE: external "tis-ui/lib/utils/popup"
  323. var popup_ = __webpack_require__(77);
  324. // EXTERNAL MODULE: external "tis-ui/lib/utils/after-leave"
  325. var after_leave_ = __webpack_require__(159);
  326. var after_leave_default = /*#__PURE__*/__webpack_require__.n(after_leave_);
  327. // CONCATENATED MODULE: ./packages/loading/src/directive.js
  328. var Mask = external_vue_default.a.extend(loading);
  329. var loadingDirective = {};
  330. loadingDirective.install = function (Vue) {
  331. if (Vue.prototype.$isServer) return;
  332. var toggleLoading = function toggleLoading(el, binding) {
  333. if (binding.value) {
  334. Vue.nextTick(function () {
  335. if (binding.modifiers.fullscreen) {
  336. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  337. el.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  338. el.maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  339. Object(dom_["addClass"])(el.mask, 'is-fullscreen');
  340. insertDom(document.body, el, binding);
  341. } else {
  342. Object(dom_["removeClass"])(el.mask, 'is-fullscreen');
  343. if (binding.modifiers.body) {
  344. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  345. ['top', 'left'].forEach(function (property) {
  346. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  347. el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - parseInt(Object(dom_["getStyle"])(document.body, 'margin-' + property), 10) + 'px';
  348. });
  349. ['height', 'width'].forEach(function (property) {
  350. el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
  351. });
  352. insertDom(document.body, el, binding);
  353. } else {
  354. el.originalPosition = Object(dom_["getStyle"])(el, 'position');
  355. insertDom(el, el, binding);
  356. }
  357. }
  358. });
  359. } else {
  360. after_leave_default()(el.instance, function (_) {
  361. if (!el.instance.hiding) return;
  362. el.domVisible = false;
  363. var target = binding.modifiers.fullscreen || binding.modifiers.body ? document.body : el;
  364. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  365. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  366. el.instance.hiding = false;
  367. }, 300, true);
  368. el.instance.visible = false;
  369. el.instance.hiding = true;
  370. }
  371. };
  372. var insertDom = function insertDom(parent, el, binding) {
  373. if (!el.domVisible && Object(dom_["getStyle"])(el, 'display') !== 'none' && Object(dom_["getStyle"])(el, 'visibility') !== 'hidden') {
  374. Object.keys(el.maskStyle).forEach(function (property) {
  375. el.mask.style[property] = el.maskStyle[property];
  376. });
  377. if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed') {
  378. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  379. }
  380. if (binding.modifiers.fullscreen && binding.modifiers.lock) {
  381. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  382. }
  383. el.domVisible = true;
  384. parent.appendChild(el.mask);
  385. Vue.nextTick(function () {
  386. if (el.instance.hiding) {
  387. el.instance.$emit('after-leave');
  388. } else {
  389. el.instance.visible = true;
  390. }
  391. });
  392. el.domInserted = true;
  393. } else if (el.domVisible && el.instance.hiding === true) {
  394. el.instance.visible = true;
  395. el.instance.hiding = false;
  396. }
  397. };
  398. Vue.directive('loading', {
  399. bind: function bind(el, binding, vnode) {
  400. var textExr = el.getAttribute('element-loading-text');
  401. var spinnerExr = el.getAttribute('element-loading-spinner');
  402. var backgroundExr = el.getAttribute('element-loading-background');
  403. var customClassExr = el.getAttribute('element-loading-custom-class');
  404. var vm = vnode.context;
  405. var mask = new Mask({
  406. el: document.createElement('div'),
  407. data: {
  408. text: vm && vm[textExr] || textExr,
  409. spinner: vm && vm[spinnerExr] || spinnerExr,
  410. background: vm && vm[backgroundExr] || backgroundExr,
  411. customClass: vm && vm[customClassExr] || customClassExr,
  412. fullscreen: !!binding.modifiers.fullscreen
  413. }
  414. });
  415. el.instance = mask;
  416. el.mask = mask.$el;
  417. el.maskStyle = {};
  418. binding.value && toggleLoading(el, binding);
  419. },
  420. update: function update(el, binding) {
  421. el.instance.setText(el.getAttribute('element-loading-text'));
  422. if (binding.oldValue !== binding.value) {
  423. toggleLoading(el, binding);
  424. }
  425. },
  426. unbind: function unbind(el, binding) {
  427. if (el.domInserted) {
  428. el.mask && el.mask.parentNode && el.mask.parentNode.removeChild(el.mask);
  429. toggleLoading(el, { value: false, modifiers: binding.modifiers });
  430. }
  431. el.instance && el.instance.$destroy();
  432. }
  433. });
  434. };
  435. /* harmony default export */ var directive = (loadingDirective);
  436. // EXTERNAL MODULE: external "tis-ui/lib/utils/merge"
  437. var merge_ = __webpack_require__(33);
  438. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  439. // CONCATENATED MODULE: ./packages/loading/src/index.js
  440. var LoadingConstructor = external_vue_default.a.extend(loading);
  441. var defaults = {
  442. text: null,
  443. fullscreen: true,
  444. body: false,
  445. lock: false,
  446. customClass: ''
  447. };
  448. var fullscreenLoading = void 0;
  449. LoadingConstructor.prototype.originalPosition = '';
  450. LoadingConstructor.prototype.originalOverflow = '';
  451. LoadingConstructor.prototype.close = function () {
  452. var _this = this;
  453. if (this.fullscreen) {
  454. fullscreenLoading = undefined;
  455. }
  456. after_leave_default()(this, function (_) {
  457. var target = _this.fullscreen || _this.body ? document.body : _this.target;
  458. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  459. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  460. if (_this.$el && _this.$el.parentNode) {
  461. _this.$el.parentNode.removeChild(_this.$el);
  462. }
  463. _this.$destroy();
  464. }, 300);
  465. this.visible = false;
  466. };
  467. var src_addStyle = function addStyle(options, parent, instance) {
  468. var maskStyle = {};
  469. if (options.fullscreen) {
  470. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  471. instance.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  472. maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  473. } else if (options.body) {
  474. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  475. ['top', 'left'].forEach(function (property) {
  476. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  477. maskStyle[property] = options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
  478. });
  479. ['height', 'width'].forEach(function (property) {
  480. maskStyle[property] = options.target.getBoundingClientRect()[property] + 'px';
  481. });
  482. } else {
  483. instance.originalPosition = Object(dom_["getStyle"])(parent, 'position');
  484. }
  485. Object.keys(maskStyle).forEach(function (property) {
  486. instance.$el.style[property] = maskStyle[property];
  487. });
  488. };
  489. var src_Loading = function Loading() {
  490. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  491. if (external_vue_default.a.prototype.$isServer) return;
  492. options = merge_default()({}, defaults, options);
  493. if (typeof options.target === 'string') {
  494. options.target = document.querySelector(options.target);
  495. }
  496. options.target = options.target || document.body;
  497. if (options.target !== document.body) {
  498. options.fullscreen = false;
  499. } else {
  500. options.body = true;
  501. }
  502. if (options.fullscreen && fullscreenLoading) {
  503. return fullscreenLoading;
  504. }
  505. var parent = options.body ? document.body : options.target;
  506. var instance = new LoadingConstructor({
  507. el: document.createElement('div'),
  508. data: options
  509. });
  510. src_addStyle(options, parent, instance);
  511. if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed') {
  512. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  513. }
  514. if (options.fullscreen && options.lock) {
  515. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  516. }
  517. parent.appendChild(instance.$el);
  518. external_vue_default.a.nextTick(function () {
  519. instance.visible = true;
  520. });
  521. if (options.fullscreen) {
  522. fullscreenLoading = instance;
  523. }
  524. return instance;
  525. };
  526. /* harmony default export */ var src = (src_Loading);
  527. // CONCATENATED MODULE: ./packages/loading/index.js
  528. /* harmony default export */ var packages_loading = __webpack_exports__["default"] = ({
  529. install: function install(Vue) {
  530. Vue.use(directive);
  531. Vue.prototype.$loading = src;
  532. },
  533. directive: directive,
  534. service: src
  535. });
  536. /***/ }),
  537. /***/ 7:
  538. /***/ (function(module, exports) {
  539. module.exports = require("tis-ui/lib/utils/dom");
  540. /***/ }),
  541. /***/ 77:
  542. /***/ (function(module, exports) {
  543. module.exports = require("tis-ui/lib/utils/popup");
  544. /***/ })
  545. /******/ });