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.

3370 lines
94 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 = 154);
  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. /***/ 154:
  192. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  193. "use strict";
  194. // ESM COMPAT FLAG
  195. __webpack_require__.r(__webpack_exports__);
  196. // 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&
  197. var render = function() {
  198. var _vm = this
  199. var _h = _vm.$createElement
  200. var _c = _vm._self._c || _h
  201. return _c(
  202. "div",
  203. {
  204. directives: [
  205. {
  206. name: "clickoutside",
  207. rawName: "v-clickoutside",
  208. value: _vm.handleClose,
  209. expression: "handleClose"
  210. }
  211. ],
  212. staticClass: "el-select",
  213. class: [_vm.selectSize ? "el-select--" + _vm.selectSize : ""],
  214. on: {
  215. click: function($event) {
  216. $event.stopPropagation()
  217. return _vm.toggleMenu($event)
  218. }
  219. }
  220. },
  221. [
  222. _vm.multiple
  223. ? _c(
  224. "div",
  225. {
  226. ref: "tags",
  227. staticClass: "el-select__tags",
  228. style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" }
  229. },
  230. [
  231. _vm.collapseTags && _vm.selected.length
  232. ? _c(
  233. "span",
  234. [
  235. _c(
  236. "tis-tag",
  237. {
  238. attrs: {
  239. closable: !_vm.selectDisabled,
  240. size: _vm.collapseTagSize,
  241. hit: _vm.selected[0].hitState,
  242. type: "info",
  243. "disable-transitions": ""
  244. },
  245. on: {
  246. close: function($event) {
  247. _vm.deleteTag($event, _vm.selected[0])
  248. }
  249. }
  250. },
  251. [
  252. _c("span", { staticClass: "el-select__tags-text" }, [
  253. _vm._v(_vm._s(_vm.selected[0].currentLabel))
  254. ])
  255. ]
  256. ),
  257. _vm.selected.length > 1
  258. ? _c(
  259. "tis-tag",
  260. {
  261. attrs: {
  262. closable: false,
  263. size: _vm.collapseTagSize,
  264. type: "info",
  265. "disable-transitions": ""
  266. }
  267. },
  268. [
  269. _c(
  270. "span",
  271. { staticClass: "el-select__tags-text" },
  272. [_vm._v("+ " + _vm._s(_vm.selected.length - 1))]
  273. )
  274. ]
  275. )
  276. : _vm._e()
  277. ],
  278. 1
  279. )
  280. : _vm._e(),
  281. !_vm.collapseTags
  282. ? _c(
  283. "transition-group",
  284. { on: { "after-leave": _vm.resetInputHeight } },
  285. _vm._l(_vm.selected, function(item) {
  286. return _c(
  287. "tis-tag",
  288. {
  289. key: _vm.getValueKey(item),
  290. attrs: {
  291. closable: !_vm.selectDisabled,
  292. size: _vm.collapseTagSize,
  293. hit: item.hitState,
  294. type: "info",
  295. "disable-transitions": ""
  296. },
  297. on: {
  298. close: function($event) {
  299. _vm.deleteTag($event, item)
  300. }
  301. }
  302. },
  303. [
  304. _c("span", { staticClass: "el-select__tags-text" }, [
  305. _vm._v(_vm._s(item.currentLabel))
  306. ])
  307. ]
  308. )
  309. }),
  310. 1
  311. )
  312. : _vm._e(),
  313. _vm.filterable
  314. ? _c("input", {
  315. directives: [
  316. {
  317. name: "model",
  318. rawName: "v-model",
  319. value: _vm.query,
  320. expression: "query"
  321. }
  322. ],
  323. ref: "input",
  324. staticClass: "el-select__input",
  325. class: [_vm.selectSize ? "is-" + _vm.selectSize : ""],
  326. style: {
  327. "flex-grow": "1",
  328. width: _vm.inputLength / (_vm.inputWidth - 32) + "%",
  329. "max-width": _vm.inputWidth - 42 + "px"
  330. },
  331. attrs: {
  332. type: "text",
  333. disabled: _vm.selectDisabled,
  334. autocomplete: _vm.autoComplete || _vm.autocomplete
  335. },
  336. domProps: { value: _vm.query },
  337. on: {
  338. focus: _vm.handleFocus,
  339. blur: function($event) {
  340. _vm.softFocus = false
  341. },
  342. keyup: _vm.managePlaceholder,
  343. keydown: [
  344. _vm.resetInputState,
  345. function($event) {
  346. if (
  347. !("button" in $event) &&
  348. _vm._k($event.keyCode, "down", 40, $event.key, [
  349. "Down",
  350. "ArrowDown"
  351. ])
  352. ) {
  353. return null
  354. }
  355. $event.preventDefault()
  356. _vm.navigateOptions("next")
  357. },
  358. function($event) {
  359. if (
  360. !("button" in $event) &&
  361. _vm._k($event.keyCode, "up", 38, $event.key, [
  362. "Up",
  363. "ArrowUp"
  364. ])
  365. ) {
  366. return null
  367. }
  368. $event.preventDefault()
  369. _vm.navigateOptions("prev")
  370. },
  371. function($event) {
  372. if (
  373. !("button" in $event) &&
  374. _vm._k(
  375. $event.keyCode,
  376. "enter",
  377. 13,
  378. $event.key,
  379. "Enter"
  380. )
  381. ) {
  382. return null
  383. }
  384. $event.preventDefault()
  385. return _vm.selectOption($event)
  386. },
  387. function($event) {
  388. if (
  389. !("button" in $event) &&
  390. _vm._k($event.keyCode, "esc", 27, $event.key, [
  391. "Esc",
  392. "Escape"
  393. ])
  394. ) {
  395. return null
  396. }
  397. $event.stopPropagation()
  398. $event.preventDefault()
  399. _vm.visible = false
  400. },
  401. function($event) {
  402. if (
  403. !("button" in $event) &&
  404. _vm._k(
  405. $event.keyCode,
  406. "delete",
  407. [8, 46],
  408. $event.key,
  409. ["Backspace", "Delete", "Del"]
  410. )
  411. ) {
  412. return null
  413. }
  414. return _vm.deletePrevTag($event)
  415. },
  416. function($event) {
  417. if (
  418. !("button" in $event) &&
  419. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  420. ) {
  421. return null
  422. }
  423. _vm.visible = false
  424. }
  425. ],
  426. compositionstart: _vm.handleComposition,
  427. compositionupdate: _vm.handleComposition,
  428. compositionend: _vm.handleComposition,
  429. input: [
  430. function($event) {
  431. if ($event.target.composing) {
  432. return
  433. }
  434. _vm.query = $event.target.value
  435. },
  436. _vm.debouncedQueryChange
  437. ]
  438. }
  439. })
  440. : _vm._e()
  441. ],
  442. 1
  443. )
  444. : _vm._e(),
  445. _c(
  446. "tis-input",
  447. {
  448. ref: "reference",
  449. class: { "is-focus": _vm.visible },
  450. attrs: {
  451. type: "text",
  452. placeholder: _vm.currentPlaceholder,
  453. name: _vm.name,
  454. id: _vm.id,
  455. autocomplete: _vm.autoComplete || _vm.autocomplete,
  456. size: _vm.selectSize,
  457. disabled: _vm.selectDisabled,
  458. readonly: _vm.readonly,
  459. "validate-event": false,
  460. tabindex: _vm.multiple && _vm.filterable ? "-1" : null
  461. },
  462. on: { focus: _vm.handleFocus, blur: _vm.handleBlur },
  463. nativeOn: {
  464. keyup: function($event) {
  465. return _vm.debouncedOnInputChange($event)
  466. },
  467. keydown: [
  468. function($event) {
  469. if (
  470. !("button" in $event) &&
  471. _vm._k($event.keyCode, "down", 40, $event.key, [
  472. "Down",
  473. "ArrowDown"
  474. ])
  475. ) {
  476. return null
  477. }
  478. $event.stopPropagation()
  479. $event.preventDefault()
  480. _vm.navigateOptions("next")
  481. },
  482. function($event) {
  483. if (
  484. !("button" in $event) &&
  485. _vm._k($event.keyCode, "up", 38, $event.key, [
  486. "Up",
  487. "ArrowUp"
  488. ])
  489. ) {
  490. return null
  491. }
  492. $event.stopPropagation()
  493. $event.preventDefault()
  494. _vm.navigateOptions("prev")
  495. },
  496. function($event) {
  497. if (
  498. !("button" in $event) &&
  499. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  500. ) {
  501. return null
  502. }
  503. $event.preventDefault()
  504. return _vm.selectOption($event)
  505. },
  506. function($event) {
  507. if (
  508. !("button" in $event) &&
  509. _vm._k($event.keyCode, "esc", 27, $event.key, [
  510. "Esc",
  511. "Escape"
  512. ])
  513. ) {
  514. return null
  515. }
  516. $event.stopPropagation()
  517. $event.preventDefault()
  518. _vm.visible = false
  519. },
  520. function($event) {
  521. if (
  522. !("button" in $event) &&
  523. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  524. ) {
  525. return null
  526. }
  527. _vm.visible = false
  528. }
  529. ],
  530. paste: function($event) {
  531. return _vm.debouncedOnInputChange($event)
  532. },
  533. mouseenter: function($event) {
  534. _vm.inputHovering = true
  535. },
  536. mouseleave: function($event) {
  537. _vm.inputHovering = false
  538. }
  539. },
  540. model: {
  541. value: _vm.selectedLabel,
  542. callback: function($$v) {
  543. _vm.selectedLabel = $$v
  544. },
  545. expression: "selectedLabel"
  546. }
  547. },
  548. [
  549. _vm.$slots.prefix
  550. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  551. : _vm._e(),
  552. _c("template", { slot: "suffix" }, [
  553. _c("i", {
  554. directives: [
  555. {
  556. name: "show",
  557. rawName: "v-show",
  558. value: !_vm.showClose,
  559. expression: "!showClose"
  560. }
  561. ],
  562. class: [
  563. "el-select__caret",
  564. "el-input__icon",
  565. "el-icon-" + _vm.iconClass
  566. ]
  567. }),
  568. _vm.showClose
  569. ? _c("i", {
  570. staticClass:
  571. "el-select__caret el-input__icon el-icon-circle-close",
  572. on: { click: _vm.handleClearClick }
  573. })
  574. : _vm._e()
  575. ])
  576. ],
  577. 2
  578. ),
  579. _c(
  580. "transition",
  581. {
  582. attrs: { name: "el-zoom-in-top" },
  583. on: {
  584. "before-enter": _vm.handleMenuEnter,
  585. "after-leave": _vm.doDestroy
  586. }
  587. },
  588. [
  589. _c(
  590. "tis-select-menu",
  591. {
  592. directives: [
  593. {
  594. name: "show",
  595. rawName: "v-show",
  596. value: _vm.visible && _vm.emptyText !== false,
  597. expression: "visible && emptyText !== false"
  598. }
  599. ],
  600. ref: "popper",
  601. attrs: { "append-to-body": _vm.popperAppendToBody }
  602. },
  603. [
  604. _c(
  605. "tis-scrollbar",
  606. {
  607. directives: [
  608. {
  609. name: "show",
  610. rawName: "v-show",
  611. value: _vm.options.length > 0 && !_vm.loading,
  612. expression: "options.length > 0 && !loading"
  613. }
  614. ],
  615. ref: "scrollbar",
  616. class: {
  617. "is-empty":
  618. !_vm.allowCreate &&
  619. _vm.query &&
  620. _vm.filteredOptionsCount === 0
  621. },
  622. attrs: {
  623. tag: "ul",
  624. "wrap-class": "el-select-dropdown__wrap",
  625. "view-class": "el-select-dropdown__list"
  626. }
  627. },
  628. [
  629. _vm.showNewOption
  630. ? _c("tis-option", {
  631. attrs: { value: _vm.query, created: "" }
  632. })
  633. : _vm._e(),
  634. _vm._t("default")
  635. ],
  636. 2
  637. ),
  638. _vm.emptyText &&
  639. (!_vm.allowCreate ||
  640. _vm.loading ||
  641. (_vm.allowCreate && _vm.options.length === 0))
  642. ? [
  643. _vm.$slots.empty
  644. ? _vm._t("empty")
  645. : _c("p", { staticClass: "el-select-dropdown__empty" }, [
  646. _vm._v(
  647. "\n " +
  648. _vm._s(_vm.emptyText) +
  649. "\n "
  650. )
  651. ])
  652. ]
  653. : _vm._e()
  654. ],
  655. 2
  656. )
  657. ],
  658. 1
  659. )
  660. ],
  661. 1
  662. )
  663. }
  664. var staticRenderFns = []
  665. render._withStripped = true
  666. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  667. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  668. var emitter_ = __webpack_require__(13);
  669. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  670. // EXTERNAL MODULE: external "tis-ui/lib/mixins/focus"
  671. var focus_ = __webpack_require__(88);
  672. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  673. // EXTERNAL MODULE: external "tis-ui/lib/mixins/locale"
  674. var locale_ = __webpack_require__(38);
  675. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  676. // EXTERNAL MODULE: ./packages/input/index.js + 6 modules
  677. var packages_input = __webpack_require__(52);
  678. // 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&
  679. var select_dropdownvue_type_template_id_06828748_render = function() {
  680. var _vm = this
  681. var _h = _vm.$createElement
  682. var _c = _vm._self._c || _h
  683. return _c(
  684. "div",
  685. {
  686. staticClass: "el-select-dropdown el-popper",
  687. class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
  688. style: { minWidth: _vm.minWidth }
  689. },
  690. [_vm._t("default")],
  691. 2
  692. )
  693. }
  694. var select_dropdownvue_type_template_id_06828748_staticRenderFns = []
  695. select_dropdownvue_type_template_id_06828748_render._withStripped = true
  696. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  697. // EXTERNAL MODULE: external "tis-ui/lib/utils/vue-popper"
  698. var vue_popper_ = __webpack_require__(34);
  699. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  700. // 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&
  701. //
  702. //
  703. //
  704. //
  705. //
  706. //
  707. //
  708. //
  709. //
  710. /* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
  711. name: 'TisSelectDropdown',
  712. componentName: 'TisSelectDropdown',
  713. mixins: [vue_popper_default.a],
  714. props: {
  715. placement: {
  716. default: 'bottom-start'
  717. },
  718. boundariesPadding: {
  719. default: 0
  720. },
  721. popperOptions: {
  722. default: function _default() {
  723. return {
  724. gpuAcceleration: false
  725. };
  726. }
  727. },
  728. visibleArrow: {
  729. default: true
  730. },
  731. appendToBody: {
  732. type: Boolean,
  733. default: true
  734. }
  735. },
  736. data: function data() {
  737. return {
  738. minWidth: ''
  739. };
  740. },
  741. computed: {
  742. popperClass: function popperClass() {
  743. return this.$parent.popperClass;
  744. }
  745. },
  746. watch: {
  747. '$parent.inputWidth': function $parentInputWidth() {
  748. this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
  749. }
  750. },
  751. mounted: function mounted() {
  752. var _this = this;
  753. this.referenceElm = this.$parent.$refs.reference.$el;
  754. this.$parent.popperElm = this.popperElm = this.$el;
  755. this.$on('updatePopper', function () {
  756. if (_this.$parent.visible) _this.updatePopper();
  757. });
  758. this.$on('destroyPopper', this.destroyPopper);
  759. }
  760. });
  761. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  762. /* harmony default export */ var src_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
  763. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  764. var componentNormalizer = __webpack_require__(2);
  765. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
  766. /* normalize component */
  767. var component = Object(componentNormalizer["a" /* default */])(
  768. src_select_dropdownvue_type_script_lang_js_,
  769. select_dropdownvue_type_template_id_06828748_render,
  770. select_dropdownvue_type_template_id_06828748_staticRenderFns,
  771. false,
  772. null,
  773. null,
  774. null
  775. )
  776. /* hot reload */
  777. if (false) { var api; }
  778. component.options.__file = "packages/select/src/select-dropdown.vue"
  779. /* harmony default export */ var select_dropdown = (component.exports);
  780. // EXTERNAL MODULE: ./packages/select/src/option.vue + 4 modules
  781. var src_option = __webpack_require__(91);
  782. // EXTERNAL MODULE: ./packages/tag/index.js + 3 modules
  783. var tag = __webpack_require__(101);
  784. // EXTERNAL MODULE: ./packages/scrollbar/index.js + 3 modules
  785. var scrollbar = __webpack_require__(66);
  786. // EXTERNAL MODULE: external "throttle-debounce/debounce"
  787. var debounce_ = __webpack_require__(62);
  788. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
  789. // EXTERNAL MODULE: external "tis-ui/lib/utils/clickoutside"
  790. var clickoutside_ = __webpack_require__(61);
  791. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  792. // EXTERNAL MODULE: external "tis-ui/lib/utils/resize-event"
  793. var resize_event_ = __webpack_require__(44);
  794. // EXTERNAL MODULE: external "tis-ui/lib/locale"
  795. var lib_locale_ = __webpack_require__(72);
  796. // EXTERNAL MODULE: external "tis-ui/lib/utils/scroll-into-view"
  797. var scroll_into_view_ = __webpack_require__(95);
  798. var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
  799. // EXTERNAL MODULE: external "tis-ui/lib/utils/util"
  800. var util_ = __webpack_require__(10);
  801. // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
  802. /* harmony default export */ var navigation_mixin = ({
  803. data: function data() {
  804. return {
  805. hoverOption: -1
  806. };
  807. },
  808. computed: {
  809. optionsAllDisabled: function optionsAllDisabled() {
  810. return this.options.filter(function (option) {
  811. return option.visible;
  812. }).every(function (option) {
  813. return option.disabled;
  814. });
  815. }
  816. },
  817. watch: {
  818. hoverIndex: function hoverIndex(val) {
  819. var _this = this;
  820. if (typeof val === 'number' && val > -1) {
  821. this.hoverOption = this.options[val] || {};
  822. }
  823. this.options.forEach(function (option) {
  824. option.hover = _this.hoverOption === option;
  825. });
  826. }
  827. },
  828. methods: {
  829. navigateOptions: function navigateOptions(direction) {
  830. var _this2 = this;
  831. if (!this.visible) {
  832. this.visible = true;
  833. return;
  834. }
  835. if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
  836. if (!this.optionsAllDisabled) {
  837. if (direction === 'next') {
  838. this.hoverIndex++;
  839. if (this.hoverIndex === this.options.length) {
  840. this.hoverIndex = 0;
  841. }
  842. } else if (direction === 'prev') {
  843. this.hoverIndex--;
  844. if (this.hoverIndex < 0) {
  845. this.hoverIndex = this.options.length - 1;
  846. }
  847. }
  848. var option = this.options[this.hoverIndex];
  849. if (option.disabled === true || option.groupDisabled === true || !option.visible) {
  850. this.navigateOptions(direction);
  851. }
  852. this.$nextTick(function () {
  853. return _this2.scrollToOption(_this2.hoverOption);
  854. });
  855. }
  856. }
  857. }
  858. });
  859. // EXTERNAL MODULE: external "tis-ui/lib/utils/shared"
  860. var shared_ = __webpack_require__(49);
  861. // 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&
  862. //
  863. //
  864. //
  865. //
  866. //
  867. //
  868. //
  869. //
  870. //
  871. //
  872. //
  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. /* harmony default export */ var selectvue_type_script_lang_js_ = ({
  998. mixins: [emitter_default.a, locale_default.a, focus_default()('reference'), navigation_mixin],
  999. name: 'TisSelect',
  1000. componentName: 'TisSelect',
  1001. inject: {
  1002. elForm: {
  1003. default: ''
  1004. },
  1005. elFormItem: {
  1006. default: ''
  1007. }
  1008. },
  1009. provide: function provide() {
  1010. return {
  1011. 'select': this
  1012. };
  1013. },
  1014. computed: {
  1015. _elFormItemSize: function _elFormItemSize() {
  1016. return (this.elFormItem || {}).elFormItemSize;
  1017. },
  1018. readonly: function readonly() {
  1019. return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
  1020. },
  1021. showClose: function showClose() {
  1022. var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
  1023. var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
  1024. return criteria;
  1025. },
  1026. iconClass: function iconClass() {
  1027. return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
  1028. },
  1029. debounce: function debounce() {
  1030. return this.remote ? 300 : 0;
  1031. },
  1032. emptyText: function emptyText() {
  1033. if (this.loading) {
  1034. return this.loadingText || this.t('el.select.loading');
  1035. } else {
  1036. if (this.remote && this.query === '' && this.options.length === 0) return false;
  1037. if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
  1038. return this.noMatchText || this.t('el.select.noMatch');
  1039. }
  1040. if (this.options.length === 0) {
  1041. return this.noDataText || this.t('el.select.noData');
  1042. }
  1043. }
  1044. return null;
  1045. },
  1046. showNewOption: function showNewOption() {
  1047. var _this = this;
  1048. var hasExistingOption = this.options.filter(function (option) {
  1049. return !option.created;
  1050. }).some(function (option) {
  1051. return option.currentLabel === _this.query;
  1052. });
  1053. return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
  1054. },
  1055. selectSize: function selectSize() {
  1056. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1057. },
  1058. selectDisabled: function selectDisabled() {
  1059. return this.disabled || (this.elForm || {}).disabled;
  1060. },
  1061. collapseTagSize: function collapseTagSize() {
  1062. return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
  1063. }
  1064. },
  1065. components: {
  1066. TisInput: packages_input["default"],
  1067. TisSelectMenu: select_dropdown,
  1068. TisOption: src_option["a" /* default */],
  1069. TisTag: tag["default"],
  1070. TisScrollbar: scrollbar["default"]
  1071. },
  1072. directives: { Clickoutside: clickoutside_default.a },
  1073. props: {
  1074. name: String,
  1075. id: String,
  1076. value: {
  1077. required: true
  1078. },
  1079. autocomplete: {
  1080. type: String,
  1081. default: 'off'
  1082. },
  1083. /** @Deprecated in next major version */
  1084. autoComplete: {
  1085. type: String,
  1086. validator: function validator(val) {
  1087. false && false;
  1088. return true;
  1089. }
  1090. },
  1091. automaticDropdown: Boolean,
  1092. size: String,
  1093. disabled: Boolean,
  1094. clearable: Boolean,
  1095. filterable: Boolean,
  1096. allowCreate: Boolean,
  1097. loading: Boolean,
  1098. popperClass: String,
  1099. remote: Boolean,
  1100. loadingText: String,
  1101. noMatchText: String,
  1102. noDataText: String,
  1103. remoteMethod: Function,
  1104. filterMethod: Function,
  1105. multiple: Boolean,
  1106. multipleLimit: {
  1107. type: Number,
  1108. default: 0
  1109. },
  1110. placeholder: {
  1111. type: String,
  1112. default: function _default() {
  1113. return Object(lib_locale_["t"])('el.select.placeholder');
  1114. }
  1115. },
  1116. defaultFirstOption: Boolean,
  1117. reserveKeyword: Boolean,
  1118. valueKey: {
  1119. type: String,
  1120. default: 'value'
  1121. },
  1122. collapseTags: Boolean,
  1123. popperAppendToBody: {
  1124. type: Boolean,
  1125. default: true
  1126. }
  1127. },
  1128. data: function data() {
  1129. return {
  1130. options: [],
  1131. cachedOptions: [],
  1132. createdLabel: null,
  1133. createdSelected: false,
  1134. selected: this.multiple ? [] : {},
  1135. inputLength: 20,
  1136. inputWidth: 0,
  1137. initialInputHeight: 0,
  1138. cachedPlaceHolder: '',
  1139. optionsCount: 0,
  1140. filteredOptionsCount: 0,
  1141. visible: false,
  1142. softFocus: false,
  1143. selectedLabel: '',
  1144. hoverIndex: -1,
  1145. query: '',
  1146. previousQuery: null,
  1147. inputHovering: false,
  1148. currentPlaceholder: '',
  1149. menuVisibleOnFocus: false,
  1150. isOnComposition: false,
  1151. isSilentBlur: false
  1152. };
  1153. },
  1154. watch: {
  1155. selectDisabled: function selectDisabled() {
  1156. var _this2 = this;
  1157. this.$nextTick(function () {
  1158. _this2.resetInputHeight();
  1159. });
  1160. },
  1161. placeholder: function placeholder(val) {
  1162. this.cachedPlaceHolder = this.currentPlaceholder = val;
  1163. },
  1164. value: function value(val, oldVal) {
  1165. if (this.multiple) {
  1166. this.resetInputHeight();
  1167. if (val && val.length > 0 || this.$refs.input && this.query !== '') {
  1168. this.currentPlaceholder = '';
  1169. } else {
  1170. this.currentPlaceholder = this.cachedPlaceHolder;
  1171. }
  1172. if (this.filterable && !this.reserveKeyword) {
  1173. this.query = '';
  1174. this.handleQueryChange(this.query);
  1175. }
  1176. }
  1177. this.setSelected();
  1178. if (this.filterable && !this.multiple) {
  1179. this.inputLength = 20;
  1180. }
  1181. if (!Object(util_["valueEquals"])(val, oldVal)) {
  1182. this.dispatch('TisFormItem', 'el.form.change', val);
  1183. }
  1184. },
  1185. visible: function visible(val) {
  1186. var _this3 = this;
  1187. if (!val) {
  1188. this.broadcast('TisSelectDropdown', 'destroyPopper');
  1189. if (this.$refs.input) {
  1190. this.$refs.input.blur();
  1191. }
  1192. this.query = '';
  1193. this.previousQuery = null;
  1194. this.selectedLabel = '';
  1195. this.inputLength = 20;
  1196. this.menuVisibleOnFocus = false;
  1197. this.resetHoverIndex();
  1198. this.$nextTick(function () {
  1199. if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
  1200. _this3.currentPlaceholder = _this3.cachedPlaceHolder;
  1201. }
  1202. });
  1203. if (!this.multiple) {
  1204. if (this.selected) {
  1205. if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
  1206. this.selectedLabel = this.createdLabel;
  1207. } else {
  1208. this.selectedLabel = this.selected.currentLabel;
  1209. }
  1210. if (this.filterable) this.query = this.selectedLabel;
  1211. }
  1212. if (this.filterable) {
  1213. this.currentPlaceholder = this.cachedPlaceHolder;
  1214. }
  1215. }
  1216. } else {
  1217. this.broadcast('TisSelectDropdown', 'updatePopper');
  1218. if (this.filterable) {
  1219. this.query = this.remote ? '' : this.selectedLabel;
  1220. this.handleQueryChange(this.query);
  1221. if (this.multiple) {
  1222. this.$refs.input.focus();
  1223. } else {
  1224. if (!this.remote) {
  1225. this.broadcast('TisOption', 'queryChange', '');
  1226. this.broadcast('TisOptionGroup', 'queryChange');
  1227. }
  1228. if (this.selectedLabel) {
  1229. this.currentPlaceholder = this.selectedLabel;
  1230. this.selectedLabel = '';
  1231. }
  1232. }
  1233. }
  1234. }
  1235. this.$emit('visible-change', val);
  1236. },
  1237. options: function options() {
  1238. var _this4 = this;
  1239. if (this.$isServer) return;
  1240. this.$nextTick(function () {
  1241. _this4.broadcast('TisSelectDropdown', 'updatePopper');
  1242. });
  1243. if (this.multiple) {
  1244. this.resetInputHeight();
  1245. }
  1246. var inputs = this.$el.querySelectorAll('input');
  1247. if ([].indexOf.call(inputs, document.activeElement) === -1) {
  1248. this.setSelected();
  1249. }
  1250. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1251. this.checkDefaultFirstOption();
  1252. }
  1253. }
  1254. },
  1255. methods: {
  1256. handleComposition: function handleComposition(event) {
  1257. var _this5 = this;
  1258. var text = event.target.value;
  1259. if (event.type === 'compositionend') {
  1260. this.isOnComposition = false;
  1261. this.$nextTick(function (_) {
  1262. return _this5.handleQueryChange(text);
  1263. });
  1264. } else {
  1265. var lastCharacter = text[text.length - 1] || '';
  1266. this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
  1267. }
  1268. },
  1269. handleQueryChange: function handleQueryChange(val) {
  1270. var _this6 = this;
  1271. if (this.previousQuery === val || this.isOnComposition) return;
  1272. if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
  1273. this.previousQuery = val;
  1274. return;
  1275. }
  1276. this.previousQuery = val;
  1277. this.$nextTick(function () {
  1278. if (_this6.visible) _this6.broadcast('TisSelectDropdown', 'updatePopper');
  1279. });
  1280. this.hoverIndex = -1;
  1281. if (this.multiple && this.filterable) {
  1282. this.$nextTick(function () {
  1283. var length = _this6.$refs.input.value.length * 15 + 20;
  1284. _this6.inputLength = _this6.collapseTags ? Math.min(50, length) : length;
  1285. _this6.managePlaceholder();
  1286. _this6.resetInputHeight();
  1287. });
  1288. }
  1289. if (this.remote && typeof this.remoteMethod === 'function') {
  1290. this.hoverIndex = -1;
  1291. this.remoteMethod(val);
  1292. } else if (typeof this.filterMethod === 'function') {
  1293. this.filterMethod(val);
  1294. this.broadcast('TisOptionGroup', 'queryChange');
  1295. } else {
  1296. this.filteredOptionsCount = this.optionsCount;
  1297. this.broadcast('TisOption', 'queryChange', val);
  1298. this.broadcast('TisOptionGroup', 'queryChange');
  1299. }
  1300. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  1301. this.checkDefaultFirstOption();
  1302. }
  1303. },
  1304. scrollToOption: function scrollToOption(option) {
  1305. var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
  1306. if (this.$refs.popper && target) {
  1307. var menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
  1308. scroll_into_view_default()(menu, target);
  1309. }
  1310. this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
  1311. },
  1312. handleMenuEnter: function handleMenuEnter() {
  1313. var _this7 = this;
  1314. this.$nextTick(function () {
  1315. return _this7.scrollToOption(_this7.selected);
  1316. });
  1317. },
  1318. emitChange: function emitChange(val) {
  1319. if (!Object(util_["valueEquals"])(this.value, val)) {
  1320. this.$emit('change', val);
  1321. }
  1322. },
  1323. getOption: function getOption(value) {
  1324. var option = void 0;
  1325. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  1326. var isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
  1327. var isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
  1328. for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
  1329. var cachedOption = this.cachedOptions[i];
  1330. var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
  1331. if (isEqual) {
  1332. option = cachedOption;
  1333. break;
  1334. }
  1335. }
  1336. if (option) return option;
  1337. var label = !isObject && !isNull && !isUndefined ? value : '';
  1338. var newOption = {
  1339. value: value,
  1340. currentLabel: label
  1341. };
  1342. if (this.multiple) {
  1343. newOption.hitState = false;
  1344. }
  1345. return newOption;
  1346. },
  1347. setSelected: function setSelected() {
  1348. var _this8 = this;
  1349. if (!this.multiple) {
  1350. var option = this.getOption(this.value);
  1351. if (option.created) {
  1352. this.createdLabel = option.currentLabel;
  1353. this.createdSelected = true;
  1354. } else {
  1355. this.createdSelected = false;
  1356. }
  1357. this.selectedLabel = option.currentLabel;
  1358. this.selected = option;
  1359. if (this.filterable) this.query = this.selectedLabel;
  1360. return;
  1361. }
  1362. var result = [];
  1363. if (Array.isArray(this.value)) {
  1364. this.value.forEach(function (value) {
  1365. result.push(_this8.getOption(value));
  1366. });
  1367. }
  1368. this.selected = result;
  1369. this.$nextTick(function () {
  1370. _this8.resetInputHeight();
  1371. });
  1372. },
  1373. handleFocus: function handleFocus(event) {
  1374. if (!this.softFocus) {
  1375. if (this.automaticDropdown || this.filterable) {
  1376. this.visible = true;
  1377. if (this.filterable) {
  1378. this.menuVisibleOnFocus = true;
  1379. }
  1380. }
  1381. this.$emit('focus', event);
  1382. } else {
  1383. this.softFocus = false;
  1384. }
  1385. },
  1386. blur: function blur() {
  1387. this.visible = false;
  1388. this.$refs.reference.blur();
  1389. },
  1390. handleBlur: function handleBlur(event) {
  1391. var _this9 = this;
  1392. setTimeout(function () {
  1393. if (_this9.isSilentBlur) {
  1394. _this9.isSilentBlur = false;
  1395. } else {
  1396. _this9.$emit('blur', event);
  1397. }
  1398. }, 50);
  1399. this.softFocus = false;
  1400. },
  1401. handleClearClick: function handleClearClick(event) {
  1402. this.deleteSelected(event);
  1403. },
  1404. doDestroy: function doDestroy() {
  1405. this.$refs.popper && this.$refs.popper.doDestroy();
  1406. },
  1407. handleClose: function handleClose() {
  1408. this.visible = false;
  1409. },
  1410. toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
  1411. if (!Array.isArray(this.selected)) return;
  1412. var option = this.selected[this.selected.length - 1];
  1413. if (!option) return;
  1414. if (hit === true || hit === false) {
  1415. option.hitState = hit;
  1416. return hit;
  1417. }
  1418. option.hitState = !option.hitState;
  1419. return option.hitState;
  1420. },
  1421. deletePrevTag: function deletePrevTag(e) {
  1422. if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
  1423. var value = this.value.slice();
  1424. value.pop();
  1425. this.$emit('input', value);
  1426. this.emitChange(value);
  1427. }
  1428. },
  1429. managePlaceholder: function managePlaceholder() {
  1430. if (this.currentPlaceholder !== '') {
  1431. this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
  1432. }
  1433. },
  1434. resetInputState: function resetInputState(e) {
  1435. if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
  1436. this.inputLength = this.$refs.input.value.length * 15 + 20;
  1437. this.resetInputHeight();
  1438. },
  1439. resetInputHeight: function resetInputHeight() {
  1440. var _this10 = this;
  1441. if (this.collapseTags && !this.filterable) return;
  1442. this.$nextTick(function () {
  1443. if (!_this10.$refs.reference) return;
  1444. var inputChildNodes = _this10.$refs.reference.$el.childNodes;
  1445. var input = [].filter.call(inputChildNodes, function (item) {
  1446. return item.tagName === 'INPUT';
  1447. })[0];
  1448. var tags = _this10.$refs.tags;
  1449. var sizeInMap = _this10.initialInputHeight || 40;
  1450. input.style.height = _this10.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tags.clientHeight + (tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
  1451. if (_this10.visible && _this10.emptyText !== false) {
  1452. _this10.broadcast('TisSelectDropdown', 'updatePopper');
  1453. }
  1454. });
  1455. },
  1456. resetHoverIndex: function resetHoverIndex() {
  1457. var _this11 = this;
  1458. setTimeout(function () {
  1459. if (!_this11.multiple) {
  1460. _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
  1461. } else {
  1462. if (_this11.selected.length > 0) {
  1463. _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
  1464. return _this11.options.indexOf(item);
  1465. }));
  1466. } else {
  1467. _this11.hoverIndex = -1;
  1468. }
  1469. }
  1470. }, 300);
  1471. },
  1472. handleOptionSelect: function handleOptionSelect(option, byClick) {
  1473. var _this12 = this;
  1474. if (this.multiple) {
  1475. var value = (this.value || []).slice();
  1476. var optionIndex = this.getValueIndex(value, option.value);
  1477. if (optionIndex > -1) {
  1478. value.splice(optionIndex, 1);
  1479. } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
  1480. value.push(option.value);
  1481. }
  1482. this.$emit('input', value);
  1483. this.emitChange(value);
  1484. if (option.created) {
  1485. this.query = '';
  1486. this.handleQueryChange('');
  1487. this.inputLength = 20;
  1488. }
  1489. if (this.filterable) this.$refs.input.focus();
  1490. } else {
  1491. this.$emit('input', option.value);
  1492. this.emitChange(option.value);
  1493. this.visible = false;
  1494. }
  1495. this.isSilentBlur = byClick;
  1496. this.setSoftFocus();
  1497. if (this.visible) return;
  1498. this.$nextTick(function () {
  1499. _this12.scrollToOption(option);
  1500. });
  1501. },
  1502. setSoftFocus: function setSoftFocus() {
  1503. this.softFocus = true;
  1504. var input = this.$refs.input || this.$refs.reference;
  1505. if (input) {
  1506. input.focus();
  1507. }
  1508. },
  1509. getValueIndex: function getValueIndex() {
  1510. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  1511. var value = arguments[1];
  1512. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  1513. if (!isObject) {
  1514. return arr.indexOf(value);
  1515. } else {
  1516. var valueKey = this.valueKey;
  1517. var index = -1;
  1518. arr.some(function (item, i) {
  1519. if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
  1520. index = i;
  1521. return true;
  1522. }
  1523. return false;
  1524. });
  1525. return index;
  1526. }
  1527. },
  1528. toggleMenu: function toggleMenu() {
  1529. if (!this.selectDisabled) {
  1530. if (this.menuVisibleOnFocus) {
  1531. this.menuVisibleOnFocus = false;
  1532. } else {
  1533. this.visible = !this.visible;
  1534. }
  1535. if (this.visible) {
  1536. (this.$refs.input || this.$refs.reference).focus();
  1537. }
  1538. }
  1539. },
  1540. selectOption: function selectOption() {
  1541. if (!this.visible) {
  1542. this.toggleMenu();
  1543. } else {
  1544. if (this.options[this.hoverIndex]) {
  1545. this.handleOptionSelect(this.options[this.hoverIndex]);
  1546. }
  1547. }
  1548. },
  1549. deleteSelected: function deleteSelected(event) {
  1550. event.stopPropagation();
  1551. var value = this.multiple ? [] : '';
  1552. this.$emit('input', value);
  1553. this.emitChange(value);
  1554. this.visible = false;
  1555. this.$emit('clear');
  1556. },
  1557. deleteTag: function deleteTag(event, tag) {
  1558. var index = this.selected.indexOf(tag);
  1559. if (index > -1 && !this.selectDisabled) {
  1560. var value = this.value.slice();
  1561. value.splice(index, 1);
  1562. this.$emit('input', value);
  1563. this.emitChange(value);
  1564. this.$emit('remove-tag', tag.value);
  1565. }
  1566. event.stopPropagation();
  1567. },
  1568. onInputChange: function onInputChange() {
  1569. if (this.filterable && this.query !== this.selectedLabel) {
  1570. this.query = this.selectedLabel;
  1571. this.handleQueryChange(this.query);
  1572. }
  1573. },
  1574. onOptionDestroy: function onOptionDestroy(index) {
  1575. if (index > -1) {
  1576. this.optionsCount--;
  1577. this.filteredOptionsCount--;
  1578. this.options.splice(index, 1);
  1579. }
  1580. },
  1581. resetInputWidth: function resetInputWidth() {
  1582. this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
  1583. },
  1584. handleResize: function handleResize() {
  1585. this.resetInputWidth();
  1586. if (this.multiple) this.resetInputHeight();
  1587. },
  1588. checkDefaultFirstOption: function checkDefaultFirstOption() {
  1589. this.hoverIndex = -1;
  1590. // highlight the created option
  1591. var hasCreated = false;
  1592. for (var i = this.options.length - 1; i >= 0; i--) {
  1593. if (this.options[i].created) {
  1594. hasCreated = true;
  1595. this.hoverIndex = i;
  1596. break;
  1597. }
  1598. }
  1599. if (hasCreated) return;
  1600. for (var _i = 0; _i !== this.options.length; ++_i) {
  1601. var option = this.options[_i];
  1602. if (this.query) {
  1603. // highlight first options that passes the filter
  1604. if (!option.disabled && !option.groupDisabled && option.visible) {
  1605. this.hoverIndex = _i;
  1606. break;
  1607. }
  1608. } else {
  1609. // highlight currently selected option
  1610. if (option.itemSelected) {
  1611. this.hoverIndex = _i;
  1612. break;
  1613. }
  1614. }
  1615. }
  1616. },
  1617. getValueKey: function getValueKey(item) {
  1618. if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
  1619. return item.value;
  1620. } else {
  1621. return Object(util_["getValueByPath"])(item.value, this.valueKey);
  1622. }
  1623. }
  1624. },
  1625. created: function created() {
  1626. var _this13 = this;
  1627. this.cachedPlaceHolder = this.currentPlaceholder = this.placeholder;
  1628. if (this.multiple && !Array.isArray(this.value)) {
  1629. this.$emit('input', []);
  1630. }
  1631. if (!this.multiple && Array.isArray(this.value)) {
  1632. this.$emit('input', '');
  1633. }
  1634. this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
  1635. _this13.onInputChange();
  1636. });
  1637. this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
  1638. _this13.handleQueryChange(e.target.value);
  1639. });
  1640. this.$on('handleOptionClick', this.handleOptionSelect);
  1641. this.$on('setSelected', this.setSelected);
  1642. },
  1643. mounted: function mounted() {
  1644. var _this14 = this;
  1645. if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
  1646. this.currentPlaceholder = '';
  1647. }
  1648. Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
  1649. var reference = this.$refs.reference;
  1650. if (reference && reference.$el) {
  1651. var sizeMap = {
  1652. medium: 36,
  1653. small: 32,
  1654. mini: 28
  1655. };
  1656. var input = reference.$el.querySelector('input');
  1657. this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
  1658. }
  1659. if (this.remote && this.multiple) {
  1660. this.resetInputHeight();
  1661. }
  1662. this.$nextTick(function () {
  1663. if (reference && reference.$el) {
  1664. _this14.inputWidth = reference.$el.getBoundingClientRect().width;
  1665. }
  1666. });
  1667. this.setSelected();
  1668. },
  1669. beforeDestroy: function beforeDestroy() {
  1670. if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
  1671. }
  1672. });
  1673. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js&
  1674. /* harmony default export */ var src_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
  1675. // CONCATENATED MODULE: ./packages/select/src/select.vue
  1676. /* normalize component */
  1677. var select_component = Object(componentNormalizer["a" /* default */])(
  1678. src_selectvue_type_script_lang_js_,
  1679. render,
  1680. staticRenderFns,
  1681. false,
  1682. null,
  1683. null,
  1684. null
  1685. )
  1686. /* hot reload */
  1687. if (false) { var select_api; }
  1688. select_component.options.__file = "packages/select/src/select.vue"
  1689. /* harmony default export */ var src_select = (select_component.exports);
  1690. // CONCATENATED MODULE: ./packages/select/index.js
  1691. /* istanbul ignore next */
  1692. src_select.install = function (Vue) {
  1693. Vue.component(src_select.name, src_select);
  1694. };
  1695. /* harmony default export */ var packages_select = __webpack_exports__["default"] = (src_select);
  1696. /***/ }),
  1697. /***/ 2:
  1698. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1699. "use strict";
  1700. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  1701. /* globals __VUE_SSR_CONTEXT__ */
  1702. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1703. // This module is a runtime utility for cleaner component module output and will
  1704. // be included in the final webpack user bundle.
  1705. function normalizeComponent (
  1706. scriptExports,
  1707. render,
  1708. staticRenderFns,
  1709. functionalTemplate,
  1710. injectStyles,
  1711. scopeId,
  1712. moduleIdentifier, /* server only */
  1713. shadowMode /* vue-cli only */
  1714. ) {
  1715. // Vue.extend constructor export interop
  1716. var options = typeof scriptExports === 'function'
  1717. ? scriptExports.options
  1718. : scriptExports
  1719. // render functions
  1720. if (render) {
  1721. options.render = render
  1722. options.staticRenderFns = staticRenderFns
  1723. options._compiled = true
  1724. }
  1725. // functional template
  1726. if (functionalTemplate) {
  1727. options.functional = true
  1728. }
  1729. // scopedId
  1730. if (scopeId) {
  1731. options._scopeId = 'data-v-' + scopeId
  1732. }
  1733. var hook
  1734. if (moduleIdentifier) { // server build
  1735. hook = function (context) {
  1736. // 2.3 injection
  1737. context =
  1738. context || // cached call
  1739. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1740. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1741. // 2.2 with runInNewContext: true
  1742. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1743. context = __VUE_SSR_CONTEXT__
  1744. }
  1745. // inject component styles
  1746. if (injectStyles) {
  1747. injectStyles.call(this, context)
  1748. }
  1749. // register component module identifier for async chunk inferrence
  1750. if (context && context._registeredComponents) {
  1751. context._registeredComponents.add(moduleIdentifier)
  1752. }
  1753. }
  1754. // used by ssr in case component is cached and beforeCreate
  1755. // never gets called
  1756. options._ssrRegister = hook
  1757. } else if (injectStyles) {
  1758. hook = shadowMode
  1759. ? function () {
  1760. injectStyles.call(
  1761. this,
  1762. (options.functional ? this.parent : this).$root.$options.shadowRoot
  1763. )
  1764. }
  1765. : injectStyles
  1766. }
  1767. if (hook) {
  1768. if (options.functional) {
  1769. // for template-only hot-reload because in that case the render fn doesn't
  1770. // go through the normalizer
  1771. options._injectStyles = hook
  1772. // register for functional component in vue file
  1773. var originalRender = options.render
  1774. options.render = function renderWithStyleInjection (h, context) {
  1775. hook.call(context)
  1776. return originalRender(h, context)
  1777. }
  1778. } else {
  1779. // inject component registration as beforeCreate hook
  1780. var existing = options.beforeCreate
  1781. options.beforeCreate = existing
  1782. ? [].concat(existing, hook)
  1783. : [hook]
  1784. }
  1785. }
  1786. return {
  1787. exports: scriptExports,
  1788. options: options
  1789. }
  1790. }
  1791. /***/ }),
  1792. /***/ 33:
  1793. /***/ (function(module, exports) {
  1794. module.exports = require("tis-ui/lib/utils/merge");
  1795. /***/ }),
  1796. /***/ 34:
  1797. /***/ (function(module, exports) {
  1798. module.exports = require("tis-ui/lib/utils/vue-popper");
  1799. /***/ }),
  1800. /***/ 36:
  1801. /***/ (function(module, exports) {
  1802. module.exports = require("tis-ui/lib/mixins/migrating");
  1803. /***/ }),
  1804. /***/ 38:
  1805. /***/ (function(module, exports) {
  1806. module.exports = require("tis-ui/lib/mixins/locale");
  1807. /***/ }),
  1808. /***/ 44:
  1809. /***/ (function(module, exports) {
  1810. module.exports = require("tis-ui/lib/utils/resize-event");
  1811. /***/ }),
  1812. /***/ 49:
  1813. /***/ (function(module, exports) {
  1814. module.exports = require("tis-ui/lib/utils/shared");
  1815. /***/ }),
  1816. /***/ 52:
  1817. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1818. "use strict";
  1819. // ESM COMPAT FLAG
  1820. __webpack_require__.r(__webpack_exports__);
  1821. // 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&
  1822. var render = function() {
  1823. var _vm = this
  1824. var _h = _vm.$createElement
  1825. var _c = _vm._self._c || _h
  1826. return _c(
  1827. "div",
  1828. {
  1829. class: [
  1830. _vm.type === "textarea" ? "el-textarea" : "el-input",
  1831. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  1832. {
  1833. "is-disabled": _vm.inputDisabled,
  1834. "is-exceed": _vm.inputExceed,
  1835. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  1836. "el-input-group--append": _vm.$slots.append,
  1837. "el-input-group--prepend": _vm.$slots.prepend,
  1838. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  1839. "el-input--suffix":
  1840. _vm.$slots.suffix ||
  1841. _vm.suffixIcon ||
  1842. _vm.clearable ||
  1843. _vm.showPassword
  1844. }
  1845. ],
  1846. on: {
  1847. mouseenter: function($event) {
  1848. _vm.hovering = true
  1849. },
  1850. mouseleave: function($event) {
  1851. _vm.hovering = false
  1852. }
  1853. }
  1854. },
  1855. [
  1856. _vm.type !== "textarea"
  1857. ? [
  1858. _vm.$slots.prepend
  1859. ? _c(
  1860. "div",
  1861. { staticClass: "el-input-group__prepend" },
  1862. [_vm._t("prepend")],
  1863. 2
  1864. )
  1865. : _vm._e(),
  1866. _vm.type !== "textarea"
  1867. ? _c(
  1868. "input",
  1869. _vm._b(
  1870. {
  1871. ref: "input",
  1872. staticClass: "el-input__inner",
  1873. attrs: {
  1874. tabindex: _vm.tabindex,
  1875. type: _vm.showPassword
  1876. ? _vm.passwordVisible
  1877. ? "text"
  1878. : "password"
  1879. : _vm.type,
  1880. disabled: _vm.inputDisabled,
  1881. readonly: _vm.readonly,
  1882. autocomplete: _vm.autoComplete || _vm.autocomplete,
  1883. "aria-label": _vm.label
  1884. },
  1885. on: {
  1886. compositionstart: _vm.handleCompositionStart,
  1887. compositionupdate: _vm.handleCompositionUpdate,
  1888. compositionend: _vm.handleCompositionEnd,
  1889. input: _vm.handleInput,
  1890. focus: _vm.handleFocus,
  1891. blur: _vm.handleBlur,
  1892. change: _vm.handleChange
  1893. }
  1894. },
  1895. "input",
  1896. _vm.$attrs,
  1897. false
  1898. )
  1899. )
  1900. : _vm._e(),
  1901. _vm.$slots.prefix || _vm.prefixIcon
  1902. ? _c(
  1903. "span",
  1904. { staticClass: "el-input__prefix" },
  1905. [
  1906. _vm._t("prefix"),
  1907. _vm.prefixIcon
  1908. ? _c("i", {
  1909. staticClass: "el-input__icon",
  1910. class: _vm.prefixIcon
  1911. })
  1912. : _vm._e()
  1913. ],
  1914. 2
  1915. )
  1916. : _vm._e(),
  1917. _vm.getSuffixVisible()
  1918. ? _c("span", { staticClass: "el-input__suffix" }, [
  1919. _c(
  1920. "span",
  1921. { staticClass: "el-input__suffix-inner" },
  1922. [
  1923. !_vm.showClear ||
  1924. !_vm.showPwdVisible ||
  1925. !_vm.isWordLimitVisible
  1926. ? [
  1927. _vm._t("suffix"),
  1928. _vm.suffixIcon
  1929. ? _c("i", {
  1930. staticClass: "el-input__icon",
  1931. class: _vm.suffixIcon
  1932. })
  1933. : _vm._e()
  1934. ]
  1935. : _vm._e(),
  1936. _vm.showClear
  1937. ? _c("i", {
  1938. staticClass:
  1939. "el-input__icon el-icon-circle-close el-input__clear",
  1940. on: {
  1941. mousedown: function($event) {
  1942. $event.preventDefault()
  1943. },
  1944. click: _vm.clear
  1945. }
  1946. })
  1947. : _vm._e(),
  1948. _vm.showPwdVisible
  1949. ? _c("i", {
  1950. staticClass:
  1951. "el-input__icon el-icon-view el-input__clear",
  1952. on: { click: _vm.handlePasswordVisible }
  1953. })
  1954. : _vm._e(),
  1955. _vm.isWordLimitVisible
  1956. ? _c("span", { staticClass: "el-input__count" }, [
  1957. _c(
  1958. "span",
  1959. { staticClass: "el-input__count-inner" },
  1960. [
  1961. _vm._v(
  1962. "\n " +
  1963. _vm._s(_vm.textLength) +
  1964. "/" +
  1965. _vm._s(_vm.upperLimit) +
  1966. "\n "
  1967. )
  1968. ]
  1969. )
  1970. ])
  1971. : _vm._e()
  1972. ],
  1973. 2
  1974. ),
  1975. _vm.validateState
  1976. ? _c("i", {
  1977. staticClass: "el-input__icon",
  1978. class: ["el-input__validateIcon", _vm.validateIcon]
  1979. })
  1980. : _vm._e()
  1981. ])
  1982. : _vm._e(),
  1983. _vm.$slots.append
  1984. ? _c(
  1985. "div",
  1986. { staticClass: "el-input-group__append" },
  1987. [_vm._t("append")],
  1988. 2
  1989. )
  1990. : _vm._e()
  1991. ]
  1992. : _c(
  1993. "textarea",
  1994. _vm._b(
  1995. {
  1996. ref: "textarea",
  1997. staticClass: "el-textarea__inner",
  1998. style: _vm.textareaStyle,
  1999. attrs: {
  2000. tabindex: _vm.tabindex,
  2001. disabled: _vm.inputDisabled,
  2002. readonly: _vm.readonly,
  2003. autocomplete: _vm.autoComplete || _vm.autocomplete,
  2004. "aria-label": _vm.label
  2005. },
  2006. on: {
  2007. compositionstart: _vm.handleCompositionStart,
  2008. compositionupdate: _vm.handleCompositionUpdate,
  2009. compositionend: _vm.handleCompositionEnd,
  2010. input: _vm.handleInput,
  2011. focus: _vm.handleFocus,
  2012. blur: _vm.handleBlur,
  2013. change: _vm.handleChange
  2014. }
  2015. },
  2016. "textarea",
  2017. _vm.$attrs,
  2018. false
  2019. )
  2020. ),
  2021. _vm.isWordLimitVisible && _vm.type === "textarea"
  2022. ? _c("span", { staticClass: "el-input__count" }, [
  2023. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  2024. ])
  2025. : _vm._e()
  2026. ],
  2027. 2
  2028. )
  2029. }
  2030. var staticRenderFns = []
  2031. render._withStripped = true
  2032. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  2033. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  2034. var emitter_ = __webpack_require__(13);
  2035. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  2036. // EXTERNAL MODULE: external "tis-ui/lib/mixins/migrating"
  2037. var migrating_ = __webpack_require__(36);
  2038. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  2039. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  2040. var hiddenTextarea = void 0;
  2041. 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';
  2042. 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'];
  2043. function calculateNodeStyling(targetElement) {
  2044. var style = window.getComputedStyle(targetElement);
  2045. var boxSizing = style.getPropertyValue('box-sizing');
  2046. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  2047. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  2048. var contextStyle = CONTEXT_STYLE.map(function (name) {
  2049. return name + ':' + style.getPropertyValue(name);
  2050. }).join(';');
  2051. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  2052. }
  2053. function calcTextareaHeight(targetElement) {
  2054. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  2055. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  2056. if (!hiddenTextarea) {
  2057. hiddenTextarea = document.createElement('textarea');
  2058. document.body.appendChild(hiddenTextarea);
  2059. }
  2060. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  2061. paddingSize = _calculateNodeStyling.paddingSize,
  2062. borderSize = _calculateNodeStyling.borderSize,
  2063. boxSizing = _calculateNodeStyling.boxSizing,
  2064. contextStyle = _calculateNodeStyling.contextStyle;
  2065. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  2066. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  2067. var height = hiddenTextarea.scrollHeight;
  2068. var result = {};
  2069. if (boxSizing === 'border-box') {
  2070. height = height + borderSize;
  2071. } else if (boxSizing === 'content-box') {
  2072. height = height - paddingSize;
  2073. }
  2074. hiddenTextarea.value = '';
  2075. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  2076. if (minRows !== null) {
  2077. var minHeight = singleRowHeight * minRows;
  2078. if (boxSizing === 'border-box') {
  2079. minHeight = minHeight + paddingSize + borderSize;
  2080. }
  2081. height = Math.max(minHeight, height);
  2082. result.minHeight = minHeight + 'px';
  2083. }
  2084. if (maxRows !== null) {
  2085. var maxHeight = singleRowHeight * maxRows;
  2086. if (boxSizing === 'border-box') {
  2087. maxHeight = maxHeight + paddingSize + borderSize;
  2088. }
  2089. height = Math.min(maxHeight, height);
  2090. }
  2091. result.height = height + 'px';
  2092. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  2093. hiddenTextarea = null;
  2094. return result;
  2095. };
  2096. // EXTERNAL MODULE: external "tis-ui/lib/utils/merge"
  2097. var merge_ = __webpack_require__(33);
  2098. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  2099. // EXTERNAL MODULE: external "tis-ui/lib/utils/shared"
  2100. var shared_ = __webpack_require__(49);
  2101. // 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&
  2102. //
  2103. //
  2104. //
  2105. //
  2106. //
  2107. //
  2108. //
  2109. //
  2110. //
  2111. //
  2112. //
  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. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  2212. name: 'TisInput',
  2213. componentName: 'TisInput',
  2214. mixins: [emitter_default.a, migrating_default.a],
  2215. inheritAttrs: false,
  2216. inject: {
  2217. elForm: {
  2218. default: ''
  2219. },
  2220. elFormItem: {
  2221. default: ''
  2222. }
  2223. },
  2224. data: function data() {
  2225. return {
  2226. textareaCalcStyle: {},
  2227. hovering: false,
  2228. focused: false,
  2229. isComposing: false,
  2230. passwordVisible: false
  2231. };
  2232. },
  2233. props: {
  2234. value: [String, Number],
  2235. size: String,
  2236. resize: String,
  2237. form: String,
  2238. disabled: Boolean,
  2239. readonly: Boolean,
  2240. type: {
  2241. type: String,
  2242. default: 'text'
  2243. },
  2244. autosize: {
  2245. type: [Boolean, Object],
  2246. default: false
  2247. },
  2248. autocomplete: {
  2249. type: String,
  2250. default: 'off'
  2251. },
  2252. /** @Deprecated in next major version */
  2253. autoComplete: {
  2254. type: String,
  2255. validator: function validator(val) {
  2256. false && false;
  2257. return true;
  2258. }
  2259. },
  2260. validateEvent: {
  2261. type: Boolean,
  2262. default: true
  2263. },
  2264. suffixIcon: String,
  2265. prefixIcon: String,
  2266. label: String,
  2267. clearable: {
  2268. type: Boolean,
  2269. default: false
  2270. },
  2271. showPassword: {
  2272. type: Boolean,
  2273. default: false
  2274. },
  2275. showWordLimit: {
  2276. type: Boolean,
  2277. default: false
  2278. },
  2279. tabindex: String
  2280. },
  2281. computed: {
  2282. _elFormItemSize: function _elFormItemSize() {
  2283. return (this.elFormItem || {}).elFormItemSize;
  2284. },
  2285. validateState: function validateState() {
  2286. return this.elFormItem ? this.elFormItem.validateState : '';
  2287. },
  2288. needStatusIcon: function needStatusIcon() {
  2289. return this.elForm ? this.elForm.statusIcon : false;
  2290. },
  2291. validateIcon: function validateIcon() {
  2292. return {
  2293. validating: 'el-icon-loading',
  2294. success: 'el-icon-circle-check',
  2295. error: 'el-icon-circle-close'
  2296. }[this.validateState];
  2297. },
  2298. textareaStyle: function textareaStyle() {
  2299. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  2300. },
  2301. inputSize: function inputSize() {
  2302. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  2303. },
  2304. inputDisabled: function inputDisabled() {
  2305. return this.disabled || (this.elForm || {}).disabled;
  2306. },
  2307. nativeInputValue: function nativeInputValue() {
  2308. return this.value === null || this.value === undefined ? '' : String(this.value);
  2309. },
  2310. showClear: function showClear() {
  2311. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  2312. },
  2313. showPwdVisible: function showPwdVisible() {
  2314. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  2315. },
  2316. isWordLimitVisible: function isWordLimitVisible() {
  2317. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  2318. },
  2319. upperLimit: function upperLimit() {
  2320. return this.$attrs.maxlength;
  2321. },
  2322. textLength: function textLength() {
  2323. if (typeof this.value === 'number') {
  2324. return String(this.value).length;
  2325. }
  2326. return (this.value || '').length;
  2327. },
  2328. inputExceed: function inputExceed() {
  2329. // show exceed style if length of initial value greater then maxlength
  2330. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  2331. }
  2332. },
  2333. watch: {
  2334. value: function value(val) {
  2335. this.$nextTick(this.resizeTextarea);
  2336. if (this.validateEvent) {
  2337. this.dispatch('ElFormItem', 'el.form.change', [val]);
  2338. }
  2339. },
  2340. // native input value is set explicitly
  2341. // do not use v-model / :value in template
  2342. // see: https://github.com/ElemeFE/element/issues/14521
  2343. nativeInputValue: function nativeInputValue() {
  2344. this.setNativeInputValue();
  2345. },
  2346. // when change between <input> and <textarea>,
  2347. // update DOM dependent value and styles
  2348. // https://github.com/ElemeFE/element/issues/14857
  2349. type: function type() {
  2350. var _this = this;
  2351. this.$nextTick(function () {
  2352. _this.setNativeInputValue();
  2353. _this.resizeTextarea();
  2354. _this.updateIconOffset();
  2355. });
  2356. }
  2357. },
  2358. methods: {
  2359. focus: function focus() {
  2360. this.getInput().focus();
  2361. },
  2362. blur: function blur() {
  2363. this.getInput().blur();
  2364. },
  2365. getMigratingConfig: function getMigratingConfig() {
  2366. return {
  2367. props: {
  2368. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  2369. 'on-icon-click': 'on-icon-click is removed.'
  2370. },
  2371. events: {
  2372. 'click': 'click is removed.'
  2373. }
  2374. };
  2375. },
  2376. handleBlur: function handleBlur(event) {
  2377. this.focused = false;
  2378. this.$emit('blur', event);
  2379. if (this.validateEvent) {
  2380. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  2381. }
  2382. },
  2383. select: function select() {
  2384. this.getInput().select();
  2385. },
  2386. resizeTextarea: function resizeTextarea() {
  2387. if (this.$isServer) return;
  2388. var autosize = this.autosize,
  2389. type = this.type;
  2390. if (type !== 'textarea') return;
  2391. if (!autosize) {
  2392. this.textareaCalcStyle = {
  2393. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  2394. };
  2395. return;
  2396. }
  2397. var minRows = autosize.minRows;
  2398. var maxRows = autosize.maxRows;
  2399. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  2400. },
  2401. setNativeInputValue: function setNativeInputValue() {
  2402. var input = this.getInput();
  2403. if (!input) return;
  2404. if (input.value === this.nativeInputValue) return;
  2405. input.value = this.nativeInputValue;
  2406. },
  2407. handleFocus: function handleFocus(event) {
  2408. this.focused = true;
  2409. this.$emit('focus', event);
  2410. },
  2411. handleCompositionStart: function handleCompositionStart() {
  2412. this.isComposing = true;
  2413. },
  2414. handleCompositionUpdate: function handleCompositionUpdate(event) {
  2415. var text = event.target.value;
  2416. var lastCharacter = text[text.length - 1] || '';
  2417. this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
  2418. },
  2419. handleCompositionEnd: function handleCompositionEnd(event) {
  2420. if (this.isComposing) {
  2421. this.isComposing = false;
  2422. this.handleInput(event);
  2423. }
  2424. },
  2425. handleInput: function handleInput(event) {
  2426. // should not emit input during composition
  2427. // see: https://github.com/ElemeFE/element/issues/10516
  2428. if (this.isComposing) return;
  2429. // hack for https://github.com/ElemeFE/element/issues/8548
  2430. // should remove the following line when we don't support IE
  2431. if (event.target.value === this.nativeInputValue) return;
  2432. this.$emit('input', event.target.value);
  2433. // ensure native input value is controlled
  2434. // see: https://github.com/ElemeFE/element/issues/12850
  2435. this.$nextTick(this.setNativeInputValue);
  2436. },
  2437. handleChange: function handleChange(event) {
  2438. this.$emit('change', event.target.value);
  2439. },
  2440. calcIconOffset: function calcIconOffset(place) {
  2441. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  2442. if (!elList.length) return;
  2443. var el = null;
  2444. for (var i = 0; i < elList.length; i++) {
  2445. if (elList[i].parentNode === this.$el) {
  2446. el = elList[i];
  2447. break;
  2448. }
  2449. }
  2450. if (!el) return;
  2451. var pendantMap = {
  2452. suffix: 'append',
  2453. prefix: 'prepend'
  2454. };
  2455. var pendant = pendantMap[place];
  2456. if (this.$slots[pendant]) {
  2457. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  2458. } else {
  2459. el.removeAttribute('style');
  2460. }
  2461. },
  2462. updateIconOffset: function updateIconOffset() {
  2463. this.calcIconOffset('prefix');
  2464. this.calcIconOffset('suffix');
  2465. },
  2466. clear: function clear() {
  2467. this.$emit('input', '');
  2468. this.$emit('change', '');
  2469. this.$emit('clear');
  2470. },
  2471. handlePasswordVisible: function handlePasswordVisible() {
  2472. this.passwordVisible = !this.passwordVisible;
  2473. this.focus();
  2474. },
  2475. getInput: function getInput() {
  2476. return this.$refs.input || this.$refs.textarea;
  2477. },
  2478. getSuffixVisible: function getSuffixVisible() {
  2479. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  2480. }
  2481. },
  2482. created: function created() {
  2483. this.$on('inputSelect', this.select);
  2484. },
  2485. mounted: function mounted() {
  2486. this.setNativeInputValue();
  2487. this.resizeTextarea();
  2488. this.updateIconOffset();
  2489. },
  2490. updated: function updated() {
  2491. this.$nextTick(this.updateIconOffset);
  2492. }
  2493. });
  2494. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  2495. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  2496. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  2497. var componentNormalizer = __webpack_require__(2);
  2498. // CONCATENATED MODULE: ./packages/input/src/input.vue
  2499. /* normalize component */
  2500. var component = Object(componentNormalizer["a" /* default */])(
  2501. src_inputvue_type_script_lang_js_,
  2502. render,
  2503. staticRenderFns,
  2504. false,
  2505. null,
  2506. null,
  2507. null
  2508. )
  2509. /* hot reload */
  2510. if (false) { var api; }
  2511. component.options.__file = "packages/input/src/input.vue"
  2512. /* harmony default export */ var input = (component.exports);
  2513. // CONCATENATED MODULE: ./packages/input/index.js
  2514. /* istanbul ignore next */
  2515. input.install = function (Vue) {
  2516. Vue.component(input.name, input);
  2517. };
  2518. /* harmony default export */ var packages_input = __webpack_exports__["default"] = (input);
  2519. /***/ }),
  2520. /***/ 61:
  2521. /***/ (function(module, exports) {
  2522. module.exports = require("tis-ui/lib/utils/clickoutside");
  2523. /***/ }),
  2524. /***/ 62:
  2525. /***/ (function(module, exports) {
  2526. module.exports = require("throttle-debounce/debounce");
  2527. /***/ }),
  2528. /***/ 65:
  2529. /***/ (function(module, exports) {
  2530. module.exports = require("tis-ui/lib/utils/scrollbar-width");
  2531. /***/ }),
  2532. /***/ 66:
  2533. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2534. "use strict";
  2535. // ESM COMPAT FLAG
  2536. __webpack_require__.r(__webpack_exports__);
  2537. // EXTERNAL MODULE: external "tis-ui/lib/utils/resize-event"
  2538. var resize_event_ = __webpack_require__(44);
  2539. // EXTERNAL MODULE: external "tis-ui/lib/utils/scrollbar-width"
  2540. var scrollbar_width_ = __webpack_require__(65);
  2541. var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
  2542. // EXTERNAL MODULE: external "tis-ui/lib/utils/util"
  2543. var util_ = __webpack_require__(10);
  2544. // EXTERNAL MODULE: external "tis-ui/lib/utils/dom"
  2545. var dom_ = __webpack_require__(7);
  2546. // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
  2547. var BAR_MAP = {
  2548. vertical: {
  2549. offset: 'offsetHeight',
  2550. scroll: 'scrollTop',
  2551. scrollSize: 'scrollHeight',
  2552. size: 'height',
  2553. key: 'vertical',
  2554. axis: 'Y',
  2555. client: 'clientY',
  2556. direction: 'top'
  2557. },
  2558. horizontal: {
  2559. offset: 'offsetWidth',
  2560. scroll: 'scrollLeft',
  2561. scrollSize: 'scrollWidth',
  2562. size: 'width',
  2563. key: 'horizontal',
  2564. axis: 'X',
  2565. client: 'clientX',
  2566. direction: 'left'
  2567. }
  2568. };
  2569. function renderThumbStyle(_ref) {
  2570. var move = _ref.move,
  2571. size = _ref.size,
  2572. bar = _ref.bar;
  2573. var style = {};
  2574. var translate = 'translate' + bar.axis + '(' + move + '%)';
  2575. style[bar.size] = size;
  2576. style.transform = translate;
  2577. style.msTransform = translate;
  2578. style.webkitTransform = translate;
  2579. return style;
  2580. };
  2581. // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
  2582. /* istanbul ignore next */
  2583. /* harmony default export */ var src_bar = ({
  2584. name: 'Bar',
  2585. props: {
  2586. vertical: Boolean,
  2587. size: String,
  2588. move: Number
  2589. },
  2590. computed: {
  2591. bar: function bar() {
  2592. return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
  2593. },
  2594. wrap: function wrap() {
  2595. return this.$parent.wrap;
  2596. }
  2597. },
  2598. render: function render(h) {
  2599. var size = this.size,
  2600. move = this.move,
  2601. bar = this.bar;
  2602. return h(
  2603. 'div',
  2604. {
  2605. 'class': ['el-scrollbar__bar', 'is-' + bar.key],
  2606. on: {
  2607. 'mousedown': this.clickTrackHandler
  2608. }
  2609. },
  2610. [h('div', {
  2611. ref: 'thumb',
  2612. 'class': 'el-scrollbar__thumb',
  2613. on: {
  2614. 'mousedown': this.clickThumbHandler
  2615. },
  2616. style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
  2617. );
  2618. },
  2619. methods: {
  2620. clickThumbHandler: function clickThumbHandler(e) {
  2621. // prevent click event of right button
  2622. if (e.ctrlKey || e.button === 2) {
  2623. return;
  2624. }
  2625. this.startDrag(e);
  2626. this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
  2627. },
  2628. clickTrackHandler: function clickTrackHandler(e) {
  2629. var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
  2630. var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
  2631. var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
  2632. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  2633. },
  2634. startDrag: function startDrag(e) {
  2635. e.stopImmediatePropagation();
  2636. this.cursorDown = true;
  2637. Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  2638. Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
  2639. document.onselectstart = function () {
  2640. return false;
  2641. };
  2642. },
  2643. mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
  2644. if (this.cursorDown === false) return;
  2645. var prevPage = this[this.bar.axis];
  2646. if (!prevPage) return;
  2647. var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
  2648. var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
  2649. var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
  2650. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  2651. },
  2652. mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
  2653. this.cursorDown = false;
  2654. this[this.bar.axis] = 0;
  2655. Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  2656. document.onselectstart = null;
  2657. }
  2658. },
  2659. destroyed: function destroyed() {
  2660. Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
  2661. }
  2662. });
  2663. // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
  2664. // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
  2665. /* istanbul ignore next */
  2666. /* harmony default export */ var main = ({
  2667. name: 'TisScrollbar',
  2668. components: { Bar: src_bar },
  2669. props: {
  2670. native: Boolean,
  2671. wrapStyle: {},
  2672. wrapClass: {},
  2673. viewClass: {},
  2674. viewStyle: {},
  2675. noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
  2676. tag: {
  2677. type: String,
  2678. default: 'div'
  2679. }
  2680. },
  2681. data: function data() {
  2682. return {
  2683. sizeWidth: '0',
  2684. sizeHeight: '0',
  2685. moveX: 0,
  2686. moveY: 0
  2687. };
  2688. },
  2689. computed: {
  2690. wrap: function wrap() {
  2691. return this.$refs.wrap;
  2692. }
  2693. },
  2694. render: function render(h) {
  2695. var gutter = scrollbar_width_default()();
  2696. var style = this.wrapStyle;
  2697. if (gutter) {
  2698. var gutterWith = '-' + gutter + 'px';
  2699. var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
  2700. if (Array.isArray(this.wrapStyle)) {
  2701. style = Object(util_["toObject"])(this.wrapStyle);
  2702. style.marginRight = style.marginBottom = gutterWith;
  2703. } else if (typeof this.wrapStyle === 'string') {
  2704. style += gutterStyle;
  2705. } else {
  2706. style = gutterStyle;
  2707. }
  2708. }
  2709. var view = h(this.tag, {
  2710. class: ['el-scrollbar__view', this.viewClass],
  2711. style: this.viewStyle,
  2712. ref: 'resize'
  2713. }, this.$slots.default);
  2714. var wrap = h(
  2715. 'div',
  2716. {
  2717. ref: 'wrap',
  2718. style: style,
  2719. on: {
  2720. 'scroll': this.handleScroll
  2721. },
  2722. 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
  2723. [[view]]
  2724. );
  2725. var nodes = void 0;
  2726. if (!this.native) {
  2727. nodes = [wrap, h(src_bar, {
  2728. attrs: {
  2729. move: this.moveX,
  2730. size: this.sizeWidth }
  2731. }), h(src_bar, {
  2732. attrs: {
  2733. vertical: true,
  2734. move: this.moveY,
  2735. size: this.sizeHeight }
  2736. })];
  2737. } else {
  2738. nodes = [h(
  2739. 'div',
  2740. {
  2741. ref: 'wrap',
  2742. 'class': [this.wrapClass, 'el-scrollbar__wrap'],
  2743. style: style },
  2744. [[view]]
  2745. )];
  2746. }
  2747. return h('div', { class: 'el-scrollbar' }, nodes);
  2748. },
  2749. methods: {
  2750. handleScroll: function handleScroll() {
  2751. var wrap = this.wrap;
  2752. this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
  2753. this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
  2754. },
  2755. update: function update() {
  2756. var heightPercentage = void 0,
  2757. widthPercentage = void 0;
  2758. var wrap = this.wrap;
  2759. if (!wrap) return;
  2760. heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
  2761. widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
  2762. this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
  2763. this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
  2764. }
  2765. },
  2766. mounted: function mounted() {
  2767. if (this.native) return;
  2768. this.$nextTick(this.update);
  2769. !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
  2770. },
  2771. beforeDestroy: function beforeDestroy() {
  2772. if (this.native) return;
  2773. !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
  2774. }
  2775. });
  2776. // CONCATENATED MODULE: ./packages/scrollbar/index.js
  2777. /* istanbul ignore next */
  2778. main.install = function (Vue) {
  2779. Vue.component(main.name, main);
  2780. };
  2781. /* harmony default export */ var scrollbar = __webpack_exports__["default"] = (main);
  2782. /***/ }),
  2783. /***/ 7:
  2784. /***/ (function(module, exports) {
  2785. module.exports = require("tis-ui/lib/utils/dom");
  2786. /***/ }),
  2787. /***/ 72:
  2788. /***/ (function(module, exports) {
  2789. module.exports = require("tis-ui/lib/locale");
  2790. /***/ }),
  2791. /***/ 88:
  2792. /***/ (function(module, exports) {
  2793. module.exports = require("tis-ui/lib/mixins/focus");
  2794. /***/ }),
  2795. /***/ 91:
  2796. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2797. "use strict";
  2798. // 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&
  2799. var render = function() {
  2800. var _vm = this
  2801. var _h = _vm.$createElement
  2802. var _c = _vm._self._c || _h
  2803. return _c(
  2804. "li",
  2805. {
  2806. directives: [
  2807. {
  2808. name: "show",
  2809. rawName: "v-show",
  2810. value: _vm.visible,
  2811. expression: "visible"
  2812. }
  2813. ],
  2814. staticClass: "el-select-dropdown__item",
  2815. class: {
  2816. selected: _vm.itemSelected,
  2817. "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
  2818. hover: _vm.hover
  2819. },
  2820. on: {
  2821. mouseenter: _vm.hoverItem,
  2822. click: function($event) {
  2823. $event.stopPropagation()
  2824. return _vm.selectOptionClick($event)
  2825. }
  2826. }
  2827. },
  2828. [_vm._t("default", [_c("span", [_vm._v(_vm._s(_vm.currentLabel))])])],
  2829. 2
  2830. )
  2831. }
  2832. var staticRenderFns = []
  2833. render._withStripped = true
  2834. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  2835. // EXTERNAL MODULE: external "tis-ui/lib/mixins/emitter"
  2836. var emitter_ = __webpack_require__(13);
  2837. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  2838. // EXTERNAL MODULE: external "tis-ui/lib/utils/util"
  2839. var util_ = __webpack_require__(10);
  2840. // 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&
  2841. 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; };
  2842. //
  2843. //
  2844. //
  2845. //
  2846. //
  2847. //
  2848. //
  2849. //
  2850. //
  2851. //
  2852. //
  2853. //
  2854. //
  2855. //
  2856. //
  2857. //
  2858. //
  2859. /* harmony default export */ var optionvue_type_script_lang_js_ = ({
  2860. mixins: [emitter_default.a],
  2861. name: 'TisOption',
  2862. componentName: 'TisOption',
  2863. inject: ['select'],
  2864. props: {
  2865. value: {
  2866. required: true
  2867. },
  2868. label: [String, Number],
  2869. created: Boolean,
  2870. disabled: {
  2871. type: Boolean,
  2872. default: false
  2873. }
  2874. },
  2875. data: function data() {
  2876. return {
  2877. index: -1,
  2878. groupDisabled: false,
  2879. visible: true,
  2880. hitState: false,
  2881. hover: false
  2882. };
  2883. },
  2884. computed: {
  2885. isObject: function isObject() {
  2886. return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
  2887. },
  2888. currentLabel: function currentLabel() {
  2889. return this.label || (this.isObject ? '' : this.value);
  2890. },
  2891. currentValue: function currentValue() {
  2892. return this.value || this.label || '';
  2893. },
  2894. itemSelected: function itemSelected() {
  2895. if (!this.select.multiple) {
  2896. return this.isEqual(this.value, this.select.value);
  2897. } else {
  2898. return this.contains(this.select.value, this.value);
  2899. }
  2900. },
  2901. limitReached: function limitReached() {
  2902. if (this.select.multiple) {
  2903. return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
  2904. } else {
  2905. return false;
  2906. }
  2907. }
  2908. },
  2909. watch: {
  2910. currentLabel: function currentLabel() {
  2911. if (!this.created && !this.select.remote) this.dispatch('TisSelect', 'setSelected');
  2912. },
  2913. value: function value(val, oldVal) {
  2914. var _select = this.select,
  2915. remote = _select.remote,
  2916. valueKey = _select.valueKey;
  2917. if (!this.created && !remote) {
  2918. if (valueKey && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && (typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) === 'object' && val[valueKey] === oldVal[valueKey]) {
  2919. return;
  2920. }
  2921. this.dispatch('TisSelect', 'setSelected');
  2922. }
  2923. }
  2924. },
  2925. methods: {
  2926. isEqual: function isEqual(a, b) {
  2927. if (!this.isObject) {
  2928. return a === b;
  2929. } else {
  2930. var valueKey = this.select.valueKey;
  2931. return Object(util_["getValueByPath"])(a, valueKey) === Object(util_["getValueByPath"])(b, valueKey);
  2932. }
  2933. },
  2934. contains: function contains() {
  2935. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  2936. var target = arguments[1];
  2937. if (!this.isObject) {
  2938. return arr && arr.indexOf(target) > -1;
  2939. } else {
  2940. var valueKey = this.select.valueKey;
  2941. return arr && arr.some(function (item) {
  2942. return Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(target, valueKey);
  2943. });
  2944. }
  2945. },
  2946. handleGroupDisabled: function handleGroupDisabled(val) {
  2947. this.groupDisabled = val;
  2948. },
  2949. hoverItem: function hoverItem() {
  2950. if (!this.disabled && !this.groupDisabled) {
  2951. this.select.hoverIndex = this.select.options.indexOf(this);
  2952. }
  2953. },
  2954. selectOptionClick: function selectOptionClick() {
  2955. if (this.disabled !== true && this.groupDisabled !== true) {
  2956. this.dispatch('TisSelect', 'handleOptionClick', [this, true]);
  2957. }
  2958. },
  2959. queryChange: function queryChange(query) {
  2960. this.visible = new RegExp(Object(util_["escapeRegexpString"])(query), 'i').test(this.currentLabel) || this.created;
  2961. if (!this.visible) {
  2962. this.select.filteredOptionsCount--;
  2963. }
  2964. }
  2965. },
  2966. created: function created() {
  2967. this.select.options.push(this);
  2968. this.select.cachedOptions.push(this);
  2969. this.select.optionsCount++;
  2970. this.select.filteredOptionsCount++;
  2971. this.$on('queryChange', this.queryChange);
  2972. this.$on('handleGroupDisabled', this.handleGroupDisabled);
  2973. },
  2974. beforeDestroy: function beforeDestroy() {
  2975. var _select2 = this.select,
  2976. selected = _select2.selected,
  2977. multiple = _select2.multiple;
  2978. var selectedOptions = multiple ? selected : [selected];
  2979. var index = this.select.cachedOptions.indexOf(this);
  2980. var selectedIndex = selectedOptions.indexOf(this);
  2981. // if option is not selected, remove it from cache
  2982. if (index > -1 && selectedIndex < 0) {
  2983. this.select.cachedOptions.splice(index, 1);
  2984. }
  2985. this.select.onOptionDestroy(this.select.options.indexOf(this));
  2986. }
  2987. });
  2988. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=script&lang=js&
  2989. /* harmony default export */ var src_optionvue_type_script_lang_js_ = (optionvue_type_script_lang_js_);
  2990. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  2991. var componentNormalizer = __webpack_require__(2);
  2992. // CONCATENATED MODULE: ./packages/select/src/option.vue
  2993. /* normalize component */
  2994. var component = Object(componentNormalizer["a" /* default */])(
  2995. src_optionvue_type_script_lang_js_,
  2996. render,
  2997. staticRenderFns,
  2998. false,
  2999. null,
  3000. null,
  3001. null
  3002. )
  3003. /* hot reload */
  3004. if (false) { var api; }
  3005. component.options.__file = "packages/select/src/option.vue"
  3006. /* harmony default export */ var src_option = __webpack_exports__["a"] = (component.exports);
  3007. /***/ }),
  3008. /***/ 95:
  3009. /***/ (function(module, exports) {
  3010. module.exports = require("tis-ui/lib/utils/scroll-into-view");
  3011. /***/ })
  3012. /******/ });