@mapomodule/uikit 1.0.0-alpha.55 → 1.0.0-alpha.56

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/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.56](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.55...v1.0.0-alpha.56) (2025-10-20)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **FksField, ListTable:** pick fields as array ([6146d1c](https://github.com/lotrekagency/mapo/commit/6146d1c77474cb586fc9187ea45881de30365f06))
12
+
13
+
14
+ ### Features
15
+
16
+ * **FksField:** add pick fields to endpoint call ([aa27a50](https://github.com/lotrekagency/mapo/commit/aa27a507e69192dd385235fa3a57eea0746ed60d))
17
+ * **ListTable:** add fields query param to list endpoint ([06b8f58](https://github.com/lotrekagency/mapo/commit/06b8f589b06408f2e61bb1f82d66560fe70437d5))
18
+
19
+
20
+
21
+
22
+
6
23
  # [1.0.0-alpha.55](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.54...v1.0.0-alpha.55) (2025-06-26)
7
24
 
8
25
 
@@ -33,6 +33,11 @@ export default {
33
33
  },
34
34
  // This is the endpoint where the component can fetch options.
35
35
  endpoint: String | Object,
36
+ // Additional fields to include in the API call
37
+ extraPick: {
38
+ type: Array,
39
+ default: () => []
40
+ },
36
41
  },
37
42
  computed: {
38
43
  fieldAttrs() {
@@ -60,6 +65,23 @@ export default {
60
65
  return { url: "", conf: null };
61
66
  }
62
67
  },
68
+ fieldsFromAttrs() {
69
+ const fields = [];
70
+ const itemText = this.$attrs.itemText || this.fieldAttrs.itemText;
71
+ const itemValue = this.$attrs.itemValue || this.fieldAttrs.itemValue;
72
+
73
+ if (itemValue && itemValue !== 'id') fields.push(itemValue);
74
+ else if (!itemValue) fields.push('id'); // default value
75
+
76
+ if (itemText && itemText !== itemValue) fields.push(itemText);
77
+
78
+ if (!fields.includes('id')) fields.push('id');
79
+
80
+ return fields;
81
+ },
82
+ pickString() {
83
+ return [...this.fieldsFromAttrs, ...this.extraPick].join(',');
84
+ },
63
85
  },
64
86
  watch: {
65
87
  items(val) {
@@ -75,13 +97,18 @@ export default {
75
97
  mounted() {
76
98
  if (this.crudConfig.url) {
77
99
  this.loading = true;
100
+
101
+ const additionalParams = {};
102
+ if (this.pickString) {
103
+ additionalParams.fields = this.pickString;
104
+ }
78
105
  this.$mapo.$api
79
- .crud(this.crudConfig.url)
80
- .list(this.crudConfig.conf)
81
- .then((res) => {
82
- this.options = res;
83
- this.loading = false;
84
- });
106
+ .crud(this.crudConfig.url)
107
+ .list({ ...this.crudConfig.conf, params: { ...this.crudConfig?.conf?.params, ...additionalParams } })
108
+ .then((res) => {
109
+ this.options = res;
110
+ this.loading = false;
111
+ });
85
112
  }
86
113
  },
87
114
  };
@@ -182,6 +182,10 @@ export default {
182
182
  type: Boolean,
183
183
  default: false,
184
184
  },
185
+ extraPick: {
186
+ type: Array,
187
+ default: () => []
188
+ },
185
189
  },
186
190
  directives: {
187
191
  sortableDataTable: {
@@ -342,6 +346,7 @@ export default {
342
346
  query.forEach((q) => params.append("fltr", q));
343
347
  });
344
348
  if (this.searchString && this.searchable) params.append("search", this.searchString);
349
+ if (this.pickString) params.append("fields", this.pickString);
345
350
  return params;
346
351
  },
347
352
  quickAction(item) {
@@ -456,6 +461,15 @@ export default {
456
461
  serverItemsLength() {
457
462
  return this.httpPaginator.count || (this.serverPaginationEnabled && (this.options.page * this.options.itemsPerPage)) || -1;
458
463
  },
464
+ fieldsFromHeaders() {
465
+ if (!this.$attrs.headers || !this.$attrs.headers.length) return [];
466
+ return this.$attrs.headers
467
+ .filter(header => header.value && header.value !== 'actions' && header.value !== 'drag-column')
468
+ .filter(header => header.value && header.value !== 'actions' && header.value !== 'drag-column').map(header => header.value);
469
+ },
470
+ pickString() {
471
+ return [...this.fieldsFromHeaders, ...this.extraPick].join(',');
472
+ },
459
473
  },
460
474
  mounted() {
461
475
  this.restoreFromQparams();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapomodule/uikit",
3
- "version": "1.0.0-alpha.55",
3
+ "version": "1.0.0-alpha.56",
4
4
  "license": "MIT",
5
5
  "description": "This is part of Mapo nuxt module. Injects Mapo ui components in the nuxt component discovery system.",
6
6
  "author": "bnznamco <gabriele.baldi.01@gmail.com>",
@@ -15,5 +15,5 @@
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
18
- "gitHead": "ca8944723dea0ab8ba6a5b02c6ef5bc1110f02e7"
18
+ "gitHead": "15b2246c49ee15881cbc55a7a935cd5942b0f9af"
19
19
  }