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.

1536 lines
43 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 = 156);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 13:
  90. /***/ (function(module, exports) {
  91. module.exports = require("tis-ui/lib/mixins/emitter");
  92. /***/ }),
  93. /***/ 156:
  94. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95. "use strict";
  96. // ESM COMPAT FLAG
  97. __webpack_require__.r(__webpack_exports__);
  98. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  99. var render = function() {
  100. var _vm = this
  101. var _h = _vm.$createElement
  102. var _c = _vm._self._c || _h
  103. return _c(
  104. "div",
  105. {
  106. class: [
  107. "el-input-number",
  108. _vm.inputNumberSize ? "el-input-number--" + _vm.inputNumberSize : "",
  109. { "is-disabled": _vm.inputNumberDisabled },
  110. { "is-without-controls": !_vm.controls },
  111. { "is-controls-right": _vm.controlsAtRight }
  112. ],
  113. on: {
  114. dragstart: function($event) {
  115. $event.preventDefault()
  116. }
  117. }
  118. },
  119. [
  120. _vm.controls
  121. ? _c(
  122. "span",
  123. {
  124. directives: [
  125. {
  126. name: "repeat-click",
  127. rawName: "v-repeat-click",
  128. value: _vm.decrease,
  129. expression: "decrease"
  130. }
  131. ],
  132. staticClass: "el-input-number__decrease",
  133. class: { "is-disabled": _vm.minDisabled },
  134. attrs: { role: "button" },
  135. on: {
  136. keydown: function($event) {
  137. if (
  138. !("button" in $event) &&
  139. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  140. ) {
  141. return null
  142. }
  143. return _vm.decrease($event)
  144. }
  145. }
  146. },
  147. [
  148. _c("i", {
  149. class:
  150. "el-icon-" + (_vm.controlsAtRight ? "arrow-down" : "minus")
  151. })
  152. ]
  153. )
  154. : _vm._e(),
  155. _vm.controls
  156. ? _c(
  157. "span",
  158. {
  159. directives: [
  160. {
  161. name: "repeat-click",
  162. rawName: "v-repeat-click",
  163. value: _vm.increase,
  164. expression: "increase"
  165. }
  166. ],
  167. staticClass: "el-input-number__increase",
  168. class: { "is-disabled": _vm.maxDisabled },
  169. attrs: { role: "button" },
  170. on: {
  171. keydown: function($event) {
  172. if (
  173. !("button" in $event) &&
  174. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  175. ) {
  176. return null
  177. }
  178. return _vm.increase($event)
  179. }
  180. }
  181. },
  182. [
  183. _c("i", {
  184. class: "el-icon-" + (_vm.controlsAtRight ? "arrow-up" : "plus")
  185. })
  186. ]
  187. )
  188. : _vm._e(),
  189. _c("tis-input", {
  190. ref: "input",
  191. attrs: {
  192. value: _vm.displayValue,
  193. placeholder: _vm.placeholder,
  194. disabled: _vm.inputNumberDisabled,
  195. size: _vm.inputNumberSize,
  196. max: _vm.max,
  197. min: _vm.min,
  198. name: _vm.name,
  199. label: _vm.label
  200. },
  201. on: {
  202. blur: _vm.handleBlur,
  203. focus: _vm.handleFocus,
  204. input: _vm.handleInput,
  205. change: _vm.handleInputChange
  206. },
  207. nativeOn: {
  208. keydown: [
  209. function($event) {
  210. if (
  211. !("button" in $event) &&
  212. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  213. ) {
  214. return null
  215. }
  216. $event.preventDefault()
  217. return _vm.increase($event)
  218. },
  219. function($event) {
  220. if (
  221. !("button" in $event) &&
  222. _vm._k($event.keyCode, "down", 40, $event.key, [
  223. "Down",
  224. "ArrowDown"
  225. ])
  226. ) {
  227. return null
  228. }
  229. $event.preventDefault()
  230. return _vm.decrease($event)
  231. }
  232. ]
  233. }
  234. })
  235. ],
  236. 1
  237. )
  238. }
  239. var staticRenderFns = []
  240. render._withStripped = true
  241. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  242. // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
  243. var input = __webpack_require__(52);
  244. // EXTERNAL MODULE: external "tis-ui/lib/mixins/focus"
  245. var focus_ = __webpack_require__(88);
  246. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  247. // EXTERNAL MODULE: ./src/directives/repeat-click.js
  248. var repeat_click = __webpack_require__(99);
  249. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  250. //
  251. //
  252. //
  253. //
  254. //
  255. //
  256. //
  257. //
  258. //
  259. //
  260. //
  261. //
  262. //
  263. //
  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. //
  291. //
  292. //
  293. //
  294. //
  295. //
  296. //
  297. /* harmony default export */ var input_numbervue_type_script_lang_js_ = ({
  298. name: 'TisInputNumber',
  299. mixins: [focus_default()('input')],
  300. inject: {
  301. elForm: {
  302. default: ''
  303. },
  304. elFormItem: {
  305. default: ''
  306. }
  307. },
  308. directives: {
  309. repeatClick: repeat_click["a" /* default */]
  310. },
  311. components: {
  312. ElInput: input["default"]
  313. },
  314. props: {
  315. step: {
  316. type: Number,
  317. default: 1
  318. },
  319. stepStrictly: {
  320. type: Boolean,
  321. default: false
  322. },
  323. max: {
  324. type: Number,
  325. default: Infinity
  326. },
  327. min: {
  328. type: Number,
  329. default: -Infinity
  330. },
  331. value: {},
  332. disabled: Boolean,
  333. size: String,
  334. controls: {
  335. type: Boolean,
  336. default: true
  337. },
  338. controlsPosition: {
  339. type: String,
  340. default: ''
  341. },
  342. name: String,
  343. label: String,
  344. placeholder: String,
  345. precision: {
  346. type: Number,
  347. validator: function validator(val) {
  348. return val >= 0 && val === parseInt(val, 10);
  349. }
  350. }
  351. },
  352. data: function data() {
  353. return {
  354. currentValue: 0,
  355. userInput: null
  356. };
  357. },
  358. watch: {
  359. value: {
  360. immediate: true,
  361. handler: function handler(value) {
  362. var newVal = value === undefined ? value : Number(value);
  363. if (newVal !== undefined) {
  364. if (isNaN(newVal)) {
  365. return;
  366. }
  367. if (this.stepStrictly) {
  368. var stepPrecision = this.getPrecision(this.step);
  369. var precisionFactor = Math.pow(10, stepPrecision);
  370. newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
  371. }
  372. if (this.precision !== undefined) {
  373. newVal = this.toPrecision(newVal, this.precision);
  374. }
  375. }
  376. if (newVal >= this.max) newVal = this.max;
  377. if (newVal <= this.min) newVal = this.min;
  378. this.currentValue = newVal;
  379. this.userInput = null;
  380. this.$emit('input', newVal);
  381. }
  382. }
  383. },
  384. computed: {
  385. minDisabled: function minDisabled() {
  386. return this._decrease(this.value, this.step) < this.min;
  387. },
  388. maxDisabled: function maxDisabled() {
  389. return this._increase(this.value, this.step) > this.max;
  390. },
  391. numPrecision: function numPrecision() {
  392. var value = this.value,
  393. step = this.step,
  394. getPrecision = this.getPrecision,
  395. precision = this.precision;
  396. var stepPrecision = getPrecision(step);
  397. if (precision !== undefined) {
  398. if (stepPrecision > precision) {
  399. console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
  400. }
  401. return precision;
  402. } else {
  403. return Math.max(getPrecision(value), stepPrecision);
  404. }
  405. },
  406. controlsAtRight: function controlsAtRight() {
  407. return this.controls && this.controlsPosition === 'right';
  408. },
  409. _elFormItemSize: function _elFormItemSize() {
  410. return (this.elFormItem || {}).elFormItemSize;
  411. },
  412. inputNumberSize: function inputNumberSize() {
  413. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  414. },
  415. inputNumberDisabled: function inputNumberDisabled() {
  416. return this.disabled || !!(this.elForm || {}).disabled;
  417. },
  418. displayValue: function displayValue() {
  419. if (this.userInput !== null) {
  420. return this.userInput;
  421. }
  422. var currentValue = this.currentValue;
  423. if (typeof currentValue === 'number') {
  424. if (this.stepStrictly) {
  425. var stepPrecision = this.getPrecision(this.step);
  426. var precisionFactor = Math.pow(10, stepPrecision);
  427. currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
  428. }
  429. if (this.precision !== undefined) {
  430. currentValue = currentValue.toFixed(this.precision);
  431. }
  432. }
  433. return currentValue;
  434. }
  435. },
  436. methods: {
  437. toPrecision: function toPrecision(num, precision) {
  438. if (precision === undefined) precision = this.numPrecision;
  439. return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
  440. },
  441. getPrecision: function getPrecision(value) {
  442. if (value === undefined) return 0;
  443. var valueString = value.toString();
  444. var dotPosition = valueString.indexOf('.');
  445. var precision = 0;
  446. if (dotPosition !== -1) {
  447. precision = valueString.length - dotPosition - 1;
  448. }
  449. return precision;
  450. },
  451. _increase: function _increase(val, step) {
  452. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  453. var precisionFactor = Math.pow(10, this.numPrecision);
  454. // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
  455. return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
  456. },
  457. _decrease: function _decrease(val, step) {
  458. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  459. var precisionFactor = Math.pow(10, this.numPrecision);
  460. return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
  461. },
  462. increase: function increase() {
  463. if (this.inputNumberDisabled || this.maxDisabled) return;
  464. var value = this.value || 0;
  465. var newVal = this._increase(value, this.step);
  466. this.setCurrentValue(newVal);
  467. },
  468. decrease: function decrease() {
  469. if (this.inputNumberDisabled || this.minDisabled) return;
  470. var value = this.value || 0;
  471. var newVal = this._decrease(value, this.step);
  472. this.setCurrentValue(newVal);
  473. },
  474. handleBlur: function handleBlur(event) {
  475. this.$emit('blur', event);
  476. },
  477. handleFocus: function handleFocus(event) {
  478. this.$emit('focus', event);
  479. },
  480. setCurrentValue: function setCurrentValue(newVal) {
  481. var oldVal = this.currentValue;
  482. if (typeof newVal === 'number' && this.precision !== undefined) {
  483. newVal = this.toPrecision(newVal, this.precision);
  484. }
  485. if (newVal >= this.max) newVal = this.max;
  486. if (newVal <= this.min) newVal = this.min;
  487. if (oldVal === newVal) return;
  488. this.userInput = null;
  489. this.$emit('input', newVal);
  490. this.$emit('change', newVal, oldVal);
  491. this.currentValue = newVal;
  492. },
  493. handleInput: function handleInput(value) {
  494. this.userInput = value;
  495. },
  496. handleInputChange: function handleInputChange(value) {
  497. var newVal = value === '' ? undefined : Number(value);
  498. if (!isNaN(newVal) || value === '') {
  499. this.setCurrentValue(newVal);
  500. }
  501. this.userInput = null;
  502. },
  503. select: function select() {
  504. this.$refs.input.select();
  505. }
  506. },
  507. mounted: function mounted() {
  508. var innerInput = this.$refs.input.$refs.input;
  509. innerInput.setAttribute('role', 'spinbutton');
  510. innerInput.setAttribute('aria-valuemax', this.max);
  511. innerInput.setAttribute('aria-valuemin', this.min);
  512. innerInput.setAttribute('aria-valuenow', this.currentValue);
  513. innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
  514. },
  515. updated: function updated() {
  516. if (!this.$refs || !this.$refs.input) return;
  517. var innerInput = this.$refs.input.$refs.input;
  518. innerInput.setAttribute('aria-valuenow', this.currentValue);
  519. }
  520. });
  521. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  522. /* harmony default export */ var src_input_numbervue_type_script_lang_js_ = (input_numbervue_type_script_lang_js_);
  523. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  524. var componentNormalizer = __webpack_require__(2);
  525. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue
  526. /* normalize component */
  527. var component = Object(componentNormalizer["a" /* default */])(
  528. src_input_numbervue_type_script_lang_js_,
  529. render,
  530. staticRenderFns,
  531. false,
  532. null,
  533. null,
  534. null
  535. )
  536. /* hot reload */
  537. if (false) { var api; }
  538. component.options.__file = "packages/input-number/src/input-number.vue"
  539. /* harmony default export */ var input_number = (component.exports);
  540. // CONCATENATED MODULE: ./packages/input-number/index.js
  541. /* istanbul ignore next */
  542. input_number.install = function (Vue) {
  543. Vue.component(input_number.name, input_number);
  544. };
  545. /* harmony default export */ var packages_input_number = __webpack_exports__["default"] = (input_number);
  546. /***/ }),
  547. /***/ 2:
  548. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  549. "use strict";
  550. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  551. /* globals __VUE_SSR_CONTEXT__ */
  552. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  553. // This module is a runtime utility for cleaner component module output and will
  554. // be included in the final webpack user bundle.
  555. function normalizeComponent (
  556. scriptExports,
  557. render,
  558. staticRenderFns,
  559. functionalTemplate,
  560. injectStyles,
  561. scopeId,
  562. moduleIdentifier, /* server only */
  563. shadowMode /* vue-cli only */
  564. ) {
  565. // Vue.extend constructor export interop
  566. var options = typeof scriptExports === 'function'
  567. ? scriptExports.options
  568. : scriptExports
  569. // render functions
  570. if (render) {
  571. options.render = render
  572. options.staticRenderFns = staticRenderFns
  573. options._compiled = true
  574. }
  575. // functional template
  576. if (functionalTemplate) {
  577. options.functional = true
  578. }
  579. // scopedId
  580. if (scopeId) {
  581. options._scopeId = 'data-v-' + scopeId
  582. }
  583. var hook
  584. if (moduleIdentifier) { // server build
  585. hook = function (context) {
  586. // 2.3 injection
  587. context =
  588. context || // cached call
  589. (this.$vnode && this.$vnode.ssrContext) || // stateful
  590. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  591. // 2.2 with runInNewContext: true
  592. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  593. context = __VUE_SSR_CONTEXT__
  594. }
  595. // inject component styles
  596. if (injectStyles) {
  597. injectStyles.call(this, context)
  598. }
  599. // register component module identifier for async chunk inferrence
  600. if (context && context._registeredComponents) {
  601. context._registeredComponents.add(moduleIdentifier)
  602. }
  603. }
  604. // used by ssr in case component is cached and beforeCreate
  605. // never gets called
  606. options._ssrRegister = hook
  607. } else if (injectStyles) {
  608. hook = shadowMode
  609. ? function () {
  610. injectStyles.call(
  611. this,
  612. (options.functional ? this.parent : this).$root.$options.shadowRoot
  613. )
  614. }
  615. : injectStyles
  616. }
  617. if (hook) {
  618. if (options.functional) {
  619. // for template-only hot-reload because in that case the render fn doesn't
  620. // go through the normalizer
  621. options._injectStyles = hook
  622. // register for functional component in vue file
  623. var originalRender = options.render
  624. options.render = function renderWithStyleInjection (h, context) {
  625. hook.call(context)
  626. return originalRender(h, context)
  627. }
  628. } else {
  629. // inject component registration as beforeCreate hook
  630. var existing = options.beforeCreate
  631. options.beforeCreate = existing
  632. ? [].concat(existing, hook)
  633. : [hook]
  634. }
  635. }
  636. return {
  637. exports: scriptExports,
  638. options: options
  639. }
  640. }
  641. /***/ }),
  642. /***/ 33:
  643. /***/ (function(module, exports) {
  644. module.exports = require("tis-ui/lib/utils/merge");
  645. /***/ }),
  646. /***/ 36:
  647. /***/ (function(module, exports) {
  648. module.exports = require("tis-ui/lib/mixins/migrating");
  649. /***/ }),
  650. /***/ 49:
  651. /***/ (function(module, exports) {
  652. module.exports = require("tis-ui/lib/utils/shared");
  653. /***/ }),
  654. /***/ 52:
  655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  656. "use strict";
  657. // ESM COMPAT FLAG
  658. __webpack_require__.r(__webpack_exports__);
  659. // 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&
  660. var render = function() {
  661. var _vm = this
  662. var _h = _vm.$createElement
  663. var _c = _vm._self._c || _h
  664. return _c(
  665. "div",
  666. {
  667. class: [
  668. _vm.type === "textarea" ? "el-textarea" : "el-input",
  669. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  670. {
  671. "is-disabled": _vm.inputDisabled,
  672. "is-exceed": _vm.inputExceed,
  673. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  674. "el-input-group--append": _vm.$slots.append,
  675. "el-input-group--prepend": _vm.$slots.prepend,
  676. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  677. "el-input--suffix":
  678. _vm.$slots.suffix ||
  679. _vm.suffixIcon ||
  680. _vm.clearable ||
  681. _vm.showPassword
  682. }
  683. ],
  684. on: {
  685. mouseenter: function($event) {
  686. _vm.hovering = true
  687. },
  688. mouseleave: function($event) {
  689. _vm.hovering = false
  690. }
  691. }
  692. },
  693. [
  694. _vm.type !== "textarea"
  695. ? [
  696. _vm.$slots.prepend
  697. ? _c(
  698. "div",
  699. { staticClass: "el-input-group__prepend" },
  700. [_vm._t("prepend")],
  701. 2
  702. )
  703. : _vm._e(),
  704. _vm.type !== "textarea"
  705. ? _c(
  706. "input",
  707. _vm._b(
  708. {
  709. ref: "input",
  710. staticClass: "el-input__inner",
  711. attrs: {
  712. tabindex: _vm.tabindex,
  713. type: _vm.showPassword
  714. ? _vm.passwordVisible
  715. ? "text"
  716. : "password"
  717. : _vm.type,
  718. disabled: _vm.inputDisabled,
  719. readonly: _vm.readonly,
  720. autocomplete: _vm.autoComplete || _vm.autocomplete,
  721. "aria-label": _vm.label
  722. },
  723. on: {
  724. compositionstart: _vm.handleCompositionStart,
  725. compositionupdate: _vm.handleCompositionUpdate,
  726. compositionend: _vm.handleCompositionEnd,
  727. input: _vm.handleInput,
  728. focus: _vm.handleFocus,
  729. blur: _vm.handleBlur,
  730. change: _vm.handleChange
  731. }
  732. },
  733. "input",
  734. _vm.$attrs,
  735. false
  736. )
  737. )
  738. : _vm._e(),
  739. _vm.$slots.prefix || _vm.prefixIcon
  740. ? _c(
  741. "span",
  742. { staticClass: "el-input__prefix" },
  743. [
  744. _vm._t("prefix"),
  745. _vm.prefixIcon
  746. ? _c("i", {
  747. staticClass: "el-input__icon",
  748. class: _vm.prefixIcon
  749. })
  750. : _vm._e()
  751. ],
  752. 2
  753. )
  754. : _vm._e(),
  755. _vm.getSuffixVisible()
  756. ? _c("span", { staticClass: "el-input__suffix" }, [
  757. _c(
  758. "span",
  759. { staticClass: "el-input__suffix-inner" },
  760. [
  761. !_vm.showClear ||
  762. !_vm.showPwdVisible ||
  763. !_vm.isWordLimitVisible
  764. ? [
  765. _vm._t("suffix"),
  766. _vm.suffixIcon
  767. ? _c("i", {
  768. staticClass: "el-input__icon",
  769. class: _vm.suffixIcon
  770. })
  771. : _vm._e()
  772. ]
  773. : _vm._e(),
  774. _vm.showClear
  775. ? _c("i", {
  776. staticClass:
  777. "el-input__icon el-icon-circle-close el-input__clear",
  778. on: {
  779. mousedown: function($event) {
  780. $event.preventDefault()
  781. },
  782. click: _vm.clear
  783. }
  784. })
  785. : _vm._e(),
  786. _vm.showPwdVisible
  787. ? _c("i", {
  788. staticClass:
  789. "el-input__icon el-icon-view el-input__clear",
  790. on: { click: _vm.handlePasswordVisible }
  791. })
  792. : _vm._e(),
  793. _vm.isWordLimitVisible
  794. ? _c("span", { staticClass: "el-input__count" }, [
  795. _c(
  796. "span",
  797. { staticClass: "el-input__count-inner" },
  798. [
  799. _vm._v(
  800. "\n " +
  801. _vm._s(_vm.textLength) +
  802. "/" +
  803. _vm._s(_vm.upperLimit) +
  804. "\n "
  805. )
  806. ]
  807. )
  808. ])
  809. : _vm._e()
  810. ],
  811. 2
  812. ),
  813. _vm.validateState
  814. ? _c("i", {
  815. staticClass: "el-input__icon",
  816. class: ["el-input__validateIcon", _vm.validateIcon]
  817. })
  818. : _vm._e()
  819. ])
  820. : _vm._e(),
  821. _vm.$slots.append
  822. ? _c(
  823. "div",
  824. { staticClass: "el-input-group__append" },
  825. [_vm._t("append")],
  826. 2
  827. )
  828. : _vm._e()
  829. ]
  830. : _c(
  831. "textarea",
  832. _vm._b(
  833. {
  834. ref: "textarea",
  835. staticClass: "el-textarea__inner",
  836. style: _vm.textareaStyle,
  837. attrs: {
  838. tabindex: _vm.tabindex,
  839. disabled: _vm.inputDisabled,
  840. readonly: _vm.readonly,
  841. autocomplete: _vm.autoComplete || _vm.autocomplete,
  842. "aria-label": _vm.label
  843. },
  844. on: {
  845. compositionstart: _vm.handleCompositionStart,
  846. compositionupdate: _vm.handleCompositionUpdate,
  847. compositionend: _vm.handleCompositionEnd,
  848. input: _vm.handleInput,
  849. focus: _vm.handleFocus,
  850. blur: _vm.handleBlur,
  851. change: _vm.handleChange
  852. }
  853. },
  854. "textarea",
  855. _vm.$attrs,
  856. false
  857. )
  858. ),
  859. _vm.isWordLimitVisible && _vm.type === "textarea"
  860. ? _c("span", { staticClass: "el-input__count" }, [
  861. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  862. ])
  863. : _vm._e()
  864. ],
  865. 2
  866. )
  867. }
  868. var staticRenderFns = []
  869. render._withStripped = true
  870. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  871. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  872. var emitter_ = __webpack_require__(13);
  873. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  874. // EXTERNAL MODULE: external "tis-ui/lib/mixins/migrating"
  875. var migrating_ = __webpack_require__(36);
  876. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  877. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  878. var hiddenTextarea = void 0;
  879. 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';
  880. 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'];
  881. function calculateNodeStyling(targetElement) {
  882. var style = window.getComputedStyle(targetElement);
  883. var boxSizing = style.getPropertyValue('box-sizing');
  884. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  885. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  886. var contextStyle = CONTEXT_STYLE.map(function (name) {
  887. return name + ':' + style.getPropertyValue(name);
  888. }).join(';');
  889. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  890. }
  891. function calcTextareaHeight(targetElement) {
  892. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  893. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  894. if (!hiddenTextarea) {
  895. hiddenTextarea = document.createElement('textarea');
  896. document.body.appendChild(hiddenTextarea);
  897. }
  898. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  899. paddingSize = _calculateNodeStyling.paddingSize,
  900. borderSize = _calculateNodeStyling.borderSize,
  901. boxSizing = _calculateNodeStyling.boxSizing,
  902. contextStyle = _calculateNodeStyling.contextStyle;
  903. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  904. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  905. var height = hiddenTextarea.scrollHeight;
  906. var result = {};
  907. if (boxSizing === 'border-box') {
  908. height = height + borderSize;
  909. } else if (boxSizing === 'content-box') {
  910. height = height - paddingSize;
  911. }
  912. hiddenTextarea.value = '';
  913. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  914. if (minRows !== null) {
  915. var minHeight = singleRowHeight * minRows;
  916. if (boxSizing === 'border-box') {
  917. minHeight = minHeight + paddingSize + borderSize;
  918. }
  919. height = Math.max(minHeight, height);
  920. result.minHeight = minHeight + 'px';
  921. }
  922. if (maxRows !== null) {
  923. var maxHeight = singleRowHeight * maxRows;
  924. if (boxSizing === 'border-box') {
  925. maxHeight = maxHeight + paddingSize + borderSize;
  926. }
  927. height = Math.min(maxHeight, height);
  928. }
  929. result.height = height + 'px';
  930. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  931. hiddenTextarea = null;
  932. return result;
  933. };
  934. // EXTERNAL MODULE: external "tis-ui/lib/utils/merge"
  935. var merge_ = __webpack_require__(33);
  936. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  937. // EXTERNAL MODULE: external "tis-ui/lib/utils/shared"
  938. var shared_ = __webpack_require__(49);
  939. // 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&
  940. //
  941. //
  942. //
  943. //
  944. //
  945. //
  946. //
  947. //
  948. //
  949. //
  950. //
  951. //
  952. //
  953. //
  954. //
  955. //
  956. //
  957. //
  958. //
  959. //
  960. //
  961. //
  962. //
  963. //
  964. //
  965. //
  966. //
  967. //
  968. //
  969. //
  970. //
  971. //
  972. //
  973. //
  974. //
  975. //
  976. //
  977. //
  978. //
  979. //
  980. //
  981. //
  982. //
  983. //
  984. //
  985. //
  986. //
  987. //
  988. //
  989. //
  990. //
  991. //
  992. //
  993. //
  994. //
  995. //
  996. //
  997. //
  998. //
  999. //
  1000. //
  1001. //
  1002. //
  1003. //
  1004. //
  1005. //
  1006. //
  1007. //
  1008. //
  1009. //
  1010. //
  1011. //
  1012. //
  1013. //
  1014. //
  1015. //
  1016. //
  1017. //
  1018. //
  1019. //
  1020. //
  1021. //
  1022. //
  1023. //
  1024. //
  1025. //
  1026. //
  1027. //
  1028. //
  1029. //
  1030. //
  1031. //
  1032. //
  1033. //
  1034. //
  1035. //
  1036. //
  1037. //
  1038. //
  1039. //
  1040. //
  1041. //
  1042. //
  1043. //
  1044. //
  1045. //
  1046. //
  1047. //
  1048. //
  1049. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  1050. name: 'TisInput',
  1051. componentName: 'TisInput',
  1052. mixins: [emitter_default.a, migrating_default.a],
  1053. inheritAttrs: false,
  1054. inject: {
  1055. elForm: {
  1056. default: ''
  1057. },
  1058. elFormItem: {
  1059. default: ''
  1060. }
  1061. },
  1062. data: function data() {
  1063. return {
  1064. textareaCalcStyle: {},
  1065. hovering: false,
  1066. focused: false,
  1067. isComposing: false,
  1068. passwordVisible: false
  1069. };
  1070. },
  1071. props: {
  1072. value: [String, Number],
  1073. size: String,
  1074. resize: String,
  1075. form: String,
  1076. disabled: Boolean,
  1077. readonly: Boolean,
  1078. type: {
  1079. type: String,
  1080. default: 'text'
  1081. },
  1082. autosize: {
  1083. type: [Boolean, Object],
  1084. default: false
  1085. },
  1086. autocomplete: {
  1087. type: String,
  1088. default: 'off'
  1089. },
  1090. /** @Deprecated in next major version */
  1091. autoComplete: {
  1092. type: String,
  1093. validator: function validator(val) {
  1094. false && false;
  1095. return true;
  1096. }
  1097. },
  1098. validateEvent: {
  1099. type: Boolean,
  1100. default: true
  1101. },
  1102. suffixIcon: String,
  1103. prefixIcon: String,
  1104. label: String,
  1105. clearable: {
  1106. type: Boolean,
  1107. default: false
  1108. },
  1109. showPassword: {
  1110. type: Boolean,
  1111. default: false
  1112. },
  1113. showWordLimit: {
  1114. type: Boolean,
  1115. default: false
  1116. },
  1117. tabindex: String
  1118. },
  1119. computed: {
  1120. _elFormItemSize: function _elFormItemSize() {
  1121. return (this.elFormItem || {}).elFormItemSize;
  1122. },
  1123. validateState: function validateState() {
  1124. return this.elFormItem ? this.elFormItem.validateState : '';
  1125. },
  1126. needStatusIcon: function needStatusIcon() {
  1127. return this.elForm ? this.elForm.statusIcon : false;
  1128. },
  1129. validateIcon: function validateIcon() {
  1130. return {
  1131. validating: 'el-icon-loading',
  1132. success: 'el-icon-circle-check',
  1133. error: 'el-icon-circle-close'
  1134. }[this.validateState];
  1135. },
  1136. textareaStyle: function textareaStyle() {
  1137. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  1138. },
  1139. inputSize: function inputSize() {
  1140. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1141. },
  1142. inputDisabled: function inputDisabled() {
  1143. return this.disabled || (this.elForm || {}).disabled;
  1144. },
  1145. nativeInputValue: function nativeInputValue() {
  1146. return this.value === null || this.value === undefined ? '' : String(this.value);
  1147. },
  1148. showClear: function showClear() {
  1149. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  1150. },
  1151. showPwdVisible: function showPwdVisible() {
  1152. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  1153. },
  1154. isWordLimitVisible: function isWordLimitVisible() {
  1155. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  1156. },
  1157. upperLimit: function upperLimit() {
  1158. return this.$attrs.maxlength;
  1159. },
  1160. textLength: function textLength() {
  1161. if (typeof this.value === 'number') {
  1162. return String(this.value).length;
  1163. }
  1164. return (this.value || '').length;
  1165. },
  1166. inputExceed: function inputExceed() {
  1167. // show exceed style if length of initial value greater then maxlength
  1168. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  1169. }
  1170. },
  1171. watch: {
  1172. value: function value(val) {
  1173. this.$nextTick(this.resizeTextarea);
  1174. if (this.validateEvent) {
  1175. this.dispatch('ElFormItem', 'el.form.change', [val]);
  1176. }
  1177. },
  1178. // native input value is set explicitly
  1179. // do not use v-model / :value in template
  1180. // see: https://github.com/ElemeFE/element/issues/14521
  1181. nativeInputValue: function nativeInputValue() {
  1182. this.setNativeInputValue();
  1183. },
  1184. // when change between <input> and <textarea>,
  1185. // update DOM dependent value and styles
  1186. // https://github.com/ElemeFE/element/issues/14857
  1187. type: function type() {
  1188. var _this = this;
  1189. this.$nextTick(function () {
  1190. _this.setNativeInputValue();
  1191. _this.resizeTextarea();
  1192. _this.updateIconOffset();
  1193. });
  1194. }
  1195. },
  1196. methods: {
  1197. focus: function focus() {
  1198. this.getInput().focus();
  1199. },
  1200. blur: function blur() {
  1201. this.getInput().blur();
  1202. },
  1203. getMigratingConfig: function getMigratingConfig() {
  1204. return {
  1205. props: {
  1206. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  1207. 'on-icon-click': 'on-icon-click is removed.'
  1208. },
  1209. events: {
  1210. 'click': 'click is removed.'
  1211. }
  1212. };
  1213. },
  1214. handleBlur: function handleBlur(event) {
  1215. this.focused = false;
  1216. this.$emit('blur', event);
  1217. if (this.validateEvent) {
  1218. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  1219. }
  1220. },
  1221. select: function select() {
  1222. this.getInput().select();
  1223. },
  1224. resizeTextarea: function resizeTextarea() {
  1225. if (this.$isServer) return;
  1226. var autosize = this.autosize,
  1227. type = this.type;
  1228. if (type !== 'textarea') return;
  1229. if (!autosize) {
  1230. this.textareaCalcStyle = {
  1231. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  1232. };
  1233. return;
  1234. }
  1235. var minRows = autosize.minRows;
  1236. var maxRows = autosize.maxRows;
  1237. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  1238. },
  1239. setNativeInputValue: function setNativeInputValue() {
  1240. var input = this.getInput();
  1241. if (!input) return;
  1242. if (input.value === this.nativeInputValue) return;
  1243. input.value = this.nativeInputValue;
  1244. },
  1245. handleFocus: function handleFocus(event) {
  1246. this.focused = true;
  1247. this.$emit('focus', event);
  1248. },
  1249. handleCompositionStart: function handleCompositionStart() {
  1250. this.isComposing = true;
  1251. },
  1252. handleCompositionUpdate: function handleCompositionUpdate(event) {
  1253. var text = event.target.value;
  1254. var lastCharacter = text[text.length - 1] || '';
  1255. this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
  1256. },
  1257. handleCompositionEnd: function handleCompositionEnd(event) {
  1258. if (this.isComposing) {
  1259. this.isComposing = false;
  1260. this.handleInput(event);
  1261. }
  1262. },
  1263. handleInput: function handleInput(event) {
  1264. // should not emit input during composition
  1265. // see: https://github.com/ElemeFE/element/issues/10516
  1266. if (this.isComposing) return;
  1267. // hack for https://github.com/ElemeFE/element/issues/8548
  1268. // should remove the following line when we don't support IE
  1269. if (event.target.value === this.nativeInputValue) return;
  1270. this.$emit('input', event.target.value);
  1271. // ensure native input value is controlled
  1272. // see: https://github.com/ElemeFE/element/issues/12850
  1273. this.$nextTick(this.setNativeInputValue);
  1274. },
  1275. handleChange: function handleChange(event) {
  1276. this.$emit('change', event.target.value);
  1277. },
  1278. calcIconOffset: function calcIconOffset(place) {
  1279. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  1280. if (!elList.length) return;
  1281. var el = null;
  1282. for (var i = 0; i < elList.length; i++) {
  1283. if (elList[i].parentNode === this.$el) {
  1284. el = elList[i];
  1285. break;
  1286. }
  1287. }
  1288. if (!el) return;
  1289. var pendantMap = {
  1290. suffix: 'append',
  1291. prefix: 'prepend'
  1292. };
  1293. var pendant = pendantMap[place];
  1294. if (this.$slots[pendant]) {
  1295. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  1296. } else {
  1297. el.removeAttribute('style');
  1298. }
  1299. },
  1300. updateIconOffset: function updateIconOffset() {
  1301. this.calcIconOffset('prefix');
  1302. this.calcIconOffset('suffix');
  1303. },
  1304. clear: function clear() {
  1305. this.$emit('input', '');
  1306. this.$emit('change', '');
  1307. this.$emit('clear');
  1308. },
  1309. handlePasswordVisible: function handlePasswordVisible() {
  1310. this.passwordVisible = !this.passwordVisible;
  1311. this.focus();
  1312. },
  1313. getInput: function getInput() {
  1314. return this.$refs.input || this.$refs.textarea;
  1315. },
  1316. getSuffixVisible: function getSuffixVisible() {
  1317. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  1318. }
  1319. },
  1320. created: function created() {
  1321. this.$on('inputSelect', this.select);
  1322. },
  1323. mounted: function mounted() {
  1324. this.setNativeInputValue();
  1325. this.resizeTextarea();
  1326. this.updateIconOffset();
  1327. },
  1328. updated: function updated() {
  1329. this.$nextTick(this.updateIconOffset);
  1330. }
  1331. });
  1332. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  1333. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  1334. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1335. var componentNormalizer = __webpack_require__(2);
  1336. // CONCATENATED MODULE: ./packages/input/src/input.vue
  1337. /* normalize component */
  1338. var component = Object(componentNormalizer["a" /* default */])(
  1339. src_inputvue_type_script_lang_js_,
  1340. render,
  1341. staticRenderFns,
  1342. false,
  1343. null,
  1344. null,
  1345. null
  1346. )
  1347. /* hot reload */
  1348. if (false) { var api; }
  1349. component.options.__file = "packages/input/src/input.vue"
  1350. /* harmony default export */ var input = (component.exports);
  1351. // CONCATENATED MODULE: ./packages/input/index.js
  1352. /* istanbul ignore next */
  1353. input.install = function (Vue) {
  1354. Vue.component(input.name, input);
  1355. };
  1356. /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
  1357. /***/ }),
  1358. /***/ 7:
  1359. /***/ (function(module, exports) {
  1360. module.exports = require("tis-ui/lib/utils/dom");
  1361. /***/ }),
  1362. /***/ 88:
  1363. /***/ (function(module, exports) {
  1364. module.exports = require("tis-ui/lib/mixins/focus");
  1365. /***/ }),
  1366. /***/ 99:
  1367. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1368. "use strict";
  1369. /* harmony import */ var tis_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
  1370. /* harmony import */ var tis_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tis_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__);
  1371. /* harmony default export */ __webpack_exports__["a"] = ({
  1372. bind: function bind(el, binding, vnode) {
  1373. var interval = null;
  1374. var startTime = void 0;
  1375. var handler = function handler() {
  1376. return vnode.context[binding.expression].apply();
  1377. };
  1378. var clear = function clear() {
  1379. if (Date.now() - startTime < 100) {
  1380. handler();
  1381. }
  1382. clearInterval(interval);
  1383. interval = null;
  1384. };
  1385. Object(tis_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["on"])(el, 'mousedown', function (e) {
  1386. if (e.button !== 0) return;
  1387. startTime = Date.now();
  1388. Object(tis_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["once"])(document, 'mouseup', clear);
  1389. clearInterval(interval);
  1390. interval = setInterval(handler, 100);
  1391. });
  1392. }
  1393. });
  1394. /***/ })
  1395. /******/ });