@nixweb/nixloc-ui 0.0.127 → 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 (60) hide show
  1. package/package.json +9 -1
  2. package/src/component/forms/Button.vue +3 -2
  3. package/src/component/forms/ButtonGroup.vue +57 -0
  4. package/src/component/forms/ButtonSub.vue +98 -0
  5. package/src/component/forms/CheckboxGroup.vue +7 -0
  6. package/src/component/forms/CheckboxSimple.vue +5 -1
  7. package/src/component/forms/DateTime.vue +5 -1
  8. package/src/component/forms/Dropdown.vue +48 -30
  9. package/src/component/forms/ImageUpload.vue +12 -4
  10. package/src/component/forms/IncrementDecrement.vue +106 -0
  11. package/src/component/forms/InputDecimal.vue +17 -5
  12. package/src/component/forms/InputDecimalDiscount.vue +92 -0
  13. package/src/component/forms/InputNumber.vue +6 -0
  14. package/src/component/forms/InputText.vue +19 -2
  15. package/src/component/forms/InputTextEdit.vue +68 -0
  16. package/src/component/forms/RadioGroup.vue +2 -2
  17. package/src/component/forms/Select.vue +14 -3
  18. package/src/component/forms/Toggle.vue +3 -1
  19. package/src/component/layout/Account.vue +3 -3
  20. package/src/component/layout/Badge.vue +6 -5
  21. package/src/component/layout/FixedBar.vue +39 -7
  22. package/src/component/layout/Gantt.vue +130 -0
  23. package/src/component/layout/Header.vue +3 -0
  24. package/src/component/layout/IconMolded.vue +48 -0
  25. package/src/component/layout/Menu.vue +12 -14
  26. package/src/component/layout/Molded.vue +4 -3
  27. package/src/component/layout/Panel.vue +2 -2
  28. package/src/component/layout/Tab.vue +135 -0
  29. package/src/component/rental/DisplayCalculatePeriod.vue +49 -0
  30. package/src/component/rental/DisplayPeriodRent.vue +56 -0
  31. package/src/component/rental/DisplayTotalization.vue +56 -0
  32. package/src/component/shared/Confirmation.vue +21 -2
  33. package/src/component/shared/DocumentPreview.vue +3 -2
  34. package/src/component/shared/DocumentPublic.vue +34 -0
  35. package/src/component/shared/FullCalendar.vue +159 -0
  36. package/src/component/shared/HeaderReport.vue +1 -1
  37. package/src/component/shared/{BodyReport.vue → Report.vue} +8 -7
  38. package/src/component/shared/SaveCancel.vue +8 -2
  39. package/src/component/shared/Search.vue +1 -1
  40. package/src/component/shared/SelectOption.vue +18 -9
  41. package/src/component/shared/Table.vue +32 -123
  42. package/src/component/shared/TableDraggable.vue +127 -0
  43. package/src/component/shared/TableItem.vue +177 -0
  44. package/src/component/shared/TimeLine.vue +47 -0
  45. package/src/component/shared/TotalizationReport.vue +59 -0
  46. package/src/component/shared/query-builder/ConvertToOdata.js +3 -9
  47. package/src/component/shared/query-builder/DynamicComponent.vue +5 -1
  48. package/src/component/shared/query-builder/DynamicComponentList.vue +20 -9
  49. package/src/component/template/ListViewWithDataHandler.vue +26 -4
  50. package/src/component/template/ReportCreateUpdate.vue +9 -2
  51. package/src/component/template/ViewTemplateConfiguration.vue +1 -0
  52. package/src/component/template/ViewTemplateDocumentView.vue +1 -0
  53. package/src/component/template/ViewTemplateReportList.vue +1 -1
  54. package/src/component/template/ViewTemplateReportPreview.vue +55 -12
  55. package/src/component/value-objects/Contact.vue +7 -0
  56. package/src/component/value-objects/Person.vue +15 -0
  57. package/src/store/modules/generic.js +124 -75
  58. package/src/store/modules/report.js +37 -19
  59. package/src/store/modules/user.js +6 -0
  60. package/src/component/shared/query-builder/Totalization.vue +0 -38
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.127",
3
+ "version": "0.0.129",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -12,10 +12,18 @@
12
12
  "dependencies": {
13
13
  "@babel/polyfill": "^7.12.1",
14
14
  "@ckeditor/ckeditor5-vue2": "^2.0.0",
15
+ "@fullcalendar/core": "^5.11.3",
16
+ "@fullcalendar/daygrid": "^5.11.3",
17
+ "@fullcalendar/interaction": "^5.11.3",
18
+ "@fullcalendar/list": "^5.11.3",
19
+ "@fullcalendar/timegrid": "^5.11.3",
20
+ "@fullcalendar/vue": "^5.11.2",
15
21
  "axios": "^0.24.0",
16
22
  "bootstrap-vue": "^2.0.0-rc.11",
17
23
  "core-js": "^3.6.5",
24
+ "frappe-gantt": "^0.6.1",
18
25
  "sass-loader": "^10.1.1",
26
+ "timeline-vuejs": "^1.1.7",
19
27
  "v-runtime-template": "^1.10.0",
20
28
  "vodal": "^2.4.0",
21
29
  "vue": "^2.6.11",
@@ -77,6 +77,7 @@ export default {
77
77
  padding: 8px 12px;
78
78
  cursor: pointer;
79
79
  border: none;
80
+ min-width: 33px;
80
81
  border-radius: 40px !important;
81
82
  font-size: 13px !important;
82
83
  font-weight: normal;
@@ -88,13 +89,13 @@ export default {
88
89
  }
89
90
 
90
91
  .small {
91
- padding: 4px 8px;
92
+ padding: 3px 7px;
92
93
  font-size: 13px;
93
94
  }
94
95
 
95
96
  .medium {
96
97
  padding: 7px 12px;
97
- font-size: 13px;
98
+ font-size: 14px;
98
99
  }
99
100
 
100
101
  .large {
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <div>
3
+ <div>
4
+ <b-button-group size="sm">
5
+ <b-button
6
+ v-for="option in options"
7
+ :class="{ selected: option.title == selected }"
8
+ class="btn-group"
9
+ @click="execute(option)"
10
+ :key="option.title"
11
+ >
12
+ {{ option.title }}
13
+ </b-button>
14
+ </b-button-group>
15
+ </div>
16
+ </div>
17
+ </template>
18
+ <script>
19
+ import { mapMutations } from "vuex";
20
+
21
+ export default {
22
+ name: "ButtonGroup",
23
+ props: {
24
+ initialOption: String,
25
+ options: {
26
+ type: Array,
27
+ default: [],
28
+ },
29
+ },
30
+ data() {
31
+ return {
32
+ selected: "",
33
+ };
34
+ },
35
+ created() {
36
+ this.selected = this.initialOption;
37
+ },
38
+ methods: {
39
+ ...mapMutations("generic", ["addEvent"]),
40
+ execute(option) {
41
+ this.selected = option.title;
42
+ this.addEvent({ name: option.eventName, data: option });
43
+ },
44
+ },
45
+ };
46
+ </script>
47
+ <style scoped>
48
+ .btn-group {
49
+ background-color: white !important;
50
+ color: black !important;
51
+ border-color: #e9e9e9 !important;
52
+ outline: none !important;
53
+ }
54
+ .selected {
55
+ background-color: #f5f5f5 !important;
56
+ }
57
+ </style>
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div>
3
+ <div class="div-table-sub">
4
+ <div class="btn-close" @click="show" v-if="!open">
5
+ <i class="icon-table-sub fa-solid fa-arrow-left"></i>
6
+ </div>
7
+ <div class="btn-close" @click="hide" v-else>
8
+ <i class="icon-table-sub fa-solid fa-arrow-down"></i>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ </template>
13
+ <script>
14
+ import { mapActions, mapMutations } from "vuex";
15
+
16
+ export default {
17
+ name: "ButtonSub",
18
+ props: {
19
+ itemId: String,
20
+ urlGet: String,
21
+ eventNameShow: String,
22
+ eventNameHide: String,
23
+ propsParam: Object,
24
+ value: Object,
25
+ },
26
+ data() {
27
+ return {
28
+ open: false,
29
+ baseParams: {
30
+ search: undefined,
31
+ filter: "contains",
32
+ currentPage: 1,
33
+ totalPerPage: 20,
34
+ },
35
+ };
36
+ },
37
+ methods: {
38
+ ...mapActions("generic", ["getApi"]),
39
+ ...mapMutations("generic", ["addEvent"]),
40
+ getAll() {
41
+ this.$emit("input", { loading: true, itemId: this.itemId });
42
+ let params = {
43
+ url: this.urlGet,
44
+ obj: { ...this.propsParam, ...this.baseParams },
45
+ };
46
+ this.getApi(params).then((response) => {
47
+ this.addEvent({
48
+ name: this.eventNameShow,
49
+ data: { itemId: this.itemId, data: response.content.data },
50
+ });
51
+
52
+ let self = this;
53
+ setTimeout(function () {
54
+ self.$emit("input", { loading: false, itemId: this.itemId });
55
+ }, 500);
56
+ });
57
+ },
58
+ show() {
59
+ this.open = true;
60
+ this.getAll();
61
+ },
62
+ hide() {
63
+ this.open = false;
64
+ this.addEvent({
65
+ name: this.eventNameHide,
66
+ data: { itemId: this.itemId, data: [] },
67
+ });
68
+ },
69
+ },
70
+ };
71
+ </script>
72
+ <style scoped>
73
+ .div-table-sub {
74
+ overflow-y: hidden !important;
75
+ overflow-x: hidden !important;
76
+ background-color: #ececec;
77
+ border-radius: 50px;
78
+ height: 35px;
79
+ width: 35px;
80
+ margin-left: 10px;
81
+ cursor: pointer;
82
+ }
83
+
84
+ .div-table-sub:hover {
85
+ background-color: #dfdfdf;
86
+ }
87
+
88
+ .icon-table-sub {
89
+ font-size: 16px;
90
+ padding-top: 10px;
91
+ padding-right: 10px;
92
+ }
93
+
94
+ .btn-close {
95
+ margin-left: 10px;
96
+ height: 30px;
97
+ }
98
+ </style>
@@ -5,6 +5,7 @@
5
5
  v-model="selected"
6
6
  :options="options"
7
7
  :stacked="stacked"
8
+ disabled-field="disabled"
8
9
  @click.native="execute"
9
10
  ></b-form-checkbox-group>
10
11
  </b-form-group>
@@ -61,6 +62,12 @@ export default {
61
62
  },
62
63
  deep: true,
63
64
  },
65
+ initialValue: {
66
+ handler(value) {
67
+ if (this.initialValue) this.selected = this.initialValue;
68
+ },
69
+ deep: true,
70
+ },
64
71
  },
65
72
  };
66
73
  </script>
@@ -20,6 +20,10 @@ export default {
20
20
  formName: String,
21
21
  field: String,
22
22
  value: Boolean,
23
+ markFormDirty: {
24
+ type: Boolean,
25
+ default: true,
26
+ },
23
27
  },
24
28
  data() {
25
29
  return {
@@ -35,7 +39,7 @@ export default {
35
39
  },
36
40
  valueLocal() {
37
41
  this.$emit("input", this.valueLocal);
38
- this.updateFormDirty(true);
42
+ if (this.markFormDirty) this.updateFormDirty(true);
39
43
  },
40
44
  },
41
45
  };
@@ -65,17 +65,21 @@ export default {
65
65
  "range",
66
66
  "confirm",
67
67
  "confirmText",
68
+ "markFormDirty",
68
69
  ],
69
70
  data() {
70
71
  return {
71
72
  notifications: [],
72
73
  formDirty: false,
73
74
  valueLocal: "",
75
+ markFormDirtyLocal: false,
74
76
  };
75
77
  },
76
78
  created() {
77
79
  this.validate();
78
80
  this.valueLocal = this.value;
81
+
82
+ if (this.markFormDirty == undefined) this.markFormDirtyLocal = true;
79
83
  },
80
84
  methods: {
81
85
  ...mapMutations("validation", [
@@ -116,7 +120,7 @@ export default {
116
120
  valueLocal() {
117
121
  this.validate();
118
122
  this.formDirty = true;
119
- this.updateFormDirty(true);
123
+ if (this.markFormDirtyLocal) this.updateFormDirty(true);
120
124
  this.$emit("input", this.valueLocal);
121
125
  },
122
126
  value() {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="c-div-button">
2
+ <div class="side-by-side main-dropdown">
3
3
  <div class="dropdown">
4
4
  <button
5
5
  class="button dropbtn"
@@ -16,26 +16,34 @@
16
16
  disabled: disabled,
17
17
  }"
18
18
  :disabled="disabled"
19
- @click="mostrarEsconder()"
19
+ @click="toggle()"
20
20
  >
21
- {{ title }} <i :class="classIcon"></i>
21
+ {{ title }}
22
+ <span class="icon-dropdown"><i :class="classIcon"></i></span>
22
23
  </button>
23
24
  <div
24
25
  v-show="show"
25
26
  class="text-left dropdown-content"
27
+ :style="'right:' + right"
26
28
  @mouseleave="show = false"
27
29
  >
28
- <Molded>
30
+ <Molded :borderRadius="15">
29
31
  <div v-for="item in items" :key="item.eventName">
30
32
  <div
31
- v-if="visivel(item.condicaoVisibilidade)"
32
33
  :style="item.style"
33
34
  class="item"
34
35
  @click="execute(item.eventName)"
35
36
  >
36
- <i :class="item.classIcon"></i>
37
- <span class="title"> {{ item.title }}</span>
37
+ <b-row>
38
+ <b-col sm="1">
39
+ <i :class="item.classIcon"></i>
40
+ </b-col>
41
+ <b-col sm="10">
42
+ <span class="title"> {{ item.title }}</span>
43
+ </b-col>
44
+ </b-row>
38
45
  </div>
46
+ <hr v-if="item.hr" class="hr-dropdown" />
39
47
  </div>
40
48
  </Molded>
41
49
  </div>
@@ -49,6 +57,7 @@ import Molded from "../layout/Molded.vue";
49
57
  import { mapMutations } from "vuex";
50
58
 
51
59
  export default {
60
+ name: "Dropdown",
52
61
  components: { Molded },
53
62
  name: "Button",
54
63
  props: {
@@ -56,8 +65,12 @@ export default {
56
65
  type: String,
57
66
  classIcon: String,
58
67
  size: String,
68
+ right: {
69
+ type: String,
70
+ default: "0",
71
+ },
59
72
  disabled: Boolean,
60
- eventData: Object,
73
+ param: Object,
61
74
  items: Array,
62
75
  },
63
76
  data() {
@@ -67,31 +80,36 @@ export default {
67
80
  },
68
81
  methods: {
69
82
  ...mapMutations("generic", ["addEvent"]),
70
- mostrarEsconder() {
83
+ toggle() {
71
84
  this.show = this.show ? false : true;
72
85
  },
73
86
  execute(eventName) {
74
- this.mostrarEsconder();
75
- this.addEvent({
76
- nome: eventName,
77
- data: this.eventData,
78
- });
79
- },
80
- visivel(condicaoVisibilidade) {
81
- // se for undefined, quer dizer que não tem condicional, então pode show
82
- if (condicaoVisibilidade == undefined) return true;
83
-
84
- var verifica = `this.eventData.${condicaoVisibilidade}`;
85
- if (eval(verifica)) return true;
87
+ this.toggle();
88
+ this.addEvent({ name: eventName, data: this.param });
86
89
  },
87
90
  },
88
91
  };
89
92
  </script>
90
93
 
91
94
  <style scoped>
95
+ .main-dropdown {
96
+ overflow-y: visible !important;
97
+ overflow-x: visible !important;
98
+ }
99
+
100
+ .hr-dropdown {
101
+ background: #fafafc !important;
102
+ height: 1px !important;
103
+ margin: 0px !important;
104
+ }
105
+
92
106
  .item {
93
107
  cursor: pointer;
94
- padding: 5px;
108
+ padding-bottom: 5px;
109
+ }
110
+
111
+ .icon-dropdown {
112
+ margin-left: 5px;
95
113
  }
96
114
 
97
115
  .item:hover {
@@ -105,22 +123,22 @@ export default {
105
123
  .dropdown {
106
124
  position: relative;
107
125
  display: inline-block;
126
+ margin-left: 5px;
127
+ min-width: 30px;
108
128
  }
109
129
 
110
130
  .dropdown-content {
111
- display: block;
112
131
  position: absolute;
113
- margin-top: 10px;
114
- right: 0;
132
+ margin-top: 1px;
115
133
  background-color: #ffffff;
116
- min-width: 260px;
117
- box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
134
+ border-radius: 15px;
135
+ min-width: 250px;
118
136
  z-index: 1000;
119
137
  }
120
138
 
121
139
  .dropdown-content a {
122
140
  color: black;
123
- padding: 12px 16px;
141
+ padding: 10px 15px;
124
142
  text-decoration: none;
125
143
  display: block;
126
144
  }
@@ -142,13 +160,13 @@ export default {
142
160
  }
143
161
 
144
162
  .small {
145
- padding: 5px 10px;
163
+ padding: 3px 7px;
146
164
  font-size: 13px;
147
165
  }
148
166
 
149
167
  .medium {
150
168
  padding: 7px 12px;
151
- font-size: 13px;
169
+ font-size: 14px;
152
170
  }
153
171
 
154
172
  .large {
@@ -14,8 +14,9 @@
14
14
  <b-col sm="12">
15
15
  <div class="div-preview">
16
16
  <img
17
- :style="'width:120;height:100px'"
18
- :src="'https://espaco.blob.core.windows.net/nixloc-photo-product/' + urlImage"
17
+ :class="classCss"
18
+ :style="'width:100px;height:100px'"
19
+ :src="'https://espaco.blob.core.windows.net/' + container + '/' + urlImage"
19
20
  />
20
21
  </div>
21
22
  <div>
@@ -31,7 +32,9 @@
31
32
  <div v-else>
32
33
  <div class="div-button">
33
34
  <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
+ <span v-if="!loadingRemove"
36
+ ><i class="fas fa-camera"></i> Remover Foto</span
37
+ >
35
38
  <vue-loading
36
39
  v-if="loadingRemove"
37
40
  type="bubbles"
@@ -70,6 +73,7 @@ export default {
70
73
  title: String,
71
74
  container: String,
72
75
  accepted: String,
76
+ classCss:String,
73
77
  urlPost: String,
74
78
  urlRemove: String,
75
79
  onLoad: Function,
@@ -216,7 +220,11 @@ export default {
216
220
  margin-bottom: 10px;
217
221
  }
218
222
 
223
+ .img-round {
224
+ border-radius: 50px;
225
+ }
226
+
219
227
  .div-button {
220
- margin-left: 18px;
228
+ margin-left: 5px;
221
229
  }
222
230
  </style>
@@ -0,0 +1,106 @@
1
+ <template>
2
+ <div>
3
+ <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>
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ export default {
25
+ name: "IncrementDecrement",
26
+ props: ["value", "min", "max"],
27
+ data() {
28
+ return {
29
+ number: 1,
30
+ showEdit: false,
31
+ };
32
+ },
33
+ mounted() {
34
+ this.number = this.value;
35
+ },
36
+ methods: {
37
+ increment() {
38
+ this.number++;
39
+ },
40
+ decrement() {
41
+ this.number--;
42
+ },
43
+ },
44
+ watch: {
45
+ number: {
46
+ handler(number) {
47
+ if (this.min)
48
+ if (this.number < this.min) {
49
+ this.number = this.min;
50
+ return;
51
+ }
52
+ if (this.max)
53
+ if (this.number > this.max) {
54
+ this.number = this.max;
55
+ return;
56
+ }
57
+ this.$emit("input", this.number);
58
+ },
59
+ deep: true,
60
+ },
61
+ },
62
+ };
63
+ </script>
64
+
65
+ <style scoped>
66
+ .input {
67
+ width: 40px;
68
+ border: none;
69
+ text-align: center;
70
+ }
71
+
72
+ .wrapper {
73
+ height: 37px;
74
+ width: 100%;
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ background: #fff;
79
+ border-radius: 8px;
80
+ border: 1px solid #eaedf3;
81
+ box-shadow: 0px 10px 20px -6px rgb(0 0 0 / 3%);
82
+ }
83
+ .wrapper span {
84
+ width: 100%;
85
+ text-align: center;
86
+ font-size: 15px;
87
+ font-weight: 600;
88
+ cursor: pointer;
89
+ user-select: none;
90
+ }
91
+ .wrapper span.num {
92
+ font-size: 17px;
93
+ border-right: 1px solid #eaedf3;
94
+ border-left: 1px solid #eaedf3;
95
+ cursor: pointer;
96
+ color: #3f529b;
97
+ font-size: 14px;
98
+ font-weight: 400;
99
+ cursor: pointer;
100
+ }
101
+
102
+ .wrapper span.num:hover {
103
+ text-decoration: underline;
104
+ transition: 0.1s;
105
+ }
106
+ </style>
@@ -6,11 +6,15 @@
6
6
  <Tip :field="field" :formName="formName" />
7
7
  </label>
8
8
  <div class="inner-addon right-addon">
9
- <i
9
+ <div
10
+ class="required glyphicon"
10
11
  v-if="notifications.length > 0 && formDirty"
11
- class="required glyphicon fas fa-exclamation-triangle"
12
- ></i>
12
+ >
13
+ <i class="fas fa-exclamation-triangle"></i>
14
+ </div>
15
+ <slot v-else></slot>
13
16
  <vue-numeric
17
+ :style="_style"
14
18
  class="form-control"
15
19
  v-on:keyup.enter.native="pressedEnter"
16
20
  :class="{ 'is-invalid': notifications.length > 0 && formDirty }"
@@ -46,6 +50,11 @@ export default {
46
50
  disabled: Boolean,
47
51
  placeholder: String,
48
52
  formName: String,
53
+ _style: String,
54
+ markFormDirty: {
55
+ type: Boolean,
56
+ default: true,
57
+ },
49
58
  required: Boolean,
50
59
  value: Number,
51
60
  enter: Function,
@@ -93,9 +102,9 @@ export default {
93
102
  },
94
103
  valueLocal() {
95
104
  this.validate();
96
- this.formDirty = true;
97
- this.updateFormDirty(true);
98
105
  this.$emit("input", this.valueLocal);
106
+ this.formDirty = true;
107
+ if (this.markFormDirty) this.updateFormDirty(true);
99
108
  },
100
109
  notifications() {
101
110
  let self = this;
@@ -135,4 +144,7 @@ export default {
135
144
  color: #f0134d;
136
145
  font-size: 14px;
137
146
  }
147
+ .margin-button {
148
+ margin-top: -2px;
149
+ }
138
150
  </style>