@nixweb/nixloc-ui 0.0.184 → 0.0.186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/component/forms/Button.vue +15 -29
- package/src/component/forms/FileUpload.vue +8 -31
- package/src/component/forms/InputTag.vue +115 -0
- package/src/component/layout/Menu.vue +0 -4
- package/src/component/shared/SelectOption.vue +2 -2
- package/src/component/shared/TableItem.vue +3 -2
- package/src/store/modules/generic.js +26 -1
package/package.json
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="c-div-button">
|
|
3
|
-
<button
|
|
4
|
-
:
|
|
5
|
-
|
|
6
|
-
:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
disabled: disabled,
|
|
17
|
-
}"
|
|
18
|
-
:disabled="disabled"
|
|
19
|
-
@click="execute()"
|
|
20
|
-
>
|
|
21
|
-
<i
|
|
22
|
-
class="title"
|
|
23
|
-
:class="classIcon"
|
|
24
|
-
v-if="!isLoading(this._key) && classIcon"
|
|
25
|
-
></i>
|
|
3
|
+
<button :style="'background-color:' + backGroundColor + ';color:' + color" class="button" :class="{
|
|
4
|
+
small: size === 'small',
|
|
5
|
+
medium: size === 'medium',
|
|
6
|
+
large: size === 'large',
|
|
7
|
+
primary: type === 'primary',
|
|
8
|
+
success: type === 'success',
|
|
9
|
+
warning: type === 'warning',
|
|
10
|
+
info: type === 'info',
|
|
11
|
+
edit: type === 'edit',
|
|
12
|
+
danger: type === 'danger',
|
|
13
|
+
disabled: disabled,
|
|
14
|
+
}" :disabled="disabled" @click="execute()">
|
|
15
|
+
<i class="title" :class="classIcon" v-if="!isLoading(this._key) && classIcon"></i>
|
|
26
16
|
<span v-if="!isLoading(this._key)">{{ title }}</span>
|
|
27
|
-
<vue-loading
|
|
28
|
-
|
|
29
|
-
type="bubbles"
|
|
30
|
-
color="#fff"
|
|
31
|
-
:size="{ width: '26px', height: '26px' }"
|
|
32
|
-
></vue-loading>
|
|
17
|
+
<vue-loading v-if="isLoading(this._key)" type="bubbles" color="#fff"
|
|
18
|
+
:size="{ width: '26px', height: '26px' }"></vue-loading>
|
|
33
19
|
</button>
|
|
34
20
|
</div>
|
|
35
21
|
</template>
|
|
@@ -4,43 +4,20 @@
|
|
|
4
4
|
<div class="file" v-if="!value">
|
|
5
5
|
<button class="button small primary">
|
|
6
6
|
<span v-if="!loadingAdd">
|
|
7
|
-
<i :class="classIcon"></i> {{ title }}</span
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
v-if="loadingAdd"
|
|
11
|
-
type="bubbles"
|
|
12
|
-
color="#fff"
|
|
13
|
-
:size="{ width: '20px', height: '20px' }"
|
|
14
|
-
></vue-loading>
|
|
7
|
+
<i :class="classIcon"></i> {{ title }}</span>
|
|
8
|
+
<vue-loading v-if="loadingAdd" type="bubbles" color="#fff"
|
|
9
|
+
:size="{ width: '20px', height: '20px' }"></vue-loading>
|
|
15
10
|
</button>
|
|
16
|
-
<input
|
|
17
|
-
type="file"
|
|
18
|
-
name="myfile"
|
|
19
|
-
ref="file"
|
|
20
|
-
:accept="allowed"
|
|
21
|
-
v-on:change="upload()"
|
|
22
|
-
/>
|
|
11
|
+
<input type="file" name="myfile" ref="file" :accept="allowed" v-on:change="upload()" />
|
|
23
12
|
</div>
|
|
24
13
|
<div v-if="value">
|
|
25
|
-
<button
|
|
26
|
-
class="button small success"
|
|
27
|
-
@click="download()"
|
|
28
|
-
v-if="!loadingAdd"
|
|
29
|
-
>
|
|
14
|
+
<button class="button small success" @click="download()" v-if="!loadingAdd">
|
|
30
15
|
<i class="fas fa-cloud-download-alt"></i> Baixar
|
|
31
16
|
</button>
|
|
32
|
-
<button
|
|
33
|
-
class="button small danger"
|
|
34
|
-
v-if="!loadingAdd"
|
|
35
|
-
@click="remove()"
|
|
36
|
-
>
|
|
17
|
+
<button class="button small danger" v-if="!loadingAdd" @click="remove()">
|
|
37
18
|
<span v-if="!loadingRemove">Remover</span>
|
|
38
|
-
<vue-loading
|
|
39
|
-
|
|
40
|
-
type="bubbles"
|
|
41
|
-
color="#fff"
|
|
42
|
-
:size="{ width: '20px', height: '20px' }"
|
|
43
|
-
></vue-loading>
|
|
19
|
+
<vue-loading v-if="loadingRemove" type="bubbles" color="#fff"
|
|
20
|
+
:size="{ width: '20px', height: '20px' }"></vue-loading>
|
|
44
21
|
</button>
|
|
45
22
|
</div>
|
|
46
23
|
</div>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div>{{ title }}
|
|
4
|
+
<span class="required" v-if="required">*</span>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="email-input-container">
|
|
7
|
+
<div class="email-tag" v-for="(email, index) in tos" :key="index">
|
|
8
|
+
{{ email }}
|
|
9
|
+
<button class="remove-button" @click="removeEmail(index)">
|
|
10
|
+
<i class="fa-solid fa-circle-xmark"></i>
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
<input v-model="newItem" @keyup.enter="addItem" :placeholder="placeholder" class="email-input" />
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: "InputTag",
|
|
21
|
+
props: {
|
|
22
|
+
title: String,
|
|
23
|
+
placeholder: String,
|
|
24
|
+
required: Boolean,
|
|
25
|
+
initialValue: Array,
|
|
26
|
+
value: Array,
|
|
27
|
+
},
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
tos: [],
|
|
31
|
+
newItem: ""
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
mounted() {
|
|
35
|
+
this.tos = this.initialValue;
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
addItem() {
|
|
39
|
+
if (this.newItem) {
|
|
40
|
+
this.tos.push(this.newItem);
|
|
41
|
+
this.newItem = "";
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
removeEmail(index) {
|
|
45
|
+
this.tos.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
watch: {
|
|
49
|
+
tos: {
|
|
50
|
+
handler(tos) {
|
|
51
|
+
this.$emit("input", tos);
|
|
52
|
+
},
|
|
53
|
+
deep: true,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
.email-input-container {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-wrap: wrap;
|
|
64
|
+
align-items: center;
|
|
65
|
+
border: 1px solid #E5E4E8;
|
|
66
|
+
border-radius: 6px;
|
|
67
|
+
padding-left: 5px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.email-tag {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
background-color: #f0f0f0;
|
|
74
|
+
padding: 4px 8px;
|
|
75
|
+
border-radius: 16px;
|
|
76
|
+
margin-top: 6px;
|
|
77
|
+
margin-right: 8px;
|
|
78
|
+
margin-bottom: 8px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.remove-button {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
border: none;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
margin-left: 4px;
|
|
89
|
+
outline: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.remove-button {
|
|
93
|
+
color: #ff0000;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.remove-button:hover {
|
|
97
|
+
color: #ff0000;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.email-input {
|
|
101
|
+
flex: 1;
|
|
102
|
+
border: none;
|
|
103
|
+
outline: none;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
padding: 4px;
|
|
106
|
+
font-weight: 400 !important;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.email-input::placeholder {
|
|
110
|
+
font-weight: 300 !important;
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
color: #969595;
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
115
|
+
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
:class="{ selected: option.value == selected }" @click="optionSelected(option.value)">
|
|
9
9
|
<div class="text-center">
|
|
10
10
|
<span :class="{ disabled: disabled }" :style="'font-size:' + option.titleSize + 'px;'">
|
|
11
|
-
<i v-if="size === 'small'" :class="option.icon"></i>
|
|
11
|
+
<i v-if="size === 'small'" :class="option.icon" :style="option.iconStyle"></i>
|
|
12
12
|
{{ option.title }}
|
|
13
13
|
</span>
|
|
14
14
|
<div v-if="size === 'medium'" class="icon" :style="'font-size:' + option.iconSize + 'px;'">
|
|
15
|
-
<i :class="option.icon"></i>
|
|
15
|
+
<i :class="option.icon" :style="option.iconStyle"></i>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
<div v-if="option.tipId">
|
|
@@ -564,7 +564,7 @@ export default {
|
|
|
564
564
|
|
|
565
565
|
let downloadLink = document.createElement("a");
|
|
566
566
|
downloadLink.href = url;
|
|
567
|
-
downloadLink.download = `${params.obj.fileName}
|
|
567
|
+
downloadLink.download = `${params.obj.fileName}`;
|
|
568
568
|
|
|
569
569
|
document.body.appendChild(downloadLink);
|
|
570
570
|
downloadLink.click();
|
|
@@ -579,6 +579,30 @@ export default {
|
|
|
579
579
|
return false;
|
|
580
580
|
})
|
|
581
581
|
},
|
|
582
|
+
getFileApiWithParameterBody: async function (context, params) {
|
|
583
|
+
context.commit('cleanMethodExecutedApi');
|
|
584
|
+
return axios.post(params.url, params.obj, {
|
|
585
|
+
headers: new Token().tokenHeaders(),
|
|
586
|
+
responseType: "arraybuffer",
|
|
587
|
+
})
|
|
588
|
+
.then((response) => {
|
|
589
|
+
|
|
590
|
+
let blob = new Blob([response.data], { type: "application/pdf" });
|
|
591
|
+
let url = window.URL.createObjectURL(blob);
|
|
592
|
+
|
|
593
|
+
let downloadLink = document.createElement("a");
|
|
594
|
+
downloadLink.href = url;
|
|
595
|
+
downloadLink.download = `${params.obj.fileName}`;
|
|
596
|
+
|
|
597
|
+
document.body.appendChild(downloadLink);
|
|
598
|
+
downloadLink.click();
|
|
599
|
+
|
|
600
|
+
document.body.removeChild(downloadLink);
|
|
601
|
+
|
|
602
|
+
}, (err) => {
|
|
603
|
+
return false;
|
|
604
|
+
})
|
|
605
|
+
},
|
|
582
606
|
postFileApi: async function (context, params) {
|
|
583
607
|
context.commit('cleanMethodExecutedApi');
|
|
584
608
|
|
|
@@ -681,5 +705,6 @@ export default {
|
|
|
681
705
|
return false;
|
|
682
706
|
})
|
|
683
707
|
},
|
|
708
|
+
|
|
684
709
|
}
|
|
685
710
|
}
|