aloha-vue 1.0.63 → 1.0.64

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.
@@ -35,6 +35,12 @@ export default {
35
35
  path: "hola",
36
36
  sortId: "hola",
37
37
  },
38
+ {
39
+ label: "Default",
40
+ id: "default",
41
+ path: "default",
42
+ defaultValue: "-",
43
+ },
38
44
  {
39
45
  label: "Hola2",
40
46
  id: "hola2",
@@ -175,6 +181,56 @@ export default {
175
181
  },
176
182
  ],
177
183
  modelQuickSearch: "",
184
+ modelFilters: {},
185
+ filters: [
186
+ {
187
+ type: "text",
188
+ id: "suche",
189
+ label: "Suche",
190
+ main: true,
191
+ },
192
+ {
193
+ type: "text",
194
+ id: "au_kbezbeobachter",
195
+ label: "Beobachter",
196
+ },
197
+ {
198
+ type: "switch",
199
+ id: "au_termin_sichtbar",
200
+ label: "Sichtbar",
201
+ alwaysVisible: true,
202
+ },
203
+ {
204
+ type: "oneCheckbox",
205
+ id: "au_ende",
206
+ label: "Bearbeitungsende",
207
+ alwaysVisible: true,
208
+ },
209
+ {
210
+ type: "multiselect",
211
+ id: "terminberechnung",
212
+ label: "Termin",
213
+ data: [
214
+ {
215
+ id: "1",
216
+ bek: "Aloha 1",
217
+ },
218
+ {
219
+ id: "2",
220
+ bek: "Aloha 2",
221
+ },
222
+ {
223
+ id: "3",
224
+ bek: "Aloha 3",
225
+ },
226
+ ],
227
+ // url: "katalog/?fields=id&fields=bez&key=syterminberechnung",
228
+ keyLabel: "bez",
229
+ keyId: "id",
230
+ search: true,
231
+ alwaysVisible: true,
232
+ },
233
+ ],
178
234
  };
179
235
  },
180
236
  created() {
@@ -13,7 +13,9 @@ div
13
13
  :is-action-column-visible="true"
14
14
  :is-columns-dnd="true"
15
15
  :is-pagination="true"
16
+ :filters="filters"
16
17
  v-model:modelQuickSearch="modelQuickSearch"
18
+ v-model:modelFilters="modelFilters"
17
19
  @change-columns-ordering="changeColumnsOrdering"
18
20
  )
19
21
  template(
@@ -37,3 +39,5 @@ div
37
39
  button.a_btn.a_btn_primary Click me
38
40
 
39
41
  span modelQuickSearch: {{ modelQuickSearch }}
42
+ div modelFilters:
43
+ pre {{ modelFilters }}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
3
  "description": "Project aloha",
4
- "version": "1.0.63",
4
+ "version": "1.0.64",
5
5
  "author": "Ilia Brykin",
6
6
  "scripts": {
7
7
  "build-icons": "node scriptsNode/iconsSvgToJs.js bootstrap3 && node scriptsNode/iconsSvgToJs.js bootstrap-1-9-1"
@@ -18,6 +18,7 @@ import MultipleActionAPI from "./compositionAPI/MultipleActionAPI";
18
18
  import PreviewAPI from "./compositionAPI/PreviewAPI";
19
19
  import RowsAPI from "./compositionAPI/RowsAPI";
20
20
  import ScrollControlAPI from "./compositionAPI/ScrollControlAPI";
21
+ import TableFiltersAPI from "./compositionAPI/TableFiltersAPI";
21
22
 
22
23
  import {
23
24
  getModelColumnsOrderingDefault,
@@ -33,84 +34,82 @@ import {
33
34
  keyBy,
34
35
  uniqueId,
35
36
  } from "lodash-es";
37
+ import ATableFiltersTop from "./ATableFiltersTop/ATableFiltersTop";
36
38
 
37
39
 
38
40
  export default {
39
41
  name: "ATable",
40
42
  props: {
41
- id: {
42
- type: String,
43
+ columnActionsWidth: {
44
+ type: Number,
43
45
  required: false,
44
- default: () => uniqueId("a_table"),
46
+ default: 170,
45
47
  },
46
48
  columns: {
47
49
  type: Array,
48
50
  required: true,
49
51
  },
50
- columnWidthDefault: {
51
- type: Number,
52
+ columnsDefaultValue: {
53
+ type: [String, Number],
52
54
  required: false,
53
- default: 250,
55
+ default: "",
54
56
  },
55
- columnActionsWidth: {
57
+ columnWidthDefault: {
56
58
  type: Number,
57
59
  required: false,
58
- default: 170,
60
+ default: 250,
59
61
  },
60
62
  countAllRows: {
61
63
  type: Number,
62
64
  required: false,
63
65
  default: undefined,
64
66
  },
65
- label: {
66
- type: [String, Number],
67
+ data: {
68
+ type: [Array, Object, Promise],
67
69
  required: false,
68
- default: "",
69
70
  },
70
- labelTag: {
71
- type: String,
71
+ filters: {
72
+ type: Array,
72
73
  required: false,
73
- default: "h2",
74
+ default: () => [],
74
75
  },
75
- labelClass: {
76
- type: [String, Object],
76
+ id: {
77
+ type: String,
77
78
  required: false,
78
- default: undefined,
79
+ default: () => uniqueId("a_table"),
79
80
  },
80
- limitsPerPage: {
81
- type: Array,
81
+ isActionColumnVisible: {
82
+ type: Boolean,
82
83
  required: false,
83
- default: () => ["10", "25", "50", "100"],
84
+ default: true,
84
85
  },
85
- limitStart: {
86
- type: Number,
86
+ isColumnsDnd: {
87
+ type: Boolean,
87
88
  required: false,
88
- default: 10,
89
+ default: true,
89
90
  },
90
- offsetStart: {
91
- type: Number,
91
+ isLoadingOptions: {
92
+ type: Boolean,
92
93
  required: false,
93
- default: 0,
94
94
  },
95
- sortingStart: {
96
- type: String,
95
+ isLoadingTable: {
96
+ type: Boolean,
97
97
  required: false,
98
- default: undefined,
99
98
  },
100
- modelIsTableWithoutScrollStart: {
99
+ isPagination: {
101
100
  type: Boolean,
102
101
  required: false,
103
102
  default: true,
104
103
  },
105
- data: {
106
- type: [Array, Object, Promise],
104
+ isPaginationOutside: {
105
+ type: Boolean,
107
106
  required: false,
108
107
  },
109
- isLoadingTable: {
108
+ isQuickSearch: {
110
109
  type: Boolean,
111
110
  required: false,
112
111
  },
113
- isLoadingOptions: {
112
+ isSortingOutside: {
114
113
  type: Boolean,
115
114
  required: false,
116
115
  },
@@ -119,43 +118,65 @@ export default {
119
118
  required: false,
120
119
  default: "count",
121
120
  },
122
- modelColumnsOrdering: {
123
- type: Array,
121
+ label: {
122
+ type: [String, Number],
124
123
  required: false,
125
- default: () => [],
124
+ default: "",
126
125
  },
127
- modelColumnsVisible: {
128
- type: Array,
126
+ labelClass: {
127
+ type: [String, Object],
129
128
  required: false,
130
- default: () => [],
129
+ default: undefined,
131
130
  },
132
- tableActions: {
131
+ labelTag: {
132
+ type: String,
133
+ required: false,
134
+ default: "h2",
135
+ },
136
+ limitsPerPage: {
133
137
  type: Array,
134
138
  required: false,
135
- default: () => [],
139
+ default: () => ["10", "25", "50", "100"],
136
140
  },
137
- rowActions: {
141
+ limitStart: {
142
+ type: Number,
143
+ required: false,
144
+ default: 10,
145
+ },
146
+ modelColumnsOrdering: {
138
147
  type: Array,
139
148
  required: false,
140
149
  default: () => [],
141
150
  },
142
- multipleActions: {
151
+ modelColumnsVisible: {
143
152
  type: Array,
144
153
  required: false,
145
154
  default: () => [],
146
155
  },
147
- isPagination: {
156
+ modelFilters: {
157
+ type: Object,
158
+ required: false,
159
+ default: () => ({}),
160
+ },
161
+ modelIsTableWithoutScrollStart: {
148
162
  type: Boolean,
149
163
  required: false,
150
164
  default: true,
151
165
  },
152
- isPaginationOutside: {
153
- type: Boolean,
166
+ modelQuickSearch: {
167
+ type: String,
154
168
  required: false,
169
+ default: "",
155
170
  },
156
- isSortingOutside: {
157
- type: Boolean,
171
+ multipleActions: {
172
+ type: Array,
158
173
  required: false,
174
+ default: () => [],
175
+ },
176
+ offsetStart: {
177
+ type: Number,
178
+ required: false,
179
+ default: 0,
159
180
  },
160
181
  preview: {
161
182
  type: String,
@@ -163,46 +184,48 @@ export default {
163
184
  default: undefined,
164
185
  validator: value => ["right", "down"].indexOf(value) !== -1,
165
186
  },
166
- previewHeaderTag: {
167
- type: String,
168
- required: false,
169
- default: "h2",
170
- },
171
187
  previewBoxWidth: {
172
188
  type: Number,
173
189
  required: false,
174
190
  default: 300,
175
191
  },
176
- isQuickSearch: {
177
- type: Boolean,
192
+ previewHeaderTag: {
193
+ type: String,
178
194
  required: false,
195
+ default: "h2",
179
196
  },
180
- modelQuickSearch: {
197
+ rowActions: {
198
+ type: Array,
199
+ required: false,
200
+ default: () => [],
201
+ },
202
+ sortingStart: {
181
203
  type: String,
182
204
  required: false,
183
- default: "",
205
+ default: undefined,
184
206
  },
185
- isActionColumnVisible: {
186
- type: Boolean,
207
+ tableActions: {
208
+ type: Array,
187
209
  required: false,
188
- default: true,
210
+ default: () => [],
189
211
  },
190
- isColumnsDnd: {
191
- type: Boolean,
212
+ valuesForColumnDefault: {
213
+ type: Array,
192
214
  required: false,
193
- default: true,
215
+ default: () => [null, undefined, ""],
194
216
  },
195
217
  },
196
218
  emits: [
197
- "update:modelColumnsOrder",
198
- "update:modelColumnsVisible",
199
- "update:modelQuickSearch",
200
219
  "changeColumnsOrdering",
201
220
  "changeColumnsVisible",
202
221
  "changeLimit",
203
222
  "changeOffset",
204
223
  "changeSorting",
205
224
  "mouseupResizePreviewRight",
225
+ "update:modelColumnsOrder",
226
+ "update:modelColumnsVisible",
227
+ "update:modelFilters",
228
+ "update:modelQuickSearch",
206
229
  "updateModelIsTableWithoutScroll",
207
230
  ],
208
231
  provide() {
@@ -211,6 +234,7 @@ export default {
211
234
  changeModelColumnsVisible: this.changeModelColumnsVisible,
212
235
  changeModelSort: this.changeModelSort,
213
236
  columns: computed(() => this.columns),
237
+ columnsDefaultValue: computed(() => this.columnsDefaultValue),
214
238
  columnActionsWidthLocal: computed(() => this.columnActionsWidth),
215
239
  columnWidthDefault: computed(() => this.columnWidthDefault),
216
240
  isActionColumnVisible: computed(() => this.isActionColumnVisible),
@@ -219,6 +243,7 @@ export default {
219
243
  isLoadingTable: computed(() => this.isLoadingTable),
220
244
  rowActions: computed(() => this.rowActions),
221
245
  tableId: computed(() => this.id),
246
+ valuesForColumnDefault: computed(() => this.valuesForColumnDefault),
222
247
  };
223
248
  },
224
249
  setup(props, context) {
@@ -246,6 +271,7 @@ export default {
246
271
  return MODEL_COLUMNS;
247
272
  });
248
273
 
274
+
249
275
  const {
250
276
  hasRows,
251
277
  limit,
@@ -300,6 +326,13 @@ export default {
300
326
  } = PreviewAPI(props, context, {
301
327
  aTableRef,
302
328
  });
329
+
330
+ const {
331
+ filtersKeyById,
332
+ modelFiltersLocal,
333
+ onUpdateModelFilters,
334
+ startSearch,
335
+ } = TableFiltersAPI(props, context);
303
336
 
304
337
  provide("changeModelIsTableWithoutScroll", changeModelIsTableWithoutScroll);
305
338
  provide("columnsOrdered", columnsOrdered);
@@ -315,6 +348,7 @@ export default {
315
348
 
316
349
  provide("modelColumnsVisibleLocal", modelColumnsVisibleLocal);
317
350
  provide("modelColumnsVisibleMapping", modelColumnsVisibleMapping);
351
+ provide("onUpdateModelFilters", onUpdateModelFilters);
318
352
 
319
353
 
320
354
  return {
@@ -351,6 +385,10 @@ export default {
351
385
  setEmptySelectedRowsIndexes,
352
386
  setSelectedRowsIndexes,
353
387
  toggleMultipleActionsActive,
388
+
389
+ filtersKeyById,
390
+ modelFiltersLocal,
391
+ startSearch,
354
392
  };
355
393
  },
356
394
  data() {
@@ -475,95 +513,103 @@ export default {
475
513
  },
476
514
  },
477
515
  render() {
478
- return h("div", {
479
- ref: "aTableRef",
480
- class: ["a_table__parent", {
481
- a_table__parent_scrollable: !this.modelIsTableWithoutScroll,
482
- }],
483
- }, [
484
- h(ATableTopPanel, {
485
- areSomeRowsSelected: this.areSomeRowsSelected,
486
- closeMultipleActionsActive: this.closeMultipleActionsActive,
487
- countAllRows: this.countAllRowsLocal,
488
- label: this.label,
489
- labelTag: this.labelTag,
490
- labelClass: this.labelClass,
491
- tableActions: this.tableActions,
492
- multipleActions: this.multipleActions,
493
- isQuickSearch: this.isQuickSearch,
494
- modelQuickSearch: this.modelQuickSearch,
495
- selectedRows: this.selectedRows,
496
- onUpdateModelQuickSearch: this.updateModelQuickSearch,
497
- onToggleMultipleActionsActive: this.toggleMultipleActionsActive,
516
+ return h("div", {}, [
517
+ h(ATableFiltersTop, {
518
+ filters: this.filters,
519
+ filtersKeyById: this.filtersKeyById,
520
+ modelFilters: this.modelFiltersLocal,
521
+ onStartSearch: this.startSearch,
498
522
  }, this.$slots),
499
523
  h("div", {
500
- class: "a_table",
501
- role: "table",
524
+ ref: "aTableRef",
525
+ class: ["a_table__parent", {
526
+ a_table__parent_scrollable: !this.modelIsTableWithoutScroll,
527
+ }],
502
528
  }, [
503
- h(ATableHeader, {
504
- areAllRowsSelected: this.areAllRowsSelected,
529
+ h(ATableTopPanel, {
505
530
  areSomeRowsSelected: this.areSomeRowsSelected,
506
- modelSort: this.modelSort,
507
- onSetSelectedRowsIndexes: this.setSelectedRowsIndexes,
508
- }),
531
+ closeMultipleActionsActive: this.closeMultipleActionsActive,
532
+ countAllRows: this.countAllRowsLocal,
533
+ label: this.label,
534
+ labelTag: this.labelTag,
535
+ labelClass: this.labelClass,
536
+ tableActions: this.tableActions,
537
+ multipleActions: this.multipleActions,
538
+ isQuickSearch: this.isQuickSearch,
539
+ modelQuickSearch: this.modelQuickSearch,
540
+ selectedRows: this.selectedRows,
541
+ onUpdateModelQuickSearch: this.updateModelQuickSearch,
542
+ onToggleMultipleActionsActive: this.toggleMultipleActionsActive,
543
+ }, this.$slots),
509
544
  h("div", {
510
- class: "a_table__body",
511
- role: "rowgroup",
512
- }, this.rowsLocal.map((row, rowIndex) => {
513
- return h(ATableTr, {
514
- row,
515
- rowIndex,
516
- selectedRowsIndexes: this.selectedRowsIndexes,
545
+ class: "a_table",
546
+ role: "table",
547
+ }, [
548
+ h(ATableHeader, {
549
+ areAllRowsSelected: this.areAllRowsSelected,
550
+ areSomeRowsSelected: this.areSomeRowsSelected,
551
+ modelSort: this.modelSort,
517
552
  onSetSelectedRowsIndexes: this.setSelectedRowsIndexes,
518
- }, {
519
- get: vm => [
520
- h(AGet, {
521
- data: vm.row,
522
- path: vm.column.path,
523
- filter: vm.column.filter,
524
- filterParameters: vm.column.filterParameters,
525
- defaultValue: vm.column.defaultValue,
526
- }),
527
- ],
528
- ...this.$slots,
529
- });
530
- })),
553
+ }),
554
+ h("div", {
555
+ class: "a_table__body",
556
+ role: "rowgroup",
557
+ }, this.rowsLocal.map((row, rowIndex) => {
558
+ return h(ATableTr, {
559
+ row,
560
+ rowIndex,
561
+ selectedRowsIndexes: this.selectedRowsIndexes,
562
+ onSetSelectedRowsIndexes: this.setSelectedRowsIndexes,
563
+ }, {
564
+ get: vm => [
565
+ h(AGet, {
566
+ data: vm.row,
567
+ path: vm.column.path,
568
+ filter: vm.column.filter,
569
+ filterParameters: vm.column.filterParameters,
570
+ defaultValue: vm.column.defaultValue,
571
+ }),
572
+ ],
573
+ ...this.$slots,
574
+ });
575
+ })),
576
+ ]),
577
+ !this.hasRows && h("div", {
578
+ class: "a_table__empty_text",
579
+ }, "Keine Einträge vorhanden."),
580
+ this.isPagination && h("div", {
581
+ class: "a_pagination__parent"
582
+ }, [
583
+ h(ATableCountProPage, {
584
+ countAllRows: this.countAllRowsLocal,
585
+ limitsPerPage: this.limitsPerPage,
586
+ isLoadingTable: this.isLoadingTable,
587
+ limit: this.limit,
588
+ offset: this.offset,
589
+ rowsLength: this.rowsLocal.length,
590
+ hasRows: this.hasRows,
591
+ "onUpdate:limit": this.changeLimit,
592
+ }),
593
+ h(ATablePagination, {
594
+ limit: this.limit,
595
+ totalRowsCount: this.totalRowsCountLocal,
596
+ isLoadingTable: this.isLoadingTable,
597
+ offset: this.offset,
598
+ hasRows: this.hasRows,
599
+ "onUpdate:offset": this.changeOffset,
600
+ }),
601
+ ]),
602
+ this.isPreviewRightOpen && h(ATablePreviewRight, {
603
+ rowIndex: this.previewRightRowIndex,
604
+ rows: this.rowsLocal,
605
+ previewHeaderTag: this.previewHeaderTag,
606
+ onClosePreview: this.closePreview,
607
+ onMousedownResizePreviewRight: this.mousedownResizePreviewRight,
608
+ onMousemoveResizePreviewRight: this.mousemoveResizePreviewRight,
609
+ onMouseupResizePreviewRight: this.mouseupResizePreviewRight,
610
+ onTogglePreviewResize: this.togglePreviewResize,
611
+ }, this.$slots),
531
612
  ]),
532
- !this.hasRows && h("div", {
533
- class: "a_table__empty_text",
534
- }, "Keine Einträge vorhanden."),
535
- this.isPagination && h("div", {
536
- class: "a_pagination__parent"
537
- }, [
538
- h(ATableCountProPage, {
539
- countAllRows: this.countAllRowsLocal,
540
- limitsPerPage: this.limitsPerPage,
541
- isLoadingTable: this.isLoadingTable,
542
- limit: this.limit,
543
- offset: this.offset,
544
- rowsLength: this.rowsLocal.length,
545
- hasRows: this.hasRows,
546
- "onUpdate:limit": this.changeLimit,
547
- }),
548
- h(ATablePagination, {
549
- limit: this.limit,
550
- totalRowsCount: this.totalRowsCountLocal,
551
- isLoadingTable: this.isLoadingTable,
552
- offset: this.offset,
553
- hasRows: this.hasRows,
554
- "onUpdate:offset": this.changeOffset,
555
- }),
556
- ]),
557
- this.isPreviewRightOpen && h(ATablePreviewRight, {
558
- rowIndex: this.previewRightRowIndex,
559
- rows: this.rowsLocal,
560
- previewHeaderTag: this.previewHeaderTag,
561
- onClosePreview: this.closePreview,
562
- onMousedownResizePreviewRight: this.mousedownResizePreviewRight,
563
- onMousemoveResizePreviewRight: this.mousemoveResizePreviewRight,
564
- onMouseupResizePreviewRight: this.mouseupResizePreviewRight,
565
- onTogglePreviewResize: this.togglePreviewResize,
566
- }, this.$slots),
567
613
  ]);
568
614
  },
569
615
  };