@nixweb/nixloc-ui 0.0.129 → 0.0.130

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.129",
3
+ "version": "0.0.130",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <div class="c-div-button">
3
3
  <button
4
+ :style="'background-color:' + backroundColor + ';color:' + color"
4
5
  class="button"
5
6
  :class="{
6
7
  small: size === 'small',
@@ -17,7 +18,11 @@
17
18
  :disabled="disabled"
18
19
  @click="execute()"
19
20
  >
20
- <i class="title" :class="classIcon" v-if="!isLoading(this._key) && classIcon"></i>
21
+ <i
22
+ class="title"
23
+ :class="classIcon"
24
+ v-if="!isLoading(this._key) && classIcon"
25
+ ></i>
21
26
  <span v-if="!isLoading(this._key)">{{ title }}</span>
22
27
  <vue-loading
23
28
  v-if="isLoading(this._key)"
@@ -39,6 +44,8 @@ export default {
39
44
  title: String,
40
45
  type: String,
41
46
  size: String,
47
+ color: String,
48
+ backroundColor: String,
42
49
  eventName: String,
43
50
  eventData: Object,
44
51
  classIcon: String,
@@ -1,6 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <b-form-checkbox v-model="valueLocal" :value="true" :unchecked-value="false">
3
+ <b-form-checkbox
4
+ v-model="valueLocal"
5
+ :value="true"
6
+ :unchecked-value="false"
7
+ >
4
8
  {{ title }}
5
9
  <Tip :field="field" :formName="formName" />
6
10
  </b-form-checkbox>
@@ -20,6 +24,7 @@ export default {
20
24
  formName: String,
21
25
  field: String,
22
26
  value: Boolean,
27
+ changed: Function,
23
28
  markFormDirty: {
24
29
  type: Boolean,
25
30
  default: true,
@@ -40,6 +45,7 @@ export default {
40
45
  valueLocal() {
41
46
  this.$emit("input", this.valueLocal);
42
47
  if (this.markFormDirty) this.updateFormDirty(true);
48
+ if (this.changed) this.changed();
43
49
  },
44
50
  },
45
51
  };
@@ -4,12 +4,14 @@
4
4
  <div>
5
5
  <div class="document-editor__toolbar"></div>
6
6
  <div class="document-editor__editable-container">
7
- <ckeditor
8
- :editor="editor"
9
- v-model="documentHtml"
10
- @ready="onReady"
11
- @focus="changed"
12
- ></ckeditor>
7
+ <div id="template-dev">
8
+ <ckeditor
9
+ :editor="editor"
10
+ v-model="documentHtml"
11
+ @ready="onReady"
12
+ @focus="changed"
13
+ ></ckeditor>
14
+ </div>
13
15
  </div>
14
16
  </div>
15
17
  </div>
@@ -46,7 +48,9 @@ export default {
46
48
  methods: {
47
49
  ...mapMutations("generic", ["updateDocumentHtml", "addEvent"]),
48
50
  onReady(editor) {
49
- const toolbarContainer = document.querySelector(".document-editor__toolbar");
51
+ const toolbarContainer = document.querySelector(
52
+ ".document-editor__toolbar"
53
+ );
50
54
  toolbarContainer.appendChild(editor.ui.view.toolbar.element);
51
55
  },
52
56
  changed() {
@@ -78,12 +82,11 @@ export default {
78
82
  padding: 10px;
79
83
  border: 1px solid #e4e6ec;
80
84
  background: var(--ck-color-base-foreground);
81
- overflow-y: scroll;
82
85
  }
83
86
 
84
87
  .document-editor__editable-container .ck-editor__editable {
85
88
  width: 22cm;
86
- min-height: 21cm;
89
+ height: 700px;
87
90
  padding: 20px;
88
91
  border: 1px hsl(0, 0%, 82.7%) solid;
89
92
  border-radius: var(--ck-border-radius);
@@ -98,7 +101,9 @@ export default {
98
101
  }
99
102
 
100
103
  .document-editor .ck-heading-dropdown .ck-list .ck-button__label {
101
- line-height: calc(1.7 * var(--ck-line-height-base) * var(--ck-font-size-base));
104
+ line-height: calc(
105
+ 1.7 * var(--ck-line-height-base) * var(--ck-font-size-base)
106
+ );
102
107
  min-width: 6em;
103
108
  }
104
109
 
@@ -130,7 +135,10 @@ export default {
130
135
  color: hsl(203, 100%, 50%);
131
136
  }
132
137
 
133
- .document-editor .ck-heading-dropdown .ck-heading_heading2.ck-on .ck-button__label {
138
+ .document-editor
139
+ .ck-heading-dropdown
140
+ .ck-heading_heading2.ck-on
141
+ .ck-button__label {
134
142
  color: var(--ck-color-list-button-on-text);
135
143
  }
136
144
 
@@ -16,12 +16,11 @@ export default {
16
16
  template: String,
17
17
  d: Object,
18
18
  },
19
-
20
19
  methods: {
21
- sMg(grN) {
20
+ somaGrupo(grupo) {
22
21
  let total = "";
23
- this.d.pLoc.forEach((x) => {
24
- if (x.pGp === grN) return (total = x.pGpT);
22
+ this.d.itensLocacao.forEach((x) => {
23
+ if (x.grupo === grupo) return (total = x.valorTotal);
25
24
  });
26
25
  return total;
27
26
  },
@@ -29,7 +28,8 @@ export default {
29
28
  computed: {
30
29
  ...mapGetters("generic", ["groupBy"]),
31
30
  produtoAgrupado() {
32
- return this.groupBy({ array: this.d.produto, key: "pGp" });
31
+ var group = this.groupBy({ array: this.d.itensLocacao, key: "grupo" });
32
+ return group;
33
33
  },
34
34
  },
35
35
  };
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div>
3
3
  <Loading type="line" :center="false" v-show="loading" />
4
- <FullCalendar ref="cc" :options="calendarOptions" />
4
+ <FullCalendar :options="calendarOptions" />
5
5
  </div>
6
6
  </template>
7
7
 
@@ -137,6 +137,11 @@ export default {
137
137
  cursor: pointer !important;
138
138
  }
139
139
 
140
+ .fc-event-time {
141
+ color: black !important;
142
+ font-weight: normal !important;
143
+ }
144
+
140
145
  .fc-list-day-side-text {
141
146
  color: black !important;
142
147
  }
@@ -153,6 +158,10 @@ export default {
153
158
  color: black !important;
154
159
  }
155
160
 
161
+ .fc-list-event-title {
162
+ cursor: pointer !important;
163
+ }
164
+
156
165
  .fc-button-primary:hover {
157
166
  background: #3e90b3 !important;
158
167
  }
@@ -6,25 +6,25 @@
6
6
  <table class="table table-responsive-xs">
7
7
  <thead>
8
8
  <tr>
9
- <th><span class="title-header">Parâmetro</span></th>
10
9
  <th><span class="title-header">Descrição</span></th>
11
10
  <th><span class="title-header">Exemplo</span></th>
11
+ <th><span class="title-header">Parâmetro</span></th>
12
12
  </tr>
13
13
  </thead>
14
14
  <tbody v-for="(legendLocal, groupName) in grouped">
15
15
  <td class="group text-center" colspan="8">
16
- <div>{{ groupName.toUpperCase() }}</div>
16
+ <div>{{ groupName }}</div>
17
17
  </td>
18
18
  <tr v-for="item in legendLocal">
19
- <td class="parametro">
20
- <span> {{ item.parameter }}</span>
21
- </td>
22
- <td>
19
+ <td class="description">
23
20
  <span> {{ item.description }}</span>
24
21
  </td>
25
22
  <td>
26
23
  <span class="exemplo"> {{ item.example }}</span>
27
24
  </td>
25
+ <td class="parametro">
26
+ <span> {{ item.parameter }}</span>
27
+ </td>
28
28
  </tr>
29
29
  </tbody>
30
30
  </table>
@@ -70,23 +70,26 @@ export default {
70
70
  let legend = [];
71
71
  let self = this;
72
72
  setTimeout(function () {
73
- self.legend.forEach(function (item) {
74
- if (self.search.filter.content == "equal") {
75
- if (item.description == self.search.content) legend.push(item);
76
- }
77
- if (self.search.filter.content == "contains") {
78
- if (item.description.includes(self.search.content)) legend.push(item);
79
- }
80
- });
81
- self.legendLocal = legend;
82
- self.removeLoading(["search", "clean"]);
73
+ if (self.search.content) {
74
+ self.legend.forEach(function (item) {
75
+ if (self.search.filter.content == "equal") {
76
+ if (item.description == self.search.content) legend.push(item);
77
+ }
78
+ if (self.search.filter.content == "contains") {
79
+ if (item.description.includes(self.search.content))
80
+ legend.push(item);
81
+ }
82
+ });
83
+ self.legendLocal = legend;
84
+ }
85
+ self.removeLoading(["btnSearch", "btnClean"]);
83
86
  }, 300);
84
87
  },
85
88
  clearedSearch: function () {
86
89
  let self = this;
87
90
  setTimeout(function () {
88
91
  self.legendLocal = self.legend;
89
- self.removeLoading(["search", "clean"]);
92
+ self.removeLoading(["btnSearch", "btnClean"]);
90
93
  }, 300);
91
94
  },
92
95
  },
@@ -116,6 +119,10 @@ export default {
116
119
  font-weight: 500;
117
120
  }
118
121
 
122
+ .description {
123
+ width: 350px;
124
+ }
125
+
119
126
  .div-warning {
120
127
  margin-bottom: 20px;
121
128
  }
@@ -100,7 +100,7 @@
100
100
  <div class="a4">
101
101
  <div id="printMe">
102
102
  <DocumentPreview
103
- :template="documentPreview"
103
+ :template="documentPreview('dev')"
104
104
  :d="parameterExemple"
105
105
  />
106
106
  </div>
@@ -165,7 +165,12 @@ export default {
165
165
  ...mapGetters("generic", ["showModal", "event", "documentPreview"]),
166
166
  },
167
167
  methods: {
168
- ...mapMutations("generic", ["openModal", "hideModal", "removeLoading", "addEvent"]),
168
+ ...mapMutations("generic", [
169
+ "openModal",
170
+ "hideModal",
171
+ "removeLoading",
172
+ "addEvent",
173
+ ]),
169
174
  saveDocument() {
170
175
  if (this.id) {
171
176
  this.addEvent({ name: "saveDocument" });
@@ -67,11 +67,17 @@ export default {
67
67
  event: (state) => {
68
68
  return state.event;
69
69
  },
70
- documentPreview: (state) => {
70
+ documentPreview: (state) => (env) => {
71
71
  let documentHtml = state.documentHtml
72
72
  let ret = documentHtml;
73
73
 
74
- var template = document.getElementById("template");
74
+ var template = null;
75
+
76
+ if (env == 'dev')
77
+ template = document.getElementById("template-dev");
78
+
79
+ if (env == 'prod')
80
+ template = document.getElementById("template-prod");
75
81
 
76
82
  if (template != null) {
77
83
  var tables = template.getElementsByTagName("table");
@@ -93,24 +99,30 @@ export default {
93
99
 
94
100
  if (th) {
95
101
 
96
- let isGrouped = th.innerText.includes("n.grupo");
97
- let isProduct = th.innerText.includes("p.pLoc");
98
- let isPeriod = th.innerText.includes("n.periodo");
99
102
  let isPayment = th.innerText.includes("n.pagamento");
100
- let isMoviment = th.innerText.includes("p.pMoviment");
103
+
104
+
105
+ let isPeriod = th.innerText.includes("t.periodoLocacao");
106
+ let isProduct = th.innerText.includes("t.produtoLocacao");
107
+ let isGrouped = th.innerText.includes("t.produtoAgrupado");
108
+ let isMoviment = th.innerText.includes("t.produtoMovimentacao");
109
+ let isCustumerAdress = th.innerText.includes("t.enderecoCliente");
110
+
101
111
 
102
112
  if (isProduct) {
103
- obj.vForSimple = "v-for='p in d.pLoc'";
113
+ obj.vForSimple = "v-for='produto in d.itensLocacao'";
104
114
  config.push(obj);
105
115
  } else if (isPeriod) {
106
- obj.vForSimple = "v-for='pe in d.periodo'";
116
+ obj.vForSimple = "v-for='periodo in d.periodoLocacao'";
107
117
  config.push(obj);
108
118
  } else if (isPayment) {
109
119
  obj.vForSimple = "v-for='pg in d.pagamento'";
110
120
  config.push(obj);
111
121
  } else if (isGrouped) {
112
- obj.vForGrouped = "v-for='(produto, grN) in produtoAgrupado'";
113
- obj.vForSimple = "v-for='p in d.pLoc'";
122
+ obj.vForGrouped = "v-for='(itensLocacao, grupo) in produtoAgrupado'";
123
+ obj.vForSimple = "v-for='produto in itensLocacao'";
124
+
125
+ // neste cenário basicamente temos que montar o <tbody> no array de agrupamento
114
126
 
115
127
  var initIndex = documentHtml.split("<tbody>", index + 1).join("<tbody>").length;
116
128
  var lastIndex = documentHtml.split("</tbody>", index + 1).join("</tbody>").length;
@@ -119,13 +131,18 @@ export default {
119
131
 
120
132
  let tr = tbody.substring(tbody.indexOf("<tr>"), tbody.lastIndexOf("</tr>"));
121
133
 
134
+ // faz o replace nameGroup para tirar o <tr/>
122
135
  obj.nameGroup = tr.substring(0, tr.indexOf('</tr>')) + "</tr>";
123
136
  obj.nameGroup = obj.nameGroup.replaceAll("\"", "'");
124
137
  obj.nameGroupReplace = obj.nameGroup.replace("<tr>", "").replace("</tr>", "");
138
+
125
139
  config.push(obj);
126
140
 
127
141
  } else if (isMoviment) {
128
- obj.vForSimple = "v-for='pM in d.pMoviment'";
142
+ obj.vForSimple = "v-for='produto in d.itensMovimentacao'";
143
+ config.push(obj);
144
+ } else if (isCustumerAdress) {
145
+ obj.vForSimple = "v-for='endereco in d.locacao.cliente.endereco'";
129
146
  config.push(obj);
130
147
  } else {
131
148
  config.push(obj);
@@ -141,17 +158,20 @@ export default {
141
158
  replace += `.replace("<tbody>${x.nameGroup}<tr>", "<tbody ${x.vForGrouped}>${x.nameGroupReplace}<tr ${x.vForSimple}>")`;
142
159
  });
143
160
 
161
+
162
+
144
163
  var retParse = ret.replaceAll("\"", "'");
145
- retParse = eval(`ret${replace}`);
164
+ retParse = eval(`retParse${replace}`);
146
165
 
147
166
  var classImportant = retParse
148
- .replaceAll("n.grupo", "")
149
- .replaceAll("p.pLoc", "")
150
- .replaceAll("p.pMoviment", "")
151
- .replaceAll("n.periodo", "")
152
- .replaceAll("n.pagamento", "")
167
+ .replaceAll("t.periodoLocacao", "")
168
+ .replaceAll("t.produtoLocacao", "")
169
+ .replaceAll("t.produtoAgrupado", "")
170
+ .replaceAll("t.produtoMovimentacao", "")
171
+ .replaceAll("t.enderecoCliente", "")
153
172
  .replaceAll("<p>&nbsp!important;</p>", "<p>&nbsp</p>");
154
173
  }
174
+
155
175
  return classImportant;
156
176
  },
157
177
  groupBy: () => (obj) => {