@nixweb/nixloc-ui 0.0.183 → 0.0.185
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/InputText.vue +6 -18
- package/src/component/forms/TextArea.vue +23 -12
- 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 +25 -0
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>
|
|
@@ -7,27 +7,14 @@
|
|
|
7
7
|
<Tip :field="field" :formName="formName" />
|
|
8
8
|
</label>
|
|
9
9
|
<div class="inner-addon right-addon">
|
|
10
|
-
<div
|
|
11
|
-
class="required glyphicon"
|
|
12
|
-
v-if="notifications.length > 0 && formDirty"
|
|
13
|
-
>
|
|
10
|
+
<div class="required glyphicon" v-if="notifications.length > 0 && formDirty">
|
|
14
11
|
<i class="fas fa-exclamation-triangle"></i>
|
|
15
12
|
</div>
|
|
16
13
|
<slot v-else></slot>
|
|
17
|
-
<input
|
|
18
|
-
|
|
19
|
-
:
|
|
20
|
-
:
|
|
21
|
-
:disabled="disabled"
|
|
22
|
-
@keyup.enter.prevent="pressedEnter"
|
|
23
|
-
@keyup="cleanedField"
|
|
24
|
-
@blur="outField"
|
|
25
|
-
v-mask="mask || withoutMask"
|
|
26
|
-
v-bind:value="value"
|
|
27
|
-
v-on:input="$emit('input', $event.target.value)"
|
|
28
|
-
class="form-control"
|
|
29
|
-
:class="{ required: notifications.length > 0 && formDirty }"
|
|
30
|
-
/>
|
|
14
|
+
<input type="text" :style="_style" :placeholder="titlePlaceholder" :disabled="disabled"
|
|
15
|
+
@keyup.enter.prevent="pressedEnter" @keyup="cleanedField" @blur="outField" v-mask="mask || withoutMask"
|
|
16
|
+
v-bind:value="value" v-on:input="$emit('input', $event.target.value)" class="form-control"
|
|
17
|
+
:class="{ required: notifications.length > 0 && formDirty }" />
|
|
31
18
|
</div>
|
|
32
19
|
<div v-if="formDirty">
|
|
33
20
|
<div v-for="message in notifications" :key="message">
|
|
@@ -175,6 +162,7 @@ input::placeholder {
|
|
|
175
162
|
color: #94aa2a;
|
|
176
163
|
font-size: 14px;
|
|
177
164
|
}
|
|
165
|
+
|
|
178
166
|
.invalid {
|
|
179
167
|
color: #f0134d;
|
|
180
168
|
font-size: 14px;
|
|
@@ -6,19 +6,11 @@
|
|
|
6
6
|
<Tip :field="field" :formName="formName" />
|
|
7
7
|
</label>
|
|
8
8
|
<div class="inner-addon right-addon">
|
|
9
|
-
<i
|
|
10
|
-
v-if="notifications.length > 0 && formDirty"
|
|
11
|
-
class="required glyphicon fas fa-exclamation-triangle"
|
|
12
|
-
></i>
|
|
9
|
+
<i v-if="notifications.length > 0 && formDirty" class="required glyphicon fas fa-exclamation-triangle"></i>
|
|
13
10
|
|
|
14
|
-
<textarea
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
v-bind:value="value"
|
|
18
|
-
v-on:input="$emit('input', $event.target.value)"
|
|
19
|
-
class="form-control"
|
|
20
|
-
:class="{ 'is-invalid': notifications.length > 0 && formDirty }"
|
|
21
|
-
></textarea>
|
|
11
|
+
<textarea :disabled="disabled" rows="4" cols="50" type="text" :placeholder="placeholder" v-bind:value="value"
|
|
12
|
+
v-on:input="$emit('input', $event.target.value)" :class="{ 'is-invalid': notifications.length > 0 && formDirty }">
|
|
13
|
+
</textarea>
|
|
22
14
|
</div>
|
|
23
15
|
|
|
24
16
|
<div v-if="formDirty">
|
|
@@ -40,6 +32,7 @@ export default {
|
|
|
40
32
|
title: String,
|
|
41
33
|
field: String,
|
|
42
34
|
placeholder: String,
|
|
35
|
+
disabled: Boolean,
|
|
43
36
|
formName: String,
|
|
44
37
|
required: Boolean,
|
|
45
38
|
maxLength: Number,
|
|
@@ -115,10 +108,28 @@ export default {
|
|
|
115
108
|
</script>
|
|
116
109
|
|
|
117
110
|
<style scoped>
|
|
111
|
+
textarea {
|
|
112
|
+
width: 100%;
|
|
113
|
+
border: 1px #DBDEE0 solid;
|
|
114
|
+
border-radius: 5px;
|
|
115
|
+
color: #35495E;
|
|
116
|
+
padding-left: 10px;
|
|
117
|
+
padding-right: 10px;
|
|
118
|
+
font-weight: normal !important;
|
|
119
|
+
font-size: 14px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
textarea:disabled{
|
|
123
|
+
background-color: white !important;
|
|
124
|
+
opacity: 0.5;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
118
128
|
.success {
|
|
119
129
|
color: #94aa2a;
|
|
120
130
|
font-size: 14px;
|
|
121
131
|
}
|
|
132
|
+
|
|
122
133
|
.invalid {
|
|
123
134
|
color: #f0134d;
|
|
124
135
|
font-size: 14px;
|
|
@@ -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">
|
|
@@ -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}.${params.obj.fileType}`;
|
|
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
|
}
|