@freteclick/quasar-financial-ui 1.0.114 → 1.0.115

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": "@freteclick/quasar-financial-ui",
3
- "version": "1.0.114",
3
+ "version": "1.0.115",
4
4
  "author": "FreteClick",
5
5
  "description": "FreteClick financial Quasar UI Component",
6
6
  "license": "MIT",
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <q-card
3
3
  class="row q-pa-md invoice-filters"
4
- :class="{ 'invoice-filters--drawer': variant === 'receivables-drawer' }"
4
+ :class="{ 'invoice-filters--inline': variant === 'filter-box' }"
5
5
  >
6
- <div v-if="variant !== 'receivables-drawer'" class="col-xs-12 q-pb-md text-h6">
6
+ <div v-if="variant !== 'filter-box'" class="col-xs-12 q-pb-md text-h6">
7
7
  Faturas
8
8
  </div>
9
9
 
@@ -12,9 +12,11 @@
12
12
  v-model="filters.text"
13
13
  stack-label
14
14
  label="Buscar por"
15
- debounce="1000"
16
- :outlined="variant === 'receivables-drawer'"
17
- :dense="variant === 'receivables-drawer'"
15
+ :debounce="variant === 'filter-box' ? 0 : 1000"
16
+ @blur="onTextBlur"
17
+ :outlined="variant === 'filter-box'"
18
+ :dense="variant === 'filter-box'"
19
+ clearable
18
20
  class="full-width"
19
21
  />
20
22
  </div>
@@ -24,8 +26,8 @@
24
26
  :options="statuses"
25
27
  stack-label
26
28
  label="Status da fatura"
27
- :outlined="variant === 'receivables-drawer'"
28
- :dense="variant === 'receivables-drawer'"
29
+ :outlined="variant === 'filter-box'"
30
+ :dense="variant === 'filter-box'"
29
31
  :loading="loadingStatuses"
30
32
  class="full-width"
31
33
  >
@@ -42,8 +44,8 @@
42
44
  :options="categories"
43
45
  stack-label
44
46
  label="Categoria"
45
- :outlined="variant === 'receivables-drawer'"
46
- :dense="variant === 'receivables-drawer'"
47
+ :outlined="variant === 'filter-box'"
48
+ :dense="variant === 'filter-box'"
47
49
  :loading="loadingCategories"
48
50
  class="full-width"
49
51
  >
@@ -60,8 +62,8 @@
60
62
  :options="orderType"
61
63
  stack-label
62
64
  label="Tipo de Fatura"
63
- :outlined="variant === 'receivables-drawer'"
64
- :dense="variant === 'receivables-drawer'"
65
+ :outlined="variant === 'filter-box'"
66
+ :dense="variant === 'filter-box'"
65
67
  :loading="loadingOrderType"
66
68
  class="full-width"
67
69
  >
@@ -74,6 +76,7 @@
74
76
  </div>
75
77
  <div class="col-6 q-pa-md invoice-filters__field invoice-filters__date">
76
78
  <DataFilter :fromDate="filters.date.from" :toDate="filters.date.to" :showButton="false"
79
+ :emitOnBlur="variant === 'filter-box'"
77
80
  @dateChanged="dateChanged" />
78
81
  </div>
79
82
  </q-card>
@@ -146,7 +149,7 @@ export default {
146
149
 
147
150
  watch: {
148
151
  "filters.text"() {
149
- this.$emit("onRequest");
152
+ if (this.variant !== "filter-box") this.$emit("onRequest");
150
153
  },
151
154
  "filters.orderType"() {
152
155
  this.$emit("onRequest");
@@ -168,6 +171,10 @@ export default {
168
171
  getCategories: "categories/getCategories",
169
172
  }),
170
173
 
174
+ onTextBlur() {
175
+ if (this.variant === "filter-box") this.$emit("onRequest");
176
+ },
177
+
171
178
  requestCategories(company) {
172
179
  if (!company || !company.id) {
173
180
  this.categories = [{ label: "Todas", value: null }];
@@ -238,53 +245,63 @@ export default {
238
245
  </script>
239
246
 
240
247
  <style lang="scss" scoped>
241
- .invoice-filters--drawer {
248
+ .invoice-filters--inline {
242
249
  display: flex;
243
- flex-flow: column nowrap;
244
- align-items: stretch;
245
- gap: 14px;
246
- width: 100%;
247
- padding: 0;
250
+ width: max-content;
251
+ min-width: 100%;
252
+ max-width: none;
253
+ flex-flow: row nowrap;
254
+ align-items: flex-end;
255
+ justify-content: flex-start;
256
+ gap: 12px;
257
+ padding: 0 !important;
248
258
  border: 0;
249
259
  border-radius: 0;
250
260
  background: transparent;
251
261
  box-shadow: none;
252
262
  }
253
263
 
254
- .invoice-filters--drawer > .invoice-filters__field {
255
- flex: 0 0 auto;
256
- width: 100%;
257
- min-width: 0;
264
+ .invoice-filters--inline > .invoice-filters__field {
265
+ flex: 1 0 190px;
266
+ width: 190px;
267
+ min-width: 190px;
258
268
  max-width: none;
259
269
  margin: 0;
260
270
  padding: 0 !important;
261
271
  }
262
272
 
263
- .invoice-filters--drawer :deep(.q-field) {
273
+ .invoice-filters--inline > .invoice-filters__date {
274
+ flex: 2 0 360px;
275
+ width: 360px;
276
+ min-width: 360px;
277
+ }
278
+
279
+ .invoice-filters--inline :deep(.q-field) {
264
280
  width: 100%;
265
281
  min-width: 0;
266
282
  }
267
283
 
268
- .invoice-filters--drawer :deep(.q-field__control),
269
- .invoice-filters--drawer :deep(.q-field__control:before),
270
- .invoice-filters--drawer :deep(.q-field__control:after) {
284
+ .invoice-filters--inline :deep(.q-field__control),
285
+ .invoice-filters--inline :deep(.q-field__control:before),
286
+ .invoice-filters--inline :deep(.q-field__control:after) {
271
287
  min-height: 42px;
272
288
  border-radius: 10px;
273
289
  }
274
290
 
275
- .invoice-filters--drawer :deep(.container-filter) {
276
- flex-direction: column;
277
- align-items: stretch;
291
+ .invoice-filters--inline :deep(.container-filter) {
292
+ flex-direction: row;
293
+ flex-wrap: nowrap;
294
+ align-items: center;
278
295
  justify-content: flex-start;
279
296
  gap: 10px;
280
297
  padding: 0;
281
298
  }
282
299
 
283
- .invoice-filters--drawer :deep(.date-filter__field) {
284
- flex: 0 0 auto;
300
+ .invoice-filters--inline :deep(.date-filter__field) {
301
+ flex: 1 1 0;
285
302
  width: 100%;
286
- max-width: none;
287
- min-width: 0;
303
+ max-width: none !important;
304
+ min-width: 150px;
288
305
  min-height: 0;
289
306
  margin: 0;
290
307
  }
@@ -1,5 +1,14 @@
1
1
  <template>
2
2
  <div class="payable-invoices">
3
+ <FilterBox title="Filtros">
4
+ <Filters
5
+ :filters="filters"
6
+ variant="filter-box"
7
+ :show-category="true"
8
+ @onRequest="onFilterRequest"
9
+ />
10
+ </FilterBox>
11
+
3
12
  <section class="payable-invoices__panel">
4
13
  <header class="payable-invoices__heading">
5
14
  <div>
@@ -194,21 +203,6 @@
194
203
  </q-card>
195
204
  </q-dialog>
196
205
 
197
- <FilterDrawer
198
- v-model="filtersDrawerOpen"
199
- eyebrow="CONTAS A PAGAR"
200
- title="Refinar despesas"
201
- description="Escolha os critérios para atualizar a listagem."
202
- :show-apply="false"
203
- @clear="clearFilters"
204
- >
205
- <Filters
206
- :filters="filters"
207
- variant="receivables-drawer"
208
- :show-category="true"
209
- @onRequest="onFilterRequest"
210
- />
211
- </FilterDrawer>
212
206
  </div>
213
207
  </template>
214
208
 
@@ -220,13 +214,13 @@ import {
220
214
  } from "@freteclick/quasar-common-ui/src/utils/formatter";
221
215
  import CreateExpense from "../expense/CreateExpense";
222
216
  import { date } from "quasar";
223
- import FilterDrawer from "@freteclick/quasar-common-ui/src/components/common/FilterDrawer.vue";
217
+ import FilterBox from "@freteclick/quasar-common-ui/src/components/common/FilterBox.vue";
224
218
  import Filters from "../../common/Filters.vue";
225
219
 
226
220
  export default {
227
221
  components: {
228
222
  CreateExpense,
229
- FilterDrawer,
223
+ FilterBox,
230
224
  Filters,
231
225
  },
232
226
 
@@ -336,8 +330,6 @@ export default {
336
330
  visible: false,
337
331
  },
338
332
  },
339
- filtersDrawerOpen: false,
340
- isClearingFilters: false,
341
333
  data: [],
342
334
  filters: {
343
335
  orderType: {
@@ -475,10 +467,6 @@ export default {
475
467
  return color ? { color } : {};
476
468
  },
477
469
 
478
- openFiltersDrawer() {
479
- this.filtersDrawerOpen = true;
480
- },
481
-
482
470
  openExpenseDialog() {
483
471
  this.dialogs.expense.visible = true;
484
472
  },
@@ -489,24 +477,7 @@ export default {
489
477
  this.onRequest({ pagination: this.pagination });
490
478
  },
491
479
 
492
- clearFilters() {
493
- this.isClearingFilters = true;
494
- this.filters.text = null;
495
- this.filters.orderType = { label: "Todos", value: null };
496
- this.filters.status = { label: "Todos", value: null };
497
- this.filters.category = { label: "Todas", value: null };
498
- this.filters.date = { from: "", to: "" };
499
- this.pagination.page = 1;
500
-
501
- this.$nextTick(() => {
502
- this.isClearingFilters = false;
503
- this.onRequest({ pagination: this.pagination });
504
- });
505
- },
506
-
507
480
  onFilterRequest() {
508
- if (this.isClearingFilters) return;
509
-
510
481
  this.pagination.page = 1;
511
482
  this.onRequest({ pagination: this.pagination });
512
483
  },
@@ -569,8 +540,10 @@ export default {
569
540
 
570
541
  <style lang="scss" scoped>
571
542
  .payable-invoices {
543
+ display: grid;
572
544
  width: 100%;
573
545
  min-width: 0;
546
+ gap: 20px;
574
547
  color: #1b2d43;
575
548
  }
576
549
 
@@ -4,19 +4,17 @@
4
4
  <PageHeader
5
5
  title="Contas a receber"
6
6
  description="Acompanhe faturas, vencimentos e valores da sua empresa."
7
+ />
8
+
9
+ <FilterBox
10
+ title="Filtros"
7
11
  >
8
- <template #actions>
9
- <q-btn
10
- outline
11
- no-caps
12
- rounded
13
- color="white"
14
- icon="tune"
15
- label="Filtros"
16
- @click="filtersDrawerOpen = true"
17
- />
18
- </template>
19
- </PageHeader>
12
+ <Filters
13
+ :filters="filters"
14
+ variant="filter-box"
15
+ @onRequest="onFilterRequest"
16
+ />
17
+ </FilterBox>
20
18
 
21
19
  <section class="receivables-table-panel">
22
20
  <div class="receivables-table-panel__heading">
@@ -206,20 +204,6 @@
206
204
  </q-card>
207
205
  </q-dialog>
208
206
 
209
- <FilterDrawer
210
- v-model="filtersDrawerOpen"
211
- eyebrow="CONTAS A RECEBER"
212
- title="Refinar recebíveis"
213
- description="Escolha os critérios para atualizar a listagem."
214
- :show-apply="false"
215
- @clear="clearFilters"
216
- >
217
- <Filters
218
- :filters="filters"
219
- variant="receivables-drawer"
220
- @onRequest="onFilterRequest"
221
- />
222
- </FilterDrawer>
223
207
  </div>
224
208
  </template>
225
209
 
@@ -232,7 +216,7 @@ import {
232
216
 
233
217
  import { date } from "quasar";
234
218
  import PageHeader from "@freteclick/quasar-common-ui/src/components/common/PageHeader.vue";
235
- import FilterDrawer from "@freteclick/quasar-common-ui/src/components/common/FilterDrawer.vue";
219
+ import FilterBox from "@freteclick/quasar-common-ui/src/components/common/FilterBox.vue";
236
220
  import Filters from "../../common/Filters.vue";
237
221
 
238
222
  const SETTINGS = {
@@ -320,7 +304,7 @@ Object.freeze(SETTINGS);
320
304
  export default {
321
305
  components: {
322
306
  PageHeader,
323
- FilterDrawer,
307
+ FilterBox,
324
308
  Filters,
325
309
  },
326
310
  props: {
@@ -379,7 +363,6 @@ export default {
379
363
  invoice: null,
380
364
  },
381
365
  },
382
- filtersDrawerOpen: false,
383
366
  data: [],
384
367
  filters: {
385
368
  orderType: {
@@ -498,15 +481,6 @@ export default {
498
481
  return color ? { color } : {};
499
482
  },
500
483
 
501
- clearFilters() {
502
- this.filters.text = null;
503
- this.filters.orderType = { label: "Todos", value: null };
504
- this.filters.status = { label: "Todos", value: null };
505
- this.filters.date = { from: "", to: "" };
506
- this.pagination.page = 1;
507
- this.onRequest({ pagination: this.pagination });
508
- },
509
-
510
484
  onFilterRequest() {
511
485
  this.pagination.page = 1;
512
486
  this.onRequest({ pagination: this.pagination });
@@ -7,15 +7,6 @@
7
7
  >
8
8
  <template #actions>
9
9
  <template v-if="currentTab === 'expenses'">
10
- <q-btn
11
- outline
12
- no-caps
13
- rounded
14
- color="white"
15
- icon="tune"
16
- label="Filtros"
17
- @click="openInvoiceFilters"
18
- />
19
10
  <q-btn
20
11
  unelevated
21
12
  no-caps
@@ -94,10 +85,6 @@ export default {
94
85
  },
95
86
 
96
87
  methods: {
97
- openInvoiceFilters() {
98
- this.$refs.invoiceSearch?.openFiltersDrawer();
99
- },
100
-
101
88
  openExpenseDialog() {
102
89
  this.$refs.invoiceSearch?.openExpenseDialog();
103
90
  },