1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434 |
- exports.ids = [7,8,9];
- exports.modules = {
- /***/ 147:
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return on; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return off; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return once; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return hasClass; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addClass; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return removeClass; });
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getStyle; });
- /* unused harmony export setStyle */
- /* unused harmony export isScroll */
- /* unused harmony export getScrollContainer */
- /* unused harmony export isInContainer */
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
- /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);
- /* istanbul ignore next */
- const isServer = vue__WEBPACK_IMPORTED_MODULE_0___default.a.prototype.$isServer;
- const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
- const MOZ_HACK_REGEXP = /^moz([A-Z])/;
- const ieVersion = isServer ? 0 : Number(document.documentMode);
- /* istanbul ignore next */
- const trim = function(string) {
- return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
- };
- /* istanbul ignore next */
- const camelCase = function(name) {
- return name.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
- return offset ? letter.toUpperCase() : letter;
- }).replace(MOZ_HACK_REGEXP, 'Moz$1');
- };
- /* istanbul ignore next */
- const on = (function() {
- if (!isServer && document.addEventListener) {
- return function(element, event, handler) {
- if (element && event && handler) {
- element.addEventListener(event, handler, false);
- }
- };
- } else {
- return function(element, event, handler) {
- if (element && event && handler) {
- element.attachEvent('on' + event, handler);
- }
- };
- }
- })();
- /* istanbul ignore next */
- const off = (function() {
- if (!isServer && document.removeEventListener) {
- return function(element, event, handler) {
- if (element && event) {
- element.removeEventListener(event, handler, false);
- }
- };
- } else {
- return function(element, event, handler) {
- if (element && event) {
- element.detachEvent('on' + event, handler);
- }
- };
- }
- })();
- /* istanbul ignore next */
- const once = function(el, event, fn) {
- var listener = function() {
- if (fn) {
- fn.apply(this, arguments);
- }
- off(el, event, listener);
- };
- on(el, event, listener);
- };
- /* istanbul ignore next */
- function hasClass(el, cls) {
- if (!el || !cls) return false;
- if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
- if (el.classList) {
- return el.classList.contains(cls);
- } else {
- return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
- }
- };
- /* istanbul ignore next */
- function addClass(el, cls) {
- if (!el) return;
- var curClass = el.className;
- var classes = (cls || '').split(' ');
- for (var i = 0, j = classes.length; i < j; i++) {
- var clsName = classes[i];
- if (!clsName) continue;
- if (el.classList) {
- el.classList.add(clsName);
- } else if (!hasClass(el, clsName)) {
- curClass += ' ' + clsName;
- }
- }
- if (!el.classList) {
- el.setAttribute('class', curClass);
- }
- };
- /* istanbul ignore next */
- function removeClass(el, cls) {
- if (!el || !cls) return;
- var classes = cls.split(' ');
- var curClass = ' ' + el.className + ' ';
- for (var i = 0, j = classes.length; i < j; i++) {
- var clsName = classes[i];
- if (!clsName) continue;
- if (el.classList) {
- el.classList.remove(clsName);
- } else if (hasClass(el, clsName)) {
- curClass = curClass.replace(' ' + clsName + ' ', ' ');
- }
- }
- if (!el.classList) {
- el.setAttribute('class', trim(curClass));
- }
- };
- /* istanbul ignore next */
- const getStyle = ieVersion < 9 ? function(element, styleName) {
- if (isServer) return;
- if (!element || !styleName) return null;
- styleName = camelCase(styleName);
- if (styleName === 'float') {
- styleName = 'styleFloat';
- }
- try {
- switch (styleName) {
- case 'opacity':
- try {
- return element.filters.item('alpha').opacity / 100;
- } catch (e) {
- return 1.0;
- }
- default:
- return (element.style[styleName] || element.currentStyle ? element.currentStyle[styleName] : null);
- }
- } catch (e) {
- return element.style[styleName];
- }
- } : function(element, styleName) {
- if (isServer) return;
- if (!element || !styleName) return null;
- styleName = camelCase(styleName);
- if (styleName === 'float') {
- styleName = 'cssFloat';
- }
- try {
- var computed = document.defaultView.getComputedStyle(element, '');
- return element.style[styleName] || computed ? computed[styleName] : null;
- } catch (e) {
- return element.style[styleName];
- }
- };
- /* istanbul ignore next */
- function setStyle(element, styleName, value) {
- if (!element || !styleName) return;
- if (typeof styleName === 'object') {
- for (var prop in styleName) {
- if (styleName.hasOwnProperty(prop)) {
- setStyle(element, prop, styleName[prop]);
- }
- }
- } else {
- styleName = camelCase(styleName);
- if (styleName === 'opacity' && ieVersion < 9) {
- element.style.filter = isNaN(value) ? '' : 'alpha(opacity=' + value * 100 + ')';
- } else {
- element.style[styleName] = value;
- }
- }
- };
- const isScroll = (el, vertical) => {
- if (isServer) return;
- const determinedDirection = vertical !== null && vertical !== undefined;
- const overflow = determinedDirection
- ? vertical
- ? getStyle(el, 'overflow-y')
- : getStyle(el, 'overflow-x')
- : getStyle(el, 'overflow');
- return overflow.match(/(scroll|auto|overlay)/);
- };
- const getScrollContainer = (el, vertical) => {
- if (isServer) return;
- let parent = el;
- while (parent) {
- if ([window, document, document.documentElement].includes(parent)) {
- return window;
- }
- if (isScroll(parent, vertical)) {
- return parent;
- }
- parent = parent.parentNode;
- }
- return parent;
- };
- const isInContainer = (el, container) => {
- if (isServer || !el || !container) return false;
- const elRect = el.getBoundingClientRect();
- let containerRect;
- if ([window, document, document.documentElement, null, undefined].includes(container)) {
- containerRect = {
- top: 0,
- right: window.innerWidth,
- bottom: window.innerHeight,
- left: 0
- };
- } else {
- containerRect = container.getBoundingClientRect();
- }
- return elRect.top < containerRect.bottom &&
- elRect.bottom > containerRect.top &&
- elRect.right > containerRect.left &&
- elRect.left < containerRect.right;
- };
- /***/ }),
- /***/ 148:
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // EXPORTS
- __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ isFirefox; });
- __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ kebabCase; });
- __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ rafThrottle; });
- __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ isMac; });
- // UNUSED EXPORTS: noop, hasOwn, toObject, getValueByPath, getPropByPath, generateId, valueEquals, escapeRegexpString, arrayFindIndex, arrayFind, coerceTruthyValueToArray, isIE, isEdge, autoprefixer, capitalize, looseEqual, arrayEquals, isEqual, isEmpty, objToArray
- // EXTERNAL MODULE: external "vue"
- var external_vue_ = __webpack_require__(0);
- var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
- // CONCATENATED MODULE: ./node_modules/element-ui/src/utils/types.js
- function isString(obj) {
- return Object.prototype.toString.call(obj) === '[object String]';
- }
- function isObject(obj) {
- return Object.prototype.toString.call(obj) === '[object Object]';
- }
- function isHtmlElement(node) {
- return node && node.nodeType === Node.ELEMENT_NODE;
- }
- /**
- * - Inspired:
- * https://github.com/jashkenas/underscore/blob/master/modules/isFunction.js
- */
- let isFunction = (functionToCheck) => {
- var getType = {};
- return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
- };
- if ( true && typeof Int8Array !== 'object' && (external_vue_default.a.prototype.$isServer || typeof document.childNodes !== 'function')) {
- isFunction = function(obj) {
- return typeof obj === 'function' || false;
- };
- }
- const isUndefined = (val)=> {
- return val === void 0;
- };
- const isDefined = (val) => {
- return val !== undefined && val !== null;
- };
- // CONCATENATED MODULE: ./node_modules/element-ui/src/utils/util.js
- const util_hasOwnProperty = Object.prototype.hasOwnProperty;
- function noop() {};
- function hasOwn(obj, key) {
- return util_hasOwnProperty.call(obj, key);
- };
- function extend(to, _from) {
- for (let key in _from) {
- to[key] = _from[key];
- }
- return to;
- };
- function toObject(arr) {
- var res = {};
- for (let i = 0; i < arr.length; i++) {
- if (arr[i]) {
- extend(res, arr[i]);
- }
- }
- return res;
- };
- const getValueByPath = function(object, prop) {
- prop = prop || '';
- const paths = prop.split('.');
- let current = object;
- let result = null;
- for (let i = 0, j = paths.length; i < j; i++) {
- const path = paths[i];
- if (!current) break;
- if (i === j - 1) {
- result = current[path];
- break;
- }
- current = current[path];
- }
- return result;
- };
- function getPropByPath(obj, path, strict) {
- let tempObj = obj;
- path = path.replace(/\[(\w+)\]/g, '.$1');
- path = path.replace(/^\./, '');
- let keyArr = path.split('.');
- let i = 0;
- for (let len = keyArr.length; i < len - 1; ++i) {
- if (!tempObj && !strict) break;
- let key = keyArr[i];
- if (key in tempObj) {
- tempObj = tempObj[key];
- } else {
- if (strict) {
- throw new Error('please transfer a valid prop path to form item!');
- }
- break;
- }
- }
- return {
- o: tempObj,
- k: keyArr[i],
- v: tempObj ? tempObj[keyArr[i]] : null
- };
- };
- const generateId = function() {
- return Math.floor(Math.random() * 10000);
- };
- const valueEquals = (a, b) => {
- // see: https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
- if (a === b) return true;
- if (!(a instanceof Array)) return false;
- if (!(b instanceof Array)) return false;
- if (a.length !== b.length) return false;
- for (let i = 0; i !== a.length; ++i) {
- if (a[i] !== b[i]) return false;
- }
- return true;
- };
- const escapeRegexpString = (value = '') => String(value).replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
- // TODO: use native Array.find, Array.findIndex when IE support is dropped
- const arrayFindIndex = function(arr, pred) {
- for (let i = 0; i !== arr.length; ++i) {
- if (pred(arr[i])) {
- return i;
- }
- }
- return -1;
- };
- const arrayFind = function(arr, pred) {
- const idx = arrayFindIndex(arr, pred);
- return idx !== -1 ? arr[idx] : undefined;
- };
- // coerce truthy value to array
- const coerceTruthyValueToArray = function(val) {
- if (Array.isArray(val)) {
- return val;
- } else if (val) {
- return [val];
- } else {
- return [];
- }
- };
- const isIE = function() {
- return !external_vue_default.a.prototype.$isServer && !isNaN(Number(document.documentMode));
- };
- const isEdge = function() {
- return !external_vue_default.a.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
- };
- const isFirefox = function() {
- return !external_vue_default.a.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
- };
- const autoprefixer = function(style) {
- if (typeof style !== 'object') return style;
- const rules = ['transform', 'transition', 'animation'];
- const prefixes = ['ms-', 'webkit-'];
- rules.forEach(rule => {
- const value = style[rule];
- if (rule && value) {
- prefixes.forEach(prefix => {
- style[prefix + rule] = value;
- });
- }
- });
- return style;
- };
- const kebabCase = function(str) {
- const hyphenateRE = /([^-])([A-Z])/g;
- return str
- .replace(hyphenateRE, '$1-$2')
- .replace(hyphenateRE, '$1-$2')
- .toLowerCase();
- };
- const capitalize = function(str) {
- if (!isString(str)) return str;
- return str.charAt(0).toUpperCase() + str.slice(1);
- };
- const looseEqual = function(a, b) {
- const isObjectA = isObject(a);
- const isObjectB = isObject(b);
- if (isObjectA && isObjectB) {
- return JSON.stringify(a) === JSON.stringify(b);
- } else if (!isObjectA && !isObjectB) {
- return String(a) === String(b);
- } else {
- return false;
- }
- };
- const arrayEquals = function(arrayA, arrayB) {
- arrayA = arrayA || [];
- arrayB = arrayB || [];
- if (arrayA.length !== arrayB.length) {
- return false;
- }
- for (let i = 0; i < arrayA.length; i++) {
- if (!looseEqual(arrayA[i], arrayB[i])) {
- return false;
- }
- }
- return true;
- };
- const isEqual = function(value1, value2) {
- if (Array.isArray(value1) && Array.isArray(value2)) {
- return arrayEquals(value1, value2);
- }
- return looseEqual(value1, value2);
- };
- const isEmpty = function(val) {
- // null or undefined
- if (val == null) return true;
- if (typeof val === 'boolean') return false;
- if (typeof val === 'number') return !val;
- if (val instanceof Error) return val.message === '';
- switch (Object.prototype.toString.call(val)) {
- // String or Array
- case '[object String]':
- case '[object Array]':
- return !val.length;
- // Map or Set or File
- case '[object File]':
- case '[object Map]':
- case '[object Set]': {
- return !val.size;
- }
- // Plain Object
- case '[object Object]': {
- return !Object.keys(val).length;
- }
- }
- return false;
- };
- function rafThrottle(fn) {
- let locked = false;
- return function(...args) {
- if (locked) return;
- locked = true;
- window.requestAnimationFrame(_ => {
- fn.apply(this, args);
- locked = false;
- });
- };
- }
- function objToArray(obj) {
- if (Array.isArray(obj)) {
- return obj;
- }
- return isEmpty(obj) ? [] : [obj];
- }
- const isMac = function() {
- return !external_vue_default.a.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent);
- };
- /***/ }),
- /***/ 149:
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- /* harmony default export */ __webpack_exports__["a"] = (function(target) {
- for (let i = 1, j = arguments.length; i < j; i++) {
- let source = arguments[i] || {};
- for (let prop in source) {
- if (source.hasOwnProperty(prop)) {
- let value = source[prop];
- if (value !== undefined) {
- target[prop] = value;
- }
- }
- }
- }
- return target;
- });;
- /***/ }),
- /***/ 158:
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // 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
- var render = function render() {
- var _vm = this,
- _c = _vm._self._c;
- return _c('div', {
- ref: "button",
- staticClass: "el-slider__button-wrapper",
- class: {
- hover: _vm.hovering,
- dragging: _vm.dragging
- },
- style: _vm.wrapperStyle,
- attrs: {
- "tabindex": "0"
- },
- on: {
- "mouseenter": _vm.handleMouseEnter,
- "mouseleave": _vm.handleMouseLeave,
- "mousedown": _vm.onButtonDown,
- "touchstart": _vm.onButtonDown,
- "focus": _vm.handleMouseEnter,
- "blur": _vm.handleMouseLeave,
- "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) return null;
- if ('button' in $event && $event.button !== 0) return null;
- return _vm.onLeftKeyDown.apply(null, arguments);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) return null;
- if ('button' in $event && $event.button !== 2) return null;
- return _vm.onRightKeyDown.apply(null, arguments);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) return null;
- $event.preventDefault();
- return _vm.onLeftKeyDown.apply(null, arguments);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) return null;
- $event.preventDefault();
- return _vm.onRightKeyDown.apply(null, arguments);
- }]
- }
- }, [_c('el-tooltip', {
- ref: "tooltip",
- attrs: {
- "placement": "top",
- "popper-class": _vm.tooltipClass,
- "disabled": !_vm.showTooltip
- }
- }, [_c('span', {
- attrs: {
- "slot": "content"
- },
- slot: "content"
- }, [_vm._v(_vm._s(_vm.formatValue))]), _vm._v(" "), _c('div', {
- staticClass: "el-slider__button",
- class: {
- hover: _vm.hovering,
- dragging: _vm.dragging
- }
- })])], 1);
- };
- var staticRenderFns = [];
- // CONCATENATED MODULE: ./components/custom-el-slider/button.vue?vue&type=template&id=09a28971
- // 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
- // import ElTooltip from 'element-ui/packages/tooltip'
- /* harmony default export */ var buttonvue_type_script_lang_js = ({
- name: 'ElSliderButton',
- components: {
- // ElTooltip,
- },
- props: {
- value: {
- type: Number,
- default: 0
- },
- vertical: {
- type: Boolean,
- default: false
- },
- tooltipClass: String,
- marks: Object
- },
- data() {
- return {
- hovering: false,
- dragging: false,
- isClick: false,
- startX: 0,
- currentX: 0,
- startY: 0,
- currentY: 0,
- startPosition: 0,
- newPosition: null,
- oldValue: this.value
- };
- },
- computed: {
- disabled() {
- return this.$parent.sliderDisabled;
- },
- max() {
- return this.$parent.max;
- },
- min() {
- return this.$parent.min;
- },
- step() {
- return this.$parent.step;
- },
- showTooltip() {
- return this.$parent.showTooltip;
- },
- precision() {
- return this.$parent.precision;
- },
- currentPosition() {
- if (this.marks) {
- // 同父组件index中barSize的计算逻辑. 直接从那边抄过来的. 不要在这里改, 在index改完再抄过来.
- // 注意父组件的 this.firstValue, 这里是 this.value
- const marks = Object.keys(this.marks).map(Number);
- // 找出目标值位于marks的那个档位, 即 即将到达哪一个'档'
- const index = marks.findIndex(i => this.value < i);
- if (index === -1) return '100%';
- // 经过后一个档位之后占总进度条的比例 + (当前值超出后一个档位的差值 / 前一个档位与后一个档位的差值) / (进度被marks划分成的档位数量)
- // 上述公式要除档位数量是因为, 当前值与档位差值占单个档位区间的百分比 !== 单个区间值占总进度条的百分比
- const value = (index - 1) / (marks.length - 1) + (this.value - marks[index - 1]) / (marks[index] - marks[index - 1]) / (marks.length - 1);
- return value > 1 ? '100%' : `${value * 100}%`;
- } else {
- // 这里是原本的逻辑. 没有传marks的.
- return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
- }
- },
- enableFormat() {
- return this.$parent.formatTooltip instanceof Function;
- },
- formatValue() {
- return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
- },
- wrapperStyle() {
- return this.vertical ? {
- bottom: this.currentPosition
- } : {
- left: this.currentPosition
- };
- }
- },
- watch: {
- dragging(val) {
- this.$parent.dragging = val;
- }
- },
- methods: {
- displayTooltip() {
- this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
- },
- hideTooltip() {
- this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
- },
- handleMouseEnter() {
- this.hovering = true;
- this.displayTooltip();
- },
- handleMouseLeave() {
- this.hovering = false;
- this.hideTooltip();
- },
- onButtonDown(event) {
- if (this.disabled) return;
- event.preventDefault();
- this.onDragStart(event);
- window.addEventListener('mousemove', this.onDragging);
- window.addEventListener('touchmove', this.onDragging);
- window.addEventListener('mouseup', this.onDragEnd);
- window.addEventListener('touchend', this.onDragEnd);
- window.addEventListener('contextmenu', this.onDragEnd);
- },
- onLeftKeyDown() {
- if (this.disabled) return;
- this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
- this.setPosition(this.newPosition);
- this.$parent.emitChange();
- },
- onRightKeyDown() {
- if (this.disabled) return;
- this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
- this.setPosition(this.newPosition);
- this.$parent.emitChange();
- },
- onDragStart(event) {
- this.dragging = true;
- this.isClick = true;
- if (event.type === 'touchstart') {
- event.clientY = event.touches[0].clientY;
- event.clientX = event.touches[0].clientX;
- }
- if (this.vertical) {
- this.startY = event.clientY;
- } else {
- this.startX = event.clientX;
- }
- this.startPosition = parseFloat(this.currentPosition);
- this.newPosition = this.startPosition;
- },
- onDragging(event) {
- if (this.dragging) {
- this.isClick = false;
- this.displayTooltip();
- this.$parent.resetSize();
- let diff = 0;
- if (event.type === 'touchmove') {
- event.clientY = event.touches[0].clientY;
- event.clientX = event.touches[0].clientX;
- }
- if (this.vertical) {
- this.currentY = event.clientY;
- diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
- } else {
- this.currentX = event.clientX;
- diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
- }
- this.newPosition = this.startPosition + diff;
- this.setPosition(this.newPosition);
- }
- },
- onDragEnd() {
- if (this.dragging) {
- /*
- * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
- * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
- */
- setTimeout(() => {
- this.dragging = false;
- this.hideTooltip();
- if (!this.isClick) {
- this.setPosition(this.newPosition);
- this.$parent.emitChange();
- }
- }, 0);
- window.removeEventListener('mousemove', this.onDragging);
- window.removeEventListener('touchmove', this.onDragging);
- window.removeEventListener('mouseup', this.onDragEnd);
- window.removeEventListener('touchend', this.onDragEnd);
- window.removeEventListener('contextmenu', this.onDragEnd);
- }
- },
- setPosition(newPosition) {
- if (newPosition === null || isNaN(newPosition)) return;
- if (newPosition < 0) {
- newPosition = 0;
- } else if (newPosition > 100) {
- newPosition = 100;
- }
- const lengthPerStep = 100 / ((this.max - this.min) / this.step);
- const steps = Math.round(newPosition / lengthPerStep);
- let value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
- if (this.marks) {
- // 处理传递marks时的逻辑. 没有传marks的保持原样.
- // 有marks时无视原计算逻辑. 重新赋值
- const marks = Object.keys(this.marks).map((current, index, arr) => {
- return {
- value: Number(current),
- perc: 100 * index / (arr.length - 1)
- };
- });
- // 找出目标值位于marks的那个档位, 即 即将到达哪一个'档'
- if (newPosition === 100) {
- value = marks[marks.length - 1].value;
- } else {
- const index = marks.findIndex(item => item.perc > newPosition);
- // 后一个区间的代表值 + ((区间数量 * 超出后一个区间的百分比值 / 100) * 所处区间的值差)
- if (index === -1) {
- // 在最后一个区间
- 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));
- } else {
- value = marks[index - 1].value + (marks.length - 1) * ((newPosition - marks[index - 1].perc) / 100 * (marks[index].value - marks[index - 1].value));
- }
- }
- }
- value = parseFloat(value.toFixed(this.precision));
- this.$emit('input', value);
- this.$nextTick(() => {
- this.displayTooltip();
- this.$refs.tooltip && this.$refs.tooltip.updatePopper();
- });
- if (!this.dragging && this.value !== this.oldValue) {
- this.oldValue = this.value;
- }
- }
- }
- });
- // CONCATENATED MODULE: ./components/custom-el-slider/button.vue?vue&type=script&lang=js
- /* harmony default export */ var custom_el_slider_buttonvue_type_script_lang_js = (buttonvue_type_script_lang_js);
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
- var componentNormalizer = __webpack_require__(2);
- // CONCATENATED MODULE: ./components/custom-el-slider/button.vue
- /* normalize component */
- var component = Object(componentNormalizer["a" /* default */])(
- custom_el_slider_buttonvue_type_script_lang_js,
- render,
- staticRenderFns,
- false,
- null,
- null,
- "5e8cb690"
-
- )
- /* harmony default export */ var custom_el_slider_button = __webpack_exports__["default"] = (component.exports);
- /***/ }),
- /***/ 159:
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // 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
- var render = function render() {
- var _vm = this,
- _c = _vm._self._c;
- return _c('div', {
- staticClass: "el-slider__marks-text",
- staticStyle: {},
- on: {
- "click": function ($event) {
- $event.stopPropagation();
- return _vm.onMarkClick.apply(null, arguments);
- }
- }
- }, [_vm._ssrNode(_vm._ssrEscape("\n " + _vm._s(_vm.label) + "\n"))]);
- };
- var staticRenderFns = [];
- // CONCATENATED MODULE: ./components/custom-el-slider/marker.vue?vue&type=template&id=2674734e
- // 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
- /* harmony default export */ var markervue_type_script_lang_js = ({
- name: 'ElMarker',
- props: {
- mark: {
- type: [String, Object]
- }
- },
- data() {
- return {
- label: ''
- };
- },
- mounted() {
- this.label = typeof this.mark === 'string' ? this.mark : this.mark.label;
- },
- methods: {
- onMarkClick(e) {
- this.$emit('click');
- }
- }
- });
- // CONCATENATED MODULE: ./components/custom-el-slider/marker.vue?vue&type=script&lang=js
- /* harmony default export */ var custom_el_slider_markervue_type_script_lang_js = (markervue_type_script_lang_js);
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
- var componentNormalizer = __webpack_require__(2);
- // CONCATENATED MODULE: ./components/custom-el-slider/marker.vue
- /* normalize component */
- var component = Object(componentNormalizer["a" /* default */])(
- custom_el_slider_markervue_type_script_lang_js,
- render,
- staticRenderFns,
- false,
- null,
- null,
- "04536480"
-
- )
- /* harmony default export */ var marker = __webpack_exports__["default"] = (component.exports);
- /***/ }),
- /***/ 160:
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
- "use strict";
- // ESM COMPAT FLAG
- __webpack_require__.r(__webpack_exports__);
- // 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
- var render = function render() {
- var _vm = this,
- _c = _vm._self._c;
- return _c('div', {
- staticClass: "el-slider",
- class: {
- 'is-vertical': _vm.vertical,
- 'el-slider--with-input': _vm.showInput
- },
- attrs: {
- "role": "slider",
- "aria-valuemin": _vm.min,
- "aria-valuemax": _vm.max,
- "aria-orientation": _vm.vertical ? 'vertical' : 'horizontal',
- "aria-disabled": _vm.sliderDisabled
- }
- }, [_vm.showInput && !_vm.range ? _c('el-input-number', {
- ref: "input",
- staticClass: "el-slider__input",
- attrs: {
- "step": _vm.step,
- "disabled": _vm.sliderDisabled,
- "controls": _vm.showInputControls,
- "min": _vm.min,
- "max": _vm.max,
- "debounce": _vm.debounce,
- "size": _vm.inputSize
- },
- on: {
- "change": _vm.emitChange
- },
- model: {
- value: _vm.firstValue,
- callback: function ($$v) {
- _vm.firstValue = $$v;
- },
- expression: "firstValue"
- }
- }) : _vm._e(), _vm._ssrNode(" "), _vm._ssrNode("<div" + _vm._ssrClass("el-slider__runway", {
- 'show-input': _vm.showInput,
- disabled: _vm.sliderDisabled
- }) + _vm._ssrStyle(null, _vm.runwayStyle, null) + ">", "</div>", [_vm._ssrNode("<div class=\"el-slider__bar\"" + _vm._ssrStyle(null, _vm.barStyle, null) + "></div> "), _c('slider-button', {
- ref: "button1",
- attrs: {
- "vertical": _vm.vertical,
- "marks": _vm.marks,
- "tooltip-class": _vm.tooltipClass
- },
- model: {
- value: _vm.firstValue,
- callback: function ($$v) {
- _vm.firstValue = $$v;
- },
- expression: "firstValue"
- }
- }), _vm._ssrNode(" "), _vm.range ? _c('slider-button', {
- ref: "button2",
- attrs: {
- "vertical": _vm.vertical,
- "marks": _vm.marks,
- "tooltip-class": _vm.tooltipClass
- },
- model: {
- value: _vm.secondValue,
- callback: function ($$v) {
- _vm.secondValue = $$v;
- },
- expression: "secondValue"
- }
- }) : _vm._e(), _vm._ssrNode(" " + _vm._ssrList(_vm.stops, function (item, key) {
- return "<div class=\"el-slider__stop\"" + _vm._ssrStyle(null, _vm.getStopStyle(item), {
- display: _vm.showStops ? '' : 'none'
- }) + "></div>";
- }) + " "), _vm.markList.length > 0 ? [_vm._ssrNode("<div>" + _vm._ssrList(_vm.markList, function (item, key) {
- return "<div class=\"el-slider__stop el-slider__marks-stop\"" + _vm._ssrStyle(null, _vm.getStopStyle(item.position), null) + "></div>";
- }) + "</div> "), _vm._ssrNode("<div class=\"el-slider__marks\">", "</div>", _vm._l(_vm.markList, function (item, key) {
- return _c('slider-marker', {
- key: key,
- style: _vm.getStopStyle(item.position),
- attrs: {
- "mark": item.mark
- },
- on: {
- "click": function ($event) {
- return _vm.onMarkClick(key);
- }
- }
- });
- }), 1)] : _vm._e()], 2)], 2);
- };
- var staticRenderFns = [];
- // CONCATENATED MODULE: ./components/custom-el-slider/index.vue?vue&type=template&id=69805dd0
- // 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
- var input_numbervue_type_template_id_5655cc82_render = function render() {
- var _vm = this,
- _c = _vm._self._c;
- return _c('div', {
- class: ['el-input-number', _vm.inputNumberSize ? 'el-input-number--' + _vm.inputNumberSize : '', {
- 'is-disabled': _vm.inputNumberDisabled
- }, {
- 'is-without-controls': !_vm.controls
- }, {
- 'is-controls-right': _vm.controlsAtRight
- }],
- on: {
- "dragstart": function ($event) {
- $event.preventDefault();
- }
- }
- }, [_vm.controls ? _c('span', {
- directives: [{
- name: "repeat-click",
- rawName: "v-repeat-click",
- value: _vm.decrease,
- expression: "decrease"
- }],
- staticClass: "el-input-number__decrease",
- class: {
- 'is-disabled': _vm.minDisabled
- },
- attrs: {
- "role": "button"
- },
- on: {
- "keydown": function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
- return _vm.decrease.apply(null, arguments);
- }
- }
- }, [_vm._ssrNode("<i" + _vm._ssrClass(null, `el-icon-${_vm.controlsAtRight ? 'arrow-down' : 'minus'}`) + "></i>")]) : _vm._e(), _vm._ssrNode(" "), _vm.controls ? _c('span', {
- directives: [{
- name: "repeat-click",
- rawName: "v-repeat-click",
- value: _vm.increase,
- expression: "increase"
- }],
- staticClass: "el-input-number__increase",
- class: {
- 'is-disabled': _vm.maxDisabled
- },
- attrs: {
- "role": "button"
- },
- on: {
- "keydown": function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) return null;
- return _vm.increase.apply(null, arguments);
- }
- }
- }, [_vm._ssrNode("<i" + _vm._ssrClass(null, `el-icon-${_vm.controlsAtRight ? 'arrow-up' : 'plus'}`) + "></i>")]) : _vm._e(), _vm._ssrNode(" "), _c('el-input', {
- ref: "input",
- attrs: {
- "value": _vm.displayValue,
- "placeholder": _vm.placeholder,
- "disabled": _vm.inputNumberDisabled,
- "size": _vm.inputNumberSize,
- "max": _vm.max,
- "min": _vm.min,
- "name": _vm.name,
- "label": _vm.label
- },
- on: {
- "blur": _vm.handleBlur,
- "focus": _vm.handleFocus,
- "input": _vm.handleInput,
- "change": _vm.handleInputChange
- },
- nativeOn: {
- "keydown": [function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) return null;
- $event.preventDefault();
- return _vm.increase.apply(null, arguments);
- }, function ($event) {
- if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) return null;
- $event.preventDefault();
- return _vm.decrease.apply(null, arguments);
- }]
- }
- })], 2);
- };
- var input_numbervue_type_template_id_5655cc82_staticRenderFns = [];
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/src/input-number.vue?vue&type=template&id=5655cc82
- // 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
- var inputvue_type_template_id_17e57c08_render = function render() {
- var _vm = this,
- _c = _vm._self._c;
- return _c('div', {
- class: [_vm.type === 'textarea' ? 'el-textarea' : 'el-input', _vm.inputSize ? 'el-input--' + _vm.inputSize : '', {
- 'is-disabled': _vm.inputDisabled,
- 'is-exceed': _vm.inputExceed,
- 'el-input-group': _vm.$slots.prepend || _vm.$slots.append,
- 'el-input-group--append': _vm.$slots.append,
- 'el-input-group--prepend': _vm.$slots.prepend,
- 'el-input--prefix': _vm.$slots.prefix || _vm.prefixIcon,
- 'el-input--suffix': _vm.$slots.suffix || _vm.suffixIcon || _vm.clearable || _vm.showPassword
- }],
- on: {
- "mouseenter": function ($event) {
- _vm.hovering = true;
- },
- "mouseleave": function ($event) {
- _vm.hovering = false;
- }
- }
- }, [_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);
- };
- var inputvue_type_template_id_17e57c08_staticRenderFns = [];
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/input.vue?vue&type=template&id=17e57c08
- // CONCATENATED MODULE: ./node_modules/element-ui/src/mixins/emitter.js
- function broadcast(componentName, eventName, params) {
- this.$children.forEach(child => {
- var name = child.$options.componentName;
- if (name === componentName) {
- child.$emit.apply(child, [eventName].concat(params));
- } else {
- broadcast.apply(child, [componentName, eventName].concat([params]));
- }
- });
- }
- /* harmony default export */ var emitter = ({
- methods: {
- dispatch(componentName, eventName, params) {
- var parent = this.$parent || this.$root;
- var name = parent.$options.componentName;
- while (parent && (!name || name !== componentName)) {
- parent = parent.$parent;
- if (parent) {
- name = parent.$options.componentName;
- }
- }
- if (parent) {
- parent.$emit.apply(parent, [eventName].concat(params));
- }
- },
- broadcast(componentName, eventName, params) {
- broadcast.call(this, componentName, eventName, params);
- }
- }
- });
- // EXTERNAL MODULE: ./node_modules/element-ui/src/utils/util.js + 1 modules
- var util = __webpack_require__(148);
- // CONCATENATED MODULE: ./node_modules/element-ui/src/mixins/migrating.js
- /**
- * Show migrating guide in browser console.
- *
- * Usage:
- * import Migrating from 'element-ui/src/mixins/migrating';
- *
- * mixins: [Migrating]
- *
- * add getMigratingConfig method for your component.
- * getMigratingConfig() {
- * return {
- * props: {
- * 'allow-no-selection': 'allow-no-selection is removed.',
- * 'selection-mode': 'selection-mode is removed.'
- * },
- * events: {
- * selectionchange: 'selectionchange is renamed to selection-change.'
- * }
- * };
- * },
- */
- /* harmony default export */ var migrating = ({
- mounted() {
- if (true) return;
- if (!this.$vnode) return;
- const { props = {}, events = {} } = this.getMigratingConfig();
- const { data, componentOptions } = this.$vnode;
- const definedProps = data.attrs || {};
- const definedEvents = componentOptions.listeners || {};
- for (let propName in definedProps) {
- propName = Object(util["c" /* kebabCase */])(propName); // compatible with camel case
- if (props[propName]) {
- console.warn(`[Element Migrating][${this.$options.name}][Attribute]: ${props[propName]}`);
- }
- }
- for (let eventName in definedEvents) {
- eventName = Object(util["c" /* kebabCase */])(eventName); // compatible with camel case
- if (events[eventName]) {
- console.warn(`[Element Migrating][${this.$options.name}][Event]: ${events[eventName]}`);
- }
- }
- },
- methods: {
- getMigratingConfig() {
- return {
- props: {},
- events: {}
- };
- }
- }
- });
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/calcTextareaHeight.js
- let hiddenTextarea;
- const HIDDEN_STYLE = `
- height:0 !important;
- visibility:hidden !important;
- overflow:hidden !important;
- position:absolute !important;
- z-index:-1000 !important;
- top:0 !important;
- right:0 !important
- `;
- const CONTEXT_STYLE = [
- 'letter-spacing',
- 'line-height',
- 'padding-top',
- 'padding-bottom',
- 'font-family',
- 'font-weight',
- 'font-size',
- 'text-rendering',
- 'text-transform',
- 'width',
- 'text-indent',
- 'padding-left',
- 'padding-right',
- 'border-width',
- 'box-sizing'
- ];
- function calculateNodeStyling(targetElement) {
- const style = window.getComputedStyle(targetElement);
- const boxSizing = style.getPropertyValue('box-sizing');
- const paddingSize = (
- parseFloat(style.getPropertyValue('padding-bottom')) +
- parseFloat(style.getPropertyValue('padding-top'))
- );
- const borderSize = (
- parseFloat(style.getPropertyValue('border-bottom-width')) +
- parseFloat(style.getPropertyValue('border-top-width'))
- );
- const contextStyle = CONTEXT_STYLE
- .map(name => `${name}:${style.getPropertyValue(name)}`)
- .join(';');
- return { contextStyle, paddingSize, borderSize, boxSizing };
- }
- function calcTextareaHeight(
- targetElement,
- minRows = 1,
- maxRows = null
- ) {
- if (!hiddenTextarea) {
- hiddenTextarea = document.createElement('textarea');
- document.body.appendChild(hiddenTextarea);
- }
- let {
- paddingSize,
- borderSize,
- boxSizing,
- contextStyle
- } = calculateNodeStyling(targetElement);
- hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`);
- hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
- let height = hiddenTextarea.scrollHeight;
- const result = {};
- if (boxSizing === 'border-box') {
- height = height + borderSize;
- } else if (boxSizing === 'content-box') {
- height = height - paddingSize;
- }
- hiddenTextarea.value = '';
- let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
- if (minRows !== null) {
- let minHeight = singleRowHeight * minRows;
- if (boxSizing === 'border-box') {
- minHeight = minHeight + paddingSize + borderSize;
- }
- height = Math.max(minHeight, height);
- result.minHeight = `${ minHeight }px`;
- }
- if (maxRows !== null) {
- let maxHeight = singleRowHeight * maxRows;
- if (boxSizing === 'border-box') {
- maxHeight = maxHeight + paddingSize + borderSize;
- }
- height = Math.min(maxHeight, height);
- }
- result.height = `${ height }px`;
- hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
- hiddenTextarea = null;
- return result;
- };
- // EXTERNAL MODULE: ./node_modules/element-ui/src/utils/merge.js
- var merge = __webpack_require__(149);
- // CONCATENATED MODULE: ./node_modules/element-ui/src/utils/shared.js
- function isDef(val) {
- return val !== undefined && val !== null;
- }
- function isKorean(text) {
- const reg = /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;
- return reg.test(text);
- }
- // 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
- /* harmony default export */ var inputvue_type_script_lang_js = ({
- name: 'ElInput',
- componentName: 'ElInput',
- mixins: [emitter, migrating],
- inheritAttrs: false,
- inject: {
- elForm: {
- default: ''
- },
- elFormItem: {
- default: ''
- }
- },
- data() {
- return {
- textareaCalcStyle: {},
- hovering: false,
- focused: false,
- isComposing: false,
- passwordVisible: false
- };
- },
- props: {
- value: [String, Number],
- size: String,
- resize: String,
- form: String,
- disabled: Boolean,
- readonly: Boolean,
- type: {
- type: String,
- default: 'text'
- },
- autosize: {
- type: [Boolean, Object],
- default: false
- },
- autocomplete: {
- type: String,
- default: 'off'
- },
- /** @Deprecated in next major version */
- autoComplete: {
- type: String,
- validator(val) {
- false && false;
- return true;
- }
- },
- validateEvent: {
- type: Boolean,
- default: true
- },
- suffixIcon: String,
- prefixIcon: String,
- label: String,
- clearable: {
- type: Boolean,
- default: false
- },
- showPassword: {
- type: Boolean,
- default: false
- },
- showWordLimit: {
- type: Boolean,
- default: false
- },
- tabindex: String
- },
- computed: {
- _elFormItemSize() {
- return (this.elFormItem || {}).elFormItemSize;
- },
- validateState() {
- return this.elFormItem ? this.elFormItem.validateState : '';
- },
- needStatusIcon() {
- return this.elForm ? this.elForm.statusIcon : false;
- },
- validateIcon() {
- return {
- validating: 'el-icon-loading',
- success: 'el-icon-circle-check',
- error: 'el-icon-circle-close'
- }[this.validateState];
- },
- textareaStyle() {
- return Object(merge["a" /* default */])({}, this.textareaCalcStyle, {
- resize: this.resize
- });
- },
- inputSize() {
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
- },
- inputDisabled() {
- return this.disabled || (this.elForm || {}).disabled;
- },
- nativeInputValue() {
- return this.value === null || this.value === undefined ? '' : String(this.value);
- },
- showClear() {
- return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
- },
- showPwdVisible() {
- return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
- },
- isWordLimitVisible() {
- return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
- },
- upperLimit() {
- return this.$attrs.maxlength;
- },
- textLength() {
- if (typeof this.value === 'number') {
- return String(this.value).length;
- }
- return (this.value || '').length;
- },
- inputExceed() {
- // show exceed style if length of initial value greater then maxlength
- return this.isWordLimitVisible && this.textLength > this.upperLimit;
- }
- },
- watch: {
- value(val) {
- this.$nextTick(this.resizeTextarea);
- if (this.validateEvent) {
- this.dispatch('ElFormItem', 'el.form.change', [val]);
- }
- },
- // native input value is set explicitly
- // do not use v-model / :value in template
- // see: https://github.com/ElemeFE/element/issues/14521
- nativeInputValue() {
- this.setNativeInputValue();
- },
- // when change between <input> and <textarea>,
- // update DOM dependent value and styles
- // https://github.com/ElemeFE/element/issues/14857
- type() {
- this.$nextTick(() => {
- this.setNativeInputValue();
- this.resizeTextarea();
- this.updateIconOffset();
- });
- }
- },
- methods: {
- focus() {
- this.getInput().focus();
- },
- blur() {
- this.getInput().blur();
- },
- getMigratingConfig() {
- return {
- props: {
- 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
- 'on-icon-click': 'on-icon-click is removed.'
- },
- events: {
- 'click': 'click is removed.'
- }
- };
- },
- handleBlur(event) {
- this.focused = false;
- this.$emit('blur', event);
- if (this.validateEvent) {
- this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
- }
- },
- select() {
- this.getInput().select();
- },
- resizeTextarea() {
- if (this.$isServer) return;
- const {
- autosize,
- type
- } = this;
- if (type !== 'textarea') return;
- if (!autosize) {
- this.textareaCalcStyle = {
- minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
- };
- return;
- }
- const minRows = autosize.minRows;
- const maxRows = autosize.maxRows;
- this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
- },
- setNativeInputValue() {
- const input = this.getInput();
- if (!input) return;
- if (input.value === this.nativeInputValue) return;
- input.value = this.nativeInputValue;
- },
- handleFocus(event) {
- this.focused = true;
- this.$emit('focus', event);
- },
- handleCompositionStart(event) {
- this.$emit('compositionstart', event);
- this.isComposing = true;
- },
- handleCompositionUpdate(event) {
- this.$emit('compositionupdate', event);
- const text = event.target.value;
- const lastCharacter = text[text.length - 1] || '';
- this.isComposing = !isKorean(lastCharacter);
- },
- handleCompositionEnd(event) {
- this.$emit('compositionend', event);
- if (this.isComposing) {
- this.isComposing = false;
- this.handleInput(event);
- }
- },
- handleInput(event) {
- // should not emit input during composition
- // see: https://github.com/ElemeFE/element/issues/10516
- if (this.isComposing) return;
- // hack for https://github.com/ElemeFE/element/issues/8548
- // should remove the following line when we don't support IE
- if (event.target.value === this.nativeInputValue) return;
- this.$emit('input', event.target.value);
- // ensure native input value is controlled
- // see: https://github.com/ElemeFE/element/issues/12850
- this.$nextTick(this.setNativeInputValue);
- },
- handleChange(event) {
- this.$emit('change', event.target.value);
- },
- calcIconOffset(place) {
- let elList = [].slice.call(this.$el.querySelectorAll(`.el-input__${place}`) || []);
- if (!elList.length) return;
- let el = null;
- for (let i = 0; i < elList.length; i++) {
- if (elList[i].parentNode === this.$el) {
- el = elList[i];
- break;
- }
- }
- if (!el) return;
- const pendantMap = {
- suffix: 'append',
- prefix: 'prepend'
- };
- const pendant = pendantMap[place];
- if (this.$slots[pendant]) {
- el.style.transform = `translateX(${place === 'suffix' ? '-' : ''}${this.$el.querySelector(`.el-input-group__${pendant}`).offsetWidth}px)`;
- } else {
- el.removeAttribute('style');
- }
- },
- updateIconOffset() {
- this.calcIconOffset('prefix');
- this.calcIconOffset('suffix');
- },
- clear() {
- this.$emit('input', '');
- this.$emit('change', '');
- this.$emit('clear');
- },
- handlePasswordVisible() {
- this.passwordVisible = !this.passwordVisible;
- this.$nextTick(() => {
- this.focus();
- });
- },
- getInput() {
- return this.$refs.input || this.$refs.textarea;
- },
- getSuffixVisible() {
- return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
- }
- },
- created() {
- this.$on('inputSelect', this.select);
- },
- mounted() {
- this.setNativeInputValue();
- this.resizeTextarea();
- this.updateIconOffset();
- },
- updated() {
- this.$nextTick(this.updateIconOffset);
- }
- });
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/input.vue?vue&type=script&lang=js
- /* harmony default export */ var src_inputvue_type_script_lang_js = (inputvue_type_script_lang_js);
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
- var componentNormalizer = __webpack_require__(2);
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/src/input.vue
- /* normalize component */
- var component = Object(componentNormalizer["a" /* default */])(
- src_inputvue_type_script_lang_js,
- inputvue_type_template_id_17e57c08_render,
- inputvue_type_template_id_17e57c08_staticRenderFns,
- false,
- null,
- null,
- "915bbf50"
-
- )
- /* harmony default export */ var input = (component.exports);
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input/index.js
- /* istanbul ignore next */
- input.install = function(Vue) {
- Vue.component(input.name, input);
- };
- /* harmony default export */ var packages_input = (input);
- // CONCATENATED MODULE: ./node_modules/element-ui/src/mixins/focus.js
- /* harmony default export */ var mixins_focus = (function(ref) {
- return {
- methods: {
- focus() {
- this.$refs[ref].focus();
- }
- }
- };
- });;
- // EXTERNAL MODULE: ./node_modules/element-ui/src/utils/dom.js
- var dom = __webpack_require__(147);
- // CONCATENATED MODULE: ./node_modules/element-ui/src/directives/repeat-click.js
- /* harmony default export */ var repeat_click = ({
- bind(el, binding, vnode) {
- let interval = null;
- let startTime;
- const maxIntervals = Object(util["b" /* isMac */])() ? 100 : 200;
- const handler = () => vnode.context[binding.expression].apply();
- const clear = () => {
- if (Date.now() - startTime < maxIntervals) {
- handler();
- }
- clearInterval(interval);
- interval = null;
- };
- Object(dom["e" /* on */])(el, 'mousedown', (e) => {
- if (e.button !== 0) return;
- startTime = Date.now();
- Object(dom["f" /* once */])(document, 'mouseup', clear);
- clearInterval(interval);
- interval = setInterval(handler, maxIntervals);
- });
- }
- });
- // 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
- /* harmony default export */ var input_numbervue_type_script_lang_js = ({
- name: 'ElInputNumber',
- mixins: [mixins_focus('input')],
- inject: {
- elForm: {
- default: ''
- },
- elFormItem: {
- default: ''
- }
- },
- directives: {
- repeatClick: repeat_click
- },
- components: {
- ElInput: packages_input
- },
- props: {
- step: {
- type: Number,
- default: 1
- },
- stepStrictly: {
- type: Boolean,
- default: false
- },
- max: {
- type: Number,
- default: Infinity
- },
- min: {
- type: Number,
- default: -Infinity
- },
- value: {},
- disabled: Boolean,
- size: String,
- controls: {
- type: Boolean,
- default: true
- },
- controlsPosition: {
- type: String,
- default: ''
- },
- name: String,
- label: String,
- placeholder: String,
- precision: {
- type: Number,
- validator(val) {
- return val >= 0 && val === parseInt(val, 10);
- }
- }
- },
- data() {
- return {
- currentValue: 0,
- userInput: null
- };
- },
- watch: {
- value: {
- immediate: true,
- handler(value) {
- let newVal = value === undefined ? value : Number(value);
- if (newVal !== undefined) {
- if (isNaN(newVal)) {
- return;
- }
- if (this.stepStrictly) {
- const stepPrecision = this.getPrecision(this.step);
- const precisionFactor = Math.pow(10, stepPrecision);
- newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
- }
- if (this.precision !== undefined) {
- newVal = this.toPrecision(newVal, this.precision);
- }
- }
- if (newVal >= this.max) newVal = this.max;
- if (newVal <= this.min) newVal = this.min;
- this.currentValue = newVal;
- this.userInput = null;
- this.$emit('input', newVal);
- }
- }
- },
- computed: {
- minDisabled() {
- return this._decrease(this.value, this.step) < this.min;
- },
- maxDisabled() {
- return this._increase(this.value, this.step) > this.max;
- },
- numPrecision() {
- const {
- value,
- step,
- getPrecision,
- precision
- } = this;
- const stepPrecision = getPrecision(step);
- if (precision !== undefined) {
- if (stepPrecision > precision) {
- console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
- }
- return precision;
- } else {
- return Math.max(getPrecision(value), stepPrecision);
- }
- },
- controlsAtRight() {
- return this.controls && this.controlsPosition === 'right';
- },
- _elFormItemSize() {
- return (this.elFormItem || {}).elFormItemSize;
- },
- inputNumberSize() {
- return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
- },
- inputNumberDisabled() {
- return this.disabled || !!(this.elForm || {}).disabled;
- },
- displayValue() {
- if (this.userInput !== null) {
- return this.userInput;
- }
- let currentValue = this.currentValue;
- if (typeof currentValue === 'number') {
- if (this.stepStrictly) {
- const stepPrecision = this.getPrecision(this.step);
- const precisionFactor = Math.pow(10, stepPrecision);
- currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
- }
- if (this.precision !== undefined) {
- currentValue = currentValue.toFixed(this.precision);
- }
- }
- return currentValue;
- }
- },
- methods: {
- toPrecision(num, precision) {
- if (precision === undefined) precision = this.numPrecision;
- return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
- },
- getPrecision(value) {
- if (value === undefined) return 0;
- const valueString = value.toString();
- const dotPosition = valueString.indexOf('.');
- let precision = 0;
- if (dotPosition !== -1) {
- precision = valueString.length - dotPosition - 1;
- }
- return precision;
- },
- _increase(val, step) {
- if (typeof val !== 'number' && val !== undefined) return this.currentValue;
- const precisionFactor = Math.pow(10, this.numPrecision);
- // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
- return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
- },
- _decrease(val, step) {
- if (typeof val !== 'number' && val !== undefined) return this.currentValue;
- const precisionFactor = Math.pow(10, this.numPrecision);
- return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
- },
- increase() {
- if (this.inputNumberDisabled || this.maxDisabled) return;
- const value = this.value || 0;
- const newVal = this._increase(value, this.step);
- this.setCurrentValue(newVal);
- },
- decrease() {
- if (this.inputNumberDisabled || this.minDisabled) return;
- const value = this.value || 0;
- const newVal = this._decrease(value, this.step);
- this.setCurrentValue(newVal);
- },
- handleBlur(event) {
- this.$emit('blur', event);
- },
- handleFocus(event) {
- this.$emit('focus', event);
- },
- setCurrentValue(newVal) {
- const oldVal = this.currentValue;
- if (typeof newVal === 'number' && this.precision !== undefined) {
- newVal = this.toPrecision(newVal, this.precision);
- }
- if (newVal >= this.max) newVal = this.max;
- if (newVal <= this.min) newVal = this.min;
- if (oldVal === newVal) return;
- this.userInput = null;
- this.$emit('input', newVal);
- this.$emit('change', newVal, oldVal);
- this.currentValue = newVal;
- },
- handleInput(value) {
- this.userInput = value;
- },
- handleInputChange(value) {
- const newVal = value === '' ? undefined : Number(value);
- if (!isNaN(newVal) || value === '') {
- this.setCurrentValue(newVal);
- }
- this.userInput = null;
- },
- select() {
- this.$refs.input.select();
- }
- },
- mounted() {
- let innerInput = this.$refs.input.$refs.input;
- innerInput.setAttribute('role', 'spinbutton');
- innerInput.setAttribute('aria-valuemax', this.max);
- innerInput.setAttribute('aria-valuemin', this.min);
- innerInput.setAttribute('aria-valuenow', this.currentValue);
- innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
- },
- updated() {
- if (!this.$refs || !this.$refs.input) return;
- const innerInput = this.$refs.input.$refs.input;
- innerInput.setAttribute('aria-valuenow', this.currentValue);
- }
- });
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/src/input-number.vue?vue&type=script&lang=js
- /* harmony default export */ var src_input_numbervue_type_script_lang_js = (input_numbervue_type_script_lang_js);
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/src/input-number.vue
- /* normalize component */
- var input_number_component = Object(componentNormalizer["a" /* default */])(
- src_input_numbervue_type_script_lang_js,
- input_numbervue_type_template_id_5655cc82_render,
- input_numbervue_type_template_id_5655cc82_staticRenderFns,
- false,
- null,
- null,
- "55db5810"
-
- )
- /* harmony default export */ var input_number = (input_number_component.exports);
- // CONCATENATED MODULE: ./node_modules/element-ui/packages/input-number/index.js
- /* istanbul ignore next */
- input_number.install = function(Vue) {
- Vue.component(input_number.name, input_number);
- };
- /* harmony default export */ var packages_input_number = (input_number);
- // EXTERNAL MODULE: ./components/custom-el-slider/button.vue + 4 modules
- var custom_el_slider_button = __webpack_require__(158);
- // EXTERNAL MODULE: ./components/custom-el-slider/marker.vue + 4 modules
- var marker = __webpack_require__(159);
- // 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
- /* harmony default export */ var custom_el_slidervue_type_script_lang_js = ({
- name: 'ElSlider',
- components: {
- ElInputNumber: packages_input_number,
- SliderButton: custom_el_slider_button["default"],
- SliderMarker: marker["default"]
- },
- mixins: [emitter],
- inject: {
- elForm: {
- default: ''
- }
- },
- props: {
- min: {
- type: Number,
- default: 0
- },
- max: {
- type: Number,
- default: 100
- },
- step: {
- type: Number,
- default: 1
- },
- value: {
- // string 是数据框被清空时的值. 理论上不会出现, 这里只是用来规避控制台报错
- type: [Number, Array, String],
- default: 0
- },
- showInput: {
- type: Boolean,
- default: false
- },
- showInputControls: {
- type: Boolean,
- default: true
- },
- inputSize: {
- type: String,
- default: 'small'
- },
- showStops: {
- type: Boolean,
- default: false
- },
- showTooltip: {
- type: Boolean,
- default: true
- },
- formatTooltip: Function,
- disabled: {
- type: Boolean,
- default: false
- },
- range: {
- type: Boolean,
- default: false
- },
- vertical: {
- type: Boolean,
- default: false
- },
- height: {
- type: String
- },
- debounce: {
- type: Number,
- default: 300
- },
- label: {
- type: String
- },
- tooltipClass: String,
- marks: Object
- },
- data() {
- return {
- firstValue: null,
- secondValue: null,
- oldValue: null,
- dragging: false,
- sliderSize: 1
- };
- },
- computed: {
- stops() {
- if (!this.showStops || this.min > this.max) return [];
- if (this.step === 0) {
- false && false;
- return [];
- }
- const stopCount = (this.max - this.min) / this.step;
- const stepWidth = 100 * this.step / (this.max - this.min);
- const result = [];
- for (let i = 1; i < stopCount; i++) {
- result.push(i * stepWidth);
- }
- if (this.range) {
- return result.filter(step => {
- return step < 100 * (this.minValue - this.min) / (this.max - this.min) || step > 100 * (this.maxValue - this.min) / (this.max - this.min);
- });
- } else {
- return result.filter(step => step > 100 * (this.firstValue - this.min) / (this.max - this.min));
- }
- },
- markList() {
- if (!this.marks) {
- return [];
- }
- const marksKeys = Object.keys(this.marks);
- return marksKeys.map(parseFloat).sort((a, b) => a - b).filter(point => point <= this.max && point >= this.min).map((point, index) => ({
- point,
- // 改造使得mark在滑动区域内均分
- position: 100 * index * (this.max - this.min) / (marksKeys.length - 1) / (this.max - this.min),
- // position: ((point - this.min) * 100) / (this.max - this.min),
- mark: this.marks[point]
- }));
- },
- minValue() {
- return Math.min(this.firstValue, this.secondValue);
- },
- maxValue() {
- return Math.max(this.firstValue, this.secondValue);
- },
- barSize() {
- if (this.marks) {
- const marks = Object.keys(this.marks).map(Number);
- // 找出目标值位于marks的那个档位, 即 即将到达哪一个'档'
- const index = marks.findIndex(i => this.firstValue < i);
- // console.log(index, 'index')
- if (this.range) {
- // todo 范围值的计算. 这个还没改. 不知道怎么算.
- return `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%`;
- }
- if (index === -1) return '100%';
- // 经过后一个档位之后占总进度条的比例 + (当前值超出后一个档位的差值 / 前一个档位与后一个档位的差值) / (进度被marks划分成的档位数量)
- // 上述公式要除档位数量是因为, 当前值与档位差值占单个档位区间的百分比 !== 单个区间值占总进度条的百分比
- const value = (index - 1) / (marks.length - 1) + (this.firstValue - marks[index - 1]) / (marks[index] - marks[index - 1]) / (marks.length - 1);
- // console.log('value', value)
- return value > 1 ? '100%' : `${value * 100}%`;
- } else {
- return this.range ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.firstValue - this.min) / (this.max - this.min)}%`;
- }
- },
- barStart() {
- return this.range ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : '0%';
- },
- precision() {
- const precisions = [this.min, this.max, this.step].map(item => {
- const decimal = ('' + item).split('.')[1];
- return decimal ? decimal.length : 0;
- });
- return Math.max.apply(null, precisions);
- },
- runwayStyle() {
- return this.vertical ? {
- height: this.height
- } : {};
- },
- barStyle() {
- return this.vertical ? {
- height: this.barSize,
- bottom: this.barStart
- } : {
- width: this.barSize,
- left: this.barStart
- };
- },
- sliderDisabled() {
- return this.disabled || (this.elForm || {}).disabled;
- }
- },
- watch: {
- value(val, oldVal) {
- if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every((item, index) => item === oldVal[index])) {
- return;
- }
- this.setValues();
- },
- dragging(val) {
- if (!val) {
- this.setValues();
- }
- },
- firstValue(val) {
- if (this.range) {
- this.$emit('input', [this.minValue, this.maxValue]);
- } else {
- this.$emit('input', val);
- }
- },
- secondValue() {
- if (this.range) {
- this.$emit('input', [this.minValue, this.maxValue]);
- }
- },
- min() {
- this.setValues();
- },
- max() {
- this.setValues();
- }
- },
- mounted() {
- let valuetext;
- if (this.range) {
- if (Array.isArray(this.value)) {
- this.firstValue = Math.max(this.min, this.value[0]);
- this.secondValue = Math.min(this.max, this.value[1]);
- } else {
- this.firstValue = this.min;
- this.secondValue = this.max;
- }
- this.oldValue = [this.firstValue, this.secondValue];
- valuetext = `${this.firstValue}-${this.secondValue}`;
- } else {
- if (typeof this.value !== 'number' || isNaN(this.value)) {
- this.firstValue = this.min;
- } else {
- this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
- }
- this.oldValue = this.firstValue;
- valuetext = this.firstValue;
- }
- this.$el.setAttribute('aria-valuetext', valuetext);
- // label screen reader
- this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${this.min} and ${this.max}`);
- this.resetSize();
- window.addEventListener('resize', this.resetSize);
- },
- beforeDestroy() {
- window.removeEventListener('resize', this.resetSize);
- },
- methods: {
- valueChanged() {
- if (this.range) {
- return ![this.minValue, this.maxValue].every((item, index) => item === this.oldValue[index]);
- } else {
- return this.value !== this.oldValue;
- }
- },
- setValues() {
- if (this.min > this.max) {
- console.error('[Element Error][Slider]min should not be greater than max.');
- return;
- }
- const val = this.value;
- if (this.range && Array.isArray(val)) {
- if (val[1] < this.min) {
- this.$emit('input', [this.min, this.min]);
- } else if (val[0] > this.max) {
- this.$emit('input', [this.max, this.max]);
- } else if (val[0] < this.min) {
- this.$emit('input', [this.min, val[1]]);
- } else if (val[1] > this.max) {
- this.$emit('input', [val[0], this.max]);
- } else {
- this.firstValue = val[0];
- this.secondValue = val[1];
- if (this.valueChanged()) {
- this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
- this.oldValue = val.slice();
- }
- }
- } else if (!this.range && typeof val === 'number' && !isNaN(val)) {
- if (val < this.min) {
- this.$emit('input', this.min);
- } else if (val > this.max) {
- this.$emit('input', this.max);
- } else {
- this.firstValue = val;
- if (this.valueChanged()) {
- this.dispatch('ElFormItem', 'el.form.change', val);
- this.oldValue = val;
- }
- }
- }
- },
- setPosition(percent) {
- const targetValue = this.min + percent * (this.max - this.min) / 100;
- if (!this.range) {
- this.$refs.button1.setPosition(percent);
- return;
- }
- let button;
- if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
- button = this.firstValue < this.secondValue ? 'button1' : 'button2';
- } else {
- button = this.firstValue > this.secondValue ? 'button1' : 'button2';
- }
- this.$refs[button].setPosition(percent);
- },
- onSliderClick(event) {
- if (this.sliderDisabled || this.dragging) return;
- this.resetSize();
- if (this.vertical) {
- const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
- this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
- } else {
- const sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
- this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
- }
- this.emitChange();
- },
- onMarkClick(index) {
- if (typeof index !== 'number') return;
- // 这个判断和resetSize从onSliderClick抄过来的.
- // 因为直接点击mark的 标志文案 得到的不是准确的数(宽度导致的位置不同), 所以魔改了一下, 点击mark按固定比例算.
- if (this.sliderDisabled || this.dragging) return;
- this.resetSize();
- const marks = Object.keys(this.marks).map(Number);
- // 计算当前点击位于marks的第几项, 算百分比
- this.setPosition(100 * index / (marks.length - 1));
- this.emitChange();
- },
- resetSize() {
- if (this.$refs.slider) {
- this.sliderSize = this.$refs.slider[`client${this.vertical ? 'Height' : 'Width'}`];
- }
- },
- emitChange() {
- this.$nextTick(() => {
- this.$emit('change', this.range ? [this.minValue, this.maxValue] : this.value);
- });
- },
- getStopStyle(position) {
- return this.vertical ? {
- bottom: position + '%'
- } : {
- left: position + '%'
- };
- }
- }
- });
- // CONCATENATED MODULE: ./components/custom-el-slider/index.vue?vue&type=script&lang=js
- /* harmony default export */ var components_custom_el_slidervue_type_script_lang_js = (custom_el_slidervue_type_script_lang_js);
- // CONCATENATED MODULE: ./components/custom-el-slider/index.vue
- /* normalize component */
- var custom_el_slider_component = Object(componentNormalizer["a" /* default */])(
- components_custom_el_slidervue_type_script_lang_js,
- render,
- staticRenderFns,
- false,
- null,
- null,
- "f9778e88"
-
- )
- /* harmony default export */ var custom_el_slider = __webpack_exports__["default"] = (custom_el_slider_component.exports);
- /***/ })
- };;
- //# sourceMappingURL=custom-el-slider.js.map
|