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.

4104 lines
113 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 = 534);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 10:
  90. /***/ (function(module, exports) {
  91. module.exports = require("tis-ui/lib/utils/util");
  92. /***/ }),
  93. /***/ 101:
  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/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tag/src/tag.vue?vue&type=script&lang=js&
  99. /* harmony default export */ var tagvue_type_script_lang_js_ = ({
  100. name: 'TisTag',
  101. props: {
  102. text: String,
  103. closable: Boolean,
  104. type: String,
  105. hit: Boolean,
  106. disableTransitions: Boolean,
  107. color: String,
  108. size: String,
  109. effect: {
  110. type: String,
  111. default: 'light',
  112. validator: function validator(val) {
  113. return ['dark', 'light', 'plain'].indexOf(val) !== -1;
  114. }
  115. }
  116. },
  117. methods: {
  118. handleClose: function handleClose(event) {
  119. event.stopPropagation();
  120. this.$emit('close', event);
  121. },
  122. handleClick: function handleClick(event) {
  123. this.$emit('click', event);
  124. }
  125. },
  126. computed: {
  127. tagSize: function tagSize() {
  128. return this.size || (this.$ELEMENT || {}).size;
  129. }
  130. },
  131. render: function render(h) {
  132. var type = this.type,
  133. tagSize = this.tagSize,
  134. hit = this.hit,
  135. effect = this.effect;
  136. var classes = ['el-tag', type ? 'el-tag--' + type : '', tagSize ? 'el-tag--' + tagSize : '', effect ? 'el-tag--' + effect : '', hit && 'is-hit'];
  137. var tagEl = h(
  138. 'span',
  139. {
  140. 'class': classes,
  141. style: { backgroundColor: this.color },
  142. on: {
  143. 'click': this.handleClick
  144. }
  145. },
  146. [this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: {
  147. 'click': this.handleClose
  148. }
  149. })]
  150. );
  151. return this.disableTransitions ? tagEl : h(
  152. 'transition',
  153. {
  154. attrs: { name: 'el-zoom-in-center' }
  155. },
  156. [tagEl]
  157. );
  158. }
  159. });
  160. // CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js&
  161. /* harmony default export */ var src_tagvue_type_script_lang_js_ = (tagvue_type_script_lang_js_);
  162. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  163. var componentNormalizer = __webpack_require__(2);
  164. // CONCATENATED MODULE: ./packages/tag/src/tag.vue
  165. var render, staticRenderFns
  166. /* normalize component */
  167. var component = Object(componentNormalizer["a" /* default */])(
  168. src_tagvue_type_script_lang_js_,
  169. render,
  170. staticRenderFns,
  171. false,
  172. null,
  173. null,
  174. null
  175. )
  176. /* hot reload */
  177. if (false) { var api; }
  178. component.options.__file = "packages/tag/src/tag.vue"
  179. /* harmony default export */ var tag = (component.exports);
  180. // CONCATENATED MODULE: ./packages/tag/index.js
  181. /* istanbul ignore next */
  182. tag.install = function (Vue) {
  183. Vue.component(tag.name, tag);
  184. };
  185. /* harmony default export */ var packages_tag = __webpack_exports__["default"] = (tag);
  186. /***/ }),
  187. /***/ 13:
  188. /***/ (function(module, exports) {
  189. module.exports = require("tis-ui/lib/mixins/emitter");
  190. /***/ }),
  191. /***/ 149:
  192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  193. "use strict";
  194. __webpack_require__.r(__webpack_exports__);
  195. /* harmony import */ var _select_src_option__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91);
  196. /* istanbul ignore next */
  197. _select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].install = function (Vue) {
  198. Vue.component(_select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].name, _select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
  199. };
  200. /* harmony default export */ __webpack_exports__["default"] = (_select_src_option__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"]);
  201. /***/ }),
  202. /***/ 154:
  203. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  204. "use strict";
  205. // ESM COMPAT FLAG
  206. __webpack_require__.r(__webpack_exports__);
  207. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  208. var render = function() {
  209. var _vm = this
  210. var _h = _vm.$createElement
  211. var _c = _vm._self._c || _h
  212. return _c(
  213. "div",
  214. {
  215. directives: [
  216. {
  217. name: "clickoutside",
  218. rawName: "v-clickoutside",
  219. value: _vm.handleClose,
  220. expression: "handleClose"
  221. }
  222. ],
  223. staticClass: "el-select",
  224. class: [_vm.selectSize ? "el-select--" + _vm.selectSize : ""],
  225. on: {
  226. click: function($event) {
  227. $event.stopPropagation()
  228. return _vm.toggleMenu($event)
  229. }
  230. }
  231. },
  232. [
  233. _vm.multiple
  234. ? _c(
  235. "div",
  236. {
  237. ref: "tags",
  238. staticClass: "el-select__tags",
  239. style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" }
  240. },
  241. [
  242. _vm.collapseTags && _vm.selected.length
  243. ? _c(
  244. "span",
  245. [
  246. _c(
  247. "tis-tag",
  248. {
  249. attrs: {
  250. closable: !_vm.selectDisabled,
  251. size: _vm.collapseTagSize,
  252. hit: _vm.selected[0].hitState,
  253. type: "info",
  254. "disable-transitions": ""
  255. },
  256. on: {
  257. close: function($event) {
  258. _vm.deleteTag($event, _vm.selected[0])
  259. }
  260. }
  261. },
  262. [
  263. _c("span", { staticClass: "el-select__tags-text" }, [
  264. _vm._v(_vm._s(_vm.selected[0].currentLabel))
  265. ])
  266. ]
  267. ),
  268. _vm.selected.length > 1
  269. ? _c(
  270. "tis-tag",
  271. {
  272. attrs: {
  273. closable: false,
  274. size: _vm.collapseTagSize,
  275. type: "info",
  276. "disable-transitions": ""
  277. }
  278. },
  279. [
  280. _c(
  281. "span",
  282. { staticClass: "el-select__tags-text" },
  283. [_vm._v("+ " + _vm._s(_vm.selected.length - 1))]
  284. )
  285. ]
  286. )
  287. : _vm._e()
  288. ],
  289. 1
  290. )
  291. : _vm._e(),
  292. !_vm.collapseTags
  293. ? _c(
  294. "transition-group",
  295. { on: { "after-leave": _vm.resetInputHeight } },
  296. _vm._l(_vm.selected, function(item) {
  297. return _c(
  298. "tis-tag",
  299. {
  300. key: _vm.getValueKey(item),
  301. attrs: {
  302. closable: !_vm.selectDisabled,
  303. size: _vm.collapseTagSize,
  304. hit: item.hitState,
  305. type: "info",
  306. "disable-transitions": ""
  307. },
  308. on: {
  309. close: function($event) {
  310. _vm.deleteTag($event, item)
  311. }
  312. }
  313. },
  314. [
  315. _c("span", { staticClass: "el-select__tags-text" }, [
  316. _vm._v(_vm._s(item.currentLabel))
  317. ])
  318. ]
  319. )
  320. }),
  321. 1
  322. )
  323. : _vm._e(),
  324. _vm.filterable
  325. ? _c("input", {
  326. directives: [
  327. {
  328. name: "model",
  329. rawName: "v-model",
  330. value: _vm.query,
  331. expression: "query"
  332. }
  333. ],
  334. ref: "input",
  335. staticClass: "el-select__input",
  336. class: [_vm.selectSize ? "is-" + _vm.selectSize : ""],
  337. style: {
  338. "flex-grow": "1",
  339. width: _vm.inputLength / (_vm.inputWidth - 32) + "%",
  340. "max-width": _vm.inputWidth - 42 + "px"
  341. },
  342. attrs: {
  343. type: "text",
  344. disabled: _vm.selectDisabled,
  345. autocomplete: _vm.autoComplete || _vm.autocomplete
  346. },
  347. domProps: { value: _vm.query },
  348. on: {
  349. focus: _vm.handleFocus,
  350. blur: function($event) {
  351. _vm.softFocus = false
  352. },
  353. keyup: _vm.managePlaceholder,
  354. keydown: [
  355. _vm.resetInputState,
  356. function($event) {
  357. if (
  358. !("button" in $event) &&
  359. _vm._k($event.keyCode, "down", 40, $event.key, [
  360. "Down",
  361. "ArrowDown"
  362. ])
  363. ) {
  364. return null
  365. }
  366. $event.preventDefault()
  367. _vm.navigateOptions("next")
  368. },
  369. function($event) {
  370. if (
  371. !("button" in $event) &&
  372. _vm._k($event.keyCode, "up", 38, $event.key, [
  373. "Up",
  374. "ArrowUp"
  375. ])
  376. ) {
  377. return null
  378. }
  379. $event.preventDefault()
  380. _vm.navigateOptions("prev")
  381. },
  382. function($event) {
  383. if (
  384. !("button" in $event) &&
  385. _vm._k(
  386. $event.keyCode,
  387. "enter",
  388. 13,
  389. $event.key,
  390. "Enter"
  391. )
  392. ) {
  393. return null
  394. }
  395. $event.preventDefault()
  396. return _vm.selectOption($event)
  397. },
  398. function($event) {
  399. if (
  400. !("button" in $event) &&
  401. _vm._k($event.keyCode, "esc", 27, $event.key, [
  402. "Esc",
  403. "Escape"
  404. ])
  405. ) {
  406. return null
  407. }
  408. $event.stopPropagation()
  409. $event.preventDefault()
  410. _vm.visible = false
  411. },
  412. function($event) {
  413. if (
  414. !("button" in $event) &&
  415. _vm._k(
  416. $event.keyCode,
  417. "delete",
  418. [8, 46],
  419. $event.key,
  420. ["Backspace", "Delete", "Del"]
  421. )
  422. ) {
  423. return null
  424. }
  425. return _vm.deletePrevTag($event)
  426. },
  427. function($event) {
  428. if (
  429. !("button" in $event) &&
  430. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  431. ) {
  432. return null
  433. }
  434. _vm.visible = false
  435. }
  436. ],
  437. compositionstart: _vm.handleComposition,
  438. compositionupdate: _vm.handleComposition,
  439. compositionend: _vm.handleComposition,
  440. input: [
  441. function($event) {
  442. if ($event.target.composing) {
  443. return
  444. }
  445. _vm.query = $event.target.value
  446. },
  447. _vm.debouncedQueryChange
  448. ]
  449. }
  450. })
  451. : _vm._e()
  452. ],
  453. 1
  454. )
  455. : _vm._e(),
  456. _c(
  457. "tis-input",
  458. {
  459. ref: "reference",
  460. class: { "is-focus": _vm.visible },
  461. attrs: {
  462. type: "text",
  463. placeholder: _vm.currentPlaceholder,
  464. name: _vm.name,
  465. id: _vm.id,
  466. autocomplete: _vm.autoComplete || _vm.autocomplete,
  467. size: _vm.selectSize,
  468. disabled: _vm.selectDisabled,
  469. readonly: _vm.readonly,
  470. "validate-event": false,
  471. tabindex: _vm.multiple && _vm.filterable ? "-1" : null
  472. },
  473. on: { focus: _vm.handleFocus, blur: _vm.handleBlur },
  474. nativeOn: {
  475. keyup: function($event) {
  476. return _vm.debouncedOnInputChange($event)
  477. },
  478. keydown: [
  479. function($event) {
  480. if (
  481. !("button" in $event) &&
  482. _vm._k($event.keyCode, "down", 40, $event.key, [
  483. "Down",
  484. "ArrowDown"
  485. ])
  486. ) {
  487. return null
  488. }
  489. $event.stopPropagation()
  490. $event.preventDefault()
  491. _vm.navigateOptions("next")
  492. },
  493. function($event) {
  494. if (
  495. !("button" in $event) &&
  496. _vm._k($event.keyCode, "up", 38, $event.key, [
  497. "Up",
  498. "ArrowUp"
  499. ])
  500. ) {
  501. return null
  502. }
  503. $event.stopPropagation()
  504. $event.preventDefault()
  505. _vm.navigateOptions("prev")
  506. },
  507. function($event) {
  508. if (
  509. !("button" in $event) &&
  510. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  511. ) {
  512. return null
  513. }
  514. $event.preventDefault()
  515. return _vm.selectOption($event)
  516. },
  517. function($event) {
  518. if (
  519. !("button" in $event) &&
  520. _vm._k($event.keyCode, "esc", 27, $event.key, [
  521. "Esc",
  522. "Escape"
  523. ])
  524. ) {
  525. return null
  526. }
  527. $event.stopPropagation()
  528. $event.preventDefault()
  529. _vm.visible = false
  530. },
  531. function($event) {
  532. if (
  533. !("button" in $event) &&
  534. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  535. ) {
  536. return null
  537. }
  538. _vm.visible = false
  539. }
  540. ],
  541. paste: function($event) {
  542. return _vm.debouncedOnInputChange($event)
  543. },
  544. mouseenter: function($event) {
  545. _vm.inputHovering = true
  546. },
  547. mouseleave: function($event) {
  548. _vm.inputHovering = false
  549. }
  550. },
  551. model: {
  552. value: _vm.selectedLabel,
  553. callback: function($$v) {
  554. _vm.selectedLabel = $$v
  555. },
  556. expression: "selectedLabel"
  557. }
  558. },
  559. [
  560. _vm.$slots.prefix
  561. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  562. : _vm._e(),
  563. _c("template", { slot: "suffix" }, [
  564. _c("i", {
  565. directives: [
  566. {
  567. name: "show",
  568. rawName: "v-show",
  569. value: !_vm.showClose,
  570. expression: "!showClose"
  571. }
  572. ],
  573. class: [
  574. "el-select__caret",
  575. "el-input__icon",
  576. "el-icon-" + _vm.iconClass
  577. ]
  578. }),
  579. _vm.showClose
  580. ? _c("i", {
  581. staticClass:
  582. "el-select__caret el-input__icon el-icon-circle-close",
  583. on: { click: _vm.handleClearClick }
  584. })
  585. : _vm._e()
  586. ])
  587. ],
  588. 2
  589. ),
  590. _c(
  591. "transition",
  592. {
  593. attrs: { name: "el-zoom-in-top" },
  594. on: {
  595. "before-enter": _vm.handleMenuEnter,
  596. "after-leave": _vm.doDestroy
  597. }
  598. },
  599. [
  600. _c(
  601. "tis-select-menu",
  602. {
  603. directives: [
  604. {
  605. name: "show",
  606. rawName: "v-show",
  607. value: _vm.visible && _vm.emptyText !== false,
  608. expression: "visible && emptyText !== false"
  609. }
  610. ],
  611. ref: "popper",
  612. attrs: { "append-to-body": _vm.popperAppendToBody }
  613. },
  614. [
  615. _c(
  616. "tis-scrollbar",
  617. {
  618. directives: [
  619. {
  620. name: "show",
  621. rawName: "v-show",
  622. value: _vm.options.length > 0 && !_vm.loading,
  623. expression: "options.length > 0 && !loading"
  624. }
  625. ],
  626. ref: "scrollbar",
  627. class: {
  628. "is-empty":
  629. !_vm.allowCreate &&
  630. _vm.query &&
  631. _vm.filteredOptionsCount === 0
  632. },
  633. attrs: {
  634. tag: "ul",
  635. "wrap-class": "el-select-dropdown__wrap",
  636. "view-class": "el-select-dropdown__list"
  637. }
  638. },
  639. [
  640. _vm.showNewOption
  641. ? _c("tis-option", {
  642. attrs: { value: _vm.query, created: "" }
  643. })
  644. : _vm._e(),
  645. _vm._t("default")
  646. ],
  647. 2
  648. ),
  649. _vm.emptyText &&
  650. (!_vm.allowCreate ||
  651. _vm.loading ||
  652. (_vm.allowCreate && _vm.options.length === 0))
  653. ? [
  654. _vm.$slots.empty
  655. ? _vm._t("empty")
  656. : _c("p", { staticClass: "el-select-dropdown__empty" }, [
  657. _vm._v(
  658. "\n " +
  659. _vm._s(_vm.emptyText) +
  660. "\n "
  661. )
  662. ])
  663. ]
  664. : _vm._e()
  665. ],
  666. 2
  667. )
  668. ],
  669. 1
  670. )
  671. ],
  672. 1
  673. )
  674. }
  675. var staticRenderFns = []
  676. render._withStripped = true
  677. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  678. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  679. var emitter_ = __webpack_require__(13);
  680. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  681. // EXTERNAL MODULE: external "tis-ui/lib/mixins/focus"
  682. var focus_ = __webpack_require__(88);
  683. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  684. // EXTERNAL MODULE: external "tis-ui/lib/mixins/locale"
  685. var locale_ = __webpack_require__(38);
  686. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  687. // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
  688. var packages_input = __webpack_require__(52);
  689. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  690. var select_dropdownvue_type_template_id_06828748_render = function() {
  691. var _vm = this
  692. var _h = _vm.$createElement
  693. var _c = _vm._self._c || _h
  694. return _c(
  695. "div",
  696. {
  697. staticClass: "el-select-dropdown el-popper",
  698. class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
  699. style: { minWidth: _vm.minWidth }
  700. },
  701. [_vm._t("default")],
  702. 2
  703. )
  704. }
  705. var select_dropdownvue_type_template_id_06828748_staticRenderFns = []
  706. select_dropdownvue_type_template_id_06828748_render._withStripped = true
  707. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  708. // EXTERNAL MODULE: external "tis-ui/lib/utils/vue-popper"
  709. var vue_popper_ = __webpack_require__(34);
  710. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  711. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  712. //
  713. //
  714. //
  715. //
  716. //
  717. //
  718. //
  719. //
  720. //
  721. /* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
  722. name: 'TisSelectDropdown',
  723. componentName: 'TisSelectDropdown',
  724. mixins: [vue_popper_default.a],
  725. props: {
  726. placement: {
  727. default: 'bottom-start'
  728. },
  729. boundariesPadding: {
  730. default: 0
  731. },
  732. popperOptions: {
  733. default: function _default() {
  734. return {
  735. gpuAcceleration: false
  736. };
  737. }
  738. },
  739. visibleArrow: {
  740. default: true
  741. },
  742. appendToBody: {
  743. type: Boolean,
  744. default: true
  745. }
  746. },
  747. data: function data() {
  748. return {
  749. minWidth: ''
  750. };
  751. },
  752. computed: {
  753. popperClass: function popperClass() {
  754. return this.$parent.popperClass;
  755. }
  756. },
  757. watch: {
  758. '$parent.inputWidth': function $parentInputWidth() {
  759. this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
  760. }
  761. },
  762. mounted: function mounted() {
  763. var _this = this;
  764. this.referenceElm = this.$parent.$refs.reference.$el;
  765. this.$parent.popperElm = this.popperElm = this.$el;
  766. this.$on('updatePopper', function () {
  767. if (_this.$parent.visible) _this.updatePopper();
  768. });
  769. this.$on('destroyPopper', this.destroyPopper);
  770. }
  771. });
  772. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  773. /* harmony default export */ var src_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
  774. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  775. var componentNormalizer = __webpack_require__(2);
  776. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
  777. /* normalize component */
  778. var component = Object(componentNormalizer["a" /* default */])(
  779. src_select_dropdownvue_type_script_lang_js_,
  780. select_dropdownvue_type_template_id_06828748_render,
  781. select_dropdownvue_type_template_id_06828748_staticRenderFns,
  782. false,
  783. null,
  784. null,
  785. null
  786. )
  787. /* hot reload */
  788. if (false) { var api; }
  789. component.options.__file = "packages/select/src/select-dropdown.vue"
  790. /* harmony default export */ var select_dropdown = (component.exports);
  791. // EXTERNAL MODULE: ./packages/select/src/option.vue + 4 modules
  792. var src_option = __webpack_require__(91);
  793. // EXTERNAL MODULE: ./packages/tag/index.js + 3 modules
  794. var tag = __webpack_require__(101);
  795. // EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
  796. var scrollbar = __webpack_require__(66);
  797. // EXTERNAL MODULE: external "throttle-debounce/debounce"
  798. var debounce_ = __webpack_require__(62);
  799. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
  800. // EXTERNAL MODULE: external "tis-ui/lib/utils/clickoutside"
  801. var clickoutside_ = __webpack_require__(61);
  802. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  803. // EXTERNAL MODULE: external "tis-ui/lib/utils/resize-event"
  804. var resize_event_ = __webpack_require__(44);
  805. // EXTERNAL MODULE: external "tis-ui/lib/locale"
  806. var lib_locale_ = __webpack_require__(72);
  807. // EXTERNAL MODULE: external "tis-ui/lib/utils/scroll-into-view"
  808. var scroll_into_view_ = __webpack_require__(95);
  809. var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
  810. // EXTERNAL MODULE: external "tis-ui/lib/utils/util"
  811. var util_ = __webpack_require__(10);
  812. // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
  813. /* harmony default export */ var navigation_mixin = ({
  814. data: function data() {
  815. return {
  816. hoverOption: -1
  817. };
  818. },
  819. computed: {
  820. optionsAllDisabled: function optionsAllDisabled() {
  821. return this.options.filter(function (option) {
  822. return option.visible;
  823. }).every(function (option) {
  824. return option.disabled;
  825. });
  826. }
  827. },
  828. watch: {
  829. hoverIndex: function hoverIndex(val) {
  830. var _this = this;
  831. if (typeof val === 'number' && val > -1) {
  832. this.hoverOption = this.options[val] || {};
  833. }
  834. this.options.forEach(function (option) {
  835. option.hover = _this.hoverOption === option;
  836. });
  837. }
  838. },
  839. methods: {
  840. navigateOptions: function navigateOptions(direction) {
  841. var _this2 = this;
  842. if (!this.visible) {
  843. this.visible = true;
  844. return;
  845. }
  846. if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
  847. if (!this.optionsAllDisabled) {
  848. if (direction === 'next') {
  849. this.hoverIndex++;
  850. if (this.hoverIndex === this.options.length) {
  851. this.hoverIndex = 0;
  852. }
  853. } else if (direction === 'prev') {
  854. this.hoverIndex--;
  855. if (this.hoverIndex < 0) {
  856. this.hoverIndex = this.options.length - 1;
  857. }
  858. }
  859. var option = this.options[this.hoverIndex];
  860. if (option.disabled === true || option.groupDisabled === true || !option.visible) {
  861. this.navigateOptions(direction);
  862. }
  863. this.$nextTick(function () {
  864. return _this2.scrollToOption(_this2.hoverOption);
  865. });
  866. }
  867. }
  868. }
  869. });
  870. // EXTERNAL MODULE: external "tis-ui/lib/utils/shared"
  871. var shared_ = __webpack_require__(49);
  872. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=script&lang=js&
  873. //
  874. //
  875. //
  876. //
  877. //
  878. //
  879. //
  880. //
  881. //
  882. //
  883. //
  884. //
  885. //
  886. //
  887. //
  888. //
  889. //
  890. //
  891. //
  892. //
  893. //
  894. //
  895. //
  896. //
  897. //
  898. //
  899. //
  900. //
  901. //
  902. //
  903. //
  904. //
  905. //
  906. //
  907. //
  908. //
  909. //
  910. //
  911. //
  912. //
  913. //
  914. //
  915. //
  916. //
  917. //
  918. //
  919. //
  920. //
  921. //
  922. //
  923. //
  924. //
  925. //
  926. //
  927. //
  928. //
  929. //
  930. //
  931. //
  932. //
  933. //
  934. //
  935. //
  936. //
  937. //
  938. //
  939. //
  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. /* harmony default export */ var selectvue_type_script_lang_js_ = ({
  1009. mixins: [emitter_default.a, locale_default.a, focus_default()('reference'), navigation_mixin],
  1010. name: 'TisSelect',
  1011. componentName: 'TisSelect',
  1012. inject: {
  1013. elForm: {
  1014. default: ''
  1015. },
  1016. elFormItem: {
  1017. default: ''
  1018. }
  1019. },
  1020. provide: function provide() {
  1021. return {
  1022. 'select': this
  1023. };
  1024. },
  1025. computed: {
  1026. _elFormItemSize: function _elFormItemSize() {
  1027. return (this.elFormItem || {}).elFormItemSize;
  1028. },
  1029. readonly: function readonly() {
  1030. return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
  1031. },
  1032. showClose: function showClose() {
  1033. var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
  1034. var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
  1035. return criteria;
  1036. },
  1037. iconClass: function iconClass() {
  1038. return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
  1039. },
  1040. debounce: function debounce() {
  1041. return this.remote ? 300 : 0;
  1042. },
  1043. emptyText: function emptyText() {
  1044. if (this.loading) {
  1045. return this.loadingText || this.t('el.select.loading');
  1046. } else {
  1047. if (this.remote && this.query === '' && this.options.length === 0) return false;
  1048. if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
  1049. return this.noMatchText || this.t('el.select.noMatch');
  1050. }
  1051. if (this.options.length === 0) {
  1052. return this.noDataText || this.t('el.select.noData');
  1053. }
  1054. }
  1055. return null;
  1056. },
  1057. showNewOption: function showNewOption() {
  1058. var _this = this;
  1059. var hasExistingOption = this.options.filter(function (option) {
  1060. return !option.created;
  1061. }).some(function (option) {
  1062. return option.currentLabel === _this.query;
  1063. });
  1064. return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
  1065. },
  1066. selectSize: function selectSize() {
  1067. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1068. },
  1069. selectDisabled: function selectDisabled() {
  1070. return this.disabled || (this.elForm || {}).disabled;
  1071. },
  1072. collapseTagSize: function collapseTagSize() {
  1073. return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
  1074. }
  1075. },
  1076. components: {
  1077. TisInput: packages_input["default"],
  1078. TisSelectMenu: select_dropdown,
  1079. TisOption: src_option["a" /* default */],
  1080. TisTag: tag["default"],
  1081. TisScrollbar: scrollbar["default"]
  1082. },
  1083. directives: { Clickoutside: clickoutside_default.a },
  1084. props: {
  1085. name: String,
  1086. id: String,
  1087. value: {
  1088. required: true
  1089. },
  1090. autocomplete: {
  1091. type: String,
  1092. default: 'off'
  1093. },
  1094. /** @Deprecated in next major version */
  1095. autoComplete: {
  1096. type: String,
  1097. validator: function validator(val) {
  1098. false && false;
  1099. return true;
  1100. }
  1101. },
  1102. automaticDropdown: Boolean,
  1103. size: String,
  1104. disabled: Boolean,
  1105. clearable: Boolean,
  1106. filterable: Boolean,
  1107. allowCreate: Boolean,
  1108. loading: Boolean,
  1109. popperClass: String,
  1110. remote: Boolean,
  1111. loadingText: String,
  1112. noMatchText: String,
  1113. noDataText: String,
  1114. remoteMethod: Function,
  1115. filterMethod: Function,
  1116. multiple: Boolean,
  1117. multipleLimit: {
  1118. type: Number,
  1119. default: 0
  1120. },
  1121. placeholder: {
  1122. type: String,
  1123. default: function _default() {
  1124. return Object(lib_locale_["t"])('el.select.placeholder');
  1125. }
  1126. },
  1127. defaultFirstOption: Boolean,
  1128. reserveKeyword: Boolean,
  1129. valueKey: {
  1130. type: String,
  1131. default: 'value'
  1132. },
  1133. collapseTags: Boolean,
  1134. popperAppendToBody: {
  1135. type: Boolean,
  1136. default: true
  1137. }
  1138. },
  1139. data: function data() {
  1140. return {
  1141. options: [],
  1142. cachedOptions: [],
  1143. createdLabel: null,
  1144. createdSelected: false,
  1145. selected: this.multiple ? [] : {},
  1146. inputLength: 20,
  1147. inputWidth: 0,
  1148. initialInputHeight: 0,
  1149. cachedPlaceHolder: '',
  1150. optionsCount: 0,
  1151. filteredOptionsCount: 0,
  1152. visible: false,
  1153. softFocus: false,
  1154. selectedLabel: '',
  1155. hoverIndex: -1,
  1156. query: '',
  1157. previousQuery: null,
  1158. inputHovering: false,
  1159. currentPlaceholder: '',
  1160. menuVisibleOnFocus: false,
  1161. isOnComposition: false,
  1162. isSilentBlur: false
  1163. };
  1164. },
  1165. watch: {
  1166. selectDisabled: function selectDisabled() {
  1167. var _this2 = this;
  1168. this.$nextTick(function () {
  1169. _this2.resetInputHeight();
  1170. });
  1171. },
  1172. placeholder: function placeholder(val) {
  1173. this.cachedPlaceHolder = this.currentPlaceholder = val;
  1174. },
  1175. value: function value(val, oldVal) {
  1176. if (this.multiple) {
  1177. this.resetInputHeight();
  1178. if (val && val.length > 0 || this.$refs.input && this.query !== '') {
  1179. this.currentPlaceholder = '';
  1180. } else {
  1181. this.currentPlaceholder = this.cachedPlaceHolder;
  1182. }
  1183. if (this.filterable && !this.reserveKeyword) {
  1184. this.query = '';
  1185. this.handleQueryChange(this.query);
  1186. }
  1187. }
  1188. this.setSelected();
  1189. if (this.filterable && !this.multiple) {
  1190. this.inputLength = 20;
  1191. }
  1192. if (!Object(util_["valueEquals"])(val, oldVal)) {
  1193. this.dispatch('TisFormItem', 'el.form.change', val);
  1194. }
  1195. },
  1196. visible: function visible(val) {
  1197. var _this3 = this;
  1198. if (!val) {
  1199. this.broadcast('TisSelectDropdown', 'destroyPopper');
  1200. if (this.$refs.input) {
  1201. this.$refs.input.blur();
  1202. }
  1203. this.query = '';
  1204. this.previousQuery = null;
  1205. this.selectedLabel = '';
  1206. this.inputLength = 20;
  1207. this.menuVisibleOnFocus = false;
  1208. this.resetHoverIndex();
  1209. this.$nextTick(function () {
  1210. if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
  1211. _this3.currentPlaceholder = _this3.cachedPlaceHolder;
  1212. }
  1213. });
  1214. if (!this.multiple) {
  1215. if (this.selected) {
  1216. if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
  1217. this.selectedLabel = this.createdLabel;
  1218. } else {
  1219. this.selectedLabel = this.selected.currentLabel;
  1220. }
  1221. if (this.filterable) this.query = this.selectedLabel;
  1222. }
  1223. if (this.filterable) {
  1224. this.currentPlaceholder = this.cachedPlaceHolder;
  1225. }
  1226. }
  1227. } else {
  1228. this.broadcast('TisSelectDropdown', 'updatePopper');
  1229. if (this.filterable) {
  1230. this.query = this.remote ? '' : this.selectedLabel;
  1231. this.handleQueryChange(this.query);
  1232. if (this.multiple) {
  1233. this.$refs.input.focus();
  1234. } else {
  1235. if (!this.remote) {
  1236. this.broadcast('TisOption', 'queryChange', '');
  1237. this.broadcast('TisOptionGroup', 'queryChange');
  1238. }
  1239. if (this.selectedLabel) {
  1240. this.currentPlaceholder = this.selectedLabel;
  1241. this.selectedLabel = '';
  1242. }
  1243. }
  1244. }
  1245. }
  1246. this.$emit('visible-change', val);
  1247. },
  1248. options: function options() {
  1249. var _this4 = this;
  1250. if (this.$isServer) return;
  1251. this.$nextTick(function () {
  1252. _this4.broadcast('TisSelectDropdown', 'updatePopper');
  1253. });
  1254. if (this.multiple) {
  1255. this.resetInputHeight();
  1256. }
  1257. var inputs = this.$el.querySelectorAll('input');
  1258. if ([].indexOf.call(inputs, document.activeElement) === -1) {
  1259. this.setSelected();
  1260. }
  1261. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1262. this.checkDefaultFirstOption();
  1263. }
  1264. }
  1265. },
  1266. methods: {
  1267. handleComposition: function handleComposition(event) {
  1268. var _this5 = this;
  1269. var text = event.target.value;
  1270. if (event.type === 'compositionend') {
  1271. this.isOnComposition = false;
  1272. this.$nextTick(function (_) {
  1273. return _this5.handleQueryChange(text);
  1274. });
  1275. } else {
  1276. var lastCharacter = text[text.length - 1] || '';
  1277. this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
  1278. }
  1279. },
  1280. handleQueryChange: function handleQueryChange(val) {
  1281. var _this6 = this;
  1282. if (this.previousQuery === val || this.isOnComposition) return;
  1283. if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
  1284. this.previousQuery = val;
  1285. return;
  1286. }
  1287. this.previousQuery = val;
  1288. this.$nextTick(function () {
  1289. if (_this6.visible) _this6.broadcast('TisSelectDropdown', 'updatePopper');
  1290. });
  1291. this.hoverIndex = -1;
  1292. if (this.multiple && this.filterable) {
  1293. this.$nextTick(function () {
  1294. var length = _this6.$refs.input.value.length * 15 + 20;
  1295. _this6.inputLength = _this6.collapseTags ? Math.min(50, length) : length;
  1296. _this6.managePlaceholder();
  1297. _this6.resetInputHeight();
  1298. });
  1299. }
  1300. if (this.remote && typeof this.remoteMethod === 'function') {
  1301. this.hoverIndex = -1;
  1302. this.remoteMethod(val);
  1303. } else if (typeof this.filterMethod === 'function') {
  1304. this.filterMethod(val);
  1305. this.broadcast('TisOptionGroup', 'queryChange');
  1306. } else {
  1307. this.filteredOptionsCount = this.optionsCount;
  1308. this.broadcast('TisOption', 'queryChange', val);
  1309. this.broadcast('TisOptionGroup', 'queryChange');
  1310. }
  1311. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1312. this.checkDefaultFirstOption();
  1313. }
  1314. },
  1315. scrollToOption: function scrollToOption(option) {
  1316. var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
  1317. if (this.$refs.popper && target) {
  1318. var menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
  1319. scroll_into_view_default()(menu, target);
  1320. }
  1321. this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
  1322. },
  1323. handleMenuEnter: function handleMenuEnter() {
  1324. var _this7 = this;
  1325. this.$nextTick(function () {
  1326. return _this7.scrollToOption(_this7.selected);
  1327. });
  1328. },
  1329. emitChange: function emitChange(val) {
  1330. if (!Object(util_["valueEquals"])(this.value, val)) {
  1331. this.$emit('change', val);
  1332. }
  1333. },
  1334. getOption: function getOption(value) {
  1335. var option = void 0;
  1336. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  1337. var isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
  1338. var isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
  1339. for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
  1340. var cachedOption = this.cachedOptions[i];
  1341. var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
  1342. if (isEqual) {
  1343. option = cachedOption;
  1344. break;
  1345. }
  1346. }
  1347. if (option) return option;
  1348. var label = !isObject && !isNull && !isUndefined ? value : '';
  1349. var newOption = {
  1350. value: value,
  1351. currentLabel: label
  1352. };
  1353. if (this.multiple) {
  1354. newOption.hitState = false;
  1355. }
  1356. return newOption;
  1357. },
  1358. setSelected: function setSelected() {
  1359. var _this8 = this;
  1360. if (!this.multiple) {
  1361. var option = this.getOption(this.value);
  1362. if (option.created) {
  1363. this.createdLabel = option.currentLabel;
  1364. this.createdSelected = true;
  1365. } else {
  1366. this.createdSelected = false;
  1367. }
  1368. this.selectedLabel = option.currentLabel;
  1369. this.selected = option;
  1370. if (this.filterable) this.query = this.selectedLabel;
  1371. return;
  1372. }
  1373. var result = [];
  1374. if (Array.isArray(this.value)) {
  1375. this.value.forEach(function (value) {
  1376. result.push(_this8.getOption(value));
  1377. });
  1378. }
  1379. this.selected = result;
  1380. this.$nextTick(function () {
  1381. _this8.resetInputHeight();
  1382. });
  1383. },
  1384. handleFocus: function handleFocus(event) {
  1385. if (!this.softFocus) {
  1386. if (this.automaticDropdown || this.filterable) {
  1387. this.visible = true;
  1388. if (this.filterable) {
  1389. this.menuVisibleOnFocus = true;
  1390. }
  1391. }
  1392. this.$emit('focus', event);
  1393. } else {
  1394. this.softFocus = false;
  1395. }
  1396. },
  1397. blur: function blur() {
  1398. this.visible = false;
  1399. this.$refs.reference.blur();
  1400. },
  1401. handleBlur: function handleBlur(event) {
  1402. var _this9 = this;
  1403. setTimeout(function () {
  1404. if (_this9.isSilentBlur) {
  1405. _this9.isSilentBlur = false;
  1406. } else {
  1407. _this9.$emit('blur', event);
  1408. }
  1409. }, 50);
  1410. this.softFocus = false;
  1411. },
  1412. handleClearClick: function handleClearClick(event) {
  1413. this.deleteSelected(event);
  1414. },
  1415. doDestroy: function doDestroy() {
  1416. this.$refs.popper && this.$refs.popper.doDestroy();
  1417. },
  1418. handleClose: function handleClose() {
  1419. this.visible = false;
  1420. },
  1421. toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
  1422. if (!Array.isArray(this.selected)) return;
  1423. var option = this.selected[this.selected.length - 1];
  1424. if (!option) return;
  1425. if (hit === true || hit === false) {
  1426. option.hitState = hit;
  1427. return hit;
  1428. }
  1429. option.hitState = !option.hitState;
  1430. return option.hitState;
  1431. },
  1432. deletePrevTag: function deletePrevTag(e) {
  1433. if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
  1434. var value = this.value.slice();
  1435. value.pop();
  1436. this.$emit('input', value);
  1437. this.emitChange(value);
  1438. }
  1439. },
  1440. managePlaceholder: function managePlaceholder() {
  1441. if (this.currentPlaceholder !== '') {
  1442. this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
  1443. }
  1444. },
  1445. resetInputState: function resetInputState(e) {
  1446. if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
  1447. this.inputLength = this.$refs.input.value.length * 15 + 20;
  1448. this.resetInputHeight();
  1449. },
  1450. resetInputHeight: function resetInputHeight() {
  1451. var _this10 = this;
  1452. if (this.collapseTags && !this.filterable) return;
  1453. this.$nextTick(function () {
  1454. if (!_this10.$refs.reference) return;
  1455. var inputChildNodes = _this10.$refs.reference.$el.childNodes;
  1456. var input = [].filter.call(inputChildNodes, function (item) {
  1457. return item.tagName === 'INPUT';
  1458. })[0];
  1459. var tags = _this10.$refs.tags;
  1460. var sizeInMap = _this10.initialInputHeight || 40;
  1461. input.style.height = _this10.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
  1462. if (_this10.visible && _this10.emptyText !== false) {
  1463. _this10.broadcast('TisSelectDropdown', 'updatePopper');
  1464. }
  1465. });
  1466. },
  1467. resetHoverIndex: function resetHoverIndex() {
  1468. var _this11 = this;
  1469. setTimeout(function () {
  1470. if (!_this11.multiple) {
  1471. _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
  1472. } else {
  1473. if (_this11.selected.length > 0) {
  1474. _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
  1475. return _this11.options.indexOf(item);
  1476. }));
  1477. } else {
  1478. _this11.hoverIndex = -1;
  1479. }
  1480. }
  1481. }, 300);
  1482. },
  1483. handleOptionSelect: function handleOptionSelect(option, byClick) {
  1484. var _this12 = this;
  1485. if (this.multiple) {
  1486. var value = (this.value || []).slice();
  1487. var optionIndex = this.getValueIndex(value, option.value);
  1488. if (optionIndex > -1) {
  1489. value.splice(optionIndex, 1);
  1490. } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
  1491. value.push(option.value);
  1492. }
  1493. this.$emit('input', value);
  1494. this.emitChange(value);
  1495. if (option.created) {
  1496. this.query = '';
  1497. this.handleQueryChange('');
  1498. this.inputLength = 20;
  1499. }
  1500. if (this.filterable) this.$refs.input.focus();
  1501. } else {
  1502. this.$emit('input', option.value);
  1503. this.emitChange(option.value);
  1504. this.visible = false;
  1505. }
  1506. this.isSilentBlur = byClick;
  1507. this.setSoftFocus();
  1508. if (this.visible) return;
  1509. this.$nextTick(function () {
  1510. _this12.scrollToOption(option);
  1511. });
  1512. },
  1513. setSoftFocus: function setSoftFocus() {
  1514. this.softFocus = true;
  1515. var input = this.$refs.input || this.$refs.reference;
  1516. if (input) {
  1517. input.focus();
  1518. }
  1519. },
  1520. getValueIndex: function getValueIndex() {
  1521. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  1522. var value = arguments[1];
  1523. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  1524. if (!isObject) {
  1525. return arr.indexOf(value);
  1526. } else {
  1527. var valueKey = this.valueKey;
  1528. var index = -1;
  1529. arr.some(function (item, i) {
  1530. if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
  1531. index = i;
  1532. return true;
  1533. }
  1534. return false;
  1535. });
  1536. return index;
  1537. }
  1538. },
  1539. toggleMenu: function toggleMenu() {
  1540. if (!this.selectDisabled) {
  1541. if (this.menuVisibleOnFocus) {
  1542. this.menuVisibleOnFocus = false;
  1543. } else {
  1544. this.visible = !this.visible;
  1545. }
  1546. if (this.visible) {
  1547. (this.$refs.input || this.$refs.reference).focus();
  1548. }
  1549. }
  1550. },
  1551. selectOption: function selectOption() {
  1552. if (!this.visible) {
  1553. this.toggleMenu();
  1554. } else {
  1555. if (this.options[this.hoverIndex]) {
  1556. this.handleOptionSelect(this.options[this.hoverIndex]);
  1557. }
  1558. }
  1559. },
  1560. deleteSelected: function deleteSelected(event) {
  1561. event.stopPropagation();
  1562. var value = this.multiple ? [] : '';
  1563. this.$emit('input', value);
  1564. this.emitChange(value);
  1565. this.visible = false;
  1566. this.$emit('clear');
  1567. },
  1568. deleteTag: function deleteTag(event, tag) {
  1569. var index = this.selected.indexOf(tag);
  1570. if (index > -1 && !this.selectDisabled) {
  1571. var value = this.value.slice();
  1572. value.splice(index, 1);
  1573. this.$emit('input', value);
  1574. this.emitChange(value);
  1575. this.$emit('remove-tag', tag.value);
  1576. }
  1577. event.stopPropagation();
  1578. },
  1579. onInputChange: function onInputChange() {
  1580. if (this.filterable && this.query !== this.selectedLabel) {
  1581. this.query = this.selectedLabel;
  1582. this.handleQueryChange(this.query);
  1583. }
  1584. },
  1585. onOptionDestroy: function onOptionDestroy(index) {
  1586. if (index > -1) {
  1587. this.optionsCount--;
  1588. this.filteredOptionsCount--;
  1589. this.options.splice(index, 1);
  1590. }
  1591. },
  1592. resetInputWidth: function resetInputWidth() {
  1593. this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
  1594. },
  1595. handleResize: function handleResize() {
  1596. this.resetInputWidth();
  1597. if (this.multiple) this.resetInputHeight();
  1598. },
  1599. checkDefaultFirstOption: function checkDefaultFirstOption() {
  1600. this.hoverIndex = -1;
  1601. // highlight the created option
  1602. var hasCreated = false;
  1603. for (var i = this.options.length - 1; i >= 0; i--) {
  1604. if (this.options[i].created) {
  1605. hasCreated = true;
  1606. this.hoverIndex = i;
  1607. break;
  1608. }
  1609. }
  1610. if (hasCreated) return;
  1611. for (var _i = 0; _i !== this.options.length; ++_i) {
  1612. var option = this.options[_i];
  1613. if (this.query) {
  1614. // highlight first options that passes the filter
  1615. if (!option.disabled && !option.groupDisabled && option.visible) {
  1616. this.hoverIndex = _i;
  1617. break;
  1618. }
  1619. } else {
  1620. // highlight currently selected option
  1621. if (option.itemSelected) {
  1622. this.hoverIndex = _i;
  1623. break;
  1624. }
  1625. }
  1626. }
  1627. },
  1628. getValueKey: function getValueKey(item) {
  1629. if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
  1630. return item.value;
  1631. } else {
  1632. return Object(util_["getValueByPath"])(item.value, this.valueKey);
  1633. }
  1634. }
  1635. },
  1636. created: function created() {
  1637. var _this13 = this;
  1638. this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
  1639. if (this.multiple && !Array.isArray(this.value)) {
  1640. this.$emit('input', []);
  1641. }
  1642. if (!this.multiple && Array.isArray(this.value)) {
  1643. this.$emit('input', '');
  1644. }
  1645. this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
  1646. _this13.onInputChange();
  1647. });
  1648. this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
  1649. _this13.handleQueryChange(e.target.value);
  1650. });
  1651. this.$on('handleOptionClick', this.handleOptionSelect);
  1652. this.$on('setSelected', this.setSelected);
  1653. },
  1654. mounted: function mounted() {
  1655. var _this14 = this;
  1656. if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
  1657. this.currentPlaceholder = '';
  1658. }
  1659. Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
  1660. var reference = this.$refs.reference;
  1661. if (reference && reference.$el) {
  1662. var sizeMap = {
  1663. medium: 36,
  1664. small: 32,
  1665. mini: 28
  1666. };
  1667. var input = reference.$el.querySelector('input');
  1668. this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
  1669. }
  1670. if (this.remote && this.multiple) {
  1671. this.resetInputHeight();
  1672. }
  1673. this.$nextTick(function () {
  1674. if (reference && reference.$el) {
  1675. _this14.inputWidth = reference.$el.getBoundingClientRect().width;
  1676. }
  1677. });
  1678. this.setSelected();
  1679. },
  1680. beforeDestroy: function beforeDestroy() {
  1681. if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
  1682. }
  1683. });
  1684. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js&
  1685. /* harmony default export */ var src_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
  1686. // CONCATENATED MODULE: ./packages/select/src/select.vue
  1687. /* normalize component */
  1688. var select_component = Object(componentNormalizer["a" /* default */])(
  1689. src_selectvue_type_script_lang_js_,
  1690. render,
  1691. staticRenderFns,
  1692. false,
  1693. null,
  1694. null,
  1695. null
  1696. )
  1697. /* hot reload */
  1698. if (false) { var select_api; }
  1699. select_component.options.__file = "packages/select/src/select.vue"
  1700. /* harmony default export */ var src_select = (select_component.exports);
  1701. // CONCATENATED MODULE: ./packages/select/index.js
  1702. /* istanbul ignore next */
  1703. src_select.install = function (Vue) {
  1704. Vue.component(src_select.name, src_select);
  1705. };
  1706. /* harmony default export */ var packages_select = __webpack_exports__["default"] = (src_select);
  1707. /***/ }),
  1708. /***/ 2:
  1709. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1710. "use strict";
  1711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  1712. /* globals __VUE_SSR_CONTEXT__ */
  1713. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1714. // This module is a runtime utility for cleaner component module output and will
  1715. // be included in the final webpack user bundle.
  1716. function normalizeComponent (
  1717. scriptExports,
  1718. render,
  1719. staticRenderFns,
  1720. functionalTemplate,
  1721. injectStyles,
  1722. scopeId,
  1723. moduleIdentifier, /* server only */
  1724. shadowMode /* vue-cli only */
  1725. ) {
  1726. // Vue.extend constructor export interop
  1727. var options = typeof scriptExports === 'function'
  1728. ? scriptExports.options
  1729. : scriptExports
  1730. // render functions
  1731. if (render) {
  1732. options.render = render
  1733. options.staticRenderFns = staticRenderFns
  1734. options._compiled = true
  1735. }
  1736. // functional template
  1737. if (functionalTemplate) {
  1738. options.functional = true
  1739. }
  1740. // scopedId
  1741. if (scopeId) {
  1742. options._scopeId = 'data-v-' + scopeId
  1743. }
  1744. var hook
  1745. if (moduleIdentifier) { // server build
  1746. hook = function (context) {
  1747. // 2.3 injection
  1748. context =
  1749. context || // cached call
  1750. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1751. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1752. // 2.2 with runInNewContext: true
  1753. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1754. context = __VUE_SSR_CONTEXT__
  1755. }
  1756. // inject component styles
  1757. if (injectStyles) {
  1758. injectStyles.call(this, context)
  1759. }
  1760. // register component module identifier for async chunk inferrence
  1761. if (context && context._registeredComponents) {
  1762. context._registeredComponents.add(moduleIdentifier)
  1763. }
  1764. }
  1765. // used by ssr in case component is cached and beforeCreate
  1766. // never gets called
  1767. options._ssrRegister = hook
  1768. } else if (injectStyles) {
  1769. hook = shadowMode
  1770. ? function () {
  1771. injectStyles.call(
  1772. this,
  1773. (options.functional ? this.parent : this).$root.$options.shadowRoot
  1774. )
  1775. }
  1776. : injectStyles
  1777. }
  1778. if (hook) {
  1779. if (options.functional) {
  1780. // for template-only hot-reload because in that case the render fn doesn't
  1781. // go through the normalizer
  1782. options._injectStyles = hook
  1783. // register for functional component in vue file
  1784. var originalRender = options.render
  1785. options.render = function renderWithStyleInjection (h, context) {
  1786. hook.call(context)
  1787. return originalRender(h, context)
  1788. }
  1789. } else {
  1790. // inject component registration as beforeCreate hook
  1791. var existing = options.beforeCreate
  1792. options.beforeCreate = existing
  1793. ? [].concat(existing, hook)
  1794. : [hook]
  1795. }
  1796. }
  1797. return {
  1798. exports: scriptExports,
  1799. options: options
  1800. }
  1801. }
  1802. /***/ }),
  1803. /***/ 33:
  1804. /***/ (function(module, exports) {
  1805. module.exports = require("tis-ui/lib/utils/merge");
  1806. /***/ }),
  1807. /***/ 34:
  1808. /***/ (function(module, exports) {
  1809. module.exports = require("tis-ui/lib/utils/vue-popper");
  1810. /***/ }),
  1811. /***/ 36:
  1812. /***/ (function(module, exports) {
  1813. module.exports = require("tis-ui/lib/mixins/migrating");
  1814. /***/ }),
  1815. /***/ 38:
  1816. /***/ (function(module, exports) {
  1817. module.exports = require("tis-ui/lib/mixins/locale");
  1818. /***/ }),
  1819. /***/ 44:
  1820. /***/ (function(module, exports) {
  1821. module.exports = require("tis-ui/lib/utils/resize-event");
  1822. /***/ }),
  1823. /***/ 49:
  1824. /***/ (function(module, exports) {
  1825. module.exports = require("tis-ui/lib/utils/shared");
  1826. /***/ }),
  1827. /***/ 52:
  1828. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1829. "use strict";
  1830. // ESM COMPAT FLAG
  1831. __webpack_require__.r(__webpack_exports__);
  1832. // 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&
  1833. var render = function() {
  1834. var _vm = this
  1835. var _h = _vm.$createElement
  1836. var _c = _vm._self._c || _h
  1837. return _c(
  1838. "div",
  1839. {
  1840. class: [
  1841. _vm.type === "textarea" ? "el-textarea" : "el-input",
  1842. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  1843. {
  1844. "is-disabled": _vm.inputDisabled,
  1845. "is-exceed": _vm.inputExceed,
  1846. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  1847. "el-input-group--append": _vm.$slots.append,
  1848. "el-input-group--prepend": _vm.$slots.prepend,
  1849. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  1850. "el-input--suffix":
  1851. _vm.$slots.suffix ||
  1852. _vm.suffixIcon ||
  1853. _vm.clearable ||
  1854. _vm.showPassword
  1855. }
  1856. ],
  1857. on: {
  1858. mouseenter: function($event) {
  1859. _vm.hovering = true
  1860. },
  1861. mouseleave: function($event) {
  1862. _vm.hovering = false
  1863. }
  1864. }
  1865. },
  1866. [
  1867. _vm.type !== "textarea"
  1868. ? [
  1869. _vm.$slots.prepend
  1870. ? _c(
  1871. "div",
  1872. { staticClass: "el-input-group__prepend" },
  1873. [_vm._t("prepend")],
  1874. 2
  1875. )
  1876. : _vm._e(),
  1877. _vm.type !== "textarea"
  1878. ? _c(
  1879. "input",
  1880. _vm._b(
  1881. {
  1882. ref: "input",
  1883. staticClass: "el-input__inner",
  1884. attrs: {
  1885. tabindex: _vm.tabindex,
  1886. type: _vm.showPassword
  1887. ? _vm.passwordVisible
  1888. ? "text"
  1889. : "password"
  1890. : _vm.type,
  1891. disabled: _vm.inputDisabled,
  1892. readonly: _vm.readonly,
  1893. autocomplete: _vm.autoComplete || _vm.autocomplete,
  1894. "aria-label": _vm.label
  1895. },
  1896. on: {
  1897. compositionstart: _vm.handleCompositionStart,
  1898. compositionupdate: _vm.handleCompositionUpdate,
  1899. compositionend: _vm.handleCompositionEnd,
  1900. input: _vm.handleInput,
  1901. focus: _vm.handleFocus,
  1902. blur: _vm.handleBlur,
  1903. change: _vm.handleChange
  1904. }
  1905. },
  1906. "input",
  1907. _vm.$attrs,
  1908. false
  1909. )
  1910. )
  1911. : _vm._e(),
  1912. _vm.$slots.prefix || _vm.prefixIcon
  1913. ? _c(
  1914. "span",
  1915. { staticClass: "el-input__prefix" },
  1916. [
  1917. _vm._t("prefix"),
  1918. _vm.prefixIcon
  1919. ? _c("i", {
  1920. staticClass: "el-input__icon",
  1921. class: _vm.prefixIcon
  1922. })
  1923. : _vm._e()
  1924. ],
  1925. 2
  1926. )
  1927. : _vm._e(),
  1928. _vm.getSuffixVisible()
  1929. ? _c("span", { staticClass: "el-input__suffix" }, [
  1930. _c(
  1931. "span",
  1932. { staticClass: "el-input__suffix-inner" },
  1933. [
  1934. !_vm.showClear ||
  1935. !_vm.showPwdVisible ||
  1936. !_vm.isWordLimitVisible
  1937. ? [
  1938. _vm._t("suffix"),
  1939. _vm.suffixIcon
  1940. ? _c("i", {
  1941. staticClass: "el-input__icon",
  1942. class: _vm.suffixIcon
  1943. })
  1944. : _vm._e()
  1945. ]
  1946. : _vm._e(),
  1947. _vm.showClear
  1948. ? _c("i", {
  1949. staticClass:
  1950. "el-input__icon el-icon-circle-close el-input__clear",
  1951. on: {
  1952. mousedown: function($event) {
  1953. $event.preventDefault()
  1954. },
  1955. click: _vm.clear
  1956. }
  1957. })
  1958. : _vm._e(),
  1959. _vm.showPwdVisible
  1960. ? _c("i", {
  1961. staticClass:
  1962. "el-input__icon el-icon-view el-input__clear",
  1963. on: { click: _vm.handlePasswordVisible }
  1964. })
  1965. : _vm._e(),
  1966. _vm.isWordLimitVisible
  1967. ? _c("span", { staticClass: "el-input__count" }, [
  1968. _c(
  1969. "span",
  1970. { staticClass: "el-input__count-inner" },
  1971. [
  1972. _vm._v(
  1973. "\n " +
  1974. _vm._s(_vm.textLength) +
  1975. "/" +
  1976. _vm._s(_vm.upperLimit) +
  1977. "\n "
  1978. )
  1979. ]
  1980. )
  1981. ])
  1982. : _vm._e()
  1983. ],
  1984. 2
  1985. ),
  1986. _vm.validateState
  1987. ? _c("i", {
  1988. staticClass: "el-input__icon",
  1989. class: ["el-input__validateIcon", _vm.validateIcon]
  1990. })
  1991. : _vm._e()
  1992. ])
  1993. : _vm._e(),
  1994. _vm.$slots.append
  1995. ? _c(
  1996. "div",
  1997. { staticClass: "el-input-group__append" },
  1998. [_vm._t("append")],
  1999. 2
  2000. )
  2001. : _vm._e()
  2002. ]
  2003. : _c(
  2004. "textarea",
  2005. _vm._b(
  2006. {
  2007. ref: "textarea",
  2008. staticClass: "el-textarea__inner",
  2009. style: _vm.textareaStyle,
  2010. attrs: {
  2011. tabindex: _vm.tabindex,
  2012. disabled: _vm.inputDisabled,
  2013. readonly: _vm.readonly,
  2014. autocomplete: _vm.autoComplete || _vm.autocomplete,
  2015. "aria-label": _vm.label
  2016. },
  2017. on: {
  2018. compositionstart: _vm.handleCompositionStart,
  2019. compositionupdate: _vm.handleCompositionUpdate,
  2020. compositionend: _vm.handleCompositionEnd,
  2021. input: _vm.handleInput,
  2022. focus: _vm.handleFocus,
  2023. blur: _vm.handleBlur,
  2024. change: _vm.handleChange
  2025. }
  2026. },
  2027. "textarea",
  2028. _vm.$attrs,
  2029. false
  2030. )
  2031. ),
  2032. _vm.isWordLimitVisible && _vm.type === "textarea"
  2033. ? _c("span", { staticClass: "el-input__count" }, [
  2034. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  2035. ])
  2036. : _vm._e()
  2037. ],
  2038. 2
  2039. )
  2040. }
  2041. var staticRenderFns = []
  2042. render._withStripped = true
  2043. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  2044. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  2045. var emitter_ = __webpack_require__(13);
  2046. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  2047. // EXTERNAL MODULE: external "tis-ui/lib/mixins/migrating"
  2048. var migrating_ = __webpack_require__(36);
  2049. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  2050. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  2051. var hiddenTextarea = void 0;
  2052. 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';
  2053. 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'];
  2054. function calculateNodeStyling(targetElement) {
  2055. var style = window.getComputedStyle(targetElement);
  2056. var boxSizing = style.getPropertyValue('box-sizing');
  2057. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  2058. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  2059. var contextStyle = CONTEXT_STYLE.map(function (name) {
  2060. return name + ':' + style.getPropertyValue(name);
  2061. }).join(';');
  2062. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  2063. }
  2064. function calcTextareaHeight(targetElement) {
  2065. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  2066. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  2067. if (!hiddenTextarea) {
  2068. hiddenTextarea = document.createElement('textarea');
  2069. document.body.appendChild(hiddenTextarea);
  2070. }
  2071. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  2072. paddingSize = _calculateNodeStyling.paddingSize,
  2073. borderSize = _calculateNodeStyling.borderSize,
  2074. boxSizing = _calculateNodeStyling.boxSizing,
  2075. contextStyle = _calculateNodeStyling.contextStyle;
  2076. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  2077. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  2078. var height = hiddenTextarea.scrollHeight;
  2079. var result = {};
  2080. if (boxSizing === 'border-box') {
  2081. height = height + borderSize;
  2082. } else if (boxSizing === 'content-box') {
  2083. height = height - paddingSize;
  2084. }
  2085. hiddenTextarea.value = '';
  2086. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  2087. if (minRows !== null) {
  2088. var minHeight = singleRowHeight * minRows;
  2089. if (boxSizing === 'border-box') {
  2090. minHeight = minHeight + paddingSize + borderSize;
  2091. }
  2092. height = Math.max(minHeight, height);
  2093. result.minHeight = minHeight + 'px';
  2094. }
  2095. if (maxRows !== null) {
  2096. var maxHeight = singleRowHeight * maxRows;
  2097. if (boxSizing === 'border-box') {
  2098. maxHeight = maxHeight + paddingSize + borderSize;
  2099. }
  2100. height = Math.min(maxHeight, height);
  2101. }
  2102. result.height = height + 'px';
  2103. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  2104. hiddenTextarea = null;
  2105. return result;
  2106. };
  2107. // EXTERNAL MODULE: external "tis-ui/lib/utils/merge"
  2108. var merge_ = __webpack_require__(33);
  2109. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  2110. // EXTERNAL MODULE: external "tis-ui/lib/utils/shared"
  2111. var shared_ = __webpack_require__(49);
  2112. // 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&
  2113. //
  2114. //
  2115. //
  2116. //
  2117. //
  2118. //
  2119. //
  2120. //
  2121. //
  2122. //
  2123. //
  2124. //
  2125. //
  2126. //
  2127. //
  2128. //
  2129. //
  2130. //
  2131. //
  2132. //
  2133. //
  2134. //
  2135. //
  2136. //
  2137. //
  2138. //
  2139. //
  2140. //
  2141. //
  2142. //
  2143. //
  2144. //
  2145. //
  2146. //
  2147. //
  2148. //
  2149. //
  2150. //
  2151. //
  2152. //
  2153. //
  2154. //
  2155. //
  2156. //
  2157. //
  2158. //
  2159. //
  2160. //
  2161. //
  2162. //
  2163. //
  2164. //
  2165. //
  2166. //
  2167. //
  2168. //
  2169. //
  2170. //
  2171. //
  2172. //
  2173. //
  2174. //
  2175. //
  2176. //
  2177. //
  2178. //
  2179. //
  2180. //
  2181. //
  2182. //
  2183. //
  2184. //
  2185. //
  2186. //
  2187. //
  2188. //
  2189. //
  2190. //
  2191. //
  2192. //
  2193. //
  2194. //
  2195. //
  2196. //
  2197. //
  2198. //
  2199. //
  2200. //
  2201. //
  2202. //
  2203. //
  2204. //
  2205. //
  2206. //
  2207. //
  2208. //
  2209. //
  2210. //
  2211. //
  2212. //
  2213. //
  2214. //
  2215. //
  2216. //
  2217. //
  2218. //
  2219. //
  2220. //
  2221. //
  2222. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  2223. name: 'TisInput',
  2224. componentName: 'TisInput',
  2225. mixins: [emitter_default.a, migrating_default.a],
  2226. inheritAttrs: false,
  2227. inject: {
  2228. elForm: {
  2229. default: ''
  2230. },
  2231. elFormItem: {
  2232. default: ''
  2233. }
  2234. },
  2235. data: function data() {
  2236. return {
  2237. textareaCalcStyle: {},
  2238. hovering: false,
  2239. focused: false,
  2240. isComposing: false,
  2241. passwordVisible: false
  2242. };
  2243. },
  2244. props: {
  2245. value: [String, Number],
  2246. size: String,
  2247. resize: String,
  2248. form: String,
  2249. disabled: Boolean,
  2250. readonly: Boolean,
  2251. type: {
  2252. type: String,
  2253. default: 'text'
  2254. },
  2255. autosize: {
  2256. type: [Boolean, Object],
  2257. default: false
  2258. },
  2259. autocomplete: {
  2260. type: String,
  2261. default: 'off'
  2262. },
  2263. /** @Deprecated in next major version */
  2264. autoComplete: {
  2265. type: String,
  2266. validator: function validator(val) {
  2267. false && false;
  2268. return true;
  2269. }
  2270. },
  2271. validateEvent: {
  2272. type: Boolean,
  2273. default: true
  2274. },
  2275. suffixIcon: String,
  2276. prefixIcon: String,
  2277. label: String,
  2278. clearable: {
  2279. type: Boolean,
  2280. default: false
  2281. },
  2282. showPassword: {
  2283. type: Boolean,
  2284. default: false
  2285. },
  2286. showWordLimit: {
  2287. type: Boolean,
  2288. default: false
  2289. },
  2290. tabindex: String
  2291. },
  2292. computed: {
  2293. _elFormItemSize: function _elFormItemSize() {
  2294. return (this.elFormItem || {}).elFormItemSize;
  2295. },
  2296. validateState: function validateState() {
  2297. return this.elFormItem ? this.elFormItem.validateState : '';
  2298. },
  2299. needStatusIcon: function needStatusIcon() {
  2300. return this.elForm ? this.elForm.statusIcon : false;
  2301. },
  2302. validateIcon: function validateIcon() {
  2303. return {
  2304. validating: 'el-icon-loading',
  2305. success: 'el-icon-circle-check',
  2306. error: 'el-icon-circle-close'
  2307. }[this.validateState];
  2308. },
  2309. textareaStyle: function textareaStyle() {
  2310. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  2311. },
  2312. inputSize: function inputSize() {
  2313. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  2314. },
  2315. inputDisabled: function inputDisabled() {
  2316. return this.disabled || (this.elForm || {}).disabled;
  2317. },
  2318. nativeInputValue: function nativeInputValue() {
  2319. return this.value === null || this.value === undefined ? '' : String(this.value);
  2320. },
  2321. showClear: function showClear() {
  2322. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  2323. },
  2324. showPwdVisible: function showPwdVisible() {
  2325. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  2326. },
  2327. isWordLimitVisible: function isWordLimitVisible() {
  2328. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  2329. },
  2330. upperLimit: function upperLimit() {
  2331. return this.$attrs.maxlength;
  2332. },
  2333. textLength: function textLength() {
  2334. if (typeof this.value === 'number') {
  2335. return String(this.value).length;
  2336. }
  2337. return (this.value || '').length;
  2338. },
  2339. inputExceed: function inputExceed() {
  2340. // show exceed style if length of initial value greater then maxlength
  2341. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  2342. }
  2343. },
  2344. watch: {
  2345. value: function value(val) {
  2346. this.$nextTick(this.resizeTextarea);
  2347. if (this.validateEvent) {
  2348. this.dispatch('ElFormItem', 'el.form.change', [val]);
  2349. }
  2350. },
  2351. // native input value is set explicitly
  2352. // do not use v-model / :value in template
  2353. // see: https://github.com/ElemeFE/element/issues/14521
  2354. nativeInputValue: function nativeInputValue() {
  2355. this.setNativeInputValue();
  2356. },
  2357. // when change between <input> and <textarea>,
  2358. // update DOM dependent value and styles
  2359. // https://github.com/ElemeFE/element/issues/14857
  2360. type: function type() {
  2361. var _this = this;
  2362. this.$nextTick(function () {
  2363. _this.setNativeInputValue();
  2364. _this.resizeTextarea();
  2365. _this.updateIconOffset();
  2366. });
  2367. }
  2368. },
  2369. methods: {
  2370. focus: function focus() {
  2371. this.getInput().focus();
  2372. },
  2373. blur: function blur() {
  2374. this.getInput().blur();
  2375. },
  2376. getMigratingConfig: function getMigratingConfig() {
  2377. return {
  2378. props: {
  2379. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  2380. 'on-icon-click': 'on-icon-click is removed.'
  2381. },
  2382. events: {
  2383. 'click': 'click is removed.'
  2384. }
  2385. };
  2386. },
  2387. handleBlur: function handleBlur(event) {
  2388. this.focused = false;
  2389. this.$emit('blur', event);
  2390. if (this.validateEvent) {
  2391. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  2392. }
  2393. },
  2394. select: function select() {
  2395. this.getInput().select();
  2396. },
  2397. resizeTextarea: function resizeTextarea() {
  2398. if (this.$isServer) return;
  2399. var autosize = this.autosize,
  2400. type = this.type;
  2401. if (type !== 'textarea') return;
  2402. if (!autosize) {
  2403. this.textareaCalcStyle = {
  2404. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  2405. };
  2406. return;
  2407. }
  2408. var minRows = autosize.minRows;
  2409. var maxRows = autosize.maxRows;
  2410. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  2411. },
  2412. setNativeInputValue: function setNativeInputValue() {
  2413. var input = this.getInput();
  2414. if (!input) return;
  2415. if (input.value === this.nativeInputValue) return;
  2416. input.value = this.nativeInputValue;
  2417. },
  2418. handleFocus: function handleFocus(event) {
  2419. this.focused = true;
  2420. this.$emit('focus', event);
  2421. },
  2422. handleCompositionStart: function handleCompositionStart() {
  2423. this.isComposing = true;
  2424. },
  2425. handleCompositionUpdate: function handleCompositionUpdate(event) {
  2426. var text = event.target.value;
  2427. var lastCharacter = text[text.length - 1] || '';
  2428. this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
  2429. },
  2430. handleCompositionEnd: function handleCompositionEnd(event) {
  2431. if (this.isComposing) {
  2432. this.isComposing = false;
  2433. this.handleInput(event);
  2434. }
  2435. },
  2436. handleInput: function handleInput(event) {
  2437. // should not emit input during composition
  2438. // see: https://github.com/ElemeFE/element/issues/10516
  2439. if (this.isComposing) return;
  2440. // hack for https://github.com/ElemeFE/element/issues/8548
  2441. // should remove the following line when we don't support IE
  2442. if (event.target.value === this.nativeInputValue) return;
  2443. this.$emit('input', event.target.value);
  2444. // ensure native input value is controlled
  2445. // see: https://github.com/ElemeFE/element/issues/12850
  2446. this.$nextTick(this.setNativeInputValue);
  2447. },
  2448. handleChange: function handleChange(event) {
  2449. this.$emit('change', event.target.value);
  2450. },
  2451. calcIconOffset: function calcIconOffset(place) {
  2452. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  2453. if (!elList.length) return;
  2454. var el = null;
  2455. for (var i = 0; i < elList.length; i++) {
  2456. if (elList[i].parentNode === this.$el) {
  2457. el = elList[i];
  2458. break;
  2459. }
  2460. }
  2461. if (!el) return;
  2462. var pendantMap = {
  2463. suffix: 'append',
  2464. prefix: 'prepend'
  2465. };
  2466. var pendant = pendantMap[place];
  2467. if (this.$slots[pendant]) {
  2468. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  2469. } else {
  2470. el.removeAttribute('style');
  2471. }
  2472. },
  2473. updateIconOffset: function updateIconOffset() {
  2474. this.calcIconOffset('prefix');
  2475. this.calcIconOffset('suffix');
  2476. },
  2477. clear: function clear() {
  2478. this.$emit('input', '');
  2479. this.$emit('change', '');
  2480. this.$emit('clear');
  2481. },
  2482. handlePasswordVisible: function handlePasswordVisible() {
  2483. this.passwordVisible = !this.passwordVisible;
  2484. this.focus();
  2485. },
  2486. getInput: function getInput() {
  2487. return this.$refs.input || this.$refs.textarea;
  2488. },
  2489. getSuffixVisible: function getSuffixVisible() {
  2490. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  2491. }
  2492. },
  2493. created: function created() {
  2494. this.$on('inputSelect', this.select);
  2495. },
  2496. mounted: function mounted() {
  2497. this.setNativeInputValue();
  2498. this.resizeTextarea();
  2499. this.updateIconOffset();
  2500. },
  2501. updated: function updated() {
  2502. this.$nextTick(this.updateIconOffset);
  2503. }
  2504. });
  2505. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  2506. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  2507. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  2508. var componentNormalizer = __webpack_require__(2);
  2509. // CONCATENATED MODULE: ./packages/input/src/input.vue
  2510. /* normalize component */
  2511. var component = Object(componentNormalizer["a" /* default */])(
  2512. src_inputvue_type_script_lang_js_,
  2513. render,
  2514. staticRenderFns,
  2515. false,
  2516. null,
  2517. null,
  2518. null
  2519. )
  2520. /* hot reload */
  2521. if (false) { var api; }
  2522. component.options.__file = "packages/input/src/input.vue"
  2523. /* harmony default export */ var input = (component.exports);
  2524. // CONCATENATED MODULE: ./packages/input/index.js
  2525. /* istanbul ignore next */
  2526. input.install = function (Vue) {
  2527. Vue.component(input.name, input);
  2528. };
  2529. /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
  2530. /***/ }),
  2531. /***/ 534:
  2532. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2533. "use strict";
  2534. // ESM COMPAT FLAG
  2535. __webpack_require__.r(__webpack_exports__);
  2536. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=template&id=7274f267&
  2537. var render = function() {
  2538. var _vm = this
  2539. var _h = _vm.$createElement
  2540. var _c = _vm._self._c || _h
  2541. return _c(
  2542. "ul",
  2543. { staticClass: "el-pager", on: { click: _vm.onPagerClick } },
  2544. [
  2545. _vm.pageCount > 0
  2546. ? _c(
  2547. "li",
  2548. {
  2549. staticClass: "number",
  2550. class: { active: _vm.currentPage === 1, disabled: _vm.disabled }
  2551. },
  2552. [_vm._v("1")]
  2553. )
  2554. : _vm._e(),
  2555. _vm.showPrevMore
  2556. ? _c("li", {
  2557. staticClass: "el-icon more btn-quickprev",
  2558. class: [_vm.quickprevIconClass, { disabled: _vm.disabled }],
  2559. on: {
  2560. mouseenter: function($event) {
  2561. _vm.onMouseenter("left")
  2562. },
  2563. mouseleave: function($event) {
  2564. _vm.quickprevIconClass = "el-icon-more"
  2565. }
  2566. }
  2567. })
  2568. : _vm._e(),
  2569. _vm._l(_vm.pagers, function(pager) {
  2570. return _c(
  2571. "li",
  2572. {
  2573. key: pager,
  2574. staticClass: "number",
  2575. class: { active: _vm.currentPage === pager, disabled: _vm.disabled }
  2576. },
  2577. [_vm._v(_vm._s(pager))]
  2578. )
  2579. }),
  2580. _vm.showNextMore
  2581. ? _c("li", {
  2582. staticClass: "el-icon more btn-quicknext",
  2583. class: [_vm.quicknextIconClass, { disabled: _vm.disabled }],
  2584. on: {
  2585. mouseenter: function($event) {
  2586. _vm.onMouseenter("right")
  2587. },
  2588. mouseleave: function($event) {
  2589. _vm.quicknextIconClass = "el-icon-more"
  2590. }
  2591. }
  2592. })
  2593. : _vm._e(),
  2594. _vm.pageCount > 1
  2595. ? _c(
  2596. "li",
  2597. {
  2598. staticClass: "number",
  2599. class: {
  2600. active: _vm.currentPage === _vm.pageCount,
  2601. disabled: _vm.disabled
  2602. }
  2603. },
  2604. [_vm._v(_vm._s(_vm.pageCount))]
  2605. )
  2606. : _vm._e()
  2607. ],
  2608. 2
  2609. )
  2610. }
  2611. var staticRenderFns = []
  2612. render._withStripped = true
  2613. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=7274f267&
  2614. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=script&lang=js&
  2615. //
  2616. //
  2617. //
  2618. //
  2619. //
  2620. //
  2621. //
  2622. //
  2623. //
  2624. //
  2625. //
  2626. //
  2627. //
  2628. //
  2629. //
  2630. //
  2631. //
  2632. //
  2633. //
  2634. //
  2635. //
  2636. //
  2637. //
  2638. //
  2639. //
  2640. //
  2641. //
  2642. //
  2643. //
  2644. //
  2645. //
  2646. //
  2647. /* harmony default export */ var pagervue_type_script_lang_js_ = ({
  2648. name: 'TisPager',
  2649. props: {
  2650. currentPage: Number,
  2651. pageCount: Number,
  2652. pagerCount: Number,
  2653. disabled: Boolean
  2654. },
  2655. watch: {
  2656. showPrevMore: function showPrevMore(val) {
  2657. if (!val) this.quickprevIconClass = 'el-icon-more';
  2658. },
  2659. showNextMore: function showNextMore(val) {
  2660. if (!val) this.quicknextIconClass = 'el-icon-more';
  2661. }
  2662. },
  2663. methods: {
  2664. onPagerClick: function onPagerClick(event) {
  2665. var target = event.target;
  2666. if (target.tagName === 'UL' || this.disabled) {
  2667. return;
  2668. }
  2669. var newPage = Number(event.target.textContent);
  2670. var pageCount = this.pageCount;
  2671. var currentPage = this.currentPage;
  2672. var pagerCountOffset = this.pagerCount - 2;
  2673. if (target.className.indexOf('more') !== -1) {
  2674. if (target.className.indexOf('quickprev') !== -1) {
  2675. newPage = currentPage - pagerCountOffset;
  2676. } else if (target.className.indexOf('quicknext') !== -1) {
  2677. newPage = currentPage + pagerCountOffset;
  2678. }
  2679. }
  2680. /* istanbul ignore if */
  2681. if (!isNaN(newPage)) {
  2682. if (newPage < 1) {
  2683. newPage = 1;
  2684. }
  2685. if (newPage > pageCount) {
  2686. newPage = pageCount;
  2687. }
  2688. }
  2689. if (newPage !== currentPage) {
  2690. this.$emit('change', newPage);
  2691. }
  2692. },
  2693. onMouseenter: function onMouseenter(direction) {
  2694. if (this.disabled) return;
  2695. if (direction === 'left') {
  2696. this.quickprevIconClass = 'el-icon-d-arrow-left';
  2697. } else {
  2698. this.quicknextIconClass = 'el-icon-d-arrow-right';
  2699. }
  2700. }
  2701. },
  2702. computed: {
  2703. pagers: function pagers() {
  2704. var pagerCount = this.pagerCount;
  2705. var halfPagerCount = (pagerCount - 1) / 2;
  2706. var currentPage = Number(this.currentPage);
  2707. var pageCount = Number(this.pageCount);
  2708. var showPrevMore = false;
  2709. var showNextMore = false;
  2710. if (pageCount > pagerCount) {
  2711. if (currentPage > pagerCount - halfPagerCount) {
  2712. showPrevMore = true;
  2713. }
  2714. if (currentPage < pageCount - halfPagerCount) {
  2715. showNextMore = true;
  2716. }
  2717. }
  2718. var array = [];
  2719. if (showPrevMore && !showNextMore) {
  2720. var startPage = pageCount - (pagerCount - 2);
  2721. for (var i = startPage; i < pageCount; i++) {
  2722. array.push(i);
  2723. }
  2724. } else if (!showPrevMore && showNextMore) {
  2725. for (var _i = 2; _i < pagerCount; _i++) {
  2726. array.push(_i);
  2727. }
  2728. } else if (showPrevMore && showNextMore) {
  2729. var offset = Math.floor(pagerCount / 2) - 1;
  2730. for (var _i2 = currentPage - offset; _i2 <= currentPage + offset; _i2++) {
  2731. array.push(_i2);
  2732. }
  2733. } else {
  2734. for (var _i3 = 2; _i3 < pageCount; _i3++) {
  2735. array.push(_i3);
  2736. }
  2737. }
  2738. this.showPrevMore = showPrevMore;
  2739. this.showNextMore = showNextMore;
  2740. return array;
  2741. }
  2742. },
  2743. data: function data() {
  2744. return {
  2745. current: null,
  2746. showPrevMore: false,
  2747. showNextMore: false,
  2748. quicknextIconClass: 'el-icon-more',
  2749. quickprevIconClass: 'el-icon-more'
  2750. };
  2751. }
  2752. });
  2753. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js&
  2754. /* harmony default export */ var src_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_);
  2755. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  2756. var componentNormalizer = __webpack_require__(2);
  2757. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue
  2758. /* normalize component */
  2759. var component = Object(componentNormalizer["a" /* default */])(
  2760. src_pagervue_type_script_lang_js_,
  2761. render,
  2762. staticRenderFns,
  2763. false,
  2764. null,
  2765. null,
  2766. null
  2767. )
  2768. /* hot reload */
  2769. if (false) { var api; }
  2770. component.options.__file = "packages/pagination/src/pager.vue"
  2771. /* harmony default export */ var pager = (component.exports);
  2772. // EXTERNAL MODULE: ./packages/select/index.js + 11 modules
  2773. var packages_select = __webpack_require__(154);
  2774. // EXTERNAL MODULE: ./packages/option/index.js
  2775. var packages_option = __webpack_require__(149);
  2776. // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
  2777. var input = __webpack_require__(52);
  2778. // EXTERNAL MODULE: external "tis-ui/lib/mixins/locale"
  2779. var locale_ = __webpack_require__(38);
  2780. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  2781. // EXTERNAL MODULE: external "tis-ui/lib/utils/util"
  2782. var util_ = __webpack_require__(10);
  2783. // CONCATENATED MODULE: ./packages/pagination/src/pagination.js
  2784. /* harmony default export */ var pagination = ({
  2785. name: 'TisPagination',
  2786. props: {
  2787. pageSize: {
  2788. type: Number,
  2789. default: 10
  2790. },
  2791. small: Boolean,
  2792. total: Number,
  2793. pageCount: Number,
  2794. pagerCount: {
  2795. type: Number,
  2796. validator: function validator(value) {
  2797. return (value | 0) === value && value > 4 && value < 22 && value % 2 === 1;
  2798. },
  2799. default: 7
  2800. },
  2801. currentPage: {
  2802. type: Number,
  2803. default: 1
  2804. },
  2805. layout: {
  2806. default: 'prev, pager, next, jumper, ->, total'
  2807. },
  2808. pageSizes: {
  2809. type: Array,
  2810. default: function _default() {
  2811. return [10, 20, 30, 40, 50, 100];
  2812. }
  2813. },
  2814. popperClass: String,
  2815. prevText: String,
  2816. nextText: String,
  2817. background: Boolean,
  2818. disabled: Boolean,
  2819. hideOnSinglePage: Boolean
  2820. },
  2821. data: function data() {
  2822. return {
  2823. internalCurrentPage: 1,
  2824. internalPageSize: 0,
  2825. lastEmittedPage: -1,
  2826. userChangePageSize: false
  2827. };
  2828. },
  2829. render: function render(h) {
  2830. var layout = this.layout;
  2831. if (!layout) return null;
  2832. if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
  2833. var template = h('div', { 'class': ['el-pagination', {
  2834. 'is-background': this.background,
  2835. 'el-pagination--small': this.small
  2836. }] });
  2837. var TEMPLATE_MAP = {
  2838. prev: h('prev'),
  2839. jumper: h('jumper'),
  2840. pager: h('pager', {
  2841. attrs: { currentPage: this.internalCurrentPage, pageCount: this.internalPageCount, pagerCount: this.pagerCount, disabled: this.disabled },
  2842. on: {
  2843. 'change': this.handleCurrentChange
  2844. }
  2845. }),
  2846. next: h('next'),
  2847. sizes: h('sizes', {
  2848. attrs: { pageSizes: this.pageSizes }
  2849. }),
  2850. slot: h('slot', [this.$slots.default ? this.$slots.default : '']),
  2851. total: h('total')
  2852. };
  2853. var components = layout.split(',').map(function (item) {
  2854. return item.trim();
  2855. });
  2856. var rightWrapper = h('div', { 'class': 'el-pagination__rightwrapper' });
  2857. var haveRightWrapper = false;
  2858. template.children = template.children || [];
  2859. rightWrapper.children = rightWrapper.children || [];
  2860. components.forEach(function (compo) {
  2861. if (compo === '->') {
  2862. haveRightWrapper = true;
  2863. return;
  2864. }
  2865. if (!haveRightWrapper) {
  2866. template.children.push(TEMPLATE_MAP[compo]);
  2867. } else {
  2868. rightWrapper.children.push(TEMPLATE_MAP[compo]);
  2869. }
  2870. });
  2871. if (haveRightWrapper) {
  2872. template.children.unshift(rightWrapper);
  2873. }
  2874. return template;
  2875. },
  2876. components: {
  2877. Prev: {
  2878. render: function render(h) {
  2879. return h(
  2880. 'button',
  2881. {
  2882. attrs: {
  2883. type: 'button',
  2884. disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1
  2885. },
  2886. 'class': 'btn-prev', on: {
  2887. 'click': this.$parent.prev
  2888. }
  2889. },
  2890. [this.$parent.prevText ? h('span', [this.$parent.prevText]) : h('i', { 'class': 'el-icon el-icon-arrow-left' })]
  2891. );
  2892. }
  2893. },
  2894. Next: {
  2895. render: function render(h) {
  2896. return h(
  2897. 'button',
  2898. {
  2899. attrs: {
  2900. type: 'button',
  2901. disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0
  2902. },
  2903. 'class': 'btn-next', on: {
  2904. 'click': this.$parent.next
  2905. }
  2906. },
  2907. [this.$parent.nextText ? h('span', [this.$parent.nextText]) : h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  2908. );
  2909. }
  2910. },
  2911. Sizes: {
  2912. mixins: [locale_default.a],
  2913. props: {
  2914. pageSizes: Array
  2915. },
  2916. watch: {
  2917. pageSizes: {
  2918. immediate: true,
  2919. handler: function handler(newVal, oldVal) {
  2920. if (Object(util_["valueEquals"])(newVal, oldVal)) return;
  2921. if (Array.isArray(newVal)) {
  2922. this.$parent.internalPageSize = newVal.indexOf(this.$parent.pageSize) > -1 ? this.$parent.pageSize : this.pageSizes[0];
  2923. }
  2924. }
  2925. }
  2926. },
  2927. render: function render(h) {
  2928. var _this = this;
  2929. return h(
  2930. 'span',
  2931. { 'class': 'el-pagination__sizes' },
  2932. [h(
  2933. 'tis-select',
  2934. {
  2935. attrs: {
  2936. value: this.$parent.internalPageSize,
  2937. popperClass: this.$parent.popperClass || '',
  2938. size: 'mini',
  2939. disabled: this.$parent.disabled },
  2940. on: {
  2941. 'input': this.handleChange
  2942. }
  2943. },
  2944. [this.pageSizes.map(function (item) {
  2945. return h('tis-option', {
  2946. attrs: {
  2947. value: item,
  2948. label: item + _this.t('el.pagination.pagesize') }
  2949. });
  2950. })]
  2951. )]
  2952. );
  2953. },
  2954. components: {
  2955. ElSelect: packages_select["default"],
  2956. ElOption: packages_option["default"]
  2957. },
  2958. methods: {
  2959. handleChange: function handleChange(val) {
  2960. if (val !== this.$parent.internalPageSize) {
  2961. this.$parent.internalPageSize = val = parseInt(val, 10);
  2962. this.$parent.userChangePageSize = true;
  2963. this.$parent.$emit('update:pageSize', val);
  2964. this.$parent.$emit('size-change', val);
  2965. }
  2966. }
  2967. }
  2968. },
  2969. Jumper: {
  2970. mixins: [locale_default.a],
  2971. components: { ElInput: input["default"] },
  2972. data: function data() {
  2973. return {
  2974. userInput: null
  2975. };
  2976. },
  2977. watch: {
  2978. '$parent.internalCurrentPage': function $parentInternalCurrentPage() {
  2979. this.userInput = null;
  2980. }
  2981. },
  2982. methods: {
  2983. handleKeyup: function handleKeyup(_ref) {
  2984. var keyCode = _ref.keyCode,
  2985. target = _ref.target;
  2986. // Chrome, Safari, Firefox triggers change event on Enter
  2987. // Hack for IE: https://github.com/ElemeFE/element/issues/11710
  2988. // Drop this method when we no longer supports IE
  2989. if (keyCode === 13) {
  2990. this.handleChange(target.value);
  2991. }
  2992. },
  2993. handleInput: function handleInput(value) {
  2994. this.userInput = value;
  2995. },
  2996. handleChange: function handleChange(value) {
  2997. this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
  2998. this.$parent.emitChange();
  2999. this.userInput = null;
  3000. }
  3001. },
  3002. render: function render(h) {
  3003. return h(
  3004. 'span',
  3005. { 'class': 'el-pagination__jump' },
  3006. [this.t('el.pagination.goto'), h('tis-input', {
  3007. 'class': 'el-pagination__editor is-in-pagination',
  3008. attrs: { min: 1,
  3009. max: this.$parent.internalPageCount,
  3010. value: this.userInput !== null ? this.userInput : this.$parent.internalCurrentPage,
  3011. type: 'number',
  3012. disabled: this.$parent.disabled
  3013. },
  3014. nativeOn: {
  3015. 'keyup': this.handleKeyup
  3016. },
  3017. on: {
  3018. 'input': this.handleInput,
  3019. 'change': this.handleChange
  3020. }
  3021. }), this.t('el.pagination.pageClassifier')]
  3022. );
  3023. }
  3024. },
  3025. Total: {
  3026. mixins: [locale_default.a],
  3027. render: function render(h) {
  3028. return typeof this.$parent.total === 'number' ? h(
  3029. 'span',
  3030. { 'class': 'el-pagination__total' },
  3031. [this.t('el.pagination.total', { total: this.$parent.total })]
  3032. ) : '';
  3033. }
  3034. },
  3035. Pager: pager
  3036. },
  3037. methods: {
  3038. handleCurrentChange: function handleCurrentChange(val) {
  3039. this.internalCurrentPage = this.getValidCurrentPage(val);
  3040. this.userChangePageSize = true;
  3041. this.emitChange();
  3042. },
  3043. prev: function prev() {
  3044. if (this.disabled) return;
  3045. var newVal = this.internalCurrentPage - 1;
  3046. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  3047. this.$emit('prev-click', this.internalCurrentPage);
  3048. this.emitChange();
  3049. },
  3050. next: function next() {
  3051. if (this.disabled) return;
  3052. var newVal = this.internalCurrentPage + 1;
  3053. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  3054. this.$emit('next-click', this.internalCurrentPage);
  3055. this.emitChange();
  3056. },
  3057. getValidCurrentPage: function getValidCurrentPage(value) {
  3058. value = parseInt(value, 10);
  3059. var havePageCount = typeof this.internalPageCount === 'number';
  3060. var resetValue = void 0;
  3061. if (!havePageCount) {
  3062. if (isNaN(value) || value < 1) resetValue = 1;
  3063. } else {
  3064. if (value < 1) {
  3065. resetValue = 1;
  3066. } else if (value > this.internalPageCount) {
  3067. resetValue = this.internalPageCount;
  3068. }
  3069. }
  3070. if (resetValue === undefined && isNaN(value)) {
  3071. resetValue = 1;
  3072. } else if (resetValue === 0) {
  3073. resetValue = 1;
  3074. }
  3075. return resetValue === undefined ? value : resetValue;
  3076. },
  3077. emitChange: function emitChange() {
  3078. var _this2 = this;
  3079. this.$nextTick(function () {
  3080. if (_this2.internalCurrentPage !== _this2.lastEmittedPage || _this2.userChangePageSize) {
  3081. _this2.$emit('current-change', _this2.internalCurrentPage);
  3082. _this2.lastEmittedPage = _this2.internalCurrentPage;
  3083. _this2.userChangePageSize = false;
  3084. }
  3085. });
  3086. }
  3087. },
  3088. computed: {
  3089. internalPageCount: function internalPageCount() {
  3090. if (typeof this.total === 'number') {
  3091. return Math.max(1, Math.ceil(this.total / this.internalPageSize));
  3092. } else if (typeof this.pageCount === 'number') {
  3093. return Math.max(1, this.pageCount);
  3094. }
  3095. return null;
  3096. }
  3097. },
  3098. watch: {
  3099. currentPage: {
  3100. immediate: true,
  3101. handler: function handler(val) {
  3102. this.internalCurrentPage = this.getValidCurrentPage(val);
  3103. }
  3104. },
  3105. pageSize: {
  3106. immediate: true,
  3107. handler: function handler(val) {
  3108. this.internalPageSize = isNaN(val) ? 10 : val;
  3109. }
  3110. },
  3111. internalCurrentPage: {
  3112. immediate: true,
  3113. handler: function handler(newVal) {
  3114. this.$emit('update:currentPage', newVal);
  3115. this.lastEmittedPage = -1;
  3116. }
  3117. },
  3118. internalPageCount: function internalPageCount(newVal) {
  3119. /* istanbul ignore if */
  3120. var oldPage = this.internalCurrentPage;
  3121. if (newVal > 0 && oldPage === 0) {
  3122. this.internalCurrentPage = 1;
  3123. } else if (oldPage > newVal) {
  3124. this.internalCurrentPage = newVal === 0 ? 1 : newVal;
  3125. this.userChangePageSize && this.emitChange();
  3126. }
  3127. this.userChangePageSize = false;
  3128. }
  3129. }
  3130. });
  3131. // CONCATENATED MODULE: ./packages/pagination/index.js
  3132. /* istanbul ignore next */
  3133. pagination.install = function (Vue) {
  3134. Vue.component(pagination.name, pagination);
  3135. };
  3136. /* harmony default export */ var packages_pagination = __webpack_exports__["default"] = (pagination);
  3137. /***/ }),
  3138. /***/ 61:
  3139. /***/ (function(module, exports) {
  3140. module.exports = require("tis-ui/lib/utils/clickoutside");
  3141. /***/ }),
  3142. /***/ 62:
  3143. /***/ (function(module, exports) {
  3144. module.exports = require("throttle-debounce/debounce");
  3145. /***/ }),
  3146. /***/ 65:
  3147. /***/ (function(module, exports) {
  3148. module.exports = require("tis-ui/lib/utils/scrollbar-width");
  3149. /***/ }),
  3150. /***/ 66:
  3151. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3152. "use strict";
  3153. // ESM COMPAT FLAG
  3154. __webpack_require__.r(__webpack_exports__);
  3155. // EXTERNAL MODULE: external "tis-ui/lib/utils/resize-event"
  3156. var resize_event_ = __webpack_require__(44);
  3157. // EXTERNAL MODULE: external "tis-ui/lib/utils/scrollbar-width"
  3158. var scrollbar_width_ = __webpack_require__(65);
  3159. var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
  3160. // EXTERNAL MODULE: external "tis-ui/lib/utils/util"
  3161. var util_ = __webpack_require__(10);
  3162. // EXTERNAL MODULE: external "tis-ui/lib/utils/dom"
  3163. var dom_ = __webpack_require__(7);
  3164. // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
  3165. var BAR_MAP = {
  3166. vertical: {
  3167. offset: 'offsetHeight',
  3168. scroll: 'scrollTop',
  3169. scrollSize: 'scrollHeight',
  3170. size: 'height',
  3171. key: 'vertical',
  3172. axis: 'Y',
  3173. client: 'clientY',
  3174. direction: 'top'
  3175. },
  3176. horizontal: {
  3177. offset: 'offsetWidth',
  3178. scroll: 'scrollLeft',
  3179. scrollSize: 'scrollWidth',
  3180. size: 'width',
  3181. key: 'horizontal',
  3182. axis: 'X',
  3183. client: 'clientX',
  3184. direction: 'left'
  3185. }
  3186. };
  3187. function renderThumbStyle(_ref) {
  3188. var move = _ref.move,
  3189. size = _ref.size,
  3190. bar = _ref.bar;
  3191. var style = {};
  3192. var translate = 'translate' + bar.axis + '(' + move + '%)';
  3193. style[bar.size] = size;
  3194. style.transform = translate;
  3195. style.msTransform = translate;
  3196. style.webkitTransform = translate;
  3197. return style;
  3198. };
  3199. // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
  3200. /* istanbul ignore next */
  3201. /* harmony default export */ var src_bar = ({
  3202. name: 'Bar',
  3203. props: {
  3204. vertical: Boolean,
  3205. size: String,
  3206. move: Number
  3207. },
  3208. computed: {
  3209. bar: function bar() {
  3210. return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
  3211. },
  3212. wrap: function wrap() {
  3213. return this.$parent.wrap;
  3214. }
  3215. },
  3216. render: function render(h) {
  3217. var size = this.size,
  3218. move = this.move,
  3219. bar = this.bar;
  3220. return h(
  3221. 'div',
  3222. {
  3223. 'class': ['el-scrollbar__bar', 'is-' + bar.key],
  3224. on: {
  3225. 'mousedown': this.clickTrackHandler
  3226. }
  3227. },
  3228. [h('div', {
  3229. ref: 'thumb',
  3230. 'class': 'el-scrollbar__thumb',
  3231. on: {
  3232. 'mousedown': this.clickThumbHandler
  3233. },
  3234. style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
  3235. );
  3236. },
  3237. methods: {
  3238. clickThumbHandler: function clickThumbHandler(e) {
  3239. // prevent click event of right button
  3240. if (e.ctrlKey || e.button === 2) {
  3241. return;
  3242. }
  3243. this.startDrag(e);
  3244. this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
  3245. },
  3246. clickTrackHandler: function clickTrackHandler(e) {
  3247. var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
  3248. var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
  3249. var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
  3250. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  3251. },
  3252. startDrag: function startDrag(e) {
  3253. e.stopImmediatePropagation();
  3254. this.cursorDown = true;
  3255. Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  3256. Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
  3257. document.onselectstart = function () {
  3258. return false;
  3259. };
  3260. },
  3261. mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
  3262. if (this.cursorDown === false) return;
  3263. var prevPage = this[this.bar.axis];
  3264. if (!prevPage) return;
  3265. var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
  3266. var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
  3267. var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
  3268. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  3269. },
  3270. mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
  3271. this.cursorDown = false;
  3272. this[this.bar.axis] = 0;
  3273. Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  3274. document.onselectstart = null;
  3275. }
  3276. },
  3277. destroyed: function destroyed() {
  3278. Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
  3279. }
  3280. });
  3281. // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
  3282. // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
  3283. /* istanbul ignore next */
  3284. /* harmony default export */ var main = ({
  3285. name: 'TisScrollbar',
  3286. components: { Bar: src_bar },
  3287. props: {
  3288. native: Boolean,
  3289. wrapStyle: {},
  3290. wrapClass: {},
  3291. viewClass: {},
  3292. viewStyle: {},
  3293. noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
  3294. tag: {
  3295. type: String,
  3296. default: 'div'
  3297. }
  3298. },
  3299. data: function data() {
  3300. return {
  3301. sizeWidth: '0',
  3302. sizeHeight: '0',
  3303. moveX: 0,
  3304. moveY: 0
  3305. };
  3306. },
  3307. computed: {
  3308. wrap: function wrap() {
  3309. return this.$refs.wrap;
  3310. }
  3311. },
  3312. render: function render(h) {
  3313. var gutter = scrollbar_width_default()();
  3314. var style = this.wrapStyle;
  3315. if (gutter) {
  3316. var gutterWith = '-' + gutter + 'px';
  3317. var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
  3318. if (Array.isArray(this.wrapStyle)) {
  3319. style = Object(util_["toObject"])(this.wrapStyle);
  3320. style.marginRight = style.marginBottom = gutterWith;
  3321. } else if (typeof this.wrapStyle === 'string') {
  3322. style += gutterStyle;
  3323. } else {
  3324. style = gutterStyle;
  3325. }
  3326. }
  3327. var view = h(this.tag, {
  3328. class: ['el-scrollbar__view', this.viewClass],
  3329. style: this.viewStyle,
  3330. ref: 'resize'
  3331. }, this.$slots.default);
  3332. var wrap = h(
  3333. 'div',
  3334. {
  3335. ref: 'wrap',
  3336. style: style,
  3337. on: {
  3338. 'scroll': this.handleScroll
  3339. },
  3340. 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
  3341. [[view]]
  3342. );
  3343. var nodes = void 0;
  3344. if (!this.native) {
  3345. nodes = [wrap, h(src_bar, {
  3346. attrs: {
  3347. move: this.moveX,
  3348. size: this.sizeWidth }
  3349. }), h(src_bar, {
  3350. attrs: {
  3351. vertical: true,
  3352. move: this.moveY,
  3353. size: this.sizeHeight }
  3354. })];
  3355. } else {
  3356. nodes = [h(
  3357. 'div',
  3358. {
  3359. ref: 'wrap',
  3360. 'class': [this.wrapClass, 'el-scrollbar__wrap'],
  3361. style: style },
  3362. [[view]]
  3363. )];
  3364. }
  3365. return h('div', { class: 'el-scrollbar' }, nodes);
  3366. },
  3367. methods: {
  3368. handleScroll: function handleScroll() {
  3369. var wrap = this.wrap;
  3370. this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
  3371. this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
  3372. },
  3373. update: function update() {
  3374. var heightPercentage = void 0,
  3375. widthPercentage = void 0;
  3376. var wrap = this.wrap;
  3377. if (!wrap) return;
  3378. heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
  3379. widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
  3380. this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
  3381. this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
  3382. }
  3383. },
  3384. mounted: function mounted() {
  3385. if (this.native) return;
  3386. this.$nextTick(this.update);
  3387. !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
  3388. },
  3389. beforeDestroy: function beforeDestroy() {
  3390. if (this.native) return;
  3391. !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
  3392. }
  3393. });
  3394. // CONCATENATED MODULE: ./packages/scrollbar/index.js
  3395. /* istanbul ignore next */
  3396. main.install = function (Vue) {
  3397. Vue.component(main.name, main);
  3398. };
  3399. /* harmony default export */ var scrollbar = __webpack_exports__["default"] = (main);
  3400. /***/ }),
  3401. /***/ 7:
  3402. /***/ (function(module, exports) {
  3403. module.exports = require("tis-ui/lib/utils/dom");
  3404. /***/ }),
  3405. /***/ 72:
  3406. /***/ (function(module, exports) {
  3407. module.exports = require("tis-ui/lib/locale");
  3408. /***/ }),
  3409. /***/ 88:
  3410. /***/ (function(module, exports) {
  3411. module.exports = require("tis-ui/lib/mixins/focus");
  3412. /***/ }),
  3413. /***/ 91:
  3414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3415. "use strict";
  3416. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  3417. var render = function() {
  3418. var _vm = this
  3419. var _h = _vm.$createElement
  3420. var _c = _vm._self._c || _h
  3421. return _c(
  3422. "li",
  3423. {
  3424. directives: [
  3425. {
  3426. name: "show",
  3427. rawName: "v-show",
  3428. value: _vm.visible,
  3429. expression: "visible"
  3430. }
  3431. ],
  3432. staticClass: "el-select-dropdown__item",
  3433. class: {
  3434. selected: _vm.itemSelected,
  3435. "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
  3436. hover: _vm.hover
  3437. },
  3438. on: {
  3439. mouseenter: _vm.hoverItem,
  3440. click: function($event) {
  3441. $event.stopPropagation()
  3442. return _vm.selectOptionClick($event)
  3443. }
  3444. }
  3445. },
  3446. [_vm._t("default", [_c("span", [_vm._v(_vm._s(_vm.currentLabel))])])],
  3447. 2
  3448. )
  3449. }
  3450. var staticRenderFns = []
  3451. render._withStripped = true
  3452. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  3453. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  3454. var emitter_ = __webpack_require__(13);
  3455. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  3456. // EXTERNAL MODULE: external "tis-ui/lib/utils/util"
  3457. var util_ = __webpack_require__(10);
  3458. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=script&lang=js&
  3459. 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; };
  3460. //
  3461. //
  3462. //
  3463. //
  3464. //
  3465. //
  3466. //
  3467. //
  3468. //
  3469. //
  3470. //
  3471. //
  3472. //
  3473. //
  3474. //
  3475. //
  3476. //
  3477. /* harmony default export */ var optionvue_type_script_lang_js_ = ({
  3478. mixins: [emitter_default.a],
  3479. name: 'TisOption',
  3480. componentName: 'TisOption',
  3481. inject: ['select'],
  3482. props: {
  3483. value: {
  3484. required: true
  3485. },
  3486. label: [String, Number],
  3487. created: Boolean,
  3488. disabled: {
  3489. type: Boolean,
  3490. default: false
  3491. }
  3492. },
  3493. data: function data() {
  3494. return {
  3495. index: -1,
  3496. groupDisabled: false,
  3497. visible: true,
  3498. hitState: false,
  3499. hover: false
  3500. };
  3501. },
  3502. computed: {
  3503. isObject: function isObject() {
  3504. return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
  3505. },
  3506. currentLabel: function currentLabel() {
  3507. return this.label || (this.isObject ? '' : this.value);
  3508. },
  3509. currentValue: function currentValue() {
  3510. return this.value || this.label || '';
  3511. },
  3512. itemSelected: function itemSelected() {
  3513. if (!this.select.multiple) {
  3514. return this.isEqual(this.value, this.select.value);
  3515. } else {
  3516. return this.contains(this.select.value, this.value);
  3517. }
  3518. },
  3519. limitReached: function limitReached() {
  3520. if (this.select.multiple) {
  3521. return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
  3522. } else {
  3523. return false;
  3524. }
  3525. }
  3526. },
  3527. watch: {
  3528. currentLabel: function currentLabel() {
  3529. if (!this.created && !this.select.remote) this.dispatch('TisSelect', 'setSelected');
  3530. },
  3531. value: function value(val, oldVal) {
  3532. var _select = this.select,
  3533. remote = _select.remote,
  3534. valueKey = _select.valueKey;
  3535. if (!this.created && !remote) {
  3536. if (valueKey && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && (typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) === 'object' && val[valueKey] === oldVal[valueKey]) {
  3537. return;
  3538. }
  3539. this.dispatch('TisSelect', 'setSelected');
  3540. }
  3541. }
  3542. },
  3543. methods: {
  3544. isEqual: function isEqual(a, b) {
  3545. if (!this.isObject) {
  3546. return a === b;
  3547. } else {
  3548. var valueKey = this.select.valueKey;
  3549. return Object(util_["getValueByPath"])(a, valueKey) === Object(util_["getValueByPath"])(b, valueKey);
  3550. }
  3551. },
  3552. contains: function contains() {
  3553. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  3554. var target = arguments[1];
  3555. if (!this.isObject) {
  3556. return arr && arr.indexOf(target) > -1;
  3557. } else {
  3558. var valueKey = this.select.valueKey;
  3559. return arr && arr.some(function (item) {
  3560. return Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(target, valueKey);
  3561. });
  3562. }
  3563. },
  3564. handleGroupDisabled: function handleGroupDisabled(val) {
  3565. this.groupDisabled = val;
  3566. },
  3567. hoverItem: function hoverItem() {
  3568. if (!this.disabled && !this.groupDisabled) {
  3569. this.select.hoverIndex = this.select.options.indexOf(this);
  3570. }
  3571. },
  3572. selectOptionClick: function selectOptionClick() {
  3573. if (this.disabled !== true && this.groupDisabled !== true) {
  3574. this.dispatch('TisSelect', 'handleOptionClick', [this, true]);
  3575. }
  3576. },
  3577. queryChange: function queryChange(query) {
  3578. this.visible = new RegExp(Object(util_["escapeRegexpString"])(query), 'i').test(this.currentLabel) || this.created;
  3579. if (!this.visible) {
  3580. this.select.filteredOptionsCount--;
  3581. }
  3582. }
  3583. },
  3584. created: function created() {
  3585. this.select.options.push(this);
  3586. this.select.cachedOptions.push(this);
  3587. this.select.optionsCount++;
  3588. this.select.filteredOptionsCount++;
  3589. this.$on('queryChange', this.queryChange);
  3590. this.$on('handleGroupDisabled', this.handleGroupDisabled);
  3591. },
  3592. beforeDestroy: function beforeDestroy() {
  3593. var _select2 = this.select,
  3594. selected = _select2.selected,
  3595. multiple = _select2.multiple;
  3596. var selectedOptions = multiple ? selected : [selected];
  3597. var index = this.select.cachedOptions.indexOf(this);
  3598. var selectedIndex = selectedOptions.indexOf(this);
  3599. // if option is not selected, remove it from cache
  3600. if (index > -1 && selectedIndex < 0) {
  3601. this.select.cachedOptions.splice(index, 1);
  3602. }
  3603. this.select.onOptionDestroy(this.select.options.indexOf(this));
  3604. }
  3605. });
  3606. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=script&lang=js&
  3607. /* harmony default export */ var src_optionvue_type_script_lang_js_ = (optionvue_type_script_lang_js_);
  3608. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  3609. var componentNormalizer = __webpack_require__(2);
  3610. // CONCATENATED MODULE: ./packages/select/src/option.vue
  3611. /* normalize component */
  3612. var component = Object(componentNormalizer["a" /* default */])(
  3613. src_optionvue_type_script_lang_js_,
  3614. render,
  3615. staticRenderFns,
  3616. false,
  3617. null,
  3618. null,
  3619. null
  3620. )
  3621. /* hot reload */
  3622. if (false) { var api; }
  3623. component.options.__file = "packages/select/src/option.vue"
  3624. /* harmony default export */ var src_option = __webpack_exports__["a"] = (component.exports);
  3625. /***/ }),
  3626. /***/ 95:
  3627. /***/ (function(module, exports) {
  3628. module.exports = require("tis-ui/lib/utils/scroll-into-view");
  3629. /***/ })
  3630. /******/ });