@nixweb/nixloc-ui 0.0.172 → 0.0.173

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.172",
3
+ "version": "0.0.173",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -100,7 +100,7 @@ export default {
100
100
  if (this.range) {
101
101
  let obj = {
102
102
  fieldTarget: this.fieldTarget,
103
- valueLocal: { start: this.valueLocal[0], end: this.valueLocal[1] },
103
+ value: { start: this.valueLocal[0], end: this.valueLocal[1] },
104
104
  };
105
105
  this.addFilter(obj);
106
106
  }
@@ -108,7 +108,7 @@ export default {
108
108
  close() {
109
109
  let obj = {
110
110
  fieldTarget: this.fieldTarget,
111
- valueLocal: { start: "", end: "" },
111
+ value: { start: "", end: "" },
112
112
  };
113
113
  this.addFilter(obj);
114
114
  },
@@ -1,21 +1,17 @@
1
1
  <template>
2
2
  <div>
3
+ <label v-if="title">
4
+ <span class="title">{{ title }} </span>
5
+ </label>
3
6
  <div class="wrapper">
4
- <span class="minus" @click="decrement">-</span>
5
- <span class="num" @click="showEdit = true" v-if="!showEdit">{{
6
- number
7
- }}</span>
8
- <input
9
- class="input"
10
- type="number"
11
- @keyup.enter.prevent="showEdit = false"
12
- v-model="number"
13
- v-if="showEdit"
14
- />
15
- <span @click="showEdit = false" v-if="showEdit"
16
- ><i class="fa-solid fa-check"></i
17
- ></span>
18
- <span class="plus" @click="increment">+</span>
7
+ <span :class="{ disabled: disabled }" class="minus" @click="decrement">-</span>
8
+ <span :class="{ disabled: disabled }" class="num" @click="showEdit = true" v-if="!showEdit">{{ number }}</span>
9
+ <input v-if="showEdit" class="input" type="number" @keyup.enter.prevent="showEdit = false" :disabled="disabled"
10
+ v-model="number" />
11
+ <span v-if="showEdit" :class="{ disabled: disabled }" @click="showEdit = false">
12
+ <i class="fa-solid fa-check"></i>
13
+ </span>
14
+ <span :class="{ disabled: disabled }" class="plus" @click="increment">+</span>
19
15
  </div>
20
16
  </div>
21
17
  </template>
@@ -25,7 +21,16 @@ import { mapMutations } from "vuex";
25
21
 
26
22
  export default {
27
23
  name: "IncrementDecrement",
28
- props: ["value", "triggerEvent", "min", "max"],
24
+ props: [
25
+ "title",
26
+ "initialValue",
27
+ "value",
28
+ "disabled",
29
+ "fieldTarget",
30
+ "triggerEvent",
31
+ "min",
32
+ "max",
33
+ ],
29
34
  data() {
30
35
  return {
31
36
  number: 1,
@@ -36,12 +41,24 @@ export default {
36
41
  this.number = this.value;
37
42
  },
38
43
  methods: {
39
- ...mapMutations("generic", ["addEvent"]),
44
+ ...mapMutations("generic", ["addFilter", "addEvent"]),
40
45
  increment() {
41
- this.number++;
46
+ if (!this.disabled) {
47
+ this.number++;
48
+ this.executeFilter();
49
+ }
42
50
  },
43
51
  decrement() {
44
- this.number--;
52
+ if (!this.disabled) {
53
+ this.number--;
54
+ this.executeFilter();
55
+ }
56
+ },
57
+ executeFilter() {
58
+ if (this.fieldTarget) {
59
+ let obj = { fieldTarget: this.fieldTarget, value: this.number };
60
+ this.addFilter(obj);
61
+ }
45
62
  },
46
63
  },
47
64
  watch: {
@@ -89,6 +106,7 @@ export default {
89
106
  border: 1px solid #eaedf3;
90
107
  box-shadow: 0px 10px 20px -6px rgb(0 0 0 / 3%);
91
108
  }
109
+
92
110
  .wrapper span {
93
111
  width: 100%;
94
112
  text-align: center;
@@ -97,6 +115,7 @@ export default {
97
115
  cursor: pointer;
98
116
  user-select: none;
99
117
  }
118
+
100
119
  .wrapper span.num {
101
120
  font-size: 17px;
102
121
  border-right: 1px solid #eaedf3;
@@ -112,4 +131,9 @@ export default {
112
131
  text-decoration: underline;
113
132
  transition: 0.1s;
114
133
  }
134
+
135
+ .disabled {
136
+ color: grey;
137
+ opacity: 0.5;
138
+ }
115
139
  </style>
@@ -3,12 +3,8 @@
3
3
  <span class="title">{{ title }}</span>
4
4
  <div class="options">
5
5
  <b-form-group>
6
- <b-form-radio-group
7
- v-model="selected"
8
- :options="options"
9
- :disabled="disabled"
10
- :stacked="stacked"
11
- ></b-form-radio-group>
6
+ <b-form-radio-group v-model="selected" :options="options" :disabled="disabled"
7
+ :stacked="stacked"></b-form-radio-group>
12
8
  </b-form-group>
13
9
  </div>
14
10
  </div>
@@ -25,6 +21,7 @@ export default {
25
21
  props: {
26
22
  title: String,
27
23
  options: Array,
24
+ fieldTarget: String,
28
25
  disabled: Boolean,
29
26
  stacked: Boolean,
30
27
  markFormDirty: {
@@ -40,6 +37,7 @@ export default {
40
37
  },
41
38
  methods: {
42
39
  ...mapMutations("validation", ["updateFormDirty"]),
40
+ ...mapMutations("generic", ["addFilter"]),
43
41
  },
44
42
  watch: {
45
43
  value() {
@@ -47,8 +45,13 @@ export default {
47
45
  },
48
46
  selected() {
49
47
  this.$emit("input", this.selected);
48
+
50
49
  if (this.markFormDirty) this.updateFormDirty(true);
51
50
  if (this.changed) this.changed();
51
+ if (this.fieldTarget) {
52
+ let obj = { fieldTarget: this.fieldTarget, value: this.selected };
53
+ this.addFilter(obj);
54
+ }
52
55
  },
53
56
  },
54
57
  };
@@ -60,6 +63,7 @@ export default {
60
63
  text-transform: uppercase;
61
64
  color: #778498;
62
65
  }
66
+
63
67
  .options {
64
68
  margin-top: 5px;
65
69
  }
@@ -1,34 +1,25 @@
1
1
  <template>
2
2
  <div class="filter-horizontal">
3
- <Collapse
4
- :buttonShow="{
5
- title: 'Mais filtros',
6
- icon: 'fas fa-arrow-alt-circle-down',
7
- type: 'info',
8
- }"
9
- :buttonHide="{
10
- title: 'Menos filtros',
11
- icon: 'fas fa-arrow-alt-circle-up',
12
- type: 'warning',
13
- }"
14
- >
3
+ <Collapse :buttonShow="{
4
+ title: 'Mais filtros',
5
+ icon: 'fas fa-arrow-alt-circle-down',
6
+ type: 'info',
7
+ }" :buttonHide="{
8
+ title: 'Menos filtros',
9
+ icon: 'fas fa-arrow-alt-circle-up',
10
+ type: 'warning',
11
+ }">
12
+ <slot name="content-filter-horizontal"></slot>
15
13
  <b-row>
16
- <b-col :sm="showTotalPerPage ? 10 : 12">
17
- <slot name="content-filter-horizontal"></slot>
18
- </b-col>
14
+ <b-col :sm="showTotalPerPage ? 10 : 12"></b-col>
19
15
  <b-col xs="12" sm="12" md="12" lg="2" xl="2" v-if="showTotalPerPage">
20
- <SelectStatic
21
- title="Mostrar"
22
- fieldTarget="totalPerPage"
23
- :initialValue="{ content: '10', id: 10 }"
24
- :data="[
25
- { content: '10', id: 10 },
26
- { content: '20', id: 20 },
27
- { content: '30', id: 30 },
28
- { content: '50', id: 50 },
29
- { content: '100', id: 100 },
30
- ]"
31
- />
16
+ <SelectStatic title="Mostrar" fieldTarget="totalPerPage" :initialValue="{ content: '10', id: 10 }" :data="[
17
+ { content: '10', id: 10 },
18
+ { content: '20', id: 20 },
19
+ { content: '30', id: 30 },
20
+ { content: '50', id: 50 },
21
+ { content: '100', id: 100 },
22
+ ]" />
32
23
  </b-col>
33
24
  </b-row>
34
25
  </Collapse>
@@ -4,44 +4,25 @@
4
4
  {{ title }}
5
5
  </div>
6
6
  <div class="alignment" v-for="option in options">
7
- <div
8
- class="option"
9
- :style="'width:' + width + 'px; height:' + height + 'px'"
10
- :class="{ selected: option.value == selected }"
11
- @click="optionSelected(option.value)"
12
- >
13
- <div class="div-content text-center">
14
- <span :style="'font-size:' + option.titleSize + 'px;'">
7
+ <div class="option" :style="'width:' + width + 'px; height:' + height + 'px'"
8
+ :class="{ selected: option.value == selected }" @click="optionSelected(option.value)">
9
+ <div class="text-center">
10
+ <span :class="{ disabled: disabled }" :style="'font-size:' + option.titleSize + 'px;'">
15
11
  <i v-if="size === 'small'" :class="option.icon"></i>
16
12
  {{ option.title }}
17
13
  </span>
18
- <div
19
- v-if="size === 'medium'"
20
- class="icon"
21
- :style="'font-size:' + option.iconSize + 'px;'"
22
- >
14
+ <div v-if="size === 'medium'" class="icon" :style="'font-size:' + option.iconSize + 'px;'">
23
15
  <i :class="option.icon"></i>
24
16
  </div>
25
17
  </div>
26
18
  <div v-if="option.tipId">
27
- <i
28
- v-b-tooltip.hover
29
- :title="tip(option.tipId)"
30
- class="fas fa-question-circle"
31
- ></i>
19
+ <i v-b-tooltip.hover :title="tip(option.tipId)" class="fas fa-question-circle"></i>
32
20
  </div>
33
21
  </div>
34
22
  </div>
35
23
  <div class="div-btn" v-if="showButtonNext">
36
- <Button
37
- _key="btnClickedNext"
38
- type="info"
39
- title="Avançar"
40
- :disabled="selected == null"
41
- :classIcon="buttonClassIcon"
42
- :size="buttonSize"
43
- :clicked="execute"
44
- />
24
+ <Button _key="btnClickedNext" type="info" title="Avançar" :disabled="selected == null" :classIcon="buttonClassIcon"
25
+ :size="buttonSize" :clicked="execute" />
45
26
  </div>
46
27
  </div>
47
28
  </template>
@@ -58,14 +39,17 @@ export default {
58
39
  props: {
59
40
  title: String,
60
41
  titleSize: Number,
42
+ fieldTarget: String,
61
43
  buttonSize: String,
62
44
  buttonClassIcon: String,
63
45
  showButtonNext: { type: Boolean, default: true },
64
46
  size: { type: String, default: "medium" },
65
47
  alignment: { type: String, default: "text-center" },
48
+ disabled: Boolean,
66
49
  width: Number,
67
50
  height: Number,
68
51
  options: Array,
52
+ initialValue: Number,
69
53
  value: Number,
70
54
  clickedNext: Function,
71
55
  },
@@ -75,10 +59,19 @@ export default {
75
59
  };
76
60
  },
77
61
  methods: {
78
- ...mapMutations("generic", ["removeLoading"]),
62
+ ...mapMutations("generic", ["addFilter", "removeLoading"]),
79
63
  optionSelected(value) {
80
- this.selected = value;
81
- this.$emit("input", value);
64
+ if (!this.disabled) {
65
+ this.selected = value;
66
+ this.$emit("input", value);
67
+ this.executeFilter(value);
68
+ }
69
+ },
70
+ executeFilter(value) {
71
+ if (this.fieldTarget) {
72
+ let obj = { fieldTarget: this.fieldTarget, value: value };
73
+ this.addFilter(obj);
74
+ }
82
75
  },
83
76
  execute() {
84
77
  let self = this;
@@ -96,7 +89,7 @@ export default {
96
89
  <style scoped>
97
90
  .div-main {
98
91
  margin: auto;
99
- padding: 10px;
92
+ padding: 0px;
100
93
  }
101
94
 
102
95
  .option {
@@ -110,6 +103,9 @@ export default {
110
103
  margin-bottom: 10px;
111
104
  font-size: 16px;
112
105
  font-weight: normal;
106
+ display: flex;
107
+ align-items: center;
108
+ justify-content: center;
113
109
  box-shadow: 0px 10px 20px -6px rgb(0 0 0 / 2%);
114
110
  }
115
111
 
@@ -121,10 +117,6 @@ export default {
121
117
  background-color: white;
122
118
  }
123
119
 
124
- .div-content {
125
- padding: 10px;
126
- }
127
-
128
120
  .selected {
129
121
  background-color: white;
130
122
  border-color: #4680a5;
@@ -147,4 +139,9 @@ export default {
147
139
  .div-btn {
148
140
  margin-top: 10px;
149
141
  }
142
+
143
+ .disabled {
144
+ color: grey;
145
+ opacity: 0.5;
146
+ }
150
147
  </style>
@@ -26,23 +26,13 @@
26
26
  <Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
27
27
  <div class="fixed-bar-options" v-show="selected.length > 0">
28
28
  <div>
29
- <Button
30
- v-if="buttonRemove"
31
- key="remove"
32
- :title="`Remover ${selected.length}`"
33
- type="danger"
34
- size="small"
35
- :clicked="removeSelected"
36
- />
29
+ <Button v-if="buttonRemove" key="remove" :title="`Remover ${selected.length}`" type="danger" size="small"
30
+ :clicked="removeSelected" />
37
31
  <slot name="content-buttons-table-header"></slot>
38
32
  </div>
39
33
  </div>
40
- <Table
41
- :header="templateList.headerTable"
42
- :data="content.data"
43
- :showChecks="templateList.showChecks"
44
- :dragAndDrop="templateList.dragAndDrop"
45
- >
34
+ <Table :header="templateList.headerTable" :data="content.data" :showChecks="templateList.showChecks"
35
+ :dragAndDrop="templateList.dragAndDrop">
46
36
  <div slot="content-buttons-table">
47
37
  <slot name="content-buttons-table"></slot>
48
38
  </div>
@@ -171,9 +161,36 @@ export default {
171
161
  notNotifyToast: true,
172
162
  };
173
163
 
174
- this.orderAllApi(params).then((response) => {});
164
+ this.orderAllApi(params).then((response) => { });
175
165
  }
176
166
  },
167
+ selectFilter(value) {
168
+ let fieldTarget = value.fieldTarget;
169
+ let obj = { key: fieldTarget, value: value.value };
170
+ this.paramsFilter.push(obj);
171
+
172
+ var result = {};
173
+ for (var i = 0; i < this.paramsFilter.length; i++) {
174
+ let key = this.paramsFilter[i].key;
175
+ let value = this.paramsFilter[i].value;
176
+
177
+ if (key == "period") {
178
+ result["start"] = value.start;
179
+ result["end"] = value.end;
180
+ } else {
181
+ result[key] = value;
182
+ }
183
+ }
184
+
185
+ this.dynamicFilter = result;
186
+
187
+ this.updatePagination({
188
+ key: "templateList",
189
+ totalPerPage: this.dynamicFilter.totalPerPage,
190
+ });
191
+
192
+ this.getAll();
193
+ },
177
194
  removeSelected() {
178
195
  let params = {
179
196
  url: this.templateList.urlDeleteAllApi,
@@ -227,31 +244,7 @@ export default {
227
244
  },
228
245
  selectStatic: {
229
246
  handler(value) {
230
- let fieldTarget = value.fieldTarget;
231
- let obj = { key: fieldTarget, value: value.value };
232
- this.paramsFilter.push(obj);
233
-
234
- var result = {};
235
- for (var i = 0; i < this.paramsFilter.length; i++) {
236
- let key = this.paramsFilter[i].key;
237
- let value = this.paramsFilter[i].value;
238
-
239
- if (key == "period") {
240
- result["start"] = value.inicio;
241
- result["end"] = value.fim;
242
- } else {
243
- result[key] = value;
244
- }
245
- }
246
-
247
- this.dynamicFilter = result;
248
-
249
- this.updatePagination({
250
- key: "templateList",
251
- totalPerPage: this.dynamicFilter.totalPerPage,
252
- });
253
-
254
- this.getAll();
247
+ this.selectFilter(value);
255
248
  },
256
249
  deep: true,
257
250
  },
@@ -1,12 +1,7 @@
1
1
  <template>
2
2
  <div>
3
- <Panel
4
- :module="panel.module"
5
- :title="panel.title"
6
- :showVerticalFilter="panel.showVerticalFilter"
7
- :showSearch="panel.showSearch"
8
- :showButtons="panel.showButtons"
9
- >
3
+ <Panel :module="panel.module" :title="panel.title" :showVerticalFilter="panel.showVerticalFilter"
4
+ :showSearch="panel.showSearch" :showButtons="panel.showButtons">
10
5
  <div slot="content-filter-vertical">
11
6
  <slot name="content-filter-vertical"></slot>
12
7
  </div>
@@ -14,11 +9,9 @@
14
9
  <slot name="content-buttons"></slot>
15
10
  </div>
16
11
  <div slot="content-main">
12
+ <slot name="content-between-search-table"></slot>
17
13
  <Molded>
18
- <ListViewWithDataHandler
19
- :templateList="templateList"
20
- :buttonRemove="buttonRemove"
21
- >
14
+ <ListViewWithDataHandler :templateList="templateList" :propsParam="propsParam" :buttonRemove="buttonRemove">
22
15
  <div slot="content-buttons-table-header">
23
16
  <slot name="content-buttons-table-header"></slot>
24
17
  </div>
@@ -47,6 +40,7 @@ export default {
47
40
  props: {
48
41
  panel: Object,
49
42
  templateList: Object,
43
+ propsParam: Object,
50
44
  buttonRemove: {
51
45
  type: Boolean,
52
46
  default: true,
@@ -308,9 +308,11 @@ export default {
308
308
  });
309
309
  },
310
310
  addFilter: (state, obj) => {
311
- state.selectStatic.dateTime = new Date();
312
- state.selectStatic.fieldTarget = obj.fieldTarget;
313
- state.selectStatic.value = obj.value;
311
+ setTimeout(function () {
312
+ state.selectStatic.dateTime = new Date();
313
+ state.selectStatic.fieldTarget = obj.fieldTarget;
314
+ state.selectStatic.value = obj.value;
315
+ }, 100);
314
316
  },
315
317
  },
316
318
  actions: {