custom-el-slider.js 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434
  1. exports.ids = [7,8,9];
  2. exports.modules = {
  3. /***/ 147:
  4. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5. "use strict";
  6. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return on; });
  7. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return off; });
  8. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return once; });
  9. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hasClass; });
  10. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
  11. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return removeClass; });
  12. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getStyle; });
  13. /* unused harmony export setStyle */
  14. /* unused harmony export isScroll */
  15. /* unused harmony export getScrollContainer */
  16. /* unused harmony export isInContainer */
  17. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
  18. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
  19. /* istanbul ignore next */
  20. const isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
  21. const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
  22. const MOZ_HACK_REGEXP = /^moz([A-Z])/;
  23. const ieVersion = isServer ? 0 : Number(document.documentMode);
  24. /* istanbul ignore next */
  25. const trim = function(string) {
  26. return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
  27. };
  28. /* istanbul ignore next */
  29. const camelCase = function(name) {
  30. return name.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
  31. return offset ? letter.toUpperCase() : letter;
  32. }).replace(MOZ_HACK_REGEXP, 'Moz$1');
  33. };
  34. /* istanbul ignore next */
  35. const on = (function() {
  36. if (!isServer && document.addEventListener) {
  37. return function(element, event, handler) {
  38. if (element && event && handler) {
  39. element.addEventListener(event, handler, false);
  40. }
  41. };
  42. } else {
  43. return function(element, event, handler) {
  44. if (element && event && handler) {
  45. element.attachEvent('on' + event, handler);
  46. }
  47. };
  48. }
  49. })();
  50. /* istanbul ignore next */
  51. const off = (function() {
  52. if (!isServer && document.removeEventListener) {
  53. return function(element, event, handler) {
  54. if (element && event) {
  55. element.removeEventListener(event, handler, false);
  56. }
  57. };
  58. } else {
  59. return function(element, event, handler) {
  60. if (element && event) {
  61. element.detachEvent('on' + event, handler);
  62. }
  63. };
  64. }
  65. })();
  66. /* istanbul ignore next */
  67. const once = function(el, event, fn) {
  68. var listener = function() {
  69. if (fn) {
  70. fn.apply(this, arguments);
  71. }
  72. off(el, event, listener);
  73. };
  74. on(el, event, listener);
  75. };
  76. /* istanbul ignore next */
  77. function hasClass(el, cls) {
  78. if (!el || !cls) return false;
  79. if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
  80. if (el.classList) {
  81. return el.classList.contains(cls);
  82. } else {
  83. return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
  84. }
  85. };
  86. /* istanbul ignore next */
  87. function addClass(el, cls) {
  88. if (!el) return;
  89. var curClass = el.className;
  90. var classes = (cls || '').split(' ');
  91. for (var i = 0, j = classes.length; i < j; i++) {
  92. var clsName = classes[i];
  93. if (!clsName) continue;
  94. if (el.classList) {
  95. el.classList.add(clsName);
  96. } else if (!hasClass(el, clsName)) {
  97. curClass += ' ' + clsName;
  98. }
  99. }
  100. if (!el.classList) {
  101. el.setAttribute('class', curClass);
  102. }
  103. };
  104. /* istanbul ignore next */
  105. function removeClass(el, cls) {
  106. if (!el || !cls) return;
  107. var classes = cls.split(' ');
  108. var curClass = ' ' + el.className + ' ';
  109. for (var i = 0, j = classes.length; i < j; i++) {
  110. var clsName = classes[i];
  111. if (!clsName) continue;
  112. if (el.classList) {
  113. el.classList.remove(clsName);
  114. } else if (hasClass(el, clsName)) {
  115. curClass = curClass.replace(' ' + clsName + ' ', ' ');
  116. }
  117. }
  118. if (!el.classList) {
  119. el.setAttribute('class', trim(curClass));
  120. }
  121. };
  122. /* istanbul ignore next */
  123. const getStyle = ieVersion < 9 ? function(element, styleName) {
  124. if (isServer) return;
  125. if (!element || !styleName) return null;
  126. styleName = camelCase(styleName);
  127. if (styleName === 'float') {
  128. styleName = 'styleFloat';
  129. }
  130. try {
  131. switch (styleName) {
  132. case 'opacity':
  133. try {
  134. return element.filters.item('alpha').opacity / 100;
  135. } catch (e) {
  136. return 1.0;
  137. }
  138. default:
  139. return (element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null);
  140. }
  141. } catch (e) {
  142. return element.style[styleName];
  143. }
  144. } : function(element, styleName) {
  145. if (isServer) return;
  146. if (!element || !styleName) return null;
  147. styleName = camelCase(styleName);
  148. if (styleName === 'float') {
  149. styleName = 'cssFloat';
  150. }
  151. try {
  152. var computed = document.defaultView.getComputedStyle(element, '');
  153. return element.style[styleName] || computed ? computed[styleName] : null;
  154. } catch (e) {
  155. return element.style[styleName];
  156. }
  157. };
  158. /* istanbul ignore next */
  159. function setStyle(element, styleName, value) {
  160. if (!element || !styleName) return;
  161. if (typeof styleName === 'object') {
  162. for (var prop in styleName) {
  163. if (styleName.hasOwnProperty(prop)) {
  164. setStyle(element, prop, styleName[prop]);
  165. }
  166. }
  167. } else {
  168. styleName = camelCase(styleName);
  169. if (styleName === 'opacity' && ieVersion < 9) {
  170. element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
  171. } else {
  172. element.style[styleName] = value;
  173. }
  174. }
  175. };
  176. const isScroll = (el, vertical) => {
  177. if (isServer) return;
  178. const determinedDirection = vertical !== null && vertical !== undefined;
  179. const overflow = determinedDirection
  180. ? vertical
  181. ? getStyle(el, 'overflow-y')
  182. : getStyle(el, 'overflow-x')
  183. : getStyle(el, 'overflow');
  184. return overflow.match(/(scroll|auto|overlay)/);
  185. };
  186. const getScrollContainer = (el, vertical) => {
  187. if (isServer) return;
  188. let parent = el;
  189. while (parent) {
  190. if ([window, document, document.documentElement].includes(parent)) {
  191. return window;
  192. }
  193. if (isScroll(parent, vertical)) {
  194. return parent;
  195. }
  196. parent = parent.parentNode;
  197. }
  198. return parent;
  199. };
  200. const isInContainer = (el, container) => {
  201. if (isServer || !el || !container) return false;
  202. const elRect = el.getBoundingClientRect();
  203. let containerRect;
  204. if ([window, document, document.documentElement, null, undefined].includes(container)) {
  205. containerRect = {
  206. top: 0,
  207. right: window.innerWidth,
  208. bottom: window.innerHeight,
  209. left: 0
  210. };
  211. } else {
  212. containerRect = container.getBoundingClientRect();
  213. }
  214. return elRect.top < containerRect.bottom &&
  215. elRect.bottom > containerRect.top &&
  216. elRect.right > containerRect.left &&
  217. elRect.left < containerRect.right;
  218. };
  219. /***/ }),
  220. /***/ 148:
  221. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  222. "use strict";
  223. // EXPORTS
  224. __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ isFirefox; });
  225. __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ kebabCase; });
  226. __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ rafThrottle; });
  227. __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ isMac; });
  228. // UNUSED EXPORTS: noop, hasOwn, toObject, getValueByPath, getPropByPath, generateId, valueEquals, escapeRegexpString, arrayFindIndex, arrayFind, coerceTruthyValueToArray, isIE, isEdge, autoprefixer, capitalize, looseEqual, arrayEquals, isEqual, isEmpty, objToArray
  229. // EXTERNAL MODULE: external "vue"
  230. var external_vue_ = __webpack_require__(0);
  231. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  232. // CONCATENATED MODULE: ./node_modules/element-ui/src/utils/types.js
  233. function isString(obj) {
  234. return Object.prototype.toString.call(obj) === '[object String]';
  235. }
  236. function isObject(obj) {
  237. return Object.prototype.toString.call(obj) === '[object Object]';
  238. }
  239. function isHtmlElement(node) {
  240. return node && node.nodeType === Node.ELEMENT_NODE;
  241. }
  242. /**
  243. * - Inspired:
  244. * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
  245. */
  246. let isFunction = (functionToCheck) => {
  247. var getType = {};
  248. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  249. };
  250. if ( true && typeof Int8Array !== 'object' && (external_vue_default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
  251. isFunction = function(obj) {
  252. return typeof obj === 'function' || false;
  253. };
  254. }
  255. const isUndefined = (val)=> {
  256. return val === void 0;
  257. };
  258. const isDefined = (val) => {
  259. return val !== undefined && val !== null;
  260. };
  261. // CONCATENATED MODULE: ./node_modules/element-ui/src/utils/util.js
  262. const util_hasOwnProperty = Object.prototype.hasOwnProperty;
  263. function noop() {};
  264. function hasOwn(obj, key) {
  265. return util_hasOwnProperty.call(obj, key);
  266. };
  267. function extend(to, _from) {
  268. for (let key in _from) {
  269. to[key] = _from[key];
  270. }
  271. return to;
  272. };
  273. function toObject(arr) {
  274. var res = {};
  275. for (let i = 0; i < arr.length; i++) {
  276. if (arr[i]) {
  277. extend(res, arr[i]);
  278. }
  279. }
  280. return res;
  281. };
  282. const getValueByPath = function(object, prop) {
  283. prop = prop || '';
  284. const paths = prop.split('.');
  285. let current = object;
  286. let result = null;
  287. for (let i = 0, j = paths.length; i < j; i++) {
  288. const path = paths[i];
  289. if (!current) break;
  290. if (i === j - 1) {
  291. result = current[path];
  292. break;
  293. }
  294. current = current[path];
  295. }
  296. return result;
  297. };
  298. function getPropByPath(obj, path, strict) {
  299. let tempObj = obj;
  300. path = path.replace(/\[(\w+)\]/g, '.$1');
  301. path = path.replace(/^\./, '');
  302. let keyArr = path.split('.');
  303. let i = 0;
  304. for (let len = keyArr.length; i < len - 1; ++i) {
  305. if (!tempObj && !strict) break;
  306. let key = keyArr[i];
  307. if (key in tempObj) {
  308. tempObj = tempObj[key];
  309. } else {
  310. if (strict) {
  311. throw new Error('please transfer a valid prop path to form item!');
  312. }
  313. break;
  314. }
  315. }
  316. return {
  317. o: tempObj,
  318. k: keyArr[i],
  319. v: tempObj ? tempObj[keyArr[i]] : null
  320. };
  321. };
  322. const generateId = function() {
  323. return Math.floor(Math.random() * 10000);
  324. };
  325. const valueEquals = (a, b) => {
  326. // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
  327. if (a === b) return true;
  328. if (!(a instanceof Array)) return false;
  329. if (!(b instanceof Array)) return false;
  330. if (a.length !== b.length) return false;
  331. for (let i = 0; i !== a.length; ++i) {
  332. if (a[i] !== b[i]) return false;
  333. }
  334. return true;
  335. };
  336. const escapeRegexpString = (value = '') => String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
  337. // TODO: use native Array.find, Array.findIndex when IE support is dropped
  338. const arrayFindIndex = function(arr, pred) {
  339. for (let i = 0; i !== arr.length; ++i) {
  340. if (pred(arr[i])) {
  341. return i;
  342. }
  343. }
  344. return -1;
  345. };
  346. const arrayFind = function(arr, pred) {
  347. const idx = arrayFindIndex(arr, pred);
  348. return idx !== -1 ? arr[idx] : undefined;
  349. };
  350. // coerce truthy value to array
  351. const coerceTruthyValueToArray = function(val) {
  352. if (Array.isArray(val)) {
  353. return val;
  354. } else if (val) {
  355. return [val];
  356. } else {
  357. return [];
  358. }
  359. };
  360. const isIE = function() {
  361. return !external_vue_default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
  362. };
  363. const isEdge = function() {
  364. return !external_vue_default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
  365. };
  366. const isFirefox = function() {
  367. return !external_vue_default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
  368. };
  369. const autoprefixer = function(style) {
  370. if (typeof style !== 'object') return style;
  371. const rules = ['transform', 'transition', 'animation'];
  372. const prefixes = ['ms-', 'webkit-'];
  373. rules.forEach(rule => {
  374. const value = style[rule];
  375. if (rule && value) {
  376. prefixes.forEach(prefix => {
  377. style[prefix + rule] = value;
  378. });
  379. }
  380. });
  381. return style;
  382. };
  383. const kebabCase = function(str) {
  384. const hyphenateRE = /([^-])([A-Z])/g;
  385. return str
  386. .replace(hyphenateRE, '$1-$2')
  387. .replace(hyphenateRE, '$1-$2')
  388. .toLowerCase();
  389. };
  390. const capitalize = function(str) {
  391. if (!isString(str)) return str;
  392. return str.charAt(0).toUpperCase() + str.slice(1);
  393. };
  394. const looseEqual = function(a, b) {
  395. const isObjectA = isObject(a);
  396. const isObjectB = isObject(b);
  397. if (isObjectA && isObjectB) {
  398. return JSON.stringify(a) === JSON.stringify(b);
  399. } else if (!isObjectA && !isObjectB) {
  400. return String(a) === String(b);
  401. } else {
  402. return false;
  403. }
  404. };
  405. const arrayEquals = function(arrayA, arrayB) {
  406. arrayA = arrayA || [];
  407. arrayB = arrayB || [];
  408. if (arrayA.length !== arrayB.length) {
  409. return false;
  410. }
  411. for (let i = 0; i < arrayA.length; i++) {
  412. if (!looseEqual(arrayA[i], arrayB[i])) {
  413. return false;
  414. }
  415. }
  416. return true;
  417. };
  418. const isEqual = function(value1, value2) {
  419. if (Array.isArray(value1) && Array.isArray(value2)) {
  420. return arrayEquals(value1, value2);
  421. }
  422. return looseEqual(value1, value2);
  423. };
  424. const isEmpty = function(val) {
  425. // null or undefined
  426. if (val == null) return true;
  427. if (typeof val === 'boolean') return false;
  428. if (typeof val === 'number') return !val;
  429. if (val instanceof Error) return val.message === '';
  430. switch (Object.prototype.toString.call(val)) {
  431. // String or Array
  432. case '[object String]':
  433. case '[object Array]':
  434. return !val.length;
  435. // Map or Set or File
  436. case '[object File]':
  437. case '[object Map]':
  438. case '[object Set]': {
  439. return !val.size;
  440. }
  441. // Plain Object
  442. case '[object Object]': {
  443. return !Object.keys(val).length;
  444. }
  445. }
  446. return false;
  447. };
  448. function rafThrottle(fn) {
  449. let locked = false;
  450. return function(...args) {
  451. if (locked) return;
  452. locked = true;
  453. window.requestAnimationFrame(_ => {
  454. fn.apply(this, args);
  455. locked = false;
  456. });
  457. };
  458. }
  459. function objToArray(obj) {
  460. if (Array.isArray(obj)) {
  461. return obj;
  462. }
  463. return isEmpty(obj) ? [] : [obj];
  464. }
  465. const isMac = function() {
  466. return !external_vue_default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
  467. };
  468. /***/ }),
  469. /***/ 149:
  470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  471. "use strict";
  472. /* harmony default export */ __webpack_exports__["a"] = (function(target) {
  473. for (let i = 1, j = arguments.length; i < j; i++) {
  474. let source = arguments[i] || {};
  475. for (let prop in source) {
  476. if (source.hasOwnProperty(prop)) {
  477. let value = source[prop];
  478. if (value !== undefined) {
  479. target[prop] = value;
  480. }
  481. }
  482. }
  483. }
  484. return target;
  485. });;
  486. /***/ }),
  487. /***/ 158:
  488. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  489. "use strict";
  490. // ESM COMPAT FLAG
  491. __webpack_require__.r(__webpack_exports__);
  492. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/custom-el-slider/button.vue?vue&type=template&id=09a28971
  493. var render = function render() {
  494. var _vm = this,
  495. _c = _vm._self._c;
  496. return _c('div', {
  497. ref: "button",
  498. staticClass: "el-slider__button-wrapper",
  499. class: {
  500. hover: _vm.hovering,
  501. dragging: _vm.dragging
  502. },
  503. style: _vm.wrapperStyle,
  504. attrs: {
  505. "tabindex": "0"
  506. },
  507. on: {
  508. "mouseenter": _vm.handleMouseEnter,
  509. "mouseleave": _vm.handleMouseLeave,
  510. "mousedown": _vm.onButtonDown,
  511. "touchstart": _vm.onButtonDown,
  512. "focus": _vm.handleMouseEnter,
  513. "blur": _vm.handleMouseLeave,
  514. "keydown": [function ($event) {
  515. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) return null;
  516. if ('button' in $event && $event.button !== 0) return null;
  517. return _vm.onLeftKeyDown.apply(null, arguments);
  518. }, function ($event) {
  519. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) return null;
  520. if ('button' in $event && $event.button !== 2) return null;
  521. return _vm.onRightKeyDown.apply(null, arguments);
  522. }, function ($event) {
  523. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) return null;
  524. $event.preventDefault();
  525. return _vm.onLeftKeyDown.apply(null, arguments);
  526. }, function ($event) {
  527. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) return null;
  528. $event.preventDefault();
  529. return _vm.onRightKeyDown.apply(null, arguments);
  530. }]
  531. }
  532. }, [_c('el-tooltip', {
  533. ref: "tooltip",
  534. attrs: {
  535. "placement": "top",
  536. "popper-class": _vm.tooltipClass,
  537. "disabled": !_vm.showTooltip
  538. }
  539. }, [_c('span', {
  540. attrs: {
  541. "slot": "content"
  542. },
  543. slot: "content"
  544. }, [_vm._v(_vm._s(_vm.formatValue))]), _vm._v(" "), _c('div', {
  545. staticClass: "el-slider__button",
  546. class: {
  547. hover: _vm.hovering,
  548. dragging: _vm.dragging
  549. }
  550. })])], 1);
  551. };
  552. var staticRenderFns = [];
  553. // CONCATENATED MODULE: ./components/custom-el-slider/button.vue?vue&type=template&id=09a28971
  554. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/custom-el-slider/button.vue?vue&type=script&lang=js
  555. // import ElTooltip from 'element-ui/packages/tooltip'
  556. /* harmony default export */ var buttonvue_type_script_lang_js = ({
  557. name: 'ElSliderButton',
  558. components: {
  559. // ElTooltip,
  560. },
  561. props: {
  562. value: {
  563. type: Number,
  564. default: 0
  565. },
  566. vertical: {
  567. type: Boolean,
  568. default: false
  569. },
  570. tooltipClass: String,
  571. marks: Object
  572. },
  573. data() {
  574. return {
  575. hovering: false,
  576. dragging: false,
  577. isClick: false,
  578. startX: 0,
  579. currentX: 0,
  580. startY: 0,
  581. currentY: 0,
  582. startPosition: 0,
  583. newPosition: null,
  584. oldValue: this.value
  585. };
  586. },
  587. computed: {
  588. disabled() {
  589. return this.$parent.sliderDisabled;
  590. },
  591. max() {
  592. return this.$parent.max;
  593. },
  594. min() {
  595. return this.$parent.min;
  596. },
  597. step() {
  598. return this.$parent.step;
  599. },
  600. showTooltip() {
  601. return this.$parent.showTooltip;
  602. },
  603. precision() {
  604. return this.$parent.precision;
  605. },
  606. currentPosition() {
  607. if (this.marks) {
  608. // 同父组件index中barSize的计算逻辑. 直接从那边抄过来的. 不要在这里改, 在index改完再抄过来.
  609. // 注意父组件的 this.firstValue, 这里是 this.value
  610. const marks = Object.keys(this.marks).map(Number);
  611. // 找出目标值位于marks的那个档位, 即 即将到达哪一个'档'
  612. const index = marks.findIndex(i => this.value < i);
  613. if (index === -1) return '100%';
  614. // 经过后一个档位之后占总进度条的比例 + (当前值超出后一个档位的差值 / 前一个档位与后一个档位的差值) / (进度被marks划分成的档位数量)
  615. // 上述公式要除档位数量是因为, 当前值与档位差值占单个档位区间的百分比 !== 单个区间值占总进度条的百分比
  616. const value = (index - 1) / (marks.length - 1) + (this.value - marks[index - 1]) / (marks[index] - marks[index - 1]) / (marks.length - 1);
  617. return value > 1 ? '100%' : `${value * 100}%`;
  618. } else {
  619. // 这里是原本的逻辑. 没有传marks的.
  620. return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
  621. }
  622. },
  623. enableFormat() {
  624. return this.$parent.formatTooltip instanceof Function;
  625. },
  626. formatValue() {
  627. return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
  628. },
  629. wrapperStyle() {
  630. return this.vertical ? {
  631. bottom: this.currentPosition
  632. } : {
  633. left: this.currentPosition
  634. };
  635. }
  636. },
  637. watch: {
  638. dragging(val) {
  639. this.$parent.dragging = val;
  640. }
  641. },
  642. methods: {
  643. displayTooltip() {
  644. this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
  645. },
  646. hideTooltip() {
  647. this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
  648. },
  649. handleMouseEnter() {
  650. this.hovering = true;
  651. this.displayTooltip();
  652. },
  653. handleMouseLeave() {
  654. this.hovering = false;
  655. this.hideTooltip();
  656. },
  657. onButtonDown(event) {
  658. if (this.disabled) return;
  659. event.preventDefault();
  660. this.onDragStart(event);
  661. window.addEventListener('mousemove', this.onDragging);
  662. window.addEventListener('touchmove', this.onDragging);
  663. window.addEventListener('mouseup', this.onDragEnd);
  664. window.addEventListener('touchend', this.onDragEnd);
  665. window.addEventListener('contextmenu', this.onDragEnd);
  666. },
  667. onLeftKeyDown() {
  668. if (this.disabled) return;
  669. this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
  670. this.setPosition(this.newPosition);
  671. this.$parent.emitChange();
  672. },
  673. onRightKeyDown() {
  674. if (this.disabled) return;
  675. this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
  676. this.setPosition(this.newPosition);
  677. this.$parent.emitChange();
  678. },
  679. onDragStart(event) {
  680. this.dragging = true;
  681. this.isClick = true;
  682. if (event.type === 'touchstart') {
  683. event.clientY = event.touches[0].clientY;
  684. event.clientX = event.touches[0].clientX;
  685. }
  686. if (this.vertical) {
  687. this.startY = event.clientY;
  688. } else {
  689. this.startX = event.clientX;
  690. }
  691. this.startPosition = parseFloat(this.currentPosition);
  692. this.newPosition = this.startPosition;
  693. },
  694. onDragging(event) {
  695. if (this.dragging) {
  696. this.isClick = false;
  697. this.displayTooltip();
  698. this.$parent.resetSize();
  699. let diff = 0;
  700. if (event.type === 'touchmove') {
  701. event.clientY = event.touches[0].clientY;
  702. event.clientX = event.touches[0].clientX;
  703. }
  704. if (this.vertical) {
  705. this.currentY = event.clientY;
  706. diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
  707. } else {
  708. this.currentX = event.clientX;
  709. diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
  710. }
  711. this.newPosition = this.startPosition + diff;
  712. this.setPosition(this.newPosition);
  713. }
  714. },
  715. onDragEnd() {
  716. if (this.dragging) {
  717. /*
  718. * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
  719. * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
  720. */
  721. setTimeout(() => {
  722. this.dragging = false;
  723. this.hideTooltip();
  724. if (!this.isClick) {
  725. this.setPosition(this.newPosition);
  726. this.$parent.emitChange();
  727. }
  728. }, 0);
  729. window.removeEventListener('mousemove', this.onDragging);
  730. window.removeEventListener('touchmove', this.onDragging);
  731. window.removeEventListener('mouseup', this.onDragEnd);
  732. window.removeEventListener('touchend', this.onDragEnd);
  733. window.removeEventListener('contextmenu', this.onDragEnd);
  734. }
  735. },
  736. setPosition(newPosition) {
  737. if (newPosition === null || isNaN(newPosition)) return;
  738. if (newPosition < 0) {
  739. newPosition = 0;
  740. } else if (newPosition > 100) {
  741. newPosition = 100;
  742. }
  743. const lengthPerStep = 100 / ((this.max - this.min) / this.step);
  744. const steps = Math.round(newPosition / lengthPerStep);
  745. let value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
  746. if (this.marks) {
  747. // 处理传递marks时的逻辑. 没有传marks的保持原样.
  748. // 有marks时无视原计算逻辑. 重新赋值
  749. const marks = Object.keys(this.marks).map((current, index, arr) => {
  750. return {
  751. value: Number(current),
  752. perc: 100 * index / (arr.length - 1)
  753. };
  754. });
  755. // 找出目标值位于marks的那个档位, 即 即将到达哪一个'档'
  756. if (newPosition === 100) {
  757. value = marks[marks.length - 1].value;
  758. } else {
  759. const index = marks.findIndex(item => item.perc > newPosition);
  760. // 后一个区间的代表值 + ((区间数量 * 超出后一个区间的百分比值 / 100) * 所处区间的值差)
  761. if (index === -1) {
  762. // 在最后一个区间
  763. value = marks[marks.length - 2].value + (marks.length - 1) * ((newPosition - marks[marks.length - 2].perc) / 100 * (marks[marks.length - 1].value - marks[marks.length - 2].value));
  764. } else {
  765. value = marks[index - 1].value + (marks.length - 1) * ((newPosition - marks[index - 1].perc) / 100 * (marks[index].value - marks[index - 1].value));
  766. }
  767. }
  768. }
  769. value = parseFloat(value.toFixed(this.precision));
  770. this.$emit('input', value);
  771. this.$nextTick(() => {
  772. this.displayTooltip();
  773. this.$refs.tooltip && this.$refs.tooltip.updatePopper();
  774. });
  775. if (!this.dragging && this.value !== this.oldValue) {
  776. this.oldValue = this.value;
  777. }
  778. }
  779. }
  780. });
  781. // CONCATENATED MODULE: ./components/custom-el-slider/button.vue?vue&type=script&lang=js
  782. /* harmony default export */ var custom_el_slider_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
  783. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  784. var componentNormalizer = __webpack_require__(2);
  785. // CONCATENATED MODULE: ./components/custom-el-slider/button.vue
  786. /* normalize component */
  787. var component = Object(componentNormalizer["a" /* default */])(
  788. custom_el_slider_buttonvue_type_script_lang_js,
  789. render,
  790. staticRenderFns,
  791. false,
  792. null,
  793. null,
  794. "5e8cb690"
  795. )
  796. /* harmony default export */ var custom_el_slider_button = __webpack_exports__["default"] = (component.exports);
  797. /***/ }),
  798. /***/ 159:
  799. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  800. "use strict";
  801. // ESM COMPAT FLAG
  802. __webpack_require__.r(__webpack_exports__);
  803. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/custom-el-slider/marker.vue?vue&type=template&id=2674734e
  804. var render = function render() {
  805. var _vm = this,
  806. _c = _vm._self._c;
  807. return _c('div', {
  808. staticClass: "el-slider__marks-text",
  809. staticStyle: {},
  810. on: {
  811. "click": function ($event) {
  812. $event.stopPropagation();
  813. return _vm.onMarkClick.apply(null, arguments);
  814. }
  815. }
  816. }, [_vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.label) + "\n"))]);
  817. };
  818. var staticRenderFns = [];
  819. // CONCATENATED MODULE: ./components/custom-el-slider/marker.vue?vue&type=template&id=2674734e
  820. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/custom-el-slider/marker.vue?vue&type=script&lang=js
  821. /* harmony default export */ var markervue_type_script_lang_js = ({
  822. name: 'ElMarker',
  823. props: {
  824. mark: {
  825. type: [String, Object]
  826. }
  827. },
  828. data() {
  829. return {
  830. label: ''
  831. };
  832. },
  833. mounted() {
  834. this.label = typeof this.mark === 'string' ? this.mark : this.mark.label;
  835. },
  836. methods: {
  837. onMarkClick(e) {
  838. this.$emit('click');
  839. }
  840. }
  841. });
  842. // CONCATENATED MODULE: ./components/custom-el-slider/marker.vue?vue&type=script&lang=js
  843. /* harmony default export */ var custom_el_slider_markervue_type_script_lang_js = (markervue_type_script_lang_js);
  844. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  845. var componentNormalizer = __webpack_require__(2);
  846. // CONCATENATED MODULE: ./components/custom-el-slider/marker.vue
  847. /* normalize component */
  848. var component = Object(componentNormalizer["a" /* default */])(
  849. custom_el_slider_markervue_type_script_lang_js,
  850. render,
  851. staticRenderFns,
  852. false,
  853. null,
  854. null,
  855. "04536480"
  856. )
  857. /* harmony default export */ var marker = __webpack_exports__["default"] = (component.exports);
  858. /***/ }),
  859. /***/ 160:
  860. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  861. "use strict";
  862. // ESM COMPAT FLAG
  863. __webpack_require__.r(__webpack_exports__);
  864. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/custom-el-slider/index.vue?vue&type=template&id=69805dd0
  865. var render = function render() {
  866. var _vm = this,
  867. _c = _vm._self._c;
  868. return _c('div', {
  869. staticClass: "el-slider",
  870. class: {
  871. 'is-vertical': _vm.vertical,
  872. 'el-slider--with-input': _vm.showInput
  873. },
  874. attrs: {
  875. "role": "slider",
  876. "aria-valuemin": _vm.min,
  877. "aria-valuemax": _vm.max,
  878. "aria-orientation": _vm.vertical ? 'vertical' : 'horizontal',
  879. "aria-disabled": _vm.sliderDisabled
  880. }
  881. }, [_vm.showInput && !_vm.range ? _c('el-input-number', {
  882. ref: "input",
  883. staticClass: "el-slider__input",
  884. attrs: {
  885. "step": _vm.step,
  886. "disabled": _vm.sliderDisabled,
  887. "controls": _vm.showInputControls,
  888. "min": _vm.min,
  889. "max": _vm.max,
  890. "debounce": _vm.debounce,
  891. "size": _vm.inputSize
  892. },
  893. on: {
  894. "change": _vm.emitChange
  895. },
  896. model: {
  897. value: _vm.firstValue,
  898. callback: function ($$v) {
  899. _vm.firstValue = $$v;
  900. },
  901. expression: "firstValue"
  902. }
  903. }) : _vm._e(), _vm._ssrNode(" "), _vm._ssrNode("<div" + _vm._ssrClass("el-slider__runway", {
  904. 'show-input': _vm.showInput,
  905. disabled: _vm.sliderDisabled
  906. }) + _vm._ssrStyle(null, _vm.runwayStyle, null) + ">", "</div>", [_vm._ssrNode("<div class=\"el-slider__bar\"" + _vm._ssrStyle(null, _vm.barStyle, null) + "></div> "), _c('slider-button', {
  907. ref: "button1",
  908. attrs: {
  909. "vertical": _vm.vertical,
  910. "marks": _vm.marks,
  911. "tooltip-class": _vm.tooltipClass
  912. },
  913. model: {
  914. value: _vm.firstValue,
  915. callback: function ($$v) {
  916. _vm.firstValue = $$v;
  917. },
  918. expression: "firstValue"
  919. }
  920. }), _vm._ssrNode(" "), _vm.range ? _c('slider-button', {
  921. ref: "button2",
  922. attrs: {
  923. "vertical": _vm.vertical,
  924. "marks": _vm.marks,
  925. "tooltip-class": _vm.tooltipClass
  926. },
  927. model: {
  928. value: _vm.secondValue,
  929. callback: function ($$v) {
  930. _vm.secondValue = $$v;
  931. },
  932. expression: "secondValue"
  933. }
  934. }) : _vm._e(), _vm._ssrNode(" " + _vm._ssrList(_vm.stops, function (item, key) {
  935. return "<div class=\"el-slider__stop\"" + _vm._ssrStyle(null, _vm.getStopStyle(item), {
  936. display: _vm.showStops ? '' : 'none'
  937. }) + "></div>";
  938. }) + " "), _vm.markList.length > 0 ? [_vm._ssrNode("<div>" + _vm._ssrList(_vm.markList, function (item, key) {
  939. return "<div class=\"el-slider__stop el-slider__marks-stop\"" + _vm._ssrStyle(null, _vm.getStopStyle(item.position), null) + "></div>";
  940. }) + "</div> "), _vm._ssrNode("<div class=\"el-slider__marks\">", "</div>", _vm._l(_vm.markList, function (item, key) {
  941. return _c('slider-marker', {
  942. key: key,
  943. style: _vm.getStopStyle(item.position),
  944. attrs: {
  945. "mark": item.mark
  946. },
  947. on: {
  948. "click": function ($event) {
  949. return _vm.onMarkClick(key);
  950. }
  951. }
  952. });
  953. }), 1)] : _vm._e()], 2)], 2);
  954. };
  955. var staticRenderFns = [];
  956. // CONCATENATED MODULE: ./components/custom-el-slider/index.vue?vue&type=template&id=69805dd0
  957. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/element-ui/packages/input-number/src/input-number.vue?vue&type=template&id=5655cc82
  958. var input_numbervue_type_template_id_5655cc82_render = function render() {
  959. var _vm = this,
  960. _c = _vm._self._c;
  961. return _c('div', {
  962. class: ['el-input-number', _vm.inputNumberSize ? 'el-input-number--' + _vm.inputNumberSize : '', {
  963. 'is-disabled': _vm.inputNumberDisabled
  964. }, {
  965. 'is-without-controls': !_vm.controls
  966. }, {
  967. 'is-controls-right': _vm.controlsAtRight
  968. }],
  969. on: {
  970. "dragstart": function ($event) {
  971. $event.preventDefault();
  972. }
  973. }
  974. }, [_vm.controls ? _c('span', {
  975. directives: [{
  976. name: "repeat-click",
  977. rawName: "v-repeat-click",
  978. value: _vm.decrease,
  979. expression: "decrease"
  980. }],
  981. staticClass: "el-input-number__decrease",
  982. class: {
  983. 'is-disabled': _vm.minDisabled
  984. },
  985. attrs: {
  986. "role": "button"
  987. },
  988. on: {
  989. "keydown": function ($event) {
  990. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
  991. return _vm.decrease.apply(null, arguments);
  992. }
  993. }
  994. }, [_vm._ssrNode("<i" + _vm._ssrClass(null, `el-icon-${_vm.controlsAtRight ? 'arrow-down' : 'minus'}`) + "></i>")]) : _vm._e(), _vm._ssrNode(" "), _vm.controls ? _c('span', {
  995. directives: [{
  996. name: "repeat-click",
  997. rawName: "v-repeat-click",
  998. value: _vm.increase,
  999. expression: "increase"
  1000. }],
  1001. staticClass: "el-input-number__increase",
  1002. class: {
  1003. 'is-disabled': _vm.maxDisabled
  1004. },
  1005. attrs: {
  1006. "role": "button"
  1007. },
  1008. on: {
  1009. "keydown": function ($event) {
  1010. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
  1011. return _vm.increase.apply(null, arguments);
  1012. }
  1013. }
  1014. }, [_vm._ssrNode("<i" + _vm._ssrClass(null, `el-icon-${_vm.controlsAtRight ? 'arrow-up' : 'plus'}`) + "></i>")]) : _vm._e(), _vm._ssrNode(" "), _c('el-input', {
  1015. ref: "input",
  1016. attrs: {
  1017. "value": _vm.displayValue,
  1018. "placeholder": _vm.placeholder,
  1019. "disabled": _vm.inputNumberDisabled,
  1020. "size": _vm.inputNumberSize,
  1021. "max": _vm.max,
  1022. "min": _vm.min,
  1023. "name": _vm.name,
  1024. "label": _vm.label
  1025. },
  1026. on: {
  1027. "blur": _vm.handleBlur,
  1028. "focus": _vm.handleFocus,
  1029. "input": _vm.handleInput,
  1030. "change": _vm.handleInputChange
  1031. },
  1032. nativeOn: {
  1033. "keydown": [function ($event) {
  1034. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) return null;
  1035. $event.preventDefault();
  1036. return _vm.increase.apply(null, arguments);
  1037. }, function ($event) {
  1038. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) return null;
  1039. $event.preventDefault();
  1040. return _vm.decrease.apply(null, arguments);
  1041. }]
  1042. }
  1043. })], 2);
  1044. };
  1045. var input_numbervue_type_template_id_5655cc82_staticRenderFns = [];
  1046. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/src/input-number.vue?vue&type=template&id=5655cc82
  1047. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/element-ui/packages/input/src/input.vue?vue&type=template&id=17e57c08
  1048. var inputvue_type_template_id_17e57c08_render = function render() {
  1049. var _vm = this,
  1050. _c = _vm._self._c;
  1051. return _c('div', {
  1052. class: [_vm.type === 'textarea' ? 'el-textarea' : 'el-input', _vm.inputSize ? 'el-input--' + _vm.inputSize : '', {
  1053. 'is-disabled': _vm.inputDisabled,
  1054. 'is-exceed': _vm.inputExceed,
  1055. 'el-input-group': _vm.$slots.prepend || _vm.$slots.append,
  1056. 'el-input-group--append': _vm.$slots.append,
  1057. 'el-input-group--prepend': _vm.$slots.prepend,
  1058. 'el-input--prefix': _vm.$slots.prefix || _vm.prefixIcon,
  1059. 'el-input--suffix': _vm.$slots.suffix || _vm.suffixIcon || _vm.clearable || _vm.showPassword
  1060. }],
  1061. on: {
  1062. "mouseenter": function ($event) {
  1063. _vm.hovering = true;
  1064. },
  1065. "mouseleave": function ($event) {
  1066. _vm.hovering = false;
  1067. }
  1068. }
  1069. }, [_vm.type !== 'textarea' ? [_vm.$slots.prepend ? _vm._ssrNode("<div class=\"el-input-group__prepend\">", "</div>", [_vm._t("prepend")], 2) : _vm._e(), _vm._ssrNode(" " + (_vm.type !== 'textarea' ? "<input" + _vm._ssrAttr("tabindex", _vm.tabindex) + _vm._ssrAttr("type", _vm.showPassword ? _vm.passwordVisible ? 'text' : 'password' : _vm.type) + _vm._ssrAttr("disabled", _vm.inputDisabled) + _vm._ssrAttr("readonly", _vm.readonly) + _vm._ssrAttr("autocomplete", _vm.autoComplete || _vm.autocomplete) + _vm._ssrAttr("aria-label", _vm.label) + _vm._ssrAttrs(_vm.$attrs) + " class=\"el-input__inner\">" : "<!---->") + " "), _vm.$slots.prefix || _vm.prefixIcon ? _vm._ssrNode("<span class=\"el-input__prefix\">", "</span>", [_vm._t("prefix"), _vm._ssrNode(" " + (_vm.prefixIcon ? "<i" + _vm._ssrClass("el-input__icon", _vm.prefixIcon) + "></i>" : "<!---->"))], 2) : _vm._e(), _vm._ssrNode(" "), _vm.getSuffixVisible() ? _vm._ssrNode("<span class=\"el-input__suffix\">", "</span>", [_vm._ssrNode("<span class=\"el-input__suffix-inner\">", "</span>", [!_vm.showClear || !_vm.showPwdVisible || !_vm.isWordLimitVisible ? [_vm._t("suffix"), _vm._ssrNode(" " + (_vm.suffixIcon ? "<i" + _vm._ssrClass("el-input__icon", _vm.suffixIcon) + "></i>" : "<!---->"))] : _vm._e(), _vm._ssrNode(" " + (_vm.showClear ? "<i class=\"el-input__icon el-icon-circle-close el-input__clear\"></i>" : "<!---->") + " " + (_vm.showPwdVisible ? "<i class=\"el-input__icon el-icon-view el-input__clear\"></i>" : "<!---->") + " " + (_vm.isWordLimitVisible ? "<span class=\"el-input__count\"><span class=\"el-input__count-inner\">" + _vm._ssrEscape("\n " + _vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit) + "\n ") + "</span></span>" : "<!---->"))], 2), _vm._ssrNode(" " + (_vm.validateState ? "<i" + _vm._ssrClass("el-input__icon", ['el-input__validateIcon', _vm.validateIcon]) + "></i>" : "<!---->"))], 2) : _vm._e(), _vm._ssrNode(" "), _vm.$slots.append ? _vm._ssrNode("<div class=\"el-input-group__append\">", "</div>", [_vm._t("append")], 2) : _vm._e()] : _vm._ssrNode("<textarea" + _vm._ssrAttr("tabindex", _vm.tabindex) + _vm._ssrAttr("disabled", _vm.inputDisabled) + _vm._ssrAttr("readonly", _vm.readonly) + _vm._ssrAttr("autocomplete", _vm.autoComplete || _vm.autocomplete) + _vm._ssrAttr("aria-label", _vm.label) + _vm._ssrAttrs(_vm.$attrs) + " class=\"el-textarea__inner\"" + _vm._ssrStyle(null, _vm.textareaStyle, null) + "></textarea>"), _vm._ssrNode(" " + (_vm.isWordLimitVisible && _vm.type === 'textarea' ? "<span class=\"el-input__count\">" + _vm._ssrEscape(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit)) + "</span>" : "<!---->"))], 2);
  1070. };
  1071. var inputvue_type_template_id_17e57c08_staticRenderFns = [];
  1072. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/input.vue?vue&type=template&id=17e57c08
  1073. // CONCATENATED MODULE: ./node_modules/element-ui/src/mixins/emitter.js
  1074. function broadcast(componentName, eventName, params) {
  1075. this.$children.forEach(child => {
  1076. var name = child.$options.componentName;
  1077. if (name === componentName) {
  1078. child.$emit.apply(child, [eventName].concat(params));
  1079. } else {
  1080. broadcast.apply(child, [componentName, eventName].concat([params]));
  1081. }
  1082. });
  1083. }
  1084. /* harmony default export */ var emitter = ({
  1085. methods: {
  1086. dispatch(componentName, eventName, params) {
  1087. var parent = this.$parent || this.$root;
  1088. var name = parent.$options.componentName;
  1089. while (parent && (!name || name !== componentName)) {
  1090. parent = parent.$parent;
  1091. if (parent) {
  1092. name = parent.$options.componentName;
  1093. }
  1094. }
  1095. if (parent) {
  1096. parent.$emit.apply(parent, [eventName].concat(params));
  1097. }
  1098. },
  1099. broadcast(componentName, eventName, params) {
  1100. broadcast.call(this, componentName, eventName, params);
  1101. }
  1102. }
  1103. });
  1104. // EXTERNAL MODULE: ./node_modules/element-ui/src/utils/util.js + 1 modules
  1105. var util = __webpack_require__(148);
  1106. // CONCATENATED MODULE: ./node_modules/element-ui/src/mixins/migrating.js
  1107. /**
  1108. * Show migrating guide in browser console.
  1109. *
  1110. * Usage:
  1111. * import Migrating from 'element-ui/src/mixins/migrating';
  1112. *
  1113. * mixins: [Migrating]
  1114. *
  1115. * add getMigratingConfig method for your component.
  1116. * getMigratingConfig() {
  1117. * return {
  1118. * props: {
  1119. * 'allow-no-selection': 'allow-no-selection is removed.',
  1120. * 'selection-mode': 'selection-mode is removed.'
  1121. * },
  1122. * events: {
  1123. * selectionchange: 'selectionchange is renamed to selection-change.'
  1124. * }
  1125. * };
  1126. * },
  1127. */
  1128. /* harmony default export */ var migrating = ({
  1129. mounted() {
  1130. if (true) return;
  1131. if (!this.$vnode) return;
  1132. const { props = {}, events = {} } = this.getMigratingConfig();
  1133. const { data, componentOptions } = this.$vnode;
  1134. const definedProps = data.attrs || {};
  1135. const definedEvents = componentOptions.listeners || {};
  1136. for (let propName in definedProps) {
  1137. propName = Object(util["c" /* kebabCase */])(propName); // compatible with camel case
  1138. if (props[propName]) {
  1139. console.warn(`[Element Migrating][${this.$options.name}][Attribute]: ${props[propName]}`);
  1140. }
  1141. }
  1142. for (let eventName in definedEvents) {
  1143. eventName = Object(util["c" /* kebabCase */])(eventName); // compatible with camel case
  1144. if (events[eventName]) {
  1145. console.warn(`[Element Migrating][${this.$options.name}][Event]: ${events[eventName]}`);
  1146. }
  1147. }
  1148. },
  1149. methods: {
  1150. getMigratingConfig() {
  1151. return {
  1152. props: {},
  1153. events: {}
  1154. };
  1155. }
  1156. }
  1157. });
  1158. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/calcTextareaHeight.js
  1159. let hiddenTextarea;
  1160. const HIDDEN_STYLE = `
  1161. height:0 !important;
  1162. visibility:hidden !important;
  1163. overflow:hidden !important;
  1164. position:absolute !important;
  1165. z-index:-1000 !important;
  1166. top:0 !important;
  1167. right:0 !important
  1168. `;
  1169. const CONTEXT_STYLE = [
  1170. 'letter-spacing',
  1171. 'line-height',
  1172. 'padding-top',
  1173. 'padding-bottom',
  1174. 'font-family',
  1175. 'font-weight',
  1176. 'font-size',
  1177. 'text-rendering',
  1178. 'text-transform',
  1179. 'width',
  1180. 'text-indent',
  1181. 'padding-left',
  1182. 'padding-right',
  1183. 'border-width',
  1184. 'box-sizing'
  1185. ];
  1186. function calculateNodeStyling(targetElement) {
  1187. const style = window.getComputedStyle(targetElement);
  1188. const boxSizing = style.getPropertyValue('box-sizing');
  1189. const paddingSize = (
  1190. parseFloat(style.getPropertyValue('padding-bottom')) +
  1191. parseFloat(style.getPropertyValue('padding-top'))
  1192. );
  1193. const borderSize = (
  1194. parseFloat(style.getPropertyValue('border-bottom-width')) +
  1195. parseFloat(style.getPropertyValue('border-top-width'))
  1196. );
  1197. const contextStyle = CONTEXT_STYLE
  1198. .map(name => `${name}:${style.getPropertyValue(name)}`)
  1199. .join(';');
  1200. return { contextStyle, paddingSize, borderSize, boxSizing };
  1201. }
  1202. function calcTextareaHeight(
  1203. targetElement,
  1204. minRows = 1,
  1205. maxRows = null
  1206. ) {
  1207. if (!hiddenTextarea) {
  1208. hiddenTextarea = document.createElement('textarea');
  1209. document.body.appendChild(hiddenTextarea);
  1210. }
  1211. let {
  1212. paddingSize,
  1213. borderSize,
  1214. boxSizing,
  1215. contextStyle
  1216. } = calculateNodeStyling(targetElement);
  1217. hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`);
  1218. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  1219. let height = hiddenTextarea.scrollHeight;
  1220. const result = {};
  1221. if (boxSizing === 'border-box') {
  1222. height = height + borderSize;
  1223. } else if (boxSizing === 'content-box') {
  1224. height = height - paddingSize;
  1225. }
  1226. hiddenTextarea.value = '';
  1227. let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  1228. if (minRows !== null) {
  1229. let minHeight = singleRowHeight * minRows;
  1230. if (boxSizing === 'border-box') {
  1231. minHeight = minHeight + paddingSize + borderSize;
  1232. }
  1233. height = Math.max(minHeight, height);
  1234. result.minHeight = `${ minHeight }px`;
  1235. }
  1236. if (maxRows !== null) {
  1237. let maxHeight = singleRowHeight * maxRows;
  1238. if (boxSizing === 'border-box') {
  1239. maxHeight = maxHeight + paddingSize + borderSize;
  1240. }
  1241. height = Math.min(maxHeight, height);
  1242. }
  1243. result.height = `${ height }px`;
  1244. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  1245. hiddenTextarea = null;
  1246. return result;
  1247. };
  1248. // EXTERNAL MODULE: ./node_modules/element-ui/src/utils/merge.js
  1249. var merge = __webpack_require__(149);
  1250. // CONCATENATED MODULE: ./node_modules/element-ui/src/utils/shared.js
  1251. function isDef(val) {
  1252. return val !== undefined && val !== null;
  1253. }
  1254. function isKorean(text) {
  1255. const reg = /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;
  1256. return reg.test(text);
  1257. }
  1258. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/element-ui/packages/input/src/input.vue?vue&type=script&lang=js
  1259. /* harmony default export */ var inputvue_type_script_lang_js = ({
  1260. name: 'ElInput',
  1261. componentName: 'ElInput',
  1262. mixins: [emitter, migrating],
  1263. inheritAttrs: false,
  1264. inject: {
  1265. elForm: {
  1266. default: ''
  1267. },
  1268. elFormItem: {
  1269. default: ''
  1270. }
  1271. },
  1272. data() {
  1273. return {
  1274. textareaCalcStyle: {},
  1275. hovering: false,
  1276. focused: false,
  1277. isComposing: false,
  1278. passwordVisible: false
  1279. };
  1280. },
  1281. props: {
  1282. value: [String, Number],
  1283. size: String,
  1284. resize: String,
  1285. form: String,
  1286. disabled: Boolean,
  1287. readonly: Boolean,
  1288. type: {
  1289. type: String,
  1290. default: 'text'
  1291. },
  1292. autosize: {
  1293. type: [Boolean, Object],
  1294. default: false
  1295. },
  1296. autocomplete: {
  1297. type: String,
  1298. default: 'off'
  1299. },
  1300. /** @Deprecated in next major version */
  1301. autoComplete: {
  1302. type: String,
  1303. validator(val) {
  1304. false && false;
  1305. return true;
  1306. }
  1307. },
  1308. validateEvent: {
  1309. type: Boolean,
  1310. default: true
  1311. },
  1312. suffixIcon: String,
  1313. prefixIcon: String,
  1314. label: String,
  1315. clearable: {
  1316. type: Boolean,
  1317. default: false
  1318. },
  1319. showPassword: {
  1320. type: Boolean,
  1321. default: false
  1322. },
  1323. showWordLimit: {
  1324. type: Boolean,
  1325. default: false
  1326. },
  1327. tabindex: String
  1328. },
  1329. computed: {
  1330. _elFormItemSize() {
  1331. return (this.elFormItem || {}).elFormItemSize;
  1332. },
  1333. validateState() {
  1334. return this.elFormItem ? this.elFormItem.validateState : '';
  1335. },
  1336. needStatusIcon() {
  1337. return this.elForm ? this.elForm.statusIcon : false;
  1338. },
  1339. validateIcon() {
  1340. return {
  1341. validating: 'el-icon-loading',
  1342. success: 'el-icon-circle-check',
  1343. error: 'el-icon-circle-close'
  1344. }[this.validateState];
  1345. },
  1346. textareaStyle() {
  1347. return Object(merge["a" /* default */])({}, this.textareaCalcStyle, {
  1348. resize: this.resize
  1349. });
  1350. },
  1351. inputSize() {
  1352. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1353. },
  1354. inputDisabled() {
  1355. return this.disabled || (this.elForm || {}).disabled;
  1356. },
  1357. nativeInputValue() {
  1358. return this.value === null || this.value === undefined ? '' : String(this.value);
  1359. },
  1360. showClear() {
  1361. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  1362. },
  1363. showPwdVisible() {
  1364. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  1365. },
  1366. isWordLimitVisible() {
  1367. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  1368. },
  1369. upperLimit() {
  1370. return this.$attrs.maxlength;
  1371. },
  1372. textLength() {
  1373. if (typeof this.value === 'number') {
  1374. return String(this.value).length;
  1375. }
  1376. return (this.value || '').length;
  1377. },
  1378. inputExceed() {
  1379. // show exceed style if length of initial value greater then maxlength
  1380. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  1381. }
  1382. },
  1383. watch: {
  1384. value(val) {
  1385. this.$nextTick(this.resizeTextarea);
  1386. if (this.validateEvent) {
  1387. this.dispatch('ElFormItem', 'el.form.change', [val]);
  1388. }
  1389. },
  1390. // native input value is set explicitly
  1391. // do not use v-model / :value in template
  1392. // see: https://github.com/ElemeFE/element/issues/14521
  1393. nativeInputValue() {
  1394. this.setNativeInputValue();
  1395. },
  1396. // when change between <input> and <textarea>,
  1397. // update DOM dependent value and styles
  1398. // https://github.com/ElemeFE/element/issues/14857
  1399. type() {
  1400. this.$nextTick(() => {
  1401. this.setNativeInputValue();
  1402. this.resizeTextarea();
  1403. this.updateIconOffset();
  1404. });
  1405. }
  1406. },
  1407. methods: {
  1408. focus() {
  1409. this.getInput().focus();
  1410. },
  1411. blur() {
  1412. this.getInput().blur();
  1413. },
  1414. getMigratingConfig() {
  1415. return {
  1416. props: {
  1417. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  1418. 'on-icon-click': 'on-icon-click is removed.'
  1419. },
  1420. events: {
  1421. 'click': 'click is removed.'
  1422. }
  1423. };
  1424. },
  1425. handleBlur(event) {
  1426. this.focused = false;
  1427. this.$emit('blur', event);
  1428. if (this.validateEvent) {
  1429. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  1430. }
  1431. },
  1432. select() {
  1433. this.getInput().select();
  1434. },
  1435. resizeTextarea() {
  1436. if (this.$isServer) return;
  1437. const {
  1438. autosize,
  1439. type
  1440. } = this;
  1441. if (type !== 'textarea') return;
  1442. if (!autosize) {
  1443. this.textareaCalcStyle = {
  1444. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  1445. };
  1446. return;
  1447. }
  1448. const minRows = autosize.minRows;
  1449. const maxRows = autosize.maxRows;
  1450. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  1451. },
  1452. setNativeInputValue() {
  1453. const input = this.getInput();
  1454. if (!input) return;
  1455. if (input.value === this.nativeInputValue) return;
  1456. input.value = this.nativeInputValue;
  1457. },
  1458. handleFocus(event) {
  1459. this.focused = true;
  1460. this.$emit('focus', event);
  1461. },
  1462. handleCompositionStart(event) {
  1463. this.$emit('compositionstart', event);
  1464. this.isComposing = true;
  1465. },
  1466. handleCompositionUpdate(event) {
  1467. this.$emit('compositionupdate', event);
  1468. const text = event.target.value;
  1469. const lastCharacter = text[text.length - 1] || '';
  1470. this.isComposing = !isKorean(lastCharacter);
  1471. },
  1472. handleCompositionEnd(event) {
  1473. this.$emit('compositionend', event);
  1474. if (this.isComposing) {
  1475. this.isComposing = false;
  1476. this.handleInput(event);
  1477. }
  1478. },
  1479. handleInput(event) {
  1480. // should not emit input during composition
  1481. // see: https://github.com/ElemeFE/element/issues/10516
  1482. if (this.isComposing) return;
  1483. // hack for https://github.com/ElemeFE/element/issues/8548
  1484. // should remove the following line when we don't support IE
  1485. if (event.target.value === this.nativeInputValue) return;
  1486. this.$emit('input', event.target.value);
  1487. // ensure native input value is controlled
  1488. // see: https://github.com/ElemeFE/element/issues/12850
  1489. this.$nextTick(this.setNativeInputValue);
  1490. },
  1491. handleChange(event) {
  1492. this.$emit('change', event.target.value);
  1493. },
  1494. calcIconOffset(place) {
  1495. let elList = [].slice.call(this.$el.querySelectorAll(`.el-input__${place}`) || []);
  1496. if (!elList.length) return;
  1497. let el = null;
  1498. for (let i = 0; i < elList.length; i++) {
  1499. if (elList[i].parentNode === this.$el) {
  1500. el = elList[i];
  1501. break;
  1502. }
  1503. }
  1504. if (!el) return;
  1505. const pendantMap = {
  1506. suffix: 'append',
  1507. prefix: 'prepend'
  1508. };
  1509. const pendant = pendantMap[place];
  1510. if (this.$slots[pendant]) {
  1511. el.style.transform = `translateX(${place === 'suffix' ? '-' : ''}${this.$el.querySelector(`.el-input-group__${pendant}`).offsetWidth}px)`;
  1512. } else {
  1513. el.removeAttribute('style');
  1514. }
  1515. },
  1516. updateIconOffset() {
  1517. this.calcIconOffset('prefix');
  1518. this.calcIconOffset('suffix');
  1519. },
  1520. clear() {
  1521. this.$emit('input', '');
  1522. this.$emit('change', '');
  1523. this.$emit('clear');
  1524. },
  1525. handlePasswordVisible() {
  1526. this.passwordVisible = !this.passwordVisible;
  1527. this.$nextTick(() => {
  1528. this.focus();
  1529. });
  1530. },
  1531. getInput() {
  1532. return this.$refs.input || this.$refs.textarea;
  1533. },
  1534. getSuffixVisible() {
  1535. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  1536. }
  1537. },
  1538. created() {
  1539. this.$on('inputSelect', this.select);
  1540. },
  1541. mounted() {
  1542. this.setNativeInputValue();
  1543. this.resizeTextarea();
  1544. this.updateIconOffset();
  1545. },
  1546. updated() {
  1547. this.$nextTick(this.updateIconOffset);
  1548. }
  1549. });
  1550. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/input.vue?vue&type=script&lang=js
  1551. /* harmony default export */ var src_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
  1552. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  1553. var componentNormalizer = __webpack_require__(2);
  1554. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/input.vue
  1555. /* normalize component */
  1556. var component = Object(componentNormalizer["a" /* default */])(
  1557. src_inputvue_type_script_lang_js,
  1558. inputvue_type_template_id_17e57c08_render,
  1559. inputvue_type_template_id_17e57c08_staticRenderFns,
  1560. false,
  1561. null,
  1562. null,
  1563. "915bbf50"
  1564. )
  1565. /* harmony default export */ var input = (component.exports);
  1566. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/index.js
  1567. /* istanbul ignore next */
  1568. input.install = function(Vue) {
  1569. Vue.component(input.name, input);
  1570. };
  1571. /* harmony default export */ var packages_input = (input);
  1572. // CONCATENATED MODULE: ./node_modules/element-ui/src/mixins/focus.js
  1573. /* harmony default export */ var mixins_focus = (function(ref) {
  1574. return {
  1575. methods: {
  1576. focus() {
  1577. this.$refs[ref].focus();
  1578. }
  1579. }
  1580. };
  1581. });;
  1582. // EXTERNAL MODULE: ./node_modules/element-ui/src/utils/dom.js
  1583. var dom = __webpack_require__(147);
  1584. // CONCATENATED MODULE: ./node_modules/element-ui/src/directives/repeat-click.js
  1585. /* harmony default export */ var repeat_click = ({
  1586. bind(el, binding, vnode) {
  1587. let interval = null;
  1588. let startTime;
  1589. const maxIntervals = Object(util["b" /* isMac */])() ? 100 : 200;
  1590. const handler = () => vnode.context[binding.expression].apply();
  1591. const clear = () => {
  1592. if (Date.now() - startTime < maxIntervals) {
  1593. handler();
  1594. }
  1595. clearInterval(interval);
  1596. interval = null;
  1597. };
  1598. Object(dom["e" /* on */])(el, 'mousedown', (e) => {
  1599. if (e.button !== 0) return;
  1600. startTime = Date.now();
  1601. Object(dom["f" /* once */])(document, 'mouseup', clear);
  1602. clearInterval(interval);
  1603. interval = setInterval(handler, maxIntervals);
  1604. });
  1605. }
  1606. });
  1607. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/element-ui/packages/input-number/src/input-number.vue?vue&type=script&lang=js
  1608. /* harmony default export */ var input_numbervue_type_script_lang_js = ({
  1609. name: 'ElInputNumber',
  1610. mixins: [mixins_focus('input')],
  1611. inject: {
  1612. elForm: {
  1613. default: ''
  1614. },
  1615. elFormItem: {
  1616. default: ''
  1617. }
  1618. },
  1619. directives: {
  1620. repeatClick: repeat_click
  1621. },
  1622. components: {
  1623. ElInput: packages_input
  1624. },
  1625. props: {
  1626. step: {
  1627. type: Number,
  1628. default: 1
  1629. },
  1630. stepStrictly: {
  1631. type: Boolean,
  1632. default: false
  1633. },
  1634. max: {
  1635. type: Number,
  1636. default: Infinity
  1637. },
  1638. min: {
  1639. type: Number,
  1640. default: -Infinity
  1641. },
  1642. value: {},
  1643. disabled: Boolean,
  1644. size: String,
  1645. controls: {
  1646. type: Boolean,
  1647. default: true
  1648. },
  1649. controlsPosition: {
  1650. type: String,
  1651. default: ''
  1652. },
  1653. name: String,
  1654. label: String,
  1655. placeholder: String,
  1656. precision: {
  1657. type: Number,
  1658. validator(val) {
  1659. return val >= 0 && val === parseInt(val, 10);
  1660. }
  1661. }
  1662. },
  1663. data() {
  1664. return {
  1665. currentValue: 0,
  1666. userInput: null
  1667. };
  1668. },
  1669. watch: {
  1670. value: {
  1671. immediate: true,
  1672. handler(value) {
  1673. let newVal = value === undefined ? value : Number(value);
  1674. if (newVal !== undefined) {
  1675. if (isNaN(newVal)) {
  1676. return;
  1677. }
  1678. if (this.stepStrictly) {
  1679. const stepPrecision = this.getPrecision(this.step);
  1680. const precisionFactor = Math.pow(10, stepPrecision);
  1681. newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
  1682. }
  1683. if (this.precision !== undefined) {
  1684. newVal = this.toPrecision(newVal, this.precision);
  1685. }
  1686. }
  1687. if (newVal >= this.max) newVal = this.max;
  1688. if (newVal <= this.min) newVal = this.min;
  1689. this.currentValue = newVal;
  1690. this.userInput = null;
  1691. this.$emit('input', newVal);
  1692. }
  1693. }
  1694. },
  1695. computed: {
  1696. minDisabled() {
  1697. return this._decrease(this.value, this.step) < this.min;
  1698. },
  1699. maxDisabled() {
  1700. return this._increase(this.value, this.step) > this.max;
  1701. },
  1702. numPrecision() {
  1703. const {
  1704. value,
  1705. step,
  1706. getPrecision,
  1707. precision
  1708. } = this;
  1709. const stepPrecision = getPrecision(step);
  1710. if (precision !== undefined) {
  1711. if (stepPrecision > precision) {
  1712. console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
  1713. }
  1714. return precision;
  1715. } else {
  1716. return Math.max(getPrecision(value), stepPrecision);
  1717. }
  1718. },
  1719. controlsAtRight() {
  1720. return this.controls && this.controlsPosition === 'right';
  1721. },
  1722. _elFormItemSize() {
  1723. return (this.elFormItem || {}).elFormItemSize;
  1724. },
  1725. inputNumberSize() {
  1726. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  1727. },
  1728. inputNumberDisabled() {
  1729. return this.disabled || !!(this.elForm || {}).disabled;
  1730. },
  1731. displayValue() {
  1732. if (this.userInput !== null) {
  1733. return this.userInput;
  1734. }
  1735. let currentValue = this.currentValue;
  1736. if (typeof currentValue === 'number') {
  1737. if (this.stepStrictly) {
  1738. const stepPrecision = this.getPrecision(this.step);
  1739. const precisionFactor = Math.pow(10, stepPrecision);
  1740. currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
  1741. }
  1742. if (this.precision !== undefined) {
  1743. currentValue = currentValue.toFixed(this.precision);
  1744. }
  1745. }
  1746. return currentValue;
  1747. }
  1748. },
  1749. methods: {
  1750. toPrecision(num, precision) {
  1751. if (precision === undefined) precision = this.numPrecision;
  1752. return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
  1753. },
  1754. getPrecision(value) {
  1755. if (value === undefined) return 0;
  1756. const valueString = value.toString();
  1757. const dotPosition = valueString.indexOf('.');
  1758. let precision = 0;
  1759. if (dotPosition !== -1) {
  1760. precision = valueString.length - dotPosition - 1;
  1761. }
  1762. return precision;
  1763. },
  1764. _increase(val, step) {
  1765. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  1766. const precisionFactor = Math.pow(10, this.numPrecision);
  1767. // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
  1768. return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
  1769. },
  1770. _decrease(val, step) {
  1771. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  1772. const precisionFactor = Math.pow(10, this.numPrecision);
  1773. return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
  1774. },
  1775. increase() {
  1776. if (this.inputNumberDisabled || this.maxDisabled) return;
  1777. const value = this.value || 0;
  1778. const newVal = this._increase(value, this.step);
  1779. this.setCurrentValue(newVal);
  1780. },
  1781. decrease() {
  1782. if (this.inputNumberDisabled || this.minDisabled) return;
  1783. const value = this.value || 0;
  1784. const newVal = this._decrease(value, this.step);
  1785. this.setCurrentValue(newVal);
  1786. },
  1787. handleBlur(event) {
  1788. this.$emit('blur', event);
  1789. },
  1790. handleFocus(event) {
  1791. this.$emit('focus', event);
  1792. },
  1793. setCurrentValue(newVal) {
  1794. const oldVal = this.currentValue;
  1795. if (typeof newVal === 'number' && this.precision !== undefined) {
  1796. newVal = this.toPrecision(newVal, this.precision);
  1797. }
  1798. if (newVal >= this.max) newVal = this.max;
  1799. if (newVal <= this.min) newVal = this.min;
  1800. if (oldVal === newVal) return;
  1801. this.userInput = null;
  1802. this.$emit('input', newVal);
  1803. this.$emit('change', newVal, oldVal);
  1804. this.currentValue = newVal;
  1805. },
  1806. handleInput(value) {
  1807. this.userInput = value;
  1808. },
  1809. handleInputChange(value) {
  1810. const newVal = value === '' ? undefined : Number(value);
  1811. if (!isNaN(newVal) || value === '') {
  1812. this.setCurrentValue(newVal);
  1813. }
  1814. this.userInput = null;
  1815. },
  1816. select() {
  1817. this.$refs.input.select();
  1818. }
  1819. },
  1820. mounted() {
  1821. let innerInput = this.$refs.input.$refs.input;
  1822. innerInput.setAttribute('role', 'spinbutton');
  1823. innerInput.setAttribute('aria-valuemax', this.max);
  1824. innerInput.setAttribute('aria-valuemin', this.min);
  1825. innerInput.setAttribute('aria-valuenow', this.currentValue);
  1826. innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
  1827. },
  1828. updated() {
  1829. if (!this.$refs || !this.$refs.input) return;
  1830. const innerInput = this.$refs.input.$refs.input;
  1831. innerInput.setAttribute('aria-valuenow', this.currentValue);
  1832. }
  1833. });
  1834. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/src/input-number.vue?vue&type=script&lang=js
  1835. /* harmony default export */ var src_input_numbervue_type_script_lang_js = (input_numbervue_type_script_lang_js);
  1836. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/src/input-number.vue
  1837. /* normalize component */
  1838. var input_number_component = Object(componentNormalizer["a" /* default */])(
  1839. src_input_numbervue_type_script_lang_js,
  1840. input_numbervue_type_template_id_5655cc82_render,
  1841. input_numbervue_type_template_id_5655cc82_staticRenderFns,
  1842. false,
  1843. null,
  1844. null,
  1845. "55db5810"
  1846. )
  1847. /* harmony default export */ var input_number = (input_number_component.exports);
  1848. // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/index.js
  1849. /* istanbul ignore next */
  1850. input_number.install = function(Vue) {
  1851. Vue.component(input_number.name, input_number);
  1852. };
  1853. /* harmony default export */ var packages_input_number = (input_number);
  1854. // EXTERNAL MODULE: ./components/custom-el-slider/button.vue + 4 modules
  1855. var custom_el_slider_button = __webpack_require__(158);
  1856. // EXTERNAL MODULE: ./components/custom-el-slider/marker.vue + 4 modules
  1857. var marker = __webpack_require__(159);
  1858. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/custom-el-slider/index.vue?vue&type=script&lang=js
  1859. /* harmony default export */ var custom_el_slidervue_type_script_lang_js = ({
  1860. name: 'ElSlider',
  1861. components: {
  1862. ElInputNumber: packages_input_number,
  1863. SliderButton: custom_el_slider_button["default"],
  1864. SliderMarker: marker["default"]
  1865. },
  1866. mixins: [emitter],
  1867. inject: {
  1868. elForm: {
  1869. default: ''
  1870. }
  1871. },
  1872. props: {
  1873. min: {
  1874. type: Number,
  1875. default: 0
  1876. },
  1877. max: {
  1878. type: Number,
  1879. default: 100
  1880. },
  1881. step: {
  1882. type: Number,
  1883. default: 1
  1884. },
  1885. value: {
  1886. // string 是数据框被清空时的值. 理论上不会出现, 这里只是用来规避控制台报错
  1887. type: [Number, Array, String],
  1888. default: 0
  1889. },
  1890. showInput: {
  1891. type: Boolean,
  1892. default: false
  1893. },
  1894. showInputControls: {
  1895. type: Boolean,
  1896. default: true
  1897. },
  1898. inputSize: {
  1899. type: String,
  1900. default: 'small'
  1901. },
  1902. showStops: {
  1903. type: Boolean,
  1904. default: false
  1905. },
  1906. showTooltip: {
  1907. type: Boolean,
  1908. default: true
  1909. },
  1910. formatTooltip: Function,
  1911. disabled: {
  1912. type: Boolean,
  1913. default: false
  1914. },
  1915. range: {
  1916. type: Boolean,
  1917. default: false
  1918. },
  1919. vertical: {
  1920. type: Boolean,
  1921. default: false
  1922. },
  1923. height: {
  1924. type: String
  1925. },
  1926. debounce: {
  1927. type: Number,
  1928. default: 300
  1929. },
  1930. label: {
  1931. type: String
  1932. },
  1933. tooltipClass: String,
  1934. marks: Object
  1935. },
  1936. data() {
  1937. return {
  1938. firstValue: null,
  1939. secondValue: null,
  1940. oldValue: null,
  1941. dragging: false,
  1942. sliderSize: 1
  1943. };
  1944. },
  1945. computed: {
  1946. stops() {
  1947. if (!this.showStops || this.min > this.max) return [];
  1948. if (this.step === 0) {
  1949. false && false;
  1950. return [];
  1951. }
  1952. const stopCount = (this.max - this.min) / this.step;
  1953. const stepWidth = 100 * this.step / (this.max - this.min);
  1954. const result = [];
  1955. for (let i = 1; i < stopCount; i++) {
  1956. result.push(i * stepWidth);
  1957. }
  1958. if (this.range) {
  1959. return result.filter(step => {
  1960. return step < 100 * (this.minValue - this.min) / (this.max - this.min) || step > 100 * (this.maxValue - this.min) / (this.max - this.min);
  1961. });
  1962. } else {
  1963. return result.filter(step => step > 100 * (this.firstValue - this.min) / (this.max - this.min));
  1964. }
  1965. },
  1966. markList() {
  1967. if (!this.marks) {
  1968. return [];
  1969. }
  1970. const marksKeys = Object.keys(this.marks);
  1971. return marksKeys.map(parseFloat).sort((a, b) => a - b).filter(point => point <= this.max && point >= this.min).map((point, index) => ({
  1972. point,
  1973. // 改造使得mark在滑动区域内均分
  1974. position: 100 * index * (this.max - this.min) / (marksKeys.length - 1) / (this.max - this.min),
  1975. // position: ((point - this.min) * 100) / (this.max - this.min),
  1976. mark: this.marks[point]
  1977. }));
  1978. },
  1979. minValue() {
  1980. return Math.min(this.firstValue, this.secondValue);
  1981. },
  1982. maxValue() {
  1983. return Math.max(this.firstValue, this.secondValue);
  1984. },
  1985. barSize() {
  1986. if (this.marks) {
  1987. const marks = Object.keys(this.marks).map(Number);
  1988. // 找出目标值位于marks的那个档位, 即 即将到达哪一个'档'
  1989. const index = marks.findIndex(i => this.firstValue < i);
  1990. // console.log(index, 'index')
  1991. if (this.range) {
  1992. // todo 范围值的计算. 这个还没改. 不知道怎么算.
  1993. return `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%`;
  1994. }
  1995. if (index === -1) return '100%';
  1996. // 经过后一个档位之后占总进度条的比例 + (当前值超出后一个档位的差值 / 前一个档位与后一个档位的差值) / (进度被marks划分成的档位数量)
  1997. // 上述公式要除档位数量是因为, 当前值与档位差值占单个档位区间的百分比 !== 单个区间值占总进度条的百分比
  1998. const value = (index - 1) / (marks.length - 1) + (this.firstValue - marks[index - 1]) / (marks[index] - marks[index - 1]) / (marks.length - 1);
  1999. // console.log('value', value)
  2000. return value > 1 ? '100%' : `${value * 100}%`;
  2001. } else {
  2002. return this.range ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.firstValue - this.min) / (this.max - this.min)}%`;
  2003. }
  2004. },
  2005. barStart() {
  2006. return this.range ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : '0%';
  2007. },
  2008. precision() {
  2009. const precisions = [this.min, this.max, this.step].map(item => {
  2010. const decimal = ('' + item).split('.')[1];
  2011. return decimal ? decimal.length : 0;
  2012. });
  2013. return Math.max.apply(null, precisions);
  2014. },
  2015. runwayStyle() {
  2016. return this.vertical ? {
  2017. height: this.height
  2018. } : {};
  2019. },
  2020. barStyle() {
  2021. return this.vertical ? {
  2022. height: this.barSize,
  2023. bottom: this.barStart
  2024. } : {
  2025. width: this.barSize,
  2026. left: this.barStart
  2027. };
  2028. },
  2029. sliderDisabled() {
  2030. return this.disabled || (this.elForm || {}).disabled;
  2031. }
  2032. },
  2033. watch: {
  2034. value(val, oldVal) {
  2035. if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every((item, index) => item === oldVal[index])) {
  2036. return;
  2037. }
  2038. this.setValues();
  2039. },
  2040. dragging(val) {
  2041. if (!val) {
  2042. this.setValues();
  2043. }
  2044. },
  2045. firstValue(val) {
  2046. if (this.range) {
  2047. this.$emit('input', [this.minValue, this.maxValue]);
  2048. } else {
  2049. this.$emit('input', val);
  2050. }
  2051. },
  2052. secondValue() {
  2053. if (this.range) {
  2054. this.$emit('input', [this.minValue, this.maxValue]);
  2055. }
  2056. },
  2057. min() {
  2058. this.setValues();
  2059. },
  2060. max() {
  2061. this.setValues();
  2062. }
  2063. },
  2064. mounted() {
  2065. let valuetext;
  2066. if (this.range) {
  2067. if (Array.isArray(this.value)) {
  2068. this.firstValue = Math.max(this.min, this.value[0]);
  2069. this.secondValue = Math.min(this.max, this.value[1]);
  2070. } else {
  2071. this.firstValue = this.min;
  2072. this.secondValue = this.max;
  2073. }
  2074. this.oldValue = [this.firstValue, this.secondValue];
  2075. valuetext = `${this.firstValue}-${this.secondValue}`;
  2076. } else {
  2077. if (typeof this.value !== 'number' || isNaN(this.value)) {
  2078. this.firstValue = this.min;
  2079. } else {
  2080. this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
  2081. }
  2082. this.oldValue = this.firstValue;
  2083. valuetext = this.firstValue;
  2084. }
  2085. this.$el.setAttribute('aria-valuetext', valuetext);
  2086. // label screen reader
  2087. this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${this.min} and ${this.max}`);
  2088. this.resetSize();
  2089. window.addEventListener('resize', this.resetSize);
  2090. },
  2091. beforeDestroy() {
  2092. window.removeEventListener('resize', this.resetSize);
  2093. },
  2094. methods: {
  2095. valueChanged() {
  2096. if (this.range) {
  2097. return ![this.minValue, this.maxValue].every((item, index) => item === this.oldValue[index]);
  2098. } else {
  2099. return this.value !== this.oldValue;
  2100. }
  2101. },
  2102. setValues() {
  2103. if (this.min > this.max) {
  2104. console.error('[Element Error][Slider]min should not be greater than max.');
  2105. return;
  2106. }
  2107. const val = this.value;
  2108. if (this.range && Array.isArray(val)) {
  2109. if (val[1] < this.min) {
  2110. this.$emit('input', [this.min, this.min]);
  2111. } else if (val[0] > this.max) {
  2112. this.$emit('input', [this.max, this.max]);
  2113. } else if (val[0] < this.min) {
  2114. this.$emit('input', [this.min, val[1]]);
  2115. } else if (val[1] > this.max) {
  2116. this.$emit('input', [val[0], this.max]);
  2117. } else {
  2118. this.firstValue = val[0];
  2119. this.secondValue = val[1];
  2120. if (this.valueChanged()) {
  2121. this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
  2122. this.oldValue = val.slice();
  2123. }
  2124. }
  2125. } else if (!this.range && typeof val === 'number' && !isNaN(val)) {
  2126. if (val < this.min) {
  2127. this.$emit('input', this.min);
  2128. } else if (val > this.max) {
  2129. this.$emit('input', this.max);
  2130. } else {
  2131. this.firstValue = val;
  2132. if (this.valueChanged()) {
  2133. this.dispatch('ElFormItem', 'el.form.change', val);
  2134. this.oldValue = val;
  2135. }
  2136. }
  2137. }
  2138. },
  2139. setPosition(percent) {
  2140. const targetValue = this.min + percent * (this.max - this.min) / 100;
  2141. if (!this.range) {
  2142. this.$refs.button1.setPosition(percent);
  2143. return;
  2144. }
  2145. let button;
  2146. if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
  2147. button = this.firstValue < this.secondValue ? 'button1' : 'button2';
  2148. } else {
  2149. button = this.firstValue > this.secondValue ? 'button1' : 'button2';
  2150. }
  2151. this.$refs[button].setPosition(percent);
  2152. },
  2153. onSliderClick(event) {
  2154. if (this.sliderDisabled || this.dragging) return;
  2155. this.resetSize();
  2156. if (this.vertical) {
  2157. const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
  2158. this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
  2159. } else {
  2160. const sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
  2161. this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
  2162. }
  2163. this.emitChange();
  2164. },
  2165. onMarkClick(index) {
  2166. if (typeof index !== 'number') return;
  2167. // 这个判断和resetSize从onSliderClick抄过来的.
  2168. // 因为直接点击mark的 标志文案 得到的不是准确的数(宽度导致的位置不同), 所以魔改了一下, 点击mark按固定比例算.
  2169. if (this.sliderDisabled || this.dragging) return;
  2170. this.resetSize();
  2171. const marks = Object.keys(this.marks).map(Number);
  2172. // 计算当前点击位于marks的第几项, 算百分比
  2173. this.setPosition(100 * index / (marks.length - 1));
  2174. this.emitChange();
  2175. },
  2176. resetSize() {
  2177. if (this.$refs.slider) {
  2178. this.sliderSize = this.$refs.slider[`client${this.vertical ? 'Height' : 'Width'}`];
  2179. }
  2180. },
  2181. emitChange() {
  2182. this.$nextTick(() => {
  2183. this.$emit('change', this.range ? [this.minValue, this.maxValue] : this.value);
  2184. });
  2185. },
  2186. getStopStyle(position) {
  2187. return this.vertical ? {
  2188. bottom: position + '%'
  2189. } : {
  2190. left: position + '%'
  2191. };
  2192. }
  2193. }
  2194. });
  2195. // CONCATENATED MODULE: ./components/custom-el-slider/index.vue?vue&type=script&lang=js
  2196. /* harmony default export */ var components_custom_el_slidervue_type_script_lang_js = (custom_el_slidervue_type_script_lang_js);
  2197. // CONCATENATED MODULE: ./components/custom-el-slider/index.vue
  2198. /* normalize component */
  2199. var custom_el_slider_component = Object(componentNormalizer["a" /* default */])(
  2200. components_custom_el_slidervue_type_script_lang_js,
  2201. render,
  2202. staticRenderFns,
  2203. false,
  2204. null,
  2205. null,
  2206. "f9778e88"
  2207. )
  2208. /* harmony default export */ var custom_el_slider = __webpack_exports__["default"] = (custom_el_slider_component.exports);
  2209. /***/ })
  2210. };;
  2211. //# sourceMappingURL=custom-el-slider.js.map