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.

2137 lines
58 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 = 532);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 104:
  90. /***/ (function(module, exports) {
  91. module.exports = require("tis-ui/lib/utils/vdom");
  92. /***/ }),
  93. /***/ 13:
  94. /***/ (function(module, exports) {
  95. module.exports = require("tis-ui/lib/mixins/emitter");
  96. /***/ }),
  97. /***/ 2:
  98. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99. "use strict";
  100. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  101. /* globals __VUE_SSR_CONTEXT__ */
  102. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  103. // This module is a runtime utility for cleaner component module output and will
  104. // be included in the final webpack user bundle.
  105. function normalizeComponent (
  106. scriptExports,
  107. render,
  108. staticRenderFns,
  109. functionalTemplate,
  110. injectStyles,
  111. scopeId,
  112. moduleIdentifier, /* server only */
  113. shadowMode /* vue-cli only */
  114. ) {
  115. // Vue.extend constructor export interop
  116. var options = typeof scriptExports === 'function'
  117. ? scriptExports.options
  118. : scriptExports
  119. // render functions
  120. if (render) {
  121. options.render = render
  122. options.staticRenderFns = staticRenderFns
  123. options._compiled = true
  124. }
  125. // functional template
  126. if (functionalTemplate) {
  127. options.functional = true
  128. }
  129. // scopedId
  130. if (scopeId) {
  131. options._scopeId = 'data-v-' + scopeId
  132. }
  133. var hook
  134. if (moduleIdentifier) { // server build
  135. hook = function (context) {
  136. // 2.3 injection
  137. context =
  138. context || // cached call
  139. (this.$vnode && this.$vnode.ssrContext) || // stateful
  140. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  141. // 2.2 with runInNewContext: true
  142. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  143. context = __VUE_SSR_CONTEXT__
  144. }
  145. // inject component styles
  146. if (injectStyles) {
  147. injectStyles.call(this, context)
  148. }
  149. // register component module identifier for async chunk inferrence
  150. if (context && context._registeredComponents) {
  151. context._registeredComponents.add(moduleIdentifier)
  152. }
  153. }
  154. // used by ssr in case component is cached and beforeCreate
  155. // never gets called
  156. options._ssrRegister = hook
  157. } else if (injectStyles) {
  158. hook = shadowMode
  159. ? function () {
  160. injectStyles.call(
  161. this,
  162. (options.functional ? this.parent : this).$root.$options.shadowRoot
  163. )
  164. }
  165. : injectStyles
  166. }
  167. if (hook) {
  168. if (options.functional) {
  169. // for template-only hot-reload because in that case the render fn doesn't
  170. // go through the normalizer
  171. options._injectStyles = hook
  172. // register for functional component in vue file
  173. var originalRender = options.render
  174. options.render = function renderWithStyleInjection (h, context) {
  175. hook.call(context)
  176. return originalRender(h, context)
  177. }
  178. } else {
  179. // inject component registration as beforeCreate hook
  180. var existing = options.beforeCreate
  181. options.beforeCreate = existing
  182. ? [].concat(existing, hook)
  183. : [hook]
  184. }
  185. }
  186. return {
  187. exports: scriptExports,
  188. options: options
  189. }
  190. }
  191. /***/ }),
  192. /***/ 247:
  193. /***/ (function(module, exports) {
  194. module.exports = require("tis-ui/lib/utils/aria-dialog");
  195. /***/ }),
  196. /***/ 33:
  197. /***/ (function(module, exports) {
  198. module.exports = require("tis-ui/lib/utils/merge");
  199. /***/ }),
  200. /***/ 36:
  201. /***/ (function(module, exports) {
  202. module.exports = require("tis-ui/lib/mixins/migrating");
  203. /***/ }),
  204. /***/ 38:
  205. /***/ (function(module, exports) {
  206. module.exports = require("tis-ui/lib/mixins/locale");
  207. /***/ }),
  208. /***/ 4:
  209. /***/ (function(module, exports) {
  210. module.exports = require("vue");
  211. /***/ }),
  212. /***/ 49:
  213. /***/ (function(module, exports) {
  214. module.exports = require("tis-ui/lib/utils/shared");
  215. /***/ }),
  216. /***/ 52:
  217. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  218. "use strict";
  219. // ESM COMPAT FLAG
  220. __webpack_require__.r(__webpack_exports__);
  221. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=343dd774&
  222. var render = function() {
  223. var _vm = this
  224. var _h = _vm.$createElement
  225. var _c = _vm._self._c || _h
  226. return _c(
  227. "div",
  228. {
  229. class: [
  230. _vm.type === "textarea" ? "el-textarea" : "el-input",
  231. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  232. {
  233. "is-disabled": _vm.inputDisabled,
  234. "is-exceed": _vm.inputExceed,
  235. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  236. "el-input-group--append": _vm.$slots.append,
  237. "el-input-group--prepend": _vm.$slots.prepend,
  238. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  239. "el-input--suffix":
  240. _vm.$slots.suffix ||
  241. _vm.suffixIcon ||
  242. _vm.clearable ||
  243. _vm.showPassword
  244. }
  245. ],
  246. on: {
  247. mouseenter: function($event) {
  248. _vm.hovering = true
  249. },
  250. mouseleave: function($event) {
  251. _vm.hovering = false
  252. }
  253. }
  254. },
  255. [
  256. _vm.type !== "textarea"
  257. ? [
  258. _vm.$slots.prepend
  259. ? _c(
  260. "div",
  261. { staticClass: "el-input-group__prepend" },
  262. [_vm._t("prepend")],
  263. 2
  264. )
  265. : _vm._e(),
  266. _vm.type !== "textarea"
  267. ? _c(
  268. "input",
  269. _vm._b(
  270. {
  271. ref: "input",
  272. staticClass: "el-input__inner",
  273. attrs: {
  274. tabindex: _vm.tabindex,
  275. type: _vm.showPassword
  276. ? _vm.passwordVisible
  277. ? "text"
  278. : "password"
  279. : _vm.type,
  280. disabled: _vm.inputDisabled,
  281. readonly: _vm.readonly,
  282. autocomplete: _vm.autoComplete || _vm.autocomplete,
  283. "aria-label": _vm.label
  284. },
  285. on: {
  286. compositionstart: _vm.handleCompositionStart,
  287. compositionupdate: _vm.handleCompositionUpdate,
  288. compositionend: _vm.handleCompositionEnd,
  289. input: _vm.handleInput,
  290. focus: _vm.handleFocus,
  291. blur: _vm.handleBlur,
  292. change: _vm.handleChange
  293. }
  294. },
  295. "input",
  296. _vm.$attrs,
  297. false
  298. )
  299. )
  300. : _vm._e(),
  301. _vm.$slots.prefix || _vm.prefixIcon
  302. ? _c(
  303. "span",
  304. { staticClass: "el-input__prefix" },
  305. [
  306. _vm._t("prefix"),
  307. _vm.prefixIcon
  308. ? _c("i", {
  309. staticClass: "el-input__icon",
  310. class: _vm.prefixIcon
  311. })
  312. : _vm._e()
  313. ],
  314. 2
  315. )
  316. : _vm._e(),
  317. _vm.getSuffixVisible()
  318. ? _c("span", { staticClass: "el-input__suffix" }, [
  319. _c(
  320. "span",
  321. { staticClass: "el-input__suffix-inner" },
  322. [
  323. !_vm.showClear ||
  324. !_vm.showPwdVisible ||
  325. !_vm.isWordLimitVisible
  326. ? [
  327. _vm._t("suffix"),
  328. _vm.suffixIcon
  329. ? _c("i", {
  330. staticClass: "el-input__icon",
  331. class: _vm.suffixIcon
  332. })
  333. : _vm._e()
  334. ]
  335. : _vm._e(),
  336. _vm.showClear
  337. ? _c("i", {
  338. staticClass:
  339. "el-input__icon el-icon-circle-close el-input__clear",
  340. on: {
  341. mousedown: function($event) {
  342. $event.preventDefault()
  343. },
  344. click: _vm.clear
  345. }
  346. })
  347. : _vm._e(),
  348. _vm.showPwdVisible
  349. ? _c("i", {
  350. staticClass:
  351. "el-input__icon el-icon-view el-input__clear",
  352. on: { click: _vm.handlePasswordVisible }
  353. })
  354. : _vm._e(),
  355. _vm.isWordLimitVisible
  356. ? _c("span", { staticClass: "el-input__count" }, [
  357. _c(
  358. "span",
  359. { staticClass: "el-input__count-inner" },
  360. [
  361. _vm._v(
  362. "\n " +
  363. _vm._s(_vm.textLength) +
  364. "/" +
  365. _vm._s(_vm.upperLimit) +
  366. "\n "
  367. )
  368. ]
  369. )
  370. ])
  371. : _vm._e()
  372. ],
  373. 2
  374. ),
  375. _vm.validateState
  376. ? _c("i", {
  377. staticClass: "el-input__icon",
  378. class: ["el-input__validateIcon", _vm.validateIcon]
  379. })
  380. : _vm._e()
  381. ])
  382. : _vm._e(),
  383. _vm.$slots.append
  384. ? _c(
  385. "div",
  386. { staticClass: "el-input-group__append" },
  387. [_vm._t("append")],
  388. 2
  389. )
  390. : _vm._e()
  391. ]
  392. : _c(
  393. "textarea",
  394. _vm._b(
  395. {
  396. ref: "textarea",
  397. staticClass: "el-textarea__inner",
  398. style: _vm.textareaStyle,
  399. attrs: {
  400. tabindex: _vm.tabindex,
  401. disabled: _vm.inputDisabled,
  402. readonly: _vm.readonly,
  403. autocomplete: _vm.autoComplete || _vm.autocomplete,
  404. "aria-label": _vm.label
  405. },
  406. on: {
  407. compositionstart: _vm.handleCompositionStart,
  408. compositionupdate: _vm.handleCompositionUpdate,
  409. compositionend: _vm.handleCompositionEnd,
  410. input: _vm.handleInput,
  411. focus: _vm.handleFocus,
  412. blur: _vm.handleBlur,
  413. change: _vm.handleChange
  414. }
  415. },
  416. "textarea",
  417. _vm.$attrs,
  418. false
  419. )
  420. ),
  421. _vm.isWordLimitVisible && _vm.type === "textarea"
  422. ? _c("span", { staticClass: "el-input__count" }, [
  423. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  424. ])
  425. : _vm._e()
  426. ],
  427. 2
  428. )
  429. }
  430. var staticRenderFns = []
  431. render._withStripped = true
  432. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  433. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  434. var emitter_ = __webpack_require__(13);
  435. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  436. // EXTERNAL MODULE: external "tis-ui/lib/mixins/migrating"
  437. var migrating_ = __webpack_require__(36);
  438. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  439. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  440. var hiddenTextarea = void 0;
  441. var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
  442. var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
  443. function calculateNodeStyling(targetElement) {
  444. var style = window.getComputedStyle(targetElement);
  445. var boxSizing = style.getPropertyValue('box-sizing');
  446. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  447. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  448. var contextStyle = CONTEXT_STYLE.map(function (name) {
  449. return name + ':' + style.getPropertyValue(name);
  450. }).join(';');
  451. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  452. }
  453. function calcTextareaHeight(targetElement) {
  454. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  455. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  456. if (!hiddenTextarea) {
  457. hiddenTextarea = document.createElement('textarea');
  458. document.body.appendChild(hiddenTextarea);
  459. }
  460. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  461. paddingSize = _calculateNodeStyling.paddingSize,
  462. borderSize = _calculateNodeStyling.borderSize,
  463. boxSizing = _calculateNodeStyling.boxSizing,
  464. contextStyle = _calculateNodeStyling.contextStyle;
  465. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  466. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  467. var height = hiddenTextarea.scrollHeight;
  468. var result = {};
  469. if (boxSizing === 'border-box') {
  470. height = height + borderSize;
  471. } else if (boxSizing === 'content-box') {
  472. height = height - paddingSize;
  473. }
  474. hiddenTextarea.value = '';
  475. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  476. if (minRows !== null) {
  477. var minHeight = singleRowHeight * minRows;
  478. if (boxSizing === 'border-box') {
  479. minHeight = minHeight + paddingSize + borderSize;
  480. }
  481. height = Math.max(minHeight, height);
  482. result.minHeight = minHeight + 'px';
  483. }
  484. if (maxRows !== null) {
  485. var maxHeight = singleRowHeight * maxRows;
  486. if (boxSizing === 'border-box') {
  487. maxHeight = maxHeight + paddingSize + borderSize;
  488. }
  489. height = Math.min(maxHeight, height);
  490. }
  491. result.height = height + 'px';
  492. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  493. hiddenTextarea = null;
  494. return result;
  495. };
  496. // EXTERNAL MODULE: external "tis-ui/lib/utils/merge"
  497. var merge_ = __webpack_require__(33);
  498. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  499. // EXTERNAL MODULE: external "tis-ui/lib/utils/shared"
  500. var shared_ = __webpack_require__(49);
  501. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js&
  502. //
  503. //
  504. //
  505. //
  506. //
  507. //
  508. //
  509. //
  510. //
  511. //
  512. //
  513. //
  514. //
  515. //
  516. //
  517. //
  518. //
  519. //
  520. //
  521. //
  522. //
  523. //
  524. //
  525. //
  526. //
  527. //
  528. //
  529. //
  530. //
  531. //
  532. //
  533. //
  534. //
  535. //
  536. //
  537. //
  538. //
  539. //
  540. //
  541. //
  542. //
  543. //
  544. //
  545. //
  546. //
  547. //
  548. //
  549. //
  550. //
  551. //
  552. //
  553. //
  554. //
  555. //
  556. //
  557. //
  558. //
  559. //
  560. //
  561. //
  562. //
  563. //
  564. //
  565. //
  566. //
  567. //
  568. //
  569. //
  570. //
  571. //
  572. //
  573. //
  574. //
  575. //
  576. //
  577. //
  578. //
  579. //
  580. //
  581. //
  582. //
  583. //
  584. //
  585. //
  586. //
  587. //
  588. //
  589. //
  590. //
  591. //
  592. //
  593. //
  594. //
  595. //
  596. //
  597. //
  598. //
  599. //
  600. //
  601. //
  602. //
  603. //
  604. //
  605. //
  606. //
  607. //
  608. //
  609. //
  610. //
  611. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  612. name: 'TisInput',
  613. componentName: 'TisInput',
  614. mixins: [emitter_default.a, migrating_default.a],
  615. inheritAttrs: false,
  616. inject: {
  617. elForm: {
  618. default: ''
  619. },
  620. elFormItem: {
  621. default: ''
  622. }
  623. },
  624. data: function data() {
  625. return {
  626. textareaCalcStyle: {},
  627. hovering: false,
  628. focused: false,
  629. isComposing: false,
  630. passwordVisible: false
  631. };
  632. },
  633. props: {
  634. value: [String, Number],
  635. size: String,
  636. resize: String,
  637. form: String,
  638. disabled: Boolean,
  639. readonly: Boolean,
  640. type: {
  641. type: String,
  642. default: 'text'
  643. },
  644. autosize: {
  645. type: [Boolean, Object],
  646. default: false
  647. },
  648. autocomplete: {
  649. type: String,
  650. default: 'off'
  651. },
  652. /** @Deprecated in next major version */
  653. autoComplete: {
  654. type: String,
  655. validator: function validator(val) {
  656. false && false;
  657. return true;
  658. }
  659. },
  660. validateEvent: {
  661. type: Boolean,
  662. default: true
  663. },
  664. suffixIcon: String,
  665. prefixIcon: String,
  666. label: String,
  667. clearable: {
  668. type: Boolean,
  669. default: false
  670. },
  671. showPassword: {
  672. type: Boolean,
  673. default: false
  674. },
  675. showWordLimit: {
  676. type: Boolean,
  677. default: false
  678. },
  679. tabindex: String
  680. },
  681. computed: {
  682. _elFormItemSize: function _elFormItemSize() {
  683. return (this.elFormItem || {}).elFormItemSize;
  684. },
  685. validateState: function validateState() {
  686. return this.elFormItem ? this.elFormItem.validateState : '';
  687. },
  688. needStatusIcon: function needStatusIcon() {
  689. return this.elForm ? this.elForm.statusIcon : false;
  690. },
  691. validateIcon: function validateIcon() {
  692. return {
  693. validating: 'el-icon-loading',
  694. success: 'el-icon-circle-check',
  695. error: 'el-icon-circle-close'
  696. }[this.validateState];
  697. },
  698. textareaStyle: function textareaStyle() {
  699. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  700. },
  701. inputSize: function inputSize() {
  702. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  703. },
  704. inputDisabled: function inputDisabled() {
  705. return this.disabled || (this.elForm || {}).disabled;
  706. },
  707. nativeInputValue: function nativeInputValue() {
  708. return this.value === null || this.value === undefined ? '' : String(this.value);
  709. },
  710. showClear: function showClear() {
  711. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  712. },
  713. showPwdVisible: function showPwdVisible() {
  714. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  715. },
  716. isWordLimitVisible: function isWordLimitVisible() {
  717. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  718. },
  719. upperLimit: function upperLimit() {
  720. return this.$attrs.maxlength;
  721. },
  722. textLength: function textLength() {
  723. if (typeof this.value === 'number') {
  724. return String(this.value).length;
  725. }
  726. return (this.value || '').length;
  727. },
  728. inputExceed: function inputExceed() {
  729. // show exceed style if length of initial value greater then maxlength
  730. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  731. }
  732. },
  733. watch: {
  734. value: function value(val) {
  735. this.$nextTick(this.resizeTextarea);
  736. if (this.validateEvent) {
  737. this.dispatch('ElFormItem', 'el.form.change', [val]);
  738. }
  739. },
  740. // native input value is set explicitly
  741. // do not use v-model / :value in template
  742. // see: https://github.com/ElemeFE/element/issues/14521
  743. nativeInputValue: function nativeInputValue() {
  744. this.setNativeInputValue();
  745. },
  746. // when change between <input> and <textarea>,
  747. // update DOM dependent value and styles
  748. // https://github.com/ElemeFE/element/issues/14857
  749. type: function type() {
  750. var _this = this;
  751. this.$nextTick(function () {
  752. _this.setNativeInputValue();
  753. _this.resizeTextarea();
  754. _this.updateIconOffset();
  755. });
  756. }
  757. },
  758. methods: {
  759. focus: function focus() {
  760. this.getInput().focus();
  761. },
  762. blur: function blur() {
  763. this.getInput().blur();
  764. },
  765. getMigratingConfig: function getMigratingConfig() {
  766. return {
  767. props: {
  768. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  769. 'on-icon-click': 'on-icon-click is removed.'
  770. },
  771. events: {
  772. 'click': 'click is removed.'
  773. }
  774. };
  775. },
  776. handleBlur: function handleBlur(event) {
  777. this.focused = false;
  778. this.$emit('blur', event);
  779. if (this.validateEvent) {
  780. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  781. }
  782. },
  783. select: function select() {
  784. this.getInput().select();
  785. },
  786. resizeTextarea: function resizeTextarea() {
  787. if (this.$isServer) return;
  788. var autosize = this.autosize,
  789. type = this.type;
  790. if (type !== 'textarea') return;
  791. if (!autosize) {
  792. this.textareaCalcStyle = {
  793. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  794. };
  795. return;
  796. }
  797. var minRows = autosize.minRows;
  798. var maxRows = autosize.maxRows;
  799. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  800. },
  801. setNativeInputValue: function setNativeInputValue() {
  802. var input = this.getInput();
  803. if (!input) return;
  804. if (input.value === this.nativeInputValue) return;
  805. input.value = this.nativeInputValue;
  806. },
  807. handleFocus: function handleFocus(event) {
  808. this.focused = true;
  809. this.$emit('focus', event);
  810. },
  811. handleCompositionStart: function handleCompositionStart() {
  812. this.isComposing = true;
  813. },
  814. handleCompositionUpdate: function handleCompositionUpdate(event) {
  815. var text = event.target.value;
  816. var lastCharacter = text[text.length - 1] || '';
  817. this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
  818. },
  819. handleCompositionEnd: function handleCompositionEnd(event) {
  820. if (this.isComposing) {
  821. this.isComposing = false;
  822. this.handleInput(event);
  823. }
  824. },
  825. handleInput: function handleInput(event) {
  826. // should not emit input during composition
  827. // see: https://github.com/ElemeFE/element/issues/10516
  828. if (this.isComposing) return;
  829. // hack for https://github.com/ElemeFE/element/issues/8548
  830. // should remove the following line when we don't support IE
  831. if (event.target.value === this.nativeInputValue) return;
  832. this.$emit('input', event.target.value);
  833. // ensure native input value is controlled
  834. // see: https://github.com/ElemeFE/element/issues/12850
  835. this.$nextTick(this.setNativeInputValue);
  836. },
  837. handleChange: function handleChange(event) {
  838. this.$emit('change', event.target.value);
  839. },
  840. calcIconOffset: function calcIconOffset(place) {
  841. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  842. if (!elList.length) return;
  843. var el = null;
  844. for (var i = 0; i < elList.length; i++) {
  845. if (elList[i].parentNode === this.$el) {
  846. el = elList[i];
  847. break;
  848. }
  849. }
  850. if (!el) return;
  851. var pendantMap = {
  852. suffix: 'append',
  853. prefix: 'prepend'
  854. };
  855. var pendant = pendantMap[place];
  856. if (this.$slots[pendant]) {
  857. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  858. } else {
  859. el.removeAttribute('style');
  860. }
  861. },
  862. updateIconOffset: function updateIconOffset() {
  863. this.calcIconOffset('prefix');
  864. this.calcIconOffset('suffix');
  865. },
  866. clear: function clear() {
  867. this.$emit('input', '');
  868. this.$emit('change', '');
  869. this.$emit('clear');
  870. },
  871. handlePasswordVisible: function handlePasswordVisible() {
  872. this.passwordVisible = !this.passwordVisible;
  873. this.focus();
  874. },
  875. getInput: function getInput() {
  876. return this.$refs.input || this.$refs.textarea;
  877. },
  878. getSuffixVisible: function getSuffixVisible() {
  879. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  880. }
  881. },
  882. created: function created() {
  883. this.$on('inputSelect', this.select);
  884. },
  885. mounted: function mounted() {
  886. this.setNativeInputValue();
  887. this.resizeTextarea();
  888. this.updateIconOffset();
  889. },
  890. updated: function updated() {
  891. this.$nextTick(this.updateIconOffset);
  892. }
  893. });
  894. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  895. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  896. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  897. var componentNormalizer = __webpack_require__(2);
  898. // CONCATENATED MODULE: ./packages/input/src/input.vue
  899. /* normalize component */
  900. var component = Object(componentNormalizer["a" /* default */])(
  901. src_inputvue_type_script_lang_js_,
  902. render,
  903. staticRenderFns,
  904. false,
  905. null,
  906. null,
  907. null
  908. )
  909. /* hot reload */
  910. if (false) { var api; }
  911. component.options.__file = "packages/input/src/input.vue"
  912. /* harmony default export */ var input = (component.exports);
  913. // CONCATENATED MODULE: ./packages/input/index.js
  914. /* istanbul ignore next */
  915. input.install = function (Vue) {
  916. Vue.component(input.name, input);
  917. };
  918. /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
  919. /***/ }),
  920. /***/ 532:
  921. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  922. "use strict";
  923. // ESM COMPAT FLAG
  924. __webpack_require__.r(__webpack_exports__);
  925. // EXTERNAL MODULE: external "vue"
  926. var external_vue_ = __webpack_require__(4);
  927. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  928. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/message-box/src/main.vue?vue&type=template&id=6b29b012&
  929. var render = function() {
  930. var _vm = this
  931. var _h = _vm.$createElement
  932. var _c = _vm._self._c || _h
  933. return _c("transition", { attrs: { name: "msgbox-fade" } }, [
  934. _c(
  935. "div",
  936. {
  937. directives: [
  938. {
  939. name: "show",
  940. rawName: "v-show",
  941. value: _vm.visible,
  942. expression: "visible"
  943. }
  944. ],
  945. staticClass: "el-message-box__wrapper",
  946. attrs: {
  947. tabindex: "-1",
  948. role: "dialog",
  949. "aria-modal": "true",
  950. "aria-label": _vm.title || "dialog"
  951. },
  952. on: {
  953. click: function($event) {
  954. if ($event.target !== $event.currentTarget) {
  955. return null
  956. }
  957. return _vm.handleWrapperClick($event)
  958. }
  959. }
  960. },
  961. [
  962. _c(
  963. "div",
  964. {
  965. staticClass: "el-message-box",
  966. class: [_vm.customClass, _vm.center && "el-message-box--center"]
  967. },
  968. [
  969. _vm.title !== null
  970. ? _c("div", { staticClass: "el-message-box__header" }, [
  971. _c("div", { staticClass: "el-message-box__title" }, [
  972. _vm.icon && _vm.center
  973. ? _c("div", {
  974. class: ["el-message-box__status", _vm.icon]
  975. })
  976. : _vm._e(),
  977. _c("span", [_vm._v(_vm._s(_vm.title))])
  978. ]),
  979. _vm.showClose
  980. ? _c(
  981. "button",
  982. {
  983. staticClass: "el-message-box__headerbtn",
  984. attrs: { type: "button", "aria-label": "Close" },
  985. on: {
  986. click: function($event) {
  987. _vm.handleAction(
  988. _vm.distinguishCancelAndClose
  989. ? "close"
  990. : "cancel"
  991. )
  992. },
  993. keydown: function($event) {
  994. if (
  995. !("button" in $event) &&
  996. _vm._k(
  997. $event.keyCode,
  998. "enter",
  999. 13,
  1000. $event.key,
  1001. "Enter"
  1002. )
  1003. ) {
  1004. return null
  1005. }
  1006. _vm.handleAction(
  1007. _vm.distinguishCancelAndClose
  1008. ? "close"
  1009. : "cancel"
  1010. )
  1011. }
  1012. }
  1013. },
  1014. [
  1015. _c("i", {
  1016. staticClass: "el-message-box__close el-icon-close"
  1017. })
  1018. ]
  1019. )
  1020. : _vm._e()
  1021. ])
  1022. : _vm._e(),
  1023. _c("div", { staticClass: "el-message-box__content" }, [
  1024. _c("div", { staticClass: "el-message-box__container" }, [
  1025. _vm.icon && !_vm.center && _vm.message !== ""
  1026. ? _c("div", { class: ["el-message-box__status", _vm.icon] })
  1027. : _vm._e(),
  1028. _vm.message !== ""
  1029. ? _c(
  1030. "div",
  1031. { staticClass: "el-message-box__message" },
  1032. [
  1033. _vm._t("default", [
  1034. !_vm.dangerouslyUseHTMLString
  1035. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  1036. : _c("p", {
  1037. domProps: { innerHTML: _vm._s(_vm.message) }
  1038. })
  1039. ])
  1040. ],
  1041. 2
  1042. )
  1043. : _vm._e()
  1044. ]),
  1045. _c(
  1046. "div",
  1047. {
  1048. directives: [
  1049. {
  1050. name: "show",
  1051. rawName: "v-show",
  1052. value: _vm.showInput,
  1053. expression: "showInput"
  1054. }
  1055. ],
  1056. staticClass: "el-message-box__input"
  1057. },
  1058. [
  1059. _c("tis-input", {
  1060. ref: "input",
  1061. attrs: {
  1062. type: _vm.inputType,
  1063. placeholder: _vm.inputPlaceholder
  1064. },
  1065. nativeOn: {
  1066. keydown: function($event) {
  1067. if (
  1068. !("button" in $event) &&
  1069. _vm._k(
  1070. $event.keyCode,
  1071. "enter",
  1072. 13,
  1073. $event.key,
  1074. "Enter"
  1075. )
  1076. ) {
  1077. return null
  1078. }
  1079. return _vm.handleInputEnter($event)
  1080. }
  1081. },
  1082. model: {
  1083. value: _vm.inputValue,
  1084. callback: function($$v) {
  1085. _vm.inputValue = $$v
  1086. },
  1087. expression: "inputValue"
  1088. }
  1089. }),
  1090. _c(
  1091. "div",
  1092. {
  1093. staticClass: "el-message-box__errormsg",
  1094. style: {
  1095. visibility: !!_vm.editorErrorMessage
  1096. ? "visible"
  1097. : "hidden"
  1098. }
  1099. },
  1100. [_vm._v(_vm._s(_vm.editorErrorMessage))]
  1101. )
  1102. ],
  1103. 1
  1104. )
  1105. ]),
  1106. _c(
  1107. "div",
  1108. { staticClass: "el-message-box__btns" },
  1109. [
  1110. _vm.showCancelButton
  1111. ? _c(
  1112. "tis-button",
  1113. {
  1114. class: [_vm.cancelButtonClasses],
  1115. attrs: {
  1116. loading: _vm.cancelButtonLoading,
  1117. round: _vm.roundButton,
  1118. size: "small"
  1119. },
  1120. on: {
  1121. keydown: function($event) {
  1122. if (
  1123. !("button" in $event) &&
  1124. _vm._k(
  1125. $event.keyCode,
  1126. "enter",
  1127. 13,
  1128. $event.key,
  1129. "Enter"
  1130. )
  1131. ) {
  1132. return null
  1133. }
  1134. _vm.handleAction("cancel")
  1135. }
  1136. },
  1137. nativeOn: {
  1138. click: function($event) {
  1139. _vm.handleAction("cancel")
  1140. }
  1141. }
  1142. },
  1143. [
  1144. _vm._v(
  1145. "\n " +
  1146. _vm._s(
  1147. _vm.cancelButtonText ||
  1148. _vm.t("el.messagebox.cancel")
  1149. ) +
  1150. "\n "
  1151. )
  1152. ]
  1153. )
  1154. : _vm._e(),
  1155. _c(
  1156. "tis-button",
  1157. {
  1158. directives: [
  1159. {
  1160. name: "show",
  1161. rawName: "v-show",
  1162. value: _vm.showConfirmButton,
  1163. expression: "showConfirmButton"
  1164. }
  1165. ],
  1166. ref: "confirm",
  1167. class: [_vm.confirmButtonClasses],
  1168. attrs: {
  1169. loading: _vm.confirmButtonLoading,
  1170. round: _vm.roundButton,
  1171. size: "small"
  1172. },
  1173. on: {
  1174. keydown: function($event) {
  1175. if (
  1176. !("button" in $event) &&
  1177. _vm._k(
  1178. $event.keyCode,
  1179. "enter",
  1180. 13,
  1181. $event.key,
  1182. "Enter"
  1183. )
  1184. ) {
  1185. return null
  1186. }
  1187. _vm.handleAction("confirm")
  1188. }
  1189. },
  1190. nativeOn: {
  1191. click: function($event) {
  1192. _vm.handleAction("confirm")
  1193. }
  1194. }
  1195. },
  1196. [
  1197. _vm._v(
  1198. "\n " +
  1199. _vm._s(
  1200. _vm.confirmButtonText ||
  1201. _vm.t("el.messagebox.confirm")
  1202. ) +
  1203. "\n "
  1204. )
  1205. ]
  1206. )
  1207. ],
  1208. 1
  1209. )
  1210. ]
  1211. )
  1212. ]
  1213. )
  1214. ])
  1215. }
  1216. var staticRenderFns = []
  1217. render._withStripped = true
  1218. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=template&id=6b29b012&
  1219. // EXTERNAL MODULE: external "tis-ui/lib/utils/popup"
  1220. var popup_ = __webpack_require__(77);
  1221. var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
  1222. // EXTERNAL MODULE: external "tis-ui/lib/mixins/locale"
  1223. var locale_ = __webpack_require__(38);
  1224. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  1225. // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
  1226. var input = __webpack_require__(52);
  1227. // EXTERNAL MODULE: ./packages/button/index.js + 5 modules
  1228. var packages_button = __webpack_require__(70);
  1229. // EXTERNAL MODULE: external "tis-ui/lib/utils/dom"
  1230. var dom_ = __webpack_require__(7);
  1231. // EXTERNAL MODULE: external "tis-ui/lib/locale"
  1232. var lib_locale_ = __webpack_require__(72);
  1233. // EXTERNAL MODULE: external "tis-ui/lib/utils/aria-dialog"
  1234. var aria_dialog_ = __webpack_require__(247);
  1235. var aria_dialog_default = /*#__PURE__*/__webpack_require__.n(aria_dialog_);
  1236. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/message-box/src/main.vue?vue&type=script&lang=js&
  1237. //
  1238. //
  1239. //
  1240. //
  1241. //
  1242. //
  1243. //
  1244. //
  1245. //
  1246. //
  1247. //
  1248. //
  1249. //
  1250. //
  1251. //
  1252. //
  1253. //
  1254. //
  1255. //
  1256. //
  1257. //
  1258. //
  1259. //
  1260. //
  1261. //
  1262. //
  1263. //
  1264. //
  1265. //
  1266. //
  1267. //
  1268. //
  1269. //
  1270. //
  1271. //
  1272. //
  1273. //
  1274. //
  1275. //
  1276. //
  1277. //
  1278. //
  1279. //
  1280. //
  1281. //
  1282. //
  1283. //
  1284. //
  1285. //
  1286. //
  1287. //
  1288. //
  1289. //
  1290. //
  1291. //
  1292. //
  1293. //
  1294. //
  1295. //
  1296. //
  1297. //
  1298. //
  1299. //
  1300. //
  1301. //
  1302. //
  1303. //
  1304. //
  1305. //
  1306. //
  1307. //
  1308. //
  1309. //
  1310. //
  1311. //
  1312. //
  1313. //
  1314. //
  1315. //
  1316. //
  1317. var messageBox = void 0;
  1318. var typeMap = {
  1319. success: 'success',
  1320. info: 'info',
  1321. warning: 'warning',
  1322. error: 'error'
  1323. };
  1324. /* harmony default export */ var mainvue_type_script_lang_js_ = ({
  1325. mixins: [popup_default.a, locale_default.a],
  1326. props: {
  1327. modal: {
  1328. default: true
  1329. },
  1330. lockScroll: {
  1331. default: true
  1332. },
  1333. showClose: {
  1334. type: Boolean,
  1335. default: true
  1336. },
  1337. closeOnClickModal: {
  1338. default: true
  1339. },
  1340. closeOnPressEscape: {
  1341. default: true
  1342. },
  1343. closeOnHashChange: {
  1344. default: true
  1345. },
  1346. center: {
  1347. default: false,
  1348. type: Boolean
  1349. },
  1350. roundButton: {
  1351. default: false,
  1352. type: Boolean
  1353. }
  1354. },
  1355. components: {
  1356. ElInput: input["default"],
  1357. ElButton: packages_button["default"]
  1358. },
  1359. computed: {
  1360. icon: function icon() {
  1361. var type = this.type,
  1362. iconClass = this.iconClass;
  1363. return iconClass || (type && typeMap[type] ? 'el-icon-' + typeMap[type] : '');
  1364. },
  1365. confirmButtonClasses: function confirmButtonClasses() {
  1366. return 'el-button--primary ' + this.confirmButtonClass;
  1367. },
  1368. cancelButtonClasses: function cancelButtonClasses() {
  1369. return '' + this.cancelButtonClass;
  1370. }
  1371. },
  1372. methods: {
  1373. getSafeClose: function getSafeClose() {
  1374. var _this = this;
  1375. var currentId = this.uid;
  1376. return function () {
  1377. _this.$nextTick(function () {
  1378. if (currentId === _this.uid) _this.doClose();
  1379. });
  1380. };
  1381. },
  1382. doClose: function doClose() {
  1383. var _this2 = this;
  1384. if (!this.visible) return;
  1385. this.visible = false;
  1386. this._closing = true;
  1387. this.onClose && this.onClose();
  1388. messageBox.closeDialog(); // 解绑
  1389. if (this.lockScroll) {
  1390. setTimeout(this.restoreBodyStyle, 200);
  1391. }
  1392. this.opened = false;
  1393. this.doAfterClose();
  1394. setTimeout(function () {
  1395. if (_this2.action) _this2.callback(_this2.action, _this2);
  1396. });
  1397. },
  1398. handleWrapperClick: function handleWrapperClick() {
  1399. if (this.closeOnClickModal) {
  1400. this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel');
  1401. }
  1402. },
  1403. handleInputEnter: function handleInputEnter() {
  1404. if (this.inputType !== 'textarea') {
  1405. return this.handleAction('confirm');
  1406. }
  1407. },
  1408. handleAction: function handleAction(action) {
  1409. if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) {
  1410. return;
  1411. }
  1412. this.action = action;
  1413. if (typeof this.beforeClose === 'function') {
  1414. this.close = this.getSafeClose();
  1415. this.beforeClose(action, this, this.close);
  1416. } else {
  1417. this.doClose();
  1418. }
  1419. },
  1420. validate: function validate() {
  1421. if (this.$type === 'prompt') {
  1422. var inputPattern = this.inputPattern;
  1423. if (inputPattern && !inputPattern.test(this.inputValue || '')) {
  1424. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  1425. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  1426. return false;
  1427. }
  1428. var inputValidator = this.inputValidator;
  1429. if (typeof inputValidator === 'function') {
  1430. var validateResult = inputValidator(this.inputValue);
  1431. if (validateResult === false) {
  1432. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  1433. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  1434. return false;
  1435. }
  1436. if (typeof validateResult === 'string') {
  1437. this.editorErrorMessage = validateResult;
  1438. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  1439. return false;
  1440. }
  1441. }
  1442. }
  1443. this.editorErrorMessage = '';
  1444. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  1445. return true;
  1446. },
  1447. getFirstFocus: function getFirstFocus() {
  1448. var btn = this.$el.querySelector('.el-message-box__btns .el-button');
  1449. var title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
  1450. return btn || title;
  1451. },
  1452. getInputElement: function getInputElement() {
  1453. var inputRefs = this.$refs.input.$refs;
  1454. return inputRefs.input || inputRefs.textarea;
  1455. },
  1456. handleClose: function handleClose() {
  1457. this.handleAction('close');
  1458. }
  1459. },
  1460. watch: {
  1461. inputValue: {
  1462. immediate: true,
  1463. handler: function handler(val) {
  1464. var _this3 = this;
  1465. this.$nextTick(function (_) {
  1466. if (_this3.$type === 'prompt' && val !== null) {
  1467. _this3.validate();
  1468. }
  1469. });
  1470. }
  1471. },
  1472. visible: function visible(val) {
  1473. var _this4 = this;
  1474. if (val) {
  1475. this.uid++;
  1476. if (this.$type === 'alert' || this.$type === 'confirm') {
  1477. this.$nextTick(function () {
  1478. _this4.$refs.confirm.$el.focus();
  1479. });
  1480. }
  1481. this.focusAfterClosed = document.activeElement;
  1482. messageBox = new aria_dialog_default.a(this.$el, this.focusAfterClosed, this.getFirstFocus());
  1483. }
  1484. // prompt
  1485. if (this.$type !== 'prompt') return;
  1486. if (val) {
  1487. setTimeout(function () {
  1488. if (_this4.$refs.input && _this4.$refs.input.$el) {
  1489. _this4.getInputElement().focus();
  1490. }
  1491. }, 500);
  1492. } else {
  1493. this.editorErrorMessage = '';
  1494. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  1495. }
  1496. }
  1497. },
  1498. mounted: function mounted() {
  1499. var _this5 = this;
  1500. this.$nextTick(function () {
  1501. if (_this5.closeOnHashChange) {
  1502. window.addEventListener('hashchange', _this5.close);
  1503. }
  1504. });
  1505. },
  1506. beforeDestroy: function beforeDestroy() {
  1507. if (this.closeOnHashChange) {
  1508. window.removeEventListener('hashchange', this.close);
  1509. }
  1510. setTimeout(function () {
  1511. messageBox.closeDialog();
  1512. });
  1513. },
  1514. data: function data() {
  1515. return {
  1516. uid: 1,
  1517. title: undefined,
  1518. message: '',
  1519. type: '',
  1520. iconClass: '',
  1521. customClass: '',
  1522. showInput: false,
  1523. inputValue: null,
  1524. inputPlaceholder: '',
  1525. inputType: 'text',
  1526. inputPattern: null,
  1527. inputValidator: null,
  1528. inputErrorMessage: '',
  1529. showConfirmButton: true,
  1530. showCancelButton: false,
  1531. action: '',
  1532. confirmButtonText: '',
  1533. cancelButtonText: '',
  1534. confirmButtonLoading: false,
  1535. cancelButtonLoading: false,
  1536. confirmButtonClass: '',
  1537. confirmButtonDisabled: false,
  1538. cancelButtonClass: '',
  1539. editorErrorMessage: null,
  1540. callback: null,
  1541. dangerouslyUseHTMLString: false,
  1542. focusAfterClosed: null,
  1543. isOnComposition: false,
  1544. distinguishCancelAndClose: false
  1545. };
  1546. }
  1547. });
  1548. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=script&lang=js&
  1549. /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
  1550. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1551. var componentNormalizer = __webpack_require__(2);
  1552. // CONCATENATED MODULE: ./packages/message-box/src/main.vue
  1553. /* normalize component */
  1554. var component = Object(componentNormalizer["a" /* default */])(
  1555. src_mainvue_type_script_lang_js_,
  1556. render,
  1557. staticRenderFns,
  1558. false,
  1559. null,
  1560. null,
  1561. null
  1562. )
  1563. /* hot reload */
  1564. if (false) { var api; }
  1565. component.options.__file = "packages/message-box/src/main.vue"
  1566. /* harmony default export */ var main = (component.exports);
  1567. // EXTERNAL MODULE: external "tis-ui/lib/utils/merge"
  1568. var merge_ = __webpack_require__(33);
  1569. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  1570. // EXTERNAL MODULE: external "tis-ui/lib/utils/vdom"
  1571. var vdom_ = __webpack_require__(104);
  1572. // CONCATENATED MODULE: ./packages/message-box/src/main.js
  1573. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  1574. var defaults = {
  1575. title: null,
  1576. message: '',
  1577. type: '',
  1578. iconClass: '',
  1579. showInput: false,
  1580. showClose: true,
  1581. modalFade: true,
  1582. lockScroll: true,
  1583. closeOnClickModal: true,
  1584. closeOnPressEscape: true,
  1585. closeOnHashChange: true,
  1586. inputValue: null,
  1587. inputPlaceholder: '',
  1588. inputType: 'text',
  1589. inputPattern: null,
  1590. inputValidator: null,
  1591. inputErrorMessage: '',
  1592. showConfirmButton: true,
  1593. showCancelButton: false,
  1594. confirmButtonPosition: 'right',
  1595. confirmButtonHighlight: false,
  1596. cancelButtonHighlight: false,
  1597. confirmButtonText: '',
  1598. cancelButtonText: '',
  1599. confirmButtonClass: '',
  1600. cancelButtonClass: '',
  1601. customClass: '',
  1602. beforeClose: null,
  1603. dangerouslyUseHTMLString: false,
  1604. center: false,
  1605. roundButton: false,
  1606. distinguishCancelAndClose: false
  1607. };
  1608. var MessageBoxConstructor = external_vue_default.a.extend(main);
  1609. var currentMsg = void 0,
  1610. instance = void 0;
  1611. var msgQueue = [];
  1612. var defaultCallback = function defaultCallback(action) {
  1613. if (currentMsg) {
  1614. var callback = currentMsg.callback;
  1615. if (typeof callback === 'function') {
  1616. if (instance.showInput) {
  1617. callback(instance.inputValue, action);
  1618. } else {
  1619. callback(action);
  1620. }
  1621. }
  1622. if (currentMsg.resolve) {
  1623. if (action === 'confirm') {
  1624. if (instance.showInput) {
  1625. currentMsg.resolve({ value: instance.inputValue, action: action });
  1626. } else {
  1627. currentMsg.resolve(action);
  1628. }
  1629. } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {
  1630. currentMsg.reject(action);
  1631. }
  1632. }
  1633. }
  1634. };
  1635. var initInstance = function initInstance() {
  1636. instance = new MessageBoxConstructor({
  1637. el: document.createElement('div')
  1638. });
  1639. instance.callback = defaultCallback;
  1640. };
  1641. var main_showNextMsg = function showNextMsg() {
  1642. if (!instance) {
  1643. initInstance();
  1644. }
  1645. instance.action = '';
  1646. if (!instance.visible || instance.closeTimer) {
  1647. if (msgQueue.length > 0) {
  1648. currentMsg = msgQueue.shift();
  1649. var options = currentMsg.options;
  1650. for (var prop in options) {
  1651. if (options.hasOwnProperty(prop)) {
  1652. instance[prop] = options[prop];
  1653. }
  1654. }
  1655. if (options.callback === undefined) {
  1656. instance.callback = defaultCallback;
  1657. }
  1658. var oldCb = instance.callback;
  1659. instance.callback = function (action, instance) {
  1660. oldCb(action, instance);
  1661. showNextMsg();
  1662. };
  1663. if (Object(vdom_["isVNode"])(instance.message)) {
  1664. instance.$slots.default = [instance.message];
  1665. instance.message = null;
  1666. } else {
  1667. delete instance.$slots.default;
  1668. }
  1669. ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(function (prop) {
  1670. if (instance[prop] === undefined) {
  1671. instance[prop] = true;
  1672. }
  1673. });
  1674. document.body.appendChild(instance.$el);
  1675. external_vue_default.a.nextTick(function () {
  1676. instance.visible = true;
  1677. });
  1678. }
  1679. }
  1680. };
  1681. var main_MessageBox = function MessageBox(options, callback) {
  1682. if (external_vue_default.a.prototype.$isServer) return;
  1683. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  1684. options = {
  1685. message: options
  1686. };
  1687. if (typeof arguments[1] === 'string') {
  1688. options.title = arguments[1];
  1689. }
  1690. } else if (options.callback && !callback) {
  1691. callback = options.callback;
  1692. }
  1693. if (typeof Promise !== 'undefined') {
  1694. return new Promise(function (resolve, reject) {
  1695. // eslint-disable-line
  1696. msgQueue.push({
  1697. options: merge_default()({}, defaults, MessageBox.defaults, options),
  1698. callback: callback,
  1699. resolve: resolve,
  1700. reject: reject
  1701. });
  1702. main_showNextMsg();
  1703. });
  1704. } else {
  1705. msgQueue.push({
  1706. options: merge_default()({}, defaults, MessageBox.defaults, options),
  1707. callback: callback
  1708. });
  1709. main_showNextMsg();
  1710. }
  1711. };
  1712. main_MessageBox.setDefaults = function (defaults) {
  1713. main_MessageBox.defaults = defaults;
  1714. };
  1715. main_MessageBox.alert = function (message, title, options) {
  1716. if ((typeof title === 'undefined' ? 'undefined' : _typeof(title)) === 'object') {
  1717. options = title;
  1718. title = '';
  1719. } else if (title === undefined) {
  1720. title = '';
  1721. }
  1722. return main_MessageBox(merge_default()({
  1723. title: title,
  1724. message: message,
  1725. $type: 'alert',
  1726. closeOnPressEscape: false,
  1727. closeOnClickModal: false
  1728. }, options));
  1729. };
  1730. main_MessageBox.confirm = function (message, title, options) {
  1731. if ((typeof title === 'undefined' ? 'undefined' : _typeof(title)) === 'object') {
  1732. options = title;
  1733. title = '';
  1734. } else if (title === undefined) {
  1735. title = '';
  1736. }
  1737. return main_MessageBox(merge_default()({
  1738. title: title,
  1739. message: message,
  1740. $type: 'confirm',
  1741. showCancelButton: true
  1742. }, options));
  1743. };
  1744. main_MessageBox.prompt = function (message, title, options) {
  1745. if ((typeof title === 'undefined' ? 'undefined' : _typeof(title)) === 'object') {
  1746. options = title;
  1747. title = '';
  1748. } else if (title === undefined) {
  1749. title = '';
  1750. }
  1751. return main_MessageBox(merge_default()({
  1752. title: title,
  1753. message: message,
  1754. showCancelButton: true,
  1755. showInput: true,
  1756. $type: 'prompt'
  1757. }, options));
  1758. };
  1759. main_MessageBox.close = function () {
  1760. instance.doClose();
  1761. instance.visible = false;
  1762. msgQueue = [];
  1763. currentMsg = null;
  1764. };
  1765. /* harmony default export */ var src_main = (main_MessageBox);
  1766. // CONCATENATED MODULE: ./packages/message-box/index.js
  1767. /* harmony default export */ var message_box = __webpack_exports__["default"] = (src_main);
  1768. /***/ }),
  1769. /***/ 7:
  1770. /***/ (function(module, exports) {
  1771. module.exports = require("tis-ui/lib/utils/dom");
  1772. /***/ }),
  1773. /***/ 70:
  1774. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1775. "use strict";
  1776. // ESM COMPAT FLAG
  1777. __webpack_require__.r(__webpack_exports__);
  1778. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  1779. var render = function() {
  1780. var _vm = this
  1781. var _h = _vm.$createElement
  1782. var _c = _vm._self._c || _h
  1783. return _c(
  1784. "button",
  1785. {
  1786. staticClass: "el-button",
  1787. class: [
  1788. _vm.type ? "el-button--" + _vm.type : "",
  1789. _vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
  1790. {
  1791. "is-disabled": _vm.buttonDisabled,
  1792. "is-loading": _vm.loading,
  1793. "is-plain": _vm.plain,
  1794. "is-round": _vm.round,
  1795. "is-circle": _vm.circle
  1796. }
  1797. ],
  1798. attrs: {
  1799. disabled: _vm.buttonDisabled || _vm.loading,
  1800. autofocus: _vm.autofocus,
  1801. type: _vm.nativeType
  1802. },
  1803. on: { click: _vm.handleClick }
  1804. },
  1805. [
  1806. _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
  1807. _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
  1808. _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e()
  1809. ]
  1810. )
  1811. }
  1812. var staticRenderFns = []
  1813. render._withStripped = true
  1814. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  1815. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=script&lang=js&
  1816. //
  1817. //
  1818. //
  1819. //
  1820. //
  1821. //
  1822. //
  1823. //
  1824. //
  1825. //
  1826. //
  1827. //
  1828. //
  1829. //
  1830. //
  1831. //
  1832. //
  1833. //
  1834. //
  1835. //
  1836. //
  1837. //
  1838. //
  1839. //
  1840. /* harmony default export */ var buttonvue_type_script_lang_js_ = ({
  1841. name: 'TisButton',
  1842. inject: {
  1843. elForm: {
  1844. default: ''
  1845. },
  1846. elFormItem: {
  1847. default: ''
  1848. }
  1849. },
  1850. props: {
  1851. type: {
  1852. type: String,
  1853. default: 'default'
  1854. },
  1855. size: String,
  1856. icon: {
  1857. type: String,
  1858. default: ''
  1859. },
  1860. nativeType: {
  1861. type: String,
  1862. default: 'button'
  1863. },
  1864. loading: Boolean,
  1865. disabled: Boolean,
  1866. plain: Boolean,
  1867. autofocus: Boolean,
  1868. round: Boolean,
  1869. circle: Boolean
  1870. },
  1871. computed: {
  1872. _elFormItemSize: function _elFormItemSize() {
  1873. return (this.elFormItem || {}).elFormItemSize;
  1874. },
  1875. buttonSize: function buttonSize() {
  1876. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1877. },
  1878. buttonDisabled: function buttonDisabled() {
  1879. return this.disabled || (this.elForm || {}).disabled;
  1880. }
  1881. },
  1882. methods: {
  1883. handleClick: function handleClick(evt) {
  1884. this.$emit('click', evt);
  1885. }
  1886. }
  1887. });
  1888. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js&
  1889. /* harmony default export */ var src_buttonvue_type_script_lang_js_ = (buttonvue_type_script_lang_js_);
  1890. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1891. var componentNormalizer = __webpack_require__(2);
  1892. // CONCATENATED MODULE: ./packages/button/src/button.vue
  1893. /* normalize component */
  1894. var component = Object(componentNormalizer["a" /* default */])(
  1895. src_buttonvue_type_script_lang_js_,
  1896. render,
  1897. staticRenderFns,
  1898. false,
  1899. null,
  1900. null,
  1901. null
  1902. )
  1903. /* hot reload */
  1904. if (false) { var api; }
  1905. component.options.__file = "packages/button/src/button.vue"
  1906. /* harmony default export */ var src_button = (component.exports);
  1907. // CONCATENATED MODULE: ./packages/button/index.js
  1908. /* istanbul ignore next */
  1909. src_button.install = function (Vue) {
  1910. Vue.component(src_button.name, src_button);
  1911. };
  1912. /* harmony default export */ var packages_button = __webpack_exports__["default"] = (src_button);
  1913. /***/ }),
  1914. /***/ 72:
  1915. /***/ (function(module, exports) {
  1916. module.exports = require("tis-ui/lib/locale");
  1917. /***/ }),
  1918. /***/ 77:
  1919. /***/ (function(module, exports) {
  1920. module.exports = require("tis-ui/lib/utils/popup");
  1921. /***/ })
  1922. /******/ });