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.

537 lines
14 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 = 533);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 104:
  90. /***/ (function(module, exports) {
  91. module.exports = require("tis-ui/lib/utils/vdom");
  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. /***/ 4:
  189. /***/ (function(module, exports) {
  190. module.exports = require("vue");
  191. /***/ }),
  192. /***/ 533:
  193. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  194. "use strict";
  195. // ESM COMPAT FLAG
  196. __webpack_require__.r(__webpack_exports__);
  197. // EXTERNAL MODULE: external "vue"
  198. var external_vue_ = __webpack_require__(4);
  199. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  200. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=template&id=455b9f60&
  201. var render = function() {
  202. var _vm = this
  203. var _h = _vm.$createElement
  204. var _c = _vm._self._c || _h
  205. return _c(
  206. "transition",
  207. {
  208. attrs: { name: "el-message-fade" },
  209. on: { "after-leave": _vm.handleAfterLeave }
  210. },
  211. [
  212. _c(
  213. "div",
  214. {
  215. directives: [
  216. {
  217. name: "show",
  218. rawName: "v-show",
  219. value: _vm.visible,
  220. expression: "visible"
  221. }
  222. ],
  223. class: [
  224. "el-message",
  225. _vm.type && !_vm.iconClass ? "el-message--" + _vm.type : "",
  226. _vm.center ? "is-center" : "",
  227. _vm.showClose ? "is-closable" : "",
  228. _vm.customClass
  229. ],
  230. style: _vm.positionStyle,
  231. attrs: { role: "alert" },
  232. on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer }
  233. },
  234. [
  235. _vm.iconClass
  236. ? _c("i", { class: _vm.iconClass })
  237. : _c("i", { class: _vm.typeClass }),
  238. _vm._t("default", [
  239. !_vm.dangerouslyUseHTMLString
  240. ? _c("p", { staticClass: "el-message__content" }, [
  241. _vm._v(_vm._s(_vm.message))
  242. ])
  243. : _c("p", {
  244. staticClass: "el-message__content",
  245. domProps: { innerHTML: _vm._s(_vm.message) }
  246. })
  247. ]),
  248. _vm.showClose
  249. ? _c("i", {
  250. staticClass: "el-message__closeBtn el-icon-close",
  251. on: { click: _vm.close }
  252. })
  253. : _vm._e()
  254. ],
  255. 2
  256. )
  257. ]
  258. )
  259. }
  260. var staticRenderFns = []
  261. render._withStripped = true
  262. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=template&id=455b9f60&
  263. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=script&lang=js&
  264. //
  265. //
  266. //
  267. //
  268. //
  269. //
  270. //
  271. //
  272. //
  273. //
  274. //
  275. //
  276. //
  277. //
  278. //
  279. //
  280. //
  281. //
  282. //
  283. //
  284. //
  285. //
  286. //
  287. //
  288. //
  289. //
  290. var typeMap = {
  291. success: 'success',
  292. info: 'info',
  293. warning: 'warning',
  294. error: 'error'
  295. };
  296. /* harmony default export */ var mainvue_type_script_lang_js_ = ({
  297. data: function data() {
  298. return {
  299. visible: false,
  300. message: '',
  301. duration: 3000,
  302. type: 'info',
  303. iconClass: '',
  304. customClass: '',
  305. onClose: null,
  306. showClose: false,
  307. closed: false,
  308. verticalOffset: 20,
  309. timer: null,
  310. dangerouslyUseHTMLString: false,
  311. center: false
  312. };
  313. },
  314. computed: {
  315. typeClass: function typeClass() {
  316. return this.type && !this.iconClass ? 'el-message__icon el-icon-' + typeMap[this.type] : '';
  317. },
  318. positionStyle: function positionStyle() {
  319. return {
  320. 'top': this.verticalOffset + 'px'
  321. };
  322. }
  323. },
  324. watch: {
  325. closed: function closed(newVal) {
  326. if (newVal) {
  327. this.visible = false;
  328. }
  329. }
  330. },
  331. methods: {
  332. handleAfterLeave: function handleAfterLeave() {
  333. this.$destroy(true);
  334. this.$el.parentNode.removeChild(this.$el);
  335. },
  336. close: function close() {
  337. this.closed = true;
  338. if (typeof this.onClose === 'function') {
  339. this.onClose(this);
  340. }
  341. },
  342. clearTimer: function clearTimer() {
  343. clearTimeout(this.timer);
  344. },
  345. startTimer: function startTimer() {
  346. var _this = this;
  347. if (this.duration > 0) {
  348. this.timer = setTimeout(function () {
  349. if (!_this.closed) {
  350. _this.close();
  351. }
  352. }, this.duration);
  353. }
  354. },
  355. keydown: function keydown(e) {
  356. if (e.keyCode === 27) {
  357. // esc关闭消息
  358. if (!this.closed) {
  359. this.close();
  360. }
  361. }
  362. }
  363. },
  364. mounted: function mounted() {
  365. this.startTimer();
  366. document.addEventListener('keydown', this.keydown);
  367. },
  368. beforeDestroy: function beforeDestroy() {
  369. document.removeEventListener('keydown', this.keydown);
  370. }
  371. });
  372. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js&
  373. /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
  374. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  375. var componentNormalizer = __webpack_require__(2);
  376. // CONCATENATED MODULE: ./packages/message/src/main.vue
  377. /* normalize component */
  378. var component = Object(componentNormalizer["a" /* default */])(
  379. src_mainvue_type_script_lang_js_,
  380. render,
  381. staticRenderFns,
  382. false,
  383. null,
  384. null,
  385. null
  386. )
  387. /* hot reload */
  388. if (false) { var api; }
  389. component.options.__file = "packages/message/src/main.vue"
  390. /* harmony default export */ var main = (component.exports);
  391. // EXTERNAL MODULE: external "tis-ui/lib/utils/popup"
  392. var popup_ = __webpack_require__(77);
  393. // EXTERNAL MODULE: external "tis-ui/lib/utils/vdom"
  394. var vdom_ = __webpack_require__(104);
  395. // CONCATENATED MODULE: ./packages/message/src/main.js
  396. var MessageConstructor = external_vue_default.a.extend(main);
  397. var instance = void 0;
  398. var instances = [];
  399. var seed = 1;
  400. var main_Message = function Message(options) {
  401. if (external_vue_default.a.prototype.$isServer) return;
  402. options = options || {};
  403. if (typeof options === 'string') {
  404. options = {
  405. message: options
  406. };
  407. }
  408. var userOnClose = options.onClose;
  409. var id = 'message_' + seed++;
  410. options.onClose = function () {
  411. Message.close(id, userOnClose);
  412. };
  413. instance = new MessageConstructor({
  414. data: options
  415. });
  416. instance.id = id;
  417. if (Object(vdom_["isVNode"])(instance.message)) {
  418. instance.$slots.default = [instance.message];
  419. instance.message = null;
  420. }
  421. instance.$mount();
  422. document.body.appendChild(instance.$el);
  423. var verticalOffset = options.offset || 20;
  424. instances.forEach(function (item) {
  425. verticalOffset += item.$el.offsetHeight + 16;
  426. });
  427. instance.verticalOffset = verticalOffset;
  428. instance.visible = true;
  429. instance.$el.style.zIndex = popup_["PopupManager"].nextZIndex();
  430. instances.push(instance);
  431. return instance;
  432. };
  433. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  434. main_Message[type] = function (options) {
  435. if (typeof options === 'string') {
  436. options = {
  437. message: options
  438. };
  439. }
  440. options.type = type;
  441. return main_Message(options);
  442. };
  443. });
  444. main_Message.close = function (id, userOnClose) {
  445. var len = instances.length;
  446. var index = -1;
  447. var removedHeight = void 0;
  448. for (var i = 0; i < len; i++) {
  449. if (id === instances[i].id) {
  450. removedHeight = instances[i].$el.offsetHeight;
  451. index = i;
  452. if (typeof userOnClose === 'function') {
  453. userOnClose(instances[i]);
  454. }
  455. instances.splice(i, 1);
  456. break;
  457. }
  458. }
  459. if (len <= 1 || index === -1 || index > instances.length - 1) return;
  460. for (var _i = index; _i < len - 1; _i++) {
  461. var dom = instances[_i].$el;
  462. dom.style['top'] = parseInt(dom.style['top'], 10) - removedHeight - 16 + 'px';
  463. }
  464. };
  465. main_Message.closeAll = function () {
  466. for (var i = instances.length - 1; i >= 0; i--) {
  467. instances[i].close();
  468. }
  469. };
  470. /* harmony default export */ var src_main = (main_Message);
  471. // CONCATENATED MODULE: ./packages/message/index.js
  472. /* harmony default export */ var message = __webpack_exports__["default"] = (src_main);
  473. /***/ }),
  474. /***/ 77:
  475. /***/ (function(module, exports) {
  476. module.exports = require("tis-ui/lib/utils/popup");
  477. /***/ })
  478. /******/ });