@nixweb/nixloc-ui 0.0.174 → 0.0.176

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.174",
3
+ "version": "0.0.176",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -1,10 +1,6 @@
1
1
  <template>
2
2
  <div>
3
- <b-form-checkbox
4
- v-model="valueLocal"
5
- :value="true"
6
- :unchecked-value="false"
7
- >
3
+ <b-form-checkbox v-model="valueLocal" :value="true" :unchecked-value="false">
8
4
  {{ title }}
9
5
  <Tip :field="field" :formName="formName" />
10
6
  </b-form-checkbox>
@@ -22,6 +18,7 @@ export default {
22
18
  props: {
23
19
  title: String,
24
20
  formName: String,
21
+ fieldTarget: String,
25
22
  field: String,
26
23
  value: Boolean,
27
24
  changed: Function,
@@ -37,6 +34,7 @@ export default {
37
34
  },
38
35
  methods: {
39
36
  ...mapMutations("validation", ["updateFormDirty"]),
37
+ ...mapMutations("generic", ["addFilter"]),
40
38
  },
41
39
  mounted() {
42
40
  this.valueLocal = this.value;
@@ -49,6 +47,12 @@ export default {
49
47
  this.$emit("input", this.valueLocal);
50
48
  if (this.markFormDirty) this.updateFormDirty(true);
51
49
  if (this.changed) this.changed();
50
+
51
+ if (this.fieldTarget) {
52
+ let obj = { fieldTarget: this.fieldTarget, value: this.valueLocal ? "yes" : "no" };
53
+ this.addFilter(obj);
54
+ }
55
+
52
56
  },
53
57
  },
54
58
  };
@@ -7,8 +7,9 @@
7
7
  </label>
8
8
  <div class="inner-addon right-addon">
9
9
  <i v-if="notifications.length > 0 && formDirty" class="required glyphicon fas fa-exclamation-triangle"></i>
10
- <date-picker lang="pt-br" :range="range" @confirm="executeConfirm" @change="executeConfirm" @clear="close"
11
- :confirm="confirm" :confirm-text="confirmText" :format="format" value-type="format" :time-picker-options="{
10
+ <date-picker lang="pt-br" :disabled="disabled" :range="range" @confirm="executeConfirm" @change="executeConfirm"
11
+ @clear="close" :confirm="confirm" :confirm-text="confirmText" :format="format" value-type="format"
12
+ :time-picker-options="{
12
13
  start: '07:00',
13
14
  step: '00:30',
14
15
  end: '23:30',
@@ -42,6 +43,7 @@ export default {
42
43
  "placeholder",
43
44
  "formName",
44
45
  "required",
46
+ "disabled",
45
47
  "format",
46
48
  "type",
47
49
  "value",
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="div-tag">
3
- <div class="tag">
3
+ <div class="tag" :class="{ 'tag-disabled': disabled }">
4
4
  <span @click="execute()">{{ title }} <span v-if="value">:</span> {{ value }}</span>
5
- <i v-if="showButtonClose" @click="remove()" class="icon-tag fas fa-times-circle"></i>
5
+ <i v-if="showButtonClose && !disabled" @click="remove()" class="icon-tag fas fa-times-circle"></i>
6
6
  </div>
7
7
  </div>
8
8
  </template>
@@ -15,6 +15,7 @@ export default {
15
15
  props: {
16
16
  _key: String,
17
17
  title: String,
18
+ disabled: Boolean,
18
19
  value: String,
19
20
  eventName: String,
20
21
  eventData: Object,
@@ -69,4 +70,8 @@ export default {
69
70
  padding-left: 5px;
70
71
  font-size: 20px;
71
72
  }
73
+
74
+ .tag-disabled {
75
+ opacity: 0.5;
76
+ }
72
77
  </style>
@@ -147,6 +147,7 @@ export default {
147
147
  methods: {
148
148
  ...mapActions("generic", ["getApi", "orderAllApi", "deleteAllApi"]),
149
149
  ...mapMutations("generic", [
150
+ "addEvent",
150
151
  "addLoading",
151
152
  "removeLoading",
152
153
  "addSelected",
@@ -154,6 +155,7 @@ export default {
154
155
  "updateSearch",
155
156
  "addTag",
156
157
  "removeTag",
158
+ "cleanTags",
157
159
  "openModal",
158
160
  "hideModal"
159
161
  ]),
@@ -1,78 +1,38 @@
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-main">
11
6
  <br />
12
7
  <Loading type="line" :center="false" v-show="loadingSearch" />
13
8
  <div v-show="!showFilter">
14
- <div
15
- class="div-progress"
16
- v-if="liveTotalRecords != baseParams.totalRecords"
17
- >
18
- <ProgressBar
19
- :text="`Carregando ${liveTotalRecords} registro(s) de ${baseParams.totalRecords}`"
20
- :value="liveTotalRecords"
21
- :max="baseParams.totalRecords"
22
- size="medium"
23
- />
9
+ <div class="div-progress" v-if="liveTotalRecords != baseParams.totalRecords && !loadingSearch">
10
+ <ProgressBar :text="`Carregando ${liveTotalRecords} registro(s) de ${baseParams.totalRecords}`"
11
+ :value="liveTotalRecords" :max="baseParams.totalRecords" size="medium" />
24
12
  </div>
25
13
  <Molded>
26
14
  <b-row>
27
15
  <b-col sm="6">
28
16
  <div class="side-by-side">
29
- <Button
30
- _key="btnSearchReport"
31
- type="primary"
32
- title="Buscar"
33
- classIcon="fas fa-file-search"
34
- :disabled="btnSearchDisabled || !rulesIsValid"
35
- size="medium"
36
- :clicked="getAll"
37
- />
17
+ <Button _key="btnSearchReport" type="primary" title="Buscar" classIcon="fas fa-file-search"
18
+ :disabled="btnSearchDisabled || !rulesIsValid" size="medium" :clicked="getAll" />
38
19
  </div>
39
20
  <div class="side-by-side">
40
- <Button
41
- _key="btnSaveReport"
42
- type="success"
43
- title="Salvar"
44
- classIcon="fas fa-save"
45
- size="small"
21
+ <Button _key="btnSaveReport" type="success" title="Salvar" classIcon="fas fa-save" size="small"
46
22
  :disabled="isLoading || btnSaveDisabled || !rulesIsValid"
47
- :params="{ name: 'save', title: 'Salvar', width: 550 }"
48
- :clicked="executeOpenModal"
49
- />
23
+ :params="{ name: 'save', title: 'Salvar', width: 550 }" :clicked="executeOpenModal" />
50
24
  </div>
51
25
  </b-col>
52
26
  <b-col class="text-right" sm="6">
53
27
  <div class="side-by-side">
54
- <Button
55
- _key="btnExecuteOpenModal"
56
- type="info"
57
- title="Campos"
58
- classIcon="fas fa-database"
59
- size="small"
60
- :disabled="isLoading"
61
- :params="{ name: 'fields', title: 'Campos', width: 550 }"
62
- :clicked="executeOpenModal"
63
- />
28
+ <Button _key="btnExecuteOpenModal" type="info" title="Campos" classIcon="fas fa-database" size="small"
29
+ :disabled="isLoading" :params="{ name: 'fields', title: 'Campos', width: 550 }"
30
+ :clicked="executeOpenModal" />
64
31
  </div>
65
32
  <div class="side-by-side">
66
- <Button
67
- _key="btnExecuteOpenModal"
68
- type="info"
69
- title="Filtros"
70
- classIcon="fas fa-filter"
71
- size="small"
72
- :disabled="isLoading"
73
- :params="{ name: 'rules', title: 'Filtros', width: 900 }"
74
- :clicked="executeShowFilter"
75
- />
33
+ <Button _key="btnExecuteOpenModal" type="info" title="Filtros" classIcon="fas fa-filter" size="small"
34
+ :disabled="isLoading" :params="{ name: 'rules', title: 'Filtros', width: 900 }"
35
+ :clicked="executeShowFilter" />
76
36
  </div>
77
37
  </b-col>
78
38
  </b-row>
@@ -83,64 +43,32 @@
83
43
  <div class="div-required" v-show="!rulesIsValid">
84
44
  <Alert type="info" v-for="rule in rulesRequired" :key="rule.id">
85
45
  É necessário informar o filtro
86
- <span class="filter-required">{{ rule.title }}</span
87
- >, clique no botão "Filtros" para adicionar.
46
+ <span class="filter-required">{{ rule.title }}</span>, clique no botão "Filtros" para adicionar.
88
47
  </Alert>
89
48
  </div>
90
49
  <div class="body-report" v-show="showBodyReport && rulesIsValid">
91
- <Report
92
- :header="content.headerTable"
93
- :data="content.data"
94
- :totalization="content.totalization"
95
- />
50
+ <Report :header="content.headerTable" :data="content.data" :totalization="content.totalization" />
96
51
  </div>
97
52
  </div>
98
53
  <div v-show="showFilter">
99
54
  <Rules />
100
55
  <br />
101
56
  <div class="text-center">
102
- <Button
103
- _key="btnCancelFilter"
104
- type="info"
105
- classIcon="fa-solid fa-arrow-left"
106
- size="small"
107
- :clicked="executeHideFilter"
108
- />
109
- <Button
110
- _key="btnApplyFilter"
111
- type="primary"
112
- title="Aplicar"
113
- classIcon="fas fa-filter"
114
- size="small"
115
- :clicked="executeHideFilter"
116
- />
57
+ <Button _key="btnCancelFilter" type="info" classIcon="fa-solid fa-arrow-left" size="small"
58
+ :clicked="executeHideFilter" />
59
+ <Button _key="btnApplyFilter" type="primary" title="Aplicar" classIcon="fas fa-filter" size="small"
60
+ :clicked="executeHideFilter" />
117
61
  </div>
118
62
  </div>
119
63
  </div>
120
64
  </Panel>
121
65
 
122
- <Modal
123
- :title="modalOptions.title"
124
- :width="modalOptions.width"
125
- v-show="showModal('templateReport')"
126
- >
127
- <ReportCreateUpdate
128
- :module="panel.module"
129
- v-show="modalOptions.name == 'save'"
130
- />
66
+ <Modal :title="modalOptions.title" :width="modalOptions.width" v-show="showModal('templateReport')">
67
+ <ReportCreateUpdate :module="panel.module" v-show="modalOptions.name == 'save'" />
131
68
  <Fields v-if="modalOptions.name == 'fields'" />
132
- <div
133
- class="text-right btn-apply"
134
- v-show="modalOptions.name == 'fields' || modalOptions.name == 'rules'"
135
- >
136
- <Button
137
- _key="btnApplyFieldsAndRules"
138
- type="primary"
139
- title="Aplicar"
140
- classIcon="fas fa-filter"
141
- size="small"
142
- :clicked="applyFieldsAndRules"
143
- />
69
+ <div class="text-right btn-apply" v-show="modalOptions.name == 'fields' || modalOptions.name == 'rules'">
70
+ <Button _key="btnApplyFieldsAndRules" type="primary" title="Aplicar" classIcon="fas fa-filter" size="small"
71
+ :clicked="applyFieldsAndRules" />
144
72
  </div>
145
73
  </Modal>
146
74
  </div>
@@ -377,9 +305,8 @@ export default {
377
305
  let query = this.oDataFilter.query
378
306
  ? `$apply=filter(${this.oDataFilter.query.replace("$filter=", "")})/`
379
307
  : "$apply=";
380
- let baseUrl = `${
381
- this.templateList.urlGetApi
382
- }?${query}aggregate(${this.oDataFilter.totalization.replace(",", "")})`;
308
+ let baseUrl = `${this.templateList.urlGetApi
309
+ }?${query}aggregate(${this.oDataFilter.totalization.replace(",", "")})`;
383
310
  return baseUrl;
384
311
  },
385
312
  liveTotalRecords() {
@@ -12,7 +12,7 @@
12
12
  <slot name="content-between-search-table"></slot>
13
13
  <div class="div-tag">
14
14
  <div class="side-by-side" v-for="tag in tags">
15
- <Tag :_key="tag.key" :title="tag.tag" />
15
+ <Tag :_key="tag.key" :disabled="propsParam.showAll" :title="tag.tag" />
16
16
  </div>
17
17
  </div>
18
18
  <Molded>