Skip to content

Commit 3417e8c

Browse files
committedJul 13, 2022
chore: run lint and run build
1 parent 3408265 commit 3417e8c

File tree

4 files changed

+80
-67
lines changed

4 files changed

+80
-67
lines changed
 

‎rollup.config.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
// rollup.config.js
2-
import image from "@rollup/plugin-image";
3-
import vue from "rollup-plugin-vue";
4-
import buble from "@rollup/plugin-buble";
5-
import commonjs from "@rollup/plugin-commonjs";
6-
import replace from "@rollup/plugin-replace";
7-
import uglify from "rollup-plugin-uglify-es";
8-
import minimist from "minimist";
9-
import alias from "@rollup/plugin-alias";
10-
import resolve from "@rollup/plugin-node-resolve";
11-
import url from "@rollup/plugin-url";
2+
import image from '@rollup/plugin-image';
3+
import vue from 'rollup-plugin-vue';
4+
import buble from '@rollup/plugin-buble';
5+
import commonjs from '@rollup/plugin-commonjs';
6+
import replace from '@rollup/plugin-replace';
7+
import uglify from 'rollup-plugin-uglify-es';
8+
import minimist from 'minimist';
9+
import alias from '@rollup/plugin-alias';
10+
import resolve from '@rollup/plugin-node-resolve';
11+
import url from '@rollup/plugin-url';
1212

1313
// eslint-disable-next-line no-undef
1414
const argv = minimist(process.argv.slice(2));
1515

1616
const config = {
17-
input: "./src/wrapper.js",
17+
input: './src/wrapper.js',
1818
output: {
19-
name: "MEWComponent",
20-
exports: "named",
19+
name: 'MEWComponent',
20+
exports: 'named',
2121
},
2222
// external: ['@/components/Blockie/Blockie.vue'],
2323
plugins: [
2424
alias({
25-
resolve: [".js", ".vue", ".css", ".scss", "mdx"],
25+
resolve: ['.js', '.vue', '.css', '.scss', 'mdx'],
2626
entries: [
2727
{
28-
find: "@",
29-
replacement: "./src",
28+
find: '@',
29+
replacement: './src',
3030
},
3131
],
3232
}),
3333
replace({
34-
"process.env.NODE_ENV": JSON.stringify("production"),
34+
'process.env.NODE_ENV': JSON.stringify('production'),
3535
}),
3636
commonjs(),
3737
vue({
@@ -48,7 +48,7 @@ const config = {
4848
image(),
4949
url({
5050
// by default, rollup-plugin-url will not handle font files
51-
include: ["**/*.eot", "**/*.svg", "**/*.ttf", "**/*.woff", "**/*.woff2"],
51+
include: ['**/*.eot', '**/*.svg', '**/*.ttf', '**/*.woff', '**/*.woff2'],
5252
// setting infinite limit will ensure that the files
5353
// are always bundled with the code, not copied to /dist
5454
limit: Infinity,
@@ -57,7 +57,7 @@ const config = {
5757
};
5858

5959
// Only minify browser (iife) version
60-
if (argv.format === "iife") {
60+
if (argv.format === 'iife') {
6161
config.plugins.push(uglify());
6262
}
6363

‎src/components/MewPopup/MewPopup.vue

+24-10
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,21 @@
1212
:scrollable="scrollable"
1313
@click:outside="handleClickOutside"
1414
>
15-
<v-card color="white" class="pa-0">
15+
<v-card
16+
color="white"
17+
class="pa-0"
18+
>
1619
<!--
1720
=====================================================================================
1821
Dialog Header
1922
=====================================================================================
2023
-->
2124
<div :class="title ? 'pt-0' : 'pt-5'">
22-
<v-btn v-if="!hideCloseBtn" icon class="header-close-icon">
25+
<v-btn
26+
v-if="!hideCloseBtn"
27+
icon
28+
class="header-close-icon"
29+
>
2330
<v-icon
2431
size="x-large"
2532
color="grey cursor--pointer"
@@ -57,8 +64,15 @@
5764
Dialog action
5865
=====================================================================================
5966
-->
60-
<v-card-actions v-if="hasButtons" class="py-5 py-md-8">
61-
<v-row class="pa-0" justify="space-around" dense>
67+
<v-card-actions
68+
v-if="hasButtons"
69+
class="py-5 py-md-8"
70+
>
71+
<v-row
72+
class="pa-0"
73+
justify="space-around"
74+
dense
75+
>
6276
<v-col
6377
cols="12"
6478
:sm="!rightBtn ? '12' : '6'"
@@ -99,7 +113,7 @@
99113
</template>
100114

101115
<script>
102-
import MewButton from "@/components/MewButton/MewButton.vue";
116+
import MewButton from '@/components/MewButton/MewButton.vue';
103117
104118
export default {
105119
components: { MewButton },
@@ -109,7 +123,7 @@ export default {
109123
*/
110124
title: {
111125
type: String,
112-
default: ""
126+
default: ''
113127
},
114128
/**
115129
* Hide top right close button
@@ -133,7 +147,7 @@ export default {
133147
leftBtn: {
134148
type: Object,
135149
default: () => {
136-
return { text: "Cancel", color: "primary", method: () => {} };
150+
return { text: 'Cancel', color: 'primary', method: () => {} };
137151
}
138152
},
139153
/**
@@ -144,8 +158,8 @@ export default {
144158
type: Object,
145159
default: () => {
146160
return {
147-
text: "Confirm",
148-
color: "primary",
161+
text: 'Confirm',
162+
color: 'primary',
149163
enabled: true,
150164
method: () => {}
151165
};
@@ -163,7 +177,7 @@ export default {
163177
*/
164178
maxWidth: {
165179
type: String,
166-
default: "600"
180+
default: '600'
167181
},
168182
/**
169183
* Displays v-card-text if there is popup body content

‎src/components/MewSelect/MewSelect.vue

+33-33
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@
8282
v-if="!loading && item.imgs"
8383
class="flex-row d-flex align-center"
8484
>
85-
<mew-token-container
86-
v-if="!normalDropdown"
87-
v-for="(url, idx) in item.imgs"
88-
:key="url + idx"
89-
class="label-token-img"
90-
:loading="loading"
91-
:img="url"
92-
size="small"
93-
/>
85+
<div v-if="!normalDropdown">
86+
<mew-token-container
87+
v-for="(url, idx) in item.imgs"
88+
:key="url + idx"
89+
class="label-token-img"
90+
:loading="loading"
91+
:img="url"
92+
size="small"
93+
/>
94+
</div>
9495
<div
9596
class="total-token-placeholder inputBorder d-flex align-center justify-center mew-caption"
9697
>
@@ -193,7 +194,6 @@
193194
>
194195
<mew-token-container
195196
v-if="!normalDropdown"
196-
197197
class="mr-1"
198198
:loading="loading"
199199
:img="!data.item.img ? null : data.item.img"
@@ -208,7 +208,7 @@
208208
class="mew-caption font-weight-regular textSecondary--text text-capitalize"
209209
>{{
210210
data.item.tokenBalance
211-
? data.item.tokenBalance + ' ' + data.item.symbol
211+
? data.item.tokenBalance + " " + data.item.symbol
212212
: data.item.subtext
213213
}}</span></span>
214214
</div>
@@ -231,36 +231,36 @@ import get from 'lodash/get';
231231
export default {
232232
name: 'MewSelect',
233233
components: {
234-
MewTokenContainer
234+
MewTokenContainer,
235235
},
236236
props: {
237237
/**
238238
* Adds a "Buy more" string to the end of the first index of the errorMessages prop.
239239
*/
240240
buyMoreStr: {
241241
type: String,
242-
default: ''
242+
default: '',
243243
},
244244
/**
245245
* Error messages to display
246246
*/
247247
errorMessages: {
248248
type: [String, Array],
249-
default: ''
249+
default: '',
250250
},
251251
/**
252252
* Adds filter to select items
253253
*/
254254
hasFilter: {
255255
type: Boolean,
256-
default: true // change to false
256+
default: true, // change to false
257257
},
258258
/**
259259
* Filter placeholder
260260
*/
261261
filterPlaceholder: {
262262
type: String,
263-
default: 'Search token name'
263+
default: 'Search token name',
264264
},
265265
/**
266266
* MEW select value
@@ -269,14 +269,14 @@ export default {
269269
type: Object,
270270
default: () => {
271271
return {};
272-
}
272+
},
273273
},
274274
/**
275275
* Disables the select dropdown.
276276
*/
277277
disabled: {
278278
type: Boolean,
279-
default: false
279+
default: false,
280280
},
281281
/**
282282
* Can be an array of objects or array of strings. When using objects, will look for a text and value field.
@@ -289,57 +289,57 @@ export default {
289289
type: Array,
290290
default: () => {
291291
return [];
292-
}
292+
},
293293
},
294294
/**
295295
* Sets the select label
296296
*/
297297
label: {
298298
type: String,
299-
default: ''
299+
default: '',
300300
},
301301
/**
302302
* Applies Custom Select styles
303303
*/
304304
isCustom: {
305305
type: Boolean,
306-
default: false
306+
default: false,
307307
},
308308
/**
309309
* Loading state
310310
*/
311311
loading: {
312312
type: Boolean,
313-
default: false
313+
default: false,
314314
},
315315
/**
316316
* Normal dropdown with no icon
317317
*/
318318
normalDropdown: {
319319
type: Boolean,
320-
default: false
321-
}
320+
default: false,
321+
},
322322
},
323323
data() {
324324
return {
325325
selectModel: null,
326326
selectItems: [],
327-
search: ''
327+
search: '',
328328
};
329329
},
330330
computed: {
331331
defaultItem() {
332-
return this.items.find(obj => {
332+
return this.items.find((obj) => {
333333
return obj.selectLabel || obj.name;
334334
});
335-
}
335+
},
336336
},
337337
watch: {
338338
search(newVal) {
339339
if (newVal === '' || newVal === null) {
340340
this.selectItems = this.items;
341341
} else {
342-
const foundItems = this.items.filter(item => {
342+
const foundItems = this.items.filter((item) => {
343343
const searchValue = String(newVal).toLowerCase();
344344
const value = String(get(item, 'value', '')).toLowerCase();
345345
const name = String(get(item, 'name', '')).toLowerCase();
@@ -373,15 +373,15 @@ export default {
373373
}
374374
},
375375
items: {
376-
handler: function (newVal) {
376+
handler: function(newVal) {
377377
this.selectItems = newVal;
378378
this.selectModel =
379379
this.value && Object.keys(this.value).length !== 0
380380
? this.value
381381
: this.defaultItem;
382382
},
383-
deep: true
384-
}
383+
deep: true,
384+
},
385385
},
386386
mounted() {
387387
this.selectItems = this.items;
@@ -413,8 +413,8 @@ export default {
413413
this.$refs.filterTextField.$refs.input.focus();
414414
}
415415
}, 100);
416-
}
417-
}
416+
},
417+
},
418418
};
419419
</script>
420420
<style lang="scss">

‎src/components/MewTable/MewTable.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@
120120
v-if="item.change !== ''"
121121
:class="[
122122
item.status === '+' ? 'primary--text' : 'error--text',
123-
'd-flex'
123+
'd-flex',
124124
]"
125125
>
126-
{{ item.change + '%' }}
126+
{{ item.change + "%" }}
127127
<v-icon
128128
v-if="item.status === '+'"
129129
class="primary--text"
@@ -175,7 +175,6 @@
175175
? 'mr-1'
176176
: ''
177177
"
178-
@click.native="button.method(item)"
179178
:title="button.title"
180179
:disabled="button.disabled"
181180
btn-size="small"
@@ -389,8 +388,8 @@ export default {
389388
*/
390389
onSelect(item) {
391390
this.$emit('selectedRow', item);
392-
}
393-
}
391+
},
392+
},
394393
};
395394
</script>
396395