@nixweb/nixloc-ui 0.0.128 → 0.0.129

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.
Files changed (84) hide show
  1. package/package.json +87 -79
  2. package/src/App.vue +13 -13
  3. package/src/component/forms/Button.vue +171 -170
  4. package/src/component/forms/ButtonGroup.vue +57 -0
  5. package/src/component/forms/ButtonSub.vue +98 -0
  6. package/src/component/forms/CheckboxGroup.vue +73 -72
  7. package/src/component/forms/CheckboxSimple.vue +46 -46
  8. package/src/component/forms/Color.vue +38 -38
  9. package/src/component/forms/DateTime.vue +167 -167
  10. package/src/component/forms/Dropdown.vue +242 -218
  11. package/src/component/forms/EditorHtml.vue +126 -126
  12. package/src/component/forms/FileUpload.vue +185 -185
  13. package/src/component/forms/IncrementDecrement.vue +7 -2
  14. package/src/component/forms/InputDecimal.vue +150 -142
  15. package/src/component/forms/InputDecimalDiscount.vue +92 -0
  16. package/src/component/forms/InputNumber.vue +160 -154
  17. package/src/component/forms/InputPassword.vue +135 -135
  18. package/src/component/forms/InputText.vue +174 -162
  19. package/src/component/forms/InputTextEdit.vue +68 -0
  20. package/src/component/forms/Modal.vue +65 -65
  21. package/src/component/forms/RadioGroup.vue +50 -50
  22. package/src/component/forms/Select.vue +351 -349
  23. package/src/component/forms/SelectStatic.vue +127 -127
  24. package/src/component/forms/Slider.vue +18 -18
  25. package/src/component/forms/TextArea.vue +126 -126
  26. package/src/component/forms/Toggle.vue +3 -1
  27. package/src/component/layout/Account.vue +3 -3
  28. package/src/component/layout/Alert.vue +92 -92
  29. package/src/component/layout/Badge.vue +104 -103
  30. package/src/component/layout/FixedBar.vue +100 -100
  31. package/src/component/layout/Gantt.vue +130 -0
  32. package/src/component/layout/Header.vue +38 -38
  33. package/src/component/layout/IconMolded.vue +48 -0
  34. package/src/component/layout/LoadingFullPage.vue +27 -27
  35. package/src/component/layout/Menu.vue +213 -210
  36. package/src/component/layout/Molded.vue +28 -28
  37. package/src/component/layout/Panel.vue +140 -140
  38. package/src/component/layout/Popover.vue +126 -126
  39. package/src/component/layout/ScrollBar.vue +42 -42
  40. package/src/component/layout/Wizard.vue +211 -211
  41. package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
  42. package/src/component/rental/DisplayPeriodRent.vue +19 -44
  43. package/src/component/rental/DisplayTotalization.vue +11 -2
  44. package/src/component/shared/Collapse.vue +131 -131
  45. package/src/component/shared/Confirmation.vue +21 -2
  46. package/src/component/shared/DocumentPreview.vue +2 -1
  47. package/src/component/shared/ExportPDF.vue +116 -116
  48. package/src/component/shared/FullCalendar.vue +159 -0
  49. package/src/component/shared/HorizontalFilter.vue +59 -59
  50. package/src/component/shared/Loading.vue +107 -107
  51. package/src/component/shared/LoadingMoreButton.vue +23 -23
  52. package/src/component/shared/Messages.vue +81 -81
  53. package/src/component/shared/PDFViewer.vue +22 -22
  54. package/src/component/shared/Pagination.vue +52 -52
  55. package/src/component/shared/ProgressBar.vue +22 -22
  56. package/src/component/shared/QueryButton.vue +66 -66
  57. package/src/component/shared/SaveCancel.vue +3 -2
  58. package/src/component/shared/Search.vue +154 -154
  59. package/src/component/shared/Table.vue +163 -163
  60. package/src/component/shared/TableButton.vue +36 -36
  61. package/src/component/shared/TableTotalization.vue +47 -47
  62. package/src/component/shared/TimeLine.vue +47 -0
  63. package/src/component/shared/Tip.vue +42 -42
  64. package/src/component/shared/Toast.vue +54 -54
  65. package/src/component/shared/VerticalFilter.vue +97 -97
  66. package/src/component/shared/query-builder/AddRule.vue +181 -181
  67. package/src/component/shared/query-builder/DynamicComponentList.vue +73 -73
  68. package/src/component/shared/query-builder/QueryBuilder.vue +69 -69
  69. package/src/component/shared/query-builder/utilities.js +21 -21
  70. package/src/component/template/ListViewWithDataHandler.vue +260 -260
  71. package/src/component/template/ViewTemplateConfiguration.vue +64 -64
  72. package/src/component/template/ViewTemplateReportList.vue +1 -1
  73. package/src/component/template/ViewTemplateReportPreview.vue +0 -1
  74. package/src/component/template/ViewTemplateWithSalveCancel.vue +32 -32
  75. package/src/component/template/ViewTemplateWithTable.vue +56 -56
  76. package/src/config/axios.js +9 -9
  77. package/src/config/dicas.js +14 -14
  78. package/src/config/router.js +13 -13
  79. package/src/config/token.js +14 -14
  80. package/src/main.js +23 -23
  81. package/src/store/modules/generic.js +543 -512
  82. package/src/store/modules/user.js +3 -0
  83. package/src/store/modules/validation.js +38 -38
  84. package/src/store/store.js +13 -13
@@ -1,22 +1,22 @@
1
- /**
2
- * Returns a depply cloned object without reference.
3
- * Copied from Vue MultiSelect and Vuex.
4
- * @type {Object}
5
- */
6
- const deepClone = function (obj) {
7
- if (Array.isArray(obj)) {
8
- return obj.map(deepClone)
9
- } else if (obj && typeof obj === 'object') {
10
- var cloned = {}
11
- var keys = Object.keys(obj)
12
- for (var i = 0, l = keys.length; i < l; i++) {
13
- var key = keys[i]
14
- cloned[key] = deepClone(obj[key])
15
- }
16
- return cloned
17
- } else {
18
- return obj
19
- }
20
- }
21
-
1
+ /**
2
+ * Returns a depply cloned object without reference.
3
+ * Copied from Vue MultiSelect and Vuex.
4
+ * @type {Object}
5
+ */
6
+ const deepClone = function (obj) {
7
+ if (Array.isArray(obj)) {
8
+ return obj.map(deepClone)
9
+ } else if (obj && typeof obj === 'object') {
10
+ var cloned = {}
11
+ var keys = Object.keys(obj)
12
+ for (var i = 0, l = keys.length; i < l; i++) {
13
+ var key = keys[i]
14
+ cloned[key] = deepClone(obj[key])
15
+ }
16
+ return cloned
17
+ } else {
18
+ return obj
19
+ }
20
+ }
21
+
22
22
  export default deepClone;
@@ -1,260 +1,260 @@
1
- <template>
2
- <div>
3
- <div :class="{ 'g-div-molded': showMolded }">
4
- <b-row>
5
- <b-col sm="12">
6
- <div>
7
- <HorizontalFilter v-if="showHorizontalFilter">
8
- <div slot="content-filter-horizontal">
9
- <slot name="content-filter-horizontal"></slot>
10
- </div>
11
- </HorizontalFilter>
12
- </div>
13
- </b-col>
14
- </b-row>
15
- <b-row>
16
- <b-col sm="6">
17
- <div v-if="templateList.dragAndDrop">
18
- <i class="fa-regular fa-maximize"></i> Clique e arraste para ordenar
19
- </div>
20
- <TableTotalization :totalization="content.totalization" />
21
- </b-col>
22
- <b-col sm="6">
23
- <TableTotalRecords :totalRecords="content.totalRecords" />
24
- </b-col>
25
- </b-row>
26
- <Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
27
- <FixedBar posicao="topo" v-show="selected.length > 0">
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
- />
37
- <slot name="content-buttons-table-header"></slot>
38
- </div>
39
- </FixedBar>
40
- <Table
41
- :header="templateList.headerTable"
42
- :data="content.data"
43
- :showChecks="templateList.showChecks"
44
- :dragAndDrop="templateList.dragAndDrop"
45
- >
46
- <div slot="content-buttons-table">
47
- <slot name="content-buttons-table"></slot>
48
- </div>
49
- </Table>
50
- </div>
51
- <br />
52
- <Pagination _key="templateList" :totalRecords="content.totalRecords" />
53
- </div>
54
- </template>
55
-
56
- <script>
57
- import Pagination from "@nixweb/nixloc-ui/src/component/shared/Pagination.vue";
58
- import Table from "../shared/Table.vue";
59
- import Button from "../forms/Button.vue";
60
- import FixedBar from "../layout/FixedBar.vue";
61
- import TableTotalRecords from "../shared/TableTotalRecords.vue";
62
- import TableTotalization from "../shared/TableTotalization.vue";
63
- import HorizontalFilter from "../shared/HorizontalFilter.vue";
64
- import Loading from "../shared/Loading.vue";
65
-
66
- import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
67
-
68
- export default {
69
- name: "ListViewWithDataHandler",
70
- props: {
71
- templateList: Object,
72
- propsParam: Object,
73
- showMolded: {
74
- type: Boolean,
75
- default: true,
76
- },
77
- showHorizontalFilter: {
78
- type: Boolean,
79
- default: true,
80
- },
81
- buttonRemove: {
82
- type: Boolean,
83
- default: true,
84
- },
85
- },
86
- components: {
87
- HorizontalFilter,
88
- TableTotalization,
89
- TableTotalRecords,
90
- Loading,
91
- FixedBar,
92
- Button,
93
- Table,
94
- Pagination,
95
- },
96
- data() {
97
- return {
98
- content: {
99
- data: [],
100
- totalRecords: 0,
101
- },
102
- baseParams: {
103
- search: undefined,
104
- filter: "contains",
105
- currentPage: 1,
106
- totalPerPage: 10,
107
- },
108
- paramsFilter: [],
109
- dynamicFilter: {},
110
- };
111
- },
112
- created() {
113
- // o carregamento inicial getAll() é feito pela mudança no paginationKey
114
- },
115
- mounted() {
116
- this.updatePagination({
117
- key: "templateList",
118
- totalPerPage: this.baseParams.totalPerPage,
119
- });
120
- },
121
- beforeDestroy() {
122
- let search = { content: "", filter: { content: "Contém", id: "contains" } };
123
- this.updateSearch(search);
124
- },
125
- computed: {
126
- ...mapState("generic", [
127
- "selected",
128
- "methodExecutedApi",
129
- "search",
130
- "executedSearch",
131
- "clearedSearch",
132
- "totalPerPage",
133
- "selectStatic",
134
- ]),
135
- ...mapGetters("generic", ["pagination", "isLoading", "event"]),
136
- paginationKey: function () {
137
- return this.pagination("templateList");
138
- },
139
- },
140
- methods: {
141
- ...mapActions("generic", ["getApi", "orderAllApi", "deleteAllApi"]),
142
- ...mapMutations("generic", [
143
- "addLoading",
144
- "removeLoading",
145
- "addSelected",
146
- "updatePagination",
147
- "updateSearch",
148
- ]),
149
- getAll() {
150
- let obj = { ...this.baseParams, ...this.dynamicFilter, ...this.propsParam };
151
- let params = { url: this.templateList.urlGetApi, obj: obj };
152
- this.getApi(params).then((response) => {
153
- this.content = response.content;
154
- let self = this;
155
- setTimeout(function () {
156
- self.removeLoading(["panel", "loadingLine", "btnSearch", "btnClean"]);
157
- }, 350);
158
- });
159
- },
160
- orderAll(data) {
161
- let obj = { listIds: data.listIds };
162
-
163
- let params = {
164
- url: this.templateList.urlOrderAllApi,
165
- obj: obj,
166
- notNotifyToast: true,
167
- };
168
-
169
- this.orderAllApi(params).then((response) => {});
170
- },
171
- removeSelected() {
172
- let params = {
173
- url: this.templateList.urlDeleteAllApi,
174
- selected: this.selected,
175
- };
176
- this.deleteAllApi(params).then(() => {
177
- this.removeLoading(["remove"]);
178
- this.addSelected([]);
179
- });
180
- },
181
- cleanParams() {
182
- this.baseParams.currentPage = 1;
183
- },
184
- },
185
- watch: {
186
- event: {
187
- handler(event) {
188
- if (event.name == "tableDragAndDrop") this.orderAll(event.data);
189
- },
190
- deep: true,
191
- },
192
- methodExecutedApi: function (value) {
193
- if (
194
- value === "postApi" ||
195
- value === "putApi" ||
196
- value === "deleteAllApi" ||
197
- value === "deleteAllApiErro"
198
- ) {
199
- this.getAll();
200
- }
201
- },
202
- executedSearch: function () {
203
- this.baseParams.search = this.search.content;
204
- if (this.search.filter.id) this.baseParams.filter = this.search.filter.id;
205
- this.cleanParams();
206
- this.getAll();
207
- },
208
- clearedSearch: function () {
209
- this.baseParams.search = "";
210
- this.baseParams.filter = "";
211
- this.cleanParams();
212
- this.getAll();
213
- },
214
- paginationKey: {
215
- handler(value) {
216
- this.cleanParams();
217
- this.baseParams.currentPage = value.currentPage;
218
- this.getAll();
219
- },
220
- deep: true,
221
- },
222
- selectStatic: {
223
- handler(value) {
224
- let fieldTarget = value.fieldTarget;
225
- let obj = { key: fieldTarget, value: value.value };
226
- this.paramsFilter.push(obj);
227
-
228
- var result = {};
229
- for (var i = 0; i < this.paramsFilter.length; i++) {
230
- let key = this.paramsFilter[i].key;
231
- let value = this.paramsFilter[i].value;
232
-
233
- if (key == "period") {
234
- result["start"] = value.inicio;
235
- result["end"] = value.fim;
236
- } else {
237
- result[key] = value;
238
- }
239
- }
240
-
241
- this.dynamicFilter = result;
242
-
243
- this.updatePagination({
244
- key: "templateList",
245
- totalPerPage: this.dynamicFilter.totalPerPage,
246
- });
247
-
248
- this.getAll();
249
- },
250
- deep: true,
251
- },
252
- },
253
- };
254
- </script>
255
-
256
- <style scoped>
257
- .div-button-excluir {
258
- padding-bottom: 10px;
259
- }
260
- </style>
1
+ <template>
2
+ <div>
3
+ <div :class="{ 'g-div-molded': showMolded }">
4
+ <b-row>
5
+ <b-col sm="12">
6
+ <div>
7
+ <HorizontalFilter v-if="showHorizontalFilter">
8
+ <div slot="content-filter-horizontal">
9
+ <slot name="content-filter-horizontal"></slot>
10
+ </div>
11
+ </HorizontalFilter>
12
+ </div>
13
+ </b-col>
14
+ </b-row>
15
+ <b-row>
16
+ <b-col sm="6">
17
+ <div v-if="templateList.dragAndDrop">
18
+ <i class="fa-regular fa-maximize"></i> Clique e arraste para ordenar
19
+ </div>
20
+ <TableTotalization :totalization="content.totalization" />
21
+ </b-col>
22
+ <b-col sm="6">
23
+ <TableTotalRecords :totalRecords="content.totalRecords" />
24
+ </b-col>
25
+ </b-row>
26
+ <Loading type="line" :center="false" v-show="isLoading('loadingLine')" />
27
+ <div class="fixed-bar-options" v-show="selected.length > 0">
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
+ />
37
+ <slot name="content-buttons-table-header"></slot>
38
+ </div>
39
+ </div>
40
+ <Table
41
+ :header="templateList.headerTable"
42
+ :data="content.data"
43
+ :showChecks="templateList.showChecks"
44
+ :dragAndDrop="templateList.dragAndDrop"
45
+ >
46
+ <div slot="content-buttons-table">
47
+ <slot name="content-buttons-table"></slot>
48
+ </div>
49
+ </Table>
50
+ </div>
51
+ <br />
52
+ <Pagination _key="templateList" :totalRecords="content.totalRecords" />
53
+ </div>
54
+ </template>
55
+
56
+ <script>
57
+ import Pagination from "@nixweb/nixloc-ui/src/component/shared/Pagination.vue";
58
+ import Table from "../shared/Table.vue";
59
+ import Button from "../forms/Button.vue";
60
+ import FixedBar from "../layout/FixedBar.vue";
61
+ import TableTotalRecords from "../shared/TableTotalRecords.vue";
62
+ import TableTotalization from "../shared/TableTotalization.vue";
63
+ import HorizontalFilter from "../shared/HorizontalFilter.vue";
64
+ import Loading from "../shared/Loading.vue";
65
+
66
+ import { mapState, mapGetters, mapActions, mapMutations } from "vuex";
67
+
68
+ export default {
69
+ name: "ListViewWithDataHandler",
70
+ props: {
71
+ templateList: Object,
72
+ propsParam: Object,
73
+ showMolded: {
74
+ type: Boolean,
75
+ default: true,
76
+ },
77
+ showHorizontalFilter: {
78
+ type: Boolean,
79
+ default: true,
80
+ },
81
+ buttonRemove: {
82
+ type: Boolean,
83
+ default: true,
84
+ },
85
+ },
86
+ components: {
87
+ HorizontalFilter,
88
+ TableTotalization,
89
+ TableTotalRecords,
90
+ Loading,
91
+ FixedBar,
92
+ Button,
93
+ Table,
94
+ Pagination,
95
+ },
96
+ data() {
97
+ return {
98
+ content: {
99
+ data: [],
100
+ totalRecords: 0,
101
+ },
102
+ baseParams: {
103
+ search: undefined,
104
+ filter: "contains",
105
+ currentPage: 1,
106
+ totalPerPage: 10,
107
+ },
108
+ paramsFilter: [],
109
+ dynamicFilter: {},
110
+ };
111
+ },
112
+ created() {
113
+ // o carregamento inicial getAll() é feito pela mudança no paginationKey
114
+ },
115
+ mounted() {
116
+ this.updatePagination({
117
+ key: "templateList",
118
+ totalPerPage: this.baseParams.totalPerPage,
119
+ });
120
+ },
121
+ beforeDestroy() {
122
+ let search = { content: "", filter: { content: "Contém", id: "contains" } };
123
+ this.updateSearch(search);
124
+ },
125
+ computed: {
126
+ ...mapState("generic", [
127
+ "selected",
128
+ "methodExecutedApi",
129
+ "search",
130
+ "executedSearch",
131
+ "clearedSearch",
132
+ "totalPerPage",
133
+ "selectStatic",
134
+ ]),
135
+ ...mapGetters("generic", ["pagination", "isLoading", "event"]),
136
+ paginationKey: function () {
137
+ return this.pagination("templateList");
138
+ },
139
+ },
140
+ methods: {
141
+ ...mapActions("generic", ["getApi", "orderAllApi", "deleteAllApi"]),
142
+ ...mapMutations("generic", [
143
+ "addLoading",
144
+ "removeLoading",
145
+ "addSelected",
146
+ "updatePagination",
147
+ "updateSearch",
148
+ ]),
149
+ getAll() {
150
+ let obj = { ...this.baseParams, ...this.dynamicFilter, ...this.propsParam };
151
+ let params = { url: this.templateList.urlGetApi, obj: obj };
152
+ this.getApi(params).then((response) => {
153
+ this.content = response.content;
154
+ let self = this;
155
+ setTimeout(function () {
156
+ self.removeLoading(["panel", "loadingLine", "btnSearch", "btnClean"]);
157
+ }, 350);
158
+ });
159
+ },
160
+ orderAll(data) {
161
+ let obj = { listIds: data.listIds };
162
+
163
+ let params = {
164
+ url: this.templateList.urlOrderAllApi,
165
+ obj: obj,
166
+ notNotifyToast: true,
167
+ };
168
+
169
+ this.orderAllApi(params).then((response) => {});
170
+ },
171
+ removeSelected() {
172
+ let params = {
173
+ url: this.templateList.urlDeleteAllApi,
174
+ selected: this.selected,
175
+ };
176
+ this.deleteAllApi(params).then(() => {
177
+ this.removeLoading(["remove"]);
178
+ this.addSelected([]);
179
+ });
180
+ },
181
+ cleanParams() {
182
+ this.baseParams.currentPage = 1;
183
+ },
184
+ },
185
+ watch: {
186
+ event: {
187
+ handler(event) {
188
+ if (event.name == "tableDragAndDrop") this.orderAll(event.data);
189
+ },
190
+ deep: true,
191
+ },
192
+ methodExecutedApi: function (value) {
193
+ if (
194
+ value === "postApi" ||
195
+ value === "putApi" ||
196
+ value === "deleteAllApi" ||
197
+ value === "deleteAllApiErro"
198
+ ) {
199
+ this.getAll();
200
+ }
201
+ },
202
+ executedSearch: function () {
203
+ this.baseParams.search = this.search.content;
204
+ if (this.search.filter.id) this.baseParams.filter = this.search.filter.id;
205
+ this.cleanParams();
206
+ this.getAll();
207
+ },
208
+ clearedSearch: function () {
209
+ this.baseParams.search = "";
210
+ this.baseParams.filter = "";
211
+ this.cleanParams();
212
+ this.getAll();
213
+ },
214
+ paginationKey: {
215
+ handler(value) {
216
+ this.cleanParams();
217
+ this.baseParams.currentPage = value.currentPage;
218
+ this.getAll();
219
+ },
220
+ deep: true,
221
+ },
222
+ selectStatic: {
223
+ handler(value) {
224
+ let fieldTarget = value.fieldTarget;
225
+ let obj = { key: fieldTarget, value: value.value };
226
+ this.paramsFilter.push(obj);
227
+
228
+ var result = {};
229
+ for (var i = 0; i < this.paramsFilter.length; i++) {
230
+ let key = this.paramsFilter[i].key;
231
+ let value = this.paramsFilter[i].value;
232
+
233
+ if (key == "period") {
234
+ result["start"] = value.inicio;
235
+ result["end"] = value.fim;
236
+ } else {
237
+ result[key] = value;
238
+ }
239
+ }
240
+
241
+ this.dynamicFilter = result;
242
+
243
+ this.updatePagination({
244
+ key: "templateList",
245
+ totalPerPage: this.dynamicFilter.totalPerPage,
246
+ });
247
+
248
+ this.getAll();
249
+ },
250
+ deep: true,
251
+ },
252
+ },
253
+ };
254
+ </script>
255
+
256
+ <style scoped>
257
+ .div-button-excluir {
258
+ padding-bottom: 10px;
259
+ }
260
+ </style>