input-number.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  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 = 114);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ({
  89. /***/ 0:
  90. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91. "use strict";
  92. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
  93. /* globals __VUE_SSR_CONTEXT__ */
  94. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  95. // This module is a runtime utility for cleaner component module output and will
  96. // be included in the final webpack user bundle.
  97. function normalizeComponent (
  98. scriptExports,
  99. render,
  100. staticRenderFns,
  101. functionalTemplate,
  102. injectStyles,
  103. scopeId,
  104. moduleIdentifier, /* server only */
  105. shadowMode /* vue-cli only */
  106. ) {
  107. // Vue.extend constructor export interop
  108. var options = typeof scriptExports === 'function'
  109. ? scriptExports.options
  110. : scriptExports
  111. // render functions
  112. if (render) {
  113. options.render = render
  114. options.staticRenderFns = staticRenderFns
  115. options._compiled = true
  116. }
  117. // functional template
  118. if (functionalTemplate) {
  119. options.functional = true
  120. }
  121. // scopedId
  122. if (scopeId) {
  123. options._scopeId = 'data-v-' + scopeId
  124. }
  125. var hook
  126. if (moduleIdentifier) { // server build
  127. hook = function (context) {
  128. // 2.3 injection
  129. context =
  130. context || // cached call
  131. (this.$vnode && this.$vnode.ssrContext) || // stateful
  132. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  133. // 2.2 with runInNewContext: true
  134. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  135. context = __VUE_SSR_CONTEXT__
  136. }
  137. // inject component styles
  138. if (injectStyles) {
  139. injectStyles.call(this, context)
  140. }
  141. // register component module identifier for async chunk inferrence
  142. if (context && context._registeredComponents) {
  143. context._registeredComponents.add(moduleIdentifier)
  144. }
  145. }
  146. // used by ssr in case component is cached and beforeCreate
  147. // never gets called
  148. options._ssrRegister = hook
  149. } else if (injectStyles) {
  150. hook = shadowMode
  151. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  152. : injectStyles
  153. }
  154. if (hook) {
  155. if (options.functional) {
  156. // for template-only hot-reload because in that case the render fn doesn't
  157. // go through the normalizer
  158. options._injectStyles = hook
  159. // register for functioal component in vue file
  160. var originalRender = options.render
  161. options.render = function renderWithStyleInjection (h, context) {
  162. hook.call(context)
  163. return originalRender(h, context)
  164. }
  165. } else {
  166. // inject component registration as beforeCreate hook
  167. var existing = options.beforeCreate
  168. options.beforeCreate = existing
  169. ? [].concat(existing, hook)
  170. : [hook]
  171. }
  172. }
  173. return {
  174. exports: scriptExports,
  175. options: options
  176. }
  177. }
  178. /***/ }),
  179. /***/ 10:
  180. /***/ (function(module, exports) {
  181. module.exports = require("element-ui/lib/input");
  182. /***/ }),
  183. /***/ 114:
  184. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  185. "use strict";
  186. __webpack_require__.r(__webpack_exports__);
  187. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  188. var render = function() {
  189. var _vm = this
  190. var _h = _vm.$createElement
  191. var _c = _vm._self._c || _h
  192. return _c(
  193. "div",
  194. {
  195. class: [
  196. "el-input-number",
  197. _vm.inputNumberSize ? "el-input-number--" + _vm.inputNumberSize : "",
  198. { "is-disabled": _vm.inputNumberDisabled },
  199. { "is-without-controls": !_vm.controls },
  200. { "is-controls-right": _vm.controlsAtRight }
  201. ],
  202. on: {
  203. dragstart: function($event) {
  204. $event.preventDefault()
  205. }
  206. }
  207. },
  208. [
  209. _vm.controls
  210. ? _c(
  211. "span",
  212. {
  213. directives: [
  214. {
  215. name: "repeat-click",
  216. rawName: "v-repeat-click",
  217. value: _vm.decrease,
  218. expression: "decrease"
  219. }
  220. ],
  221. staticClass: "el-input-number__decrease",
  222. class: { "is-disabled": _vm.minDisabled },
  223. attrs: { role: "button" },
  224. on: {
  225. keydown: function($event) {
  226. if (
  227. !("button" in $event) &&
  228. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  229. ) {
  230. return null
  231. }
  232. return _vm.decrease($event)
  233. }
  234. }
  235. },
  236. [
  237. _c("i", {
  238. class:
  239. "el-icon-" + (_vm.controlsAtRight ? "arrow-down" : "minus")
  240. })
  241. ]
  242. )
  243. : _vm._e(),
  244. _vm.controls
  245. ? _c(
  246. "span",
  247. {
  248. directives: [
  249. {
  250. name: "repeat-click",
  251. rawName: "v-repeat-click",
  252. value: _vm.increase,
  253. expression: "increase"
  254. }
  255. ],
  256. staticClass: "el-input-number__increase",
  257. class: { "is-disabled": _vm.maxDisabled },
  258. attrs: { role: "button" },
  259. on: {
  260. keydown: function($event) {
  261. if (
  262. !("button" in $event) &&
  263. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  264. ) {
  265. return null
  266. }
  267. return _vm.increase($event)
  268. }
  269. }
  270. },
  271. [
  272. _c("i", {
  273. class: "el-icon-" + (_vm.controlsAtRight ? "arrow-up" : "plus")
  274. })
  275. ]
  276. )
  277. : _vm._e(),
  278. _c("el-input", {
  279. ref: "input",
  280. attrs: {
  281. value: _vm.displayValue,
  282. placeholder: _vm.placeholder,
  283. disabled: _vm.inputNumberDisabled,
  284. size: _vm.inputNumberSize,
  285. max: _vm.max,
  286. min: _vm.min,
  287. name: _vm.name,
  288. label: _vm.label
  289. },
  290. on: {
  291. blur: _vm.handleBlur,
  292. focus: _vm.handleFocus,
  293. input: _vm.handleInput,
  294. change: _vm.handleInputChange
  295. },
  296. nativeOn: {
  297. keydown: [
  298. function($event) {
  299. if (
  300. !("button" in $event) &&
  301. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  302. ) {
  303. return null
  304. }
  305. $event.preventDefault()
  306. return _vm.increase($event)
  307. },
  308. function($event) {
  309. if (
  310. !("button" in $event) &&
  311. _vm._k($event.keyCode, "down", 40, $event.key, [
  312. "Down",
  313. "ArrowDown"
  314. ])
  315. ) {
  316. return null
  317. }
  318. $event.preventDefault()
  319. return _vm.decrease($event)
  320. }
  321. ]
  322. }
  323. })
  324. ],
  325. 1
  326. )
  327. }
  328. var staticRenderFns = []
  329. render._withStripped = true
  330. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  331. // EXTERNAL MODULE: external "element-ui/lib/input"
  332. var input_ = __webpack_require__(10);
  333. var input_default = /*#__PURE__*/__webpack_require__.n(input_);
  334. // EXTERNAL MODULE: external "element-ui/lib/mixins/focus"
  335. var focus_ = __webpack_require__(22);
  336. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  337. // EXTERNAL MODULE: ./src/directives/repeat-click.js
  338. var repeat_click = __webpack_require__(30);
  339. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  340. //
  341. //
  342. //
  343. //
  344. //
  345. //
  346. //
  347. //
  348. //
  349. //
  350. //
  351. //
  352. //
  353. //
  354. //
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. //
  369. //
  370. //
  371. //
  372. //
  373. //
  374. //
  375. //
  376. //
  377. //
  378. //
  379. //
  380. //
  381. //
  382. //
  383. //
  384. //
  385. //
  386. //
  387. /* harmony default export */ var input_numbervue_type_script_lang_js_ = ({
  388. name: 'ElInputNumber',
  389. mixins: [focus_default()('input')],
  390. inject: {
  391. elForm: {
  392. default: ''
  393. },
  394. elFormItem: {
  395. default: ''
  396. }
  397. },
  398. directives: {
  399. repeatClick: repeat_click["a" /* default */]
  400. },
  401. components: {
  402. ElInput: input_default.a
  403. },
  404. props: {
  405. step: {
  406. type: Number,
  407. default: 1
  408. },
  409. stepStrictly: {
  410. type: Boolean,
  411. default: false
  412. },
  413. max: {
  414. type: Number,
  415. default: Infinity
  416. },
  417. min: {
  418. type: Number,
  419. default: -Infinity
  420. },
  421. value: {},
  422. disabled: Boolean,
  423. size: String,
  424. controls: {
  425. type: Boolean,
  426. default: true
  427. },
  428. controlsPosition: {
  429. type: String,
  430. default: ''
  431. },
  432. name: String,
  433. label: String,
  434. placeholder: String,
  435. precision: {
  436. type: Number,
  437. validator: function validator(val) {
  438. return val >= 0 && val === parseInt(val, 10);
  439. }
  440. }
  441. },
  442. data: function data() {
  443. return {
  444. currentValue: 0,
  445. userInput: null
  446. };
  447. },
  448. watch: {
  449. value: {
  450. immediate: true,
  451. handler: function handler(value) {
  452. var newVal = value === undefined ? value : Number(value);
  453. if (newVal !== undefined) {
  454. if (isNaN(newVal)) {
  455. return;
  456. }
  457. if (this.stepStrictly) {
  458. var stepPrecision = this.getPrecision(this.step);
  459. var precisionFactor = Math.pow(10, stepPrecision);
  460. newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
  461. }
  462. if (this.precision !== undefined) {
  463. newVal = this.toPrecision(newVal, this.precision);
  464. }
  465. }
  466. if (newVal >= this.max) newVal = this.max;
  467. if (newVal <= this.min) newVal = this.min;
  468. this.currentValue = newVal;
  469. this.userInput = null;
  470. this.$emit('input', newVal);
  471. }
  472. }
  473. },
  474. computed: {
  475. minDisabled: function minDisabled() {
  476. return this._decrease(this.value, this.step) < this.min;
  477. },
  478. maxDisabled: function maxDisabled() {
  479. return this._increase(this.value, this.step) > this.max;
  480. },
  481. numPrecision: function numPrecision() {
  482. var value = this.value,
  483. step = this.step,
  484. getPrecision = this.getPrecision,
  485. precision = this.precision;
  486. var stepPrecision = getPrecision(step);
  487. if (precision !== undefined) {
  488. if (stepPrecision > precision) {
  489. console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
  490. }
  491. return precision;
  492. } else {
  493. return Math.max(getPrecision(value), stepPrecision);
  494. }
  495. },
  496. controlsAtRight: function controlsAtRight() {
  497. return this.controls && this.controlsPosition === 'right';
  498. },
  499. _elFormItemSize: function _elFormItemSize() {
  500. return (this.elFormItem || {}).elFormItemSize;
  501. },
  502. inputNumberSize: function inputNumberSize() {
  503. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  504. },
  505. inputNumberDisabled: function inputNumberDisabled() {
  506. return this.disabled || (this.elForm || {}).disabled;
  507. },
  508. displayValue: function displayValue() {
  509. if (this.userInput !== null) {
  510. return this.userInput;
  511. }
  512. var currentValue = this.currentValue;
  513. if (typeof currentValue === 'number') {
  514. if (this.stepStrictly) {
  515. var stepPrecision = this.getPrecision(this.step);
  516. var precisionFactor = Math.pow(10, stepPrecision);
  517. currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
  518. }
  519. if (this.precision !== undefined) {
  520. currentValue = currentValue.toFixed(this.precision);
  521. }
  522. }
  523. return currentValue;
  524. }
  525. },
  526. methods: {
  527. toPrecision: function toPrecision(num, precision) {
  528. if (precision === undefined) precision = this.numPrecision;
  529. return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
  530. },
  531. getPrecision: function getPrecision(value) {
  532. if (value === undefined) return 0;
  533. var valueString = value.toString();
  534. var dotPosition = valueString.indexOf('.');
  535. var precision = 0;
  536. if (dotPosition !== -1) {
  537. precision = valueString.length - dotPosition - 1;
  538. }
  539. return precision;
  540. },
  541. _increase: function _increase(val, step) {
  542. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  543. var precisionFactor = Math.pow(10, this.numPrecision);
  544. // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
  545. return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
  546. },
  547. _decrease: function _decrease(val, step) {
  548. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  549. var precisionFactor = Math.pow(10, this.numPrecision);
  550. return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
  551. },
  552. increase: function increase() {
  553. if (this.inputNumberDisabled || this.maxDisabled) return;
  554. var value = this.value || 0;
  555. var newVal = this._increase(value, this.step);
  556. this.setCurrentValue(newVal);
  557. },
  558. decrease: function decrease() {
  559. if (this.inputNumberDisabled || this.minDisabled) return;
  560. var value = this.value || 0;
  561. var newVal = this._decrease(value, this.step);
  562. this.setCurrentValue(newVal);
  563. },
  564. handleBlur: function handleBlur(event) {
  565. this.$emit('blur', event);
  566. },
  567. handleFocus: function handleFocus(event) {
  568. this.$emit('focus', event);
  569. },
  570. setCurrentValue: function setCurrentValue(newVal) {
  571. var oldVal = this.currentValue;
  572. if (typeof newVal === 'number' && this.precision !== undefined) {
  573. newVal = this.toPrecision(newVal, this.precision);
  574. }
  575. if (newVal >= this.max) newVal = this.max;
  576. if (newVal <= this.min) newVal = this.min;
  577. if (oldVal === newVal) return;
  578. this.userInput = null;
  579. this.$emit('input', newVal);
  580. this.$emit('change', newVal, oldVal);
  581. this.currentValue = newVal;
  582. },
  583. handleInput: function handleInput(value) {
  584. this.userInput = value;
  585. },
  586. handleInputChange: function handleInputChange(value) {
  587. var newVal = value === '' ? undefined : Number(value);
  588. if (!isNaN(newVal) || value === '') {
  589. this.setCurrentValue(newVal);
  590. }
  591. this.userInput = null;
  592. },
  593. select: function select() {
  594. this.$refs.input.select();
  595. }
  596. },
  597. mounted: function mounted() {
  598. var innerInput = this.$refs.input.$refs.input;
  599. innerInput.setAttribute('role', 'spinbutton');
  600. innerInput.setAttribute('aria-valuemax', this.max);
  601. innerInput.setAttribute('aria-valuemin', this.min);
  602. innerInput.setAttribute('aria-valuenow', this.currentValue);
  603. innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
  604. },
  605. updated: function updated() {
  606. if (!this.$refs || !this.$refs.input) return;
  607. var innerInput = this.$refs.input.$refs.input;
  608. innerInput.setAttribute('aria-valuenow', this.currentValue);
  609. }
  610. });
  611. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  612. /* harmony default export */ var src_input_numbervue_type_script_lang_js_ = (input_numbervue_type_script_lang_js_);
  613. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  614. var componentNormalizer = __webpack_require__(0);
  615. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue
  616. /* normalize component */
  617. var component = Object(componentNormalizer["a" /* default */])(
  618. src_input_numbervue_type_script_lang_js_,
  619. render,
  620. staticRenderFns,
  621. false,
  622. null,
  623. null,
  624. null
  625. )
  626. /* hot reload */
  627. if (false) { var api; }
  628. component.options.__file = "packages/input-number/src/input-number.vue"
  629. /* harmony default export */ var input_number = (component.exports);
  630. // CONCATENATED MODULE: ./packages/input-number/index.js
  631. /* istanbul ignore next */
  632. input_number.install = function (Vue) {
  633. Vue.component(input_number.name, input_number);
  634. };
  635. /* harmony default export */ var packages_input_number = __webpack_exports__["default"] = (input_number);
  636. /***/ }),
  637. /***/ 2:
  638. /***/ (function(module, exports) {
  639. module.exports = require("element-ui/lib/utils/dom");
  640. /***/ }),
  641. /***/ 22:
  642. /***/ (function(module, exports) {
  643. module.exports = require("element-ui/lib/mixins/focus");
  644. /***/ }),
  645. /***/ 30:
  646. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  647. "use strict";
  648. /* harmony import */ var element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
  649. /* harmony import */ var element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__);
  650. /* harmony default export */ __webpack_exports__["a"] = ({
  651. bind: function bind(el, binding, vnode) {
  652. var interval = null;
  653. var startTime = void 0;
  654. var handler = function handler() {
  655. return vnode.context[binding.expression].apply();
  656. };
  657. var clear = function clear() {
  658. if (Date.now() - startTime < 100) {
  659. handler();
  660. }
  661. clearInterval(interval);
  662. interval = null;
  663. };
  664. Object(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["on"])(el, 'mousedown', function (e) {
  665. if (e.button !== 0) return;
  666. startTime = Date.now();
  667. Object(element_ui_src_utils_dom__WEBPACK_IMPORTED_MODULE_0__["once"])(document, 'mouseup', clear);
  668. clearInterval(interval);
  669. interval = setInterval(handler, 100);
  670. });
  671. }
  672. });
  673. /***/ })
  674. /******/ });