@nixweb/nixloc-ui 0.0.126 → 0.0.127

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.126",
3
+ "version": "0.0.127",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -38,6 +38,7 @@
38
38
  "vue-upload-file": "^1.1.0",
39
39
  "vue2-datepicker": "^2.13.0",
40
40
  "vue2-editor": "^2.6.6",
41
+ "vuedraggable": "^2.24.3",
41
42
  "vuejs-ace-editor": "^1.0.1",
42
43
  "vuex": "^3.6.2",
43
44
  "vuex-persistedstate": "^4.0.0"
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <b-form-checkbox v-model="value" :value="true" :unchecked-value="false">
3
+ <b-form-checkbox v-model="valueLocal" :value="true" :unchecked-value="false">
4
4
  {{ title }}
5
5
  <Tip :field="field" :formName="formName" />
6
6
  </b-form-checkbox>
@@ -9,6 +9,9 @@
9
9
 
10
10
  <script>
11
11
  import Tip from "../shared/Tip.vue";
12
+
13
+ import { mapMutations } from "vuex";
14
+
12
15
  export default {
13
16
  components: { Tip },
14
17
  name: "CheckboxSimple",
@@ -18,9 +21,21 @@ export default {
18
21
  field: String,
19
22
  value: Boolean,
20
23
  },
24
+ data() {
25
+ return {
26
+ valueLocal: false,
27
+ };
28
+ },
29
+ methods: {
30
+ ...mapMutations("validation", ["updateFormDirty"]),
31
+ },
21
32
  watch: {
22
33
  value() {
23
- this.$emit("input", this.value);
34
+ this.valueLocal = this.value;
35
+ },
36
+ valueLocal() {
37
+ this.$emit("input", this.valueLocal);
38
+ this.updateFormDirty(true);
24
39
  },
25
40
  },
26
41
  };
@@ -1,38 +1,49 @@
1
1
  <template>
2
2
  <div>
3
- <div class="div-preview">
4
- <img
5
- :style="'width:120;height:100px'"
6
- :src="'https://espaco.blob.core.windows.net/nixloc-photo-product/' + urlImage"
7
- />
8
- </div>
9
- <div v-if="!value">
10
- <button class="button small primary" @click="show = !show">
11
- <span v-if="!loadingAdd">
12
- <i class="fas fa-cloud-upload-alt"></i> {{ title }}
13
- </span>
3
+ <b-row v-show="loadingAdd || loadingRemove">
4
+ <b-col sm="2">
14
5
  <vue-loading
15
- v-if="loadingAdd"
6
+ v-if="true"
16
7
  type="bubbles"
17
- color="#fff"
18
- :size="{ width: '20px', height: '20px' }"
8
+ color="#D98621"
9
+ :size="{ width: '50px', height: '50px' }"
19
10
  ></vue-loading>
20
- </button>
21
- </div>
22
- <div v-else>
23
- <button class="button small success" @click="download()" v-if="!loadingAdd">
24
- <i class="fas fa-cloud-download-alt"></i> Baixar
25
- </button>
26
- <button class="button small danger" v-if="!loadingAdd" @click="remove()">
27
- <span v-if="!loadingRemove">Remover</span>
28
- <vue-loading
29
- v-if="loadingRemove"
30
- type="bubbles"
31
- color="#fff"
32
- :size="{ width: '20px', height: '20px' }"
33
- ></vue-loading>
34
- </button>
35
- </div>
11
+ </b-col>
12
+ </b-row>
13
+ <b-row v-show="!loadingAdd && !loadingRemove">
14
+ <b-col sm="12">
15
+ <div class="div-preview">
16
+ <img
17
+ :style="'width:120;height:100px'"
18
+ :src="'https://espaco.blob.core.windows.net/nixloc-photo-product/' + urlImage"
19
+ />
20
+ </div>
21
+ <div>
22
+ <div v-if="!value">
23
+ <div class="div-button">
24
+ <button class="button small primary" @click="show = !show">
25
+ <span v-if="!loadingAdd">
26
+ <span><i class="fas fa-camera"></i> Carregar Foto</span>
27
+ </span>
28
+ </button>
29
+ </div>
30
+ </div>
31
+ <div v-else>
32
+ <div class="div-button">
33
+ <button class="button small danger" v-if="!loadingAdd" @click="remove()">
34
+ <span v-if="!loadingRemove"><i class="fas fa-camera"></i> Remover Foto</span>
35
+ <vue-loading
36
+ v-if="loadingRemove"
37
+ type="bubbles"
38
+ color="#fff"
39
+ :size="{ width: '20px', height: '20px' }"
40
+ ></vue-loading>
41
+ </button>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </b-col>
46
+ </b-row>
36
47
  <my-upload
37
48
  field="img"
38
49
  @crop-success="cropSuccess"
@@ -61,6 +72,7 @@ export default {
61
72
  accepted: String,
62
73
  urlPost: String,
63
74
  urlRemove: String,
75
+ onLoad: Function,
64
76
  value: String,
65
77
  },
66
78
  data() {
@@ -75,7 +87,7 @@ export default {
75
87
  },
76
88
  computed: {
77
89
  urlImage() {
78
- if (this.value != "") return this.value;
90
+ if (this.value) return this.value;
79
91
  return "noImage.jpg";
80
92
  },
81
93
  },
@@ -96,6 +108,7 @@ export default {
96
108
  this.postFileApi(params).then((response) => {
97
109
  if (response.success) {
98
110
  this.$emit("input", response.content);
111
+ if (this.onLoad) this.onLoad();
99
112
  }
100
113
  this.loadingAdd = false;
101
114
  });
@@ -111,6 +124,7 @@ export default {
111
124
  this.deleteFileApi(params).then((response) => {
112
125
  if (response.success) {
113
126
  this.$emit("input", "");
127
+ if (this.onLoad) this.onLoad();
114
128
  }
115
129
  this.loadingRemove = false;
116
130
  });
@@ -182,7 +196,7 @@ export default {
182
196
  }
183
197
 
184
198
  .small {
185
- padding: 5px 10px;
199
+ padding: 3px 7px;
186
200
  font-size: 13px;
187
201
  }
188
202
 
@@ -201,4 +215,8 @@ export default {
201
215
  .div-image {
202
216
  margin-bottom: 10px;
203
217
  }
218
+
219
+ .div-button {
220
+ margin-left: 18px;
221
+ }
204
222
  </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="form-group">
3
- <label>
3
+ <label v-if="title">
4
4
  <span class="title">{{ title }}</span>
5
5
  <span class="required" v-if="required">*</span>
6
6
  <Tip :field="field" :formName="formName" />
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="form-group">
3
- <label>
3
+ <label v-if="title">
4
4
  <span class="title">{{ title }}</span>
5
5
  <span class="required" v-if="required">*</span>
6
6
  <Tip :field="field" :formName="formName" />
@@ -51,6 +51,7 @@ export default {
51
51
  type: Boolean,
52
52
  default: true,
53
53
  },
54
+ params: Object,
54
55
  value: Number,
55
56
  changed: Function,
56
57
  enter: Function,
@@ -88,7 +89,7 @@ export default {
88
89
  }
89
90
  },
90
91
  pressedEnter() {
91
- if (this.enter) this.enter();
92
+ if (this.enter) this.enter(this.params);
92
93
  },
93
94
  },
94
95
  computed: {
@@ -100,7 +101,6 @@ export default {
100
101
  if (this.changed) this.changed();
101
102
  },
102
103
  valueLocal() {
103
- console.log("teste");
104
104
  this.validate();
105
105
 
106
106
  let valueLocal;
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div>
3
3
  <vodal
4
- :duration="50"
4
+ :duration="80"
5
5
  :show="modal.open"
6
- @hide="hideModal()"
6
+ @hide="hide()"
7
7
  :width="width"
8
8
  :height="height"
9
9
  :closeOnEsc="closeOnEsc"
@@ -41,6 +41,7 @@ export default {
41
41
  type: Boolean,
42
42
  default: true,
43
43
  },
44
+ onHideModal: Function,
44
45
  },
45
46
  components: { Messages, Vodal },
46
47
  computed: {
@@ -48,6 +49,10 @@ export default {
48
49
  },
49
50
  methods: {
50
51
  ...mapMutations("generic", ["hideModal"]),
52
+ hide() {
53
+ if (this.onHideModal) this.onHideModal();
54
+ this.hideModal();
55
+ },
51
56
  },
52
57
  };
53
58
  </script>
@@ -49,6 +49,10 @@ export default {
49
49
  type: Boolean,
50
50
  default: true,
51
51
  },
52
+ markFormDirty: {
53
+ type: Boolean,
54
+ default: false,
55
+ },
52
56
  data: Array,
53
57
  value: Object,
54
58
  },
@@ -69,11 +73,14 @@ export default {
69
73
  },
70
74
  methods: {
71
75
  ...mapMutations("generic", ["addFilter", "removeLoading"]),
76
+ ...mapMutations("validation", ["updateFormDirty"]),
72
77
  onOpen() {},
73
78
  onSelected(value) {
74
79
  this.$emit("input", value);
75
80
  let obj = { fieldTarget: this.fieldTarget, value: value.id };
76
81
  if (!this.onlyQuery) this.addFilter(obj);
82
+
83
+ if (this.markFormDirty) this.updateFormDirty(true);
77
84
  },
78
85
  onSearch(value) {},
79
86
  label(value) {
@@ -17,15 +17,14 @@ export default {
17
17
  id: String,
18
18
  maxHeight: Number,
19
19
  minHeight: Number,
20
+ endScrollBar: Function,
20
21
  },
21
22
  mounted() {
22
23
  const listElm = document.querySelector("#" + this.id);
23
24
  if (listElm != null)
24
25
  listElm.addEventListener("scroll", (e) => {
25
- if (listElm.scrollTop + listElm.clientHeight >= listElm.scrollHeight) {
26
- this.addEvent({
27
- nome: "endScrollbar",
28
- });
26
+ if (listElm.scrollTop + listElm.clientHeight >= listElm.scrollHeight) {
27
+ if (this.endScrollBar) this.endScrollBar();
29
28
  }
30
29
  });
31
30
  },
@@ -1,11 +1,9 @@
1
1
  <template>
2
2
  <div>
3
3
  <div :class="{ 'div-message': !modal.open }" v-if="storageNotification.length > 0">
4
- <div>
4
+ <div v-for="notification in storageNotification">
5
5
  <Alert type="danger">
6
- <div v-for="notification in storageNotification">
7
- {{ notification.message }}
8
- </div>
6
+ {{ notification.message }}
9
7
  </Alert>
10
8
  </div>
11
9
  <b-alert
@@ -51,6 +51,7 @@ export default {
51
51
  },
52
52
  computed: {
53
53
  ...mapState("validation", ["formDirty"]),
54
+ ...mapState("generic", ["loading"]),
54
55
  ...mapGetters("validation", ["isFormValid"]),
55
56
  ...mapState("generic", ["modal"]),
56
57
  },
@@ -19,7 +19,9 @@
19
19
  <tbody>
20
20
  <tr v-for="(row, index) in data" :key="index" :style="row.rowCss">
21
21
  <td class="td-checkbox" v-if="showChecks">
22
- <b-form-checkbox v-model="selected" :value="row.id" />
22
+ <div :class="{ 'center-vertical': row.photo != null }">
23
+ <b-form-checkbox v-model="selected" :value="row.id" />
24
+ </div>
23
25
  </td>
24
26
  <td v-for="(obj, ind) in header" :key="ind">
25
27
  <div
@@ -30,9 +32,20 @@
30
32
  </div>
31
33
  <div
32
34
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
33
- v-if="obj.type === 'class'"
35
+ v-if="obj.type === 'image'"
34
36
  >
35
- {{ row[obj.field] }}
37
+ <img
38
+ :style="'width:60;height:50px'"
39
+ :src="
40
+ 'https://espaco.blob.core.windows.net/nixloc-photo-product/' +
41
+ row[obj.field]
42
+ "
43
+ />
44
+ </div>
45
+ <div class="text-center center-vertical" v-if="obj.type === 'class'">
46
+ <div :class="convertClass(row[obj.fieldComparison], obj.classCssBody)">
47
+ {{ row[obj.field] }}
48
+ </div>
36
49
  </div>
37
50
  <div
38
51
  :class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
@@ -71,7 +84,12 @@
71
84
  >
72
85
  <TableButton :obj="obj" :row="row" />
73
86
  </div>
74
- <div class="link" v-if="obj.type === 'link'" @click="navegateTo(obj, row)">
87
+ <div
88
+ class="link"
89
+ :class="convertClass(row[obj.fieldComparison], obj.classCssBody)"
90
+ v-if="obj.type === 'link'"
91
+ @click="navegateTo(obj, row)"
92
+ >
75
93
  <span> {{ row[obj.field] }}</span>
76
94
  </div>
77
95
  </td>
@@ -90,6 +108,7 @@
90
108
 
91
109
  <script>
92
110
  import TableButton from "@nixweb/nixloc-ui/src/component/shared/TableButton.vue";
111
+ import draggable from "@nixweb/nixloc-ui/vuedraggable";
93
112
 
94
113
  import { mapState, mapMutations, mapActions } from "vuex";
95
114
 
@@ -148,7 +167,7 @@ export default {
148
167
  if (obj.routeName) {
149
168
  this.$router.push({
150
169
  name: obj.routeName,
151
- params: { id: row.id },
170
+ params: { id: row.id, type: row.type },
152
171
  });
153
172
  } else {
154
173
  this.addEvent({
@@ -224,4 +243,12 @@ tr:hover {
224
243
  .icon-link:hover {
225
244
  font-size: 12.5px;
226
245
  }
246
+
247
+ .center-vertical {
248
+ padding-top: 10px;
249
+ }
250
+
251
+ .badge-center {
252
+ margin: auto !important;
253
+ }
227
254
  </style>
@@ -20,6 +20,7 @@
20
20
  <TableTotalRecords :totalRecords="content.totalRecords" />
21
21
  </b-col>
22
22
  </b-row>
23
+ <Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
23
24
  <FixedBar posicao="topo" v-show="selected.length > 0">
24
25
  <div>
25
26
  <Button
@@ -56,6 +57,7 @@ import FixedBar from "../layout/FixedBar.vue";
56
57
  import TableTotalRecords from "../shared/TableTotalRecords.vue";
57
58
  import TableTotalization from "../shared/TableTotalization.vue";
58
59
  import HorizontalFilter from "../shared/HorizontalFilter.vue";
60
+ import Loading from "../shared/Loading.vue";
59
61
 
60
62
  import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
61
63
 
@@ -81,6 +83,7 @@ export default {
81
83
  HorizontalFilter,
82
84
  TableTotalization,
83
85
  TableTotalRecords,
86
+ Loading,
84
87
  FixedBar,
85
88
  Button,
86
89
  Table,
@@ -125,7 +128,7 @@ export default {
125
128
  "totalPerPage",
126
129
  "selectStatic",
127
130
  ]),
128
- ...mapGetters("generic", ["pagination"]),
131
+ ...mapGetters("generic", ["pagination", "isLoading"]),
129
132
  paginationKey: function () {
130
133
  return this.pagination("templateList");
131
134
  },
@@ -143,7 +146,10 @@ export default {
143
146
  let params = { url: this.templateList.urlGetApi, obj: obj };
144
147
  this.getApi(params).then((response) => {
145
148
  this.content = response.content;
146
- this.removeLoading(["panel", "modeloSubView", "btnSearch", "btnClean"]);
149
+ let self = this;
150
+ setTimeout(function () {
151
+ self.removeLoading(["panel", "loadingLine", "btnSearch", "btnClean"]);
152
+ }, 350);
147
153
  });
148
154
  },
149
155
  removeSelected() {
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <Loading :center="false" v-show="isLoading('modeloSubView')" />
4
- <div v-show="!isLoading('modeloSubView')">
3
+ <div>
5
4
  <slot name="content-buttons"></slot>
6
5
  <div v-if="showSearch">
7
6
  <Search />
@@ -30,7 +29,6 @@
30
29
 
31
30
  <script>
32
31
  import Search from "../shared/Search.vue";
33
- import Loading from "../shared/Loading.vue";
34
32
 
35
33
  import ListViewWithDataHandler from "@nixweb/nixloc-ui/src/component/template/ListViewWithDataHandler.vue";
36
34
 
@@ -38,7 +36,7 @@ import { mapGetters, mapMutations } from "vuex";
38
36
 
39
37
  export default {
40
38
  name: "ViewTemplateConfiguration",
41
- components: { Search, Loading, ListViewWithDataHandler },
39
+ components: { Search, ListViewWithDataHandler },
42
40
  props: {
43
41
  templateList: Object,
44
42
  propsParam: Object,
@@ -55,11 +53,8 @@ export default {
55
53
  default: true,
56
54
  },
57
55
  },
58
- computed: {
59
- ...mapGetters("generic", ["isLoading"]),
60
- },
61
56
  created() {
62
- this.addLoading("modeloSubView");
57
+ this.addLoading("loadingLine");
63
58
  },
64
59
  methods: {
65
60
  ...mapMutations("generic", ["addLoading"]),
@@ -255,6 +255,7 @@ export default {
255
255
  headers: new Token().tokenHeaders(),
256
256
  })
257
257
  .then((response) => {
258
+
258
259
  if (response.data.success) {
259
260
  context.commit('addMethodExecutedApi', 'postApi');
260
261
 
@@ -271,6 +272,9 @@ export default {
271
272
  return response.data;
272
273
  }
273
274
  }, (err) => {
275
+
276
+ console.log(err);
277
+
274
278
  if (err.response)
275
279
  if (err.response.status === 403)
276
280
  context.commit('addNotifications', [{ message: "Usuário sem permissão para adicionar!" }])
@@ -34,5 +34,8 @@ export default {
34
34
  removeItemMenu: (state) => {
35
35
  state.menu.items = [];
36
36
  },
37
+ updateParameterRental: (state, parameterRental) => {
38
+ state.userLogged.parameterRental = parameterRental;
39
+ }
37
40
  },
38
41
  }