@mapomodule/uikit 1.0.0-alpha.53 → 1.0.0-alpha.54
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 +11 -0
- package/components/Form/fields/Repeater.vue +34 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.54](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.53...v1.0.0-alpha.54) (2025-03-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **repeater:** fix lower-case control and add example to repeater ([#56](https://github.com/lotrekagency/mapo/issues/56)) ([b897150](https://github.com/lotrekagency/mapo/commit/b89715054b8ba6df4c1d66dc853b64a840a5e433))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [1.0.0-alpha.53](https://github.com/lotrekagency/mapo/compare/v1.0.0-alpha.52...v1.0.0-alpha.53) (2024-07-11)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -57,9 +57,10 @@
|
|
|
57
57
|
</v-container>
|
|
58
58
|
</div>
|
|
59
59
|
<div class="repeater-side-bar grey lighten-2">
|
|
60
|
-
<span
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
<span
|
|
61
|
+
class="repeater-counter grey--text text--darken-2 text-truncate"
|
|
62
|
+
>{{ index + 1 }}</span
|
|
63
|
+
>
|
|
63
64
|
<v-tooltip right>
|
|
64
65
|
<template v-slot:activator="{ on, attrs }">
|
|
65
66
|
<v-icon
|
|
@@ -120,7 +121,11 @@
|
|
|
120
121
|
}}</v-card-title>
|
|
121
122
|
<v-card-text>
|
|
122
123
|
<div class="row mt-4">
|
|
123
|
-
<div
|
|
124
|
+
<div
|
|
125
|
+
v-for="(template, i) in templates"
|
|
126
|
+
:key="i"
|
|
127
|
+
class="col-12 col-md-6 pa-0"
|
|
128
|
+
>
|
|
124
129
|
<div @click="tModalCallback(template)" class="template-button">
|
|
125
130
|
<span class="text-h5">{{ template.name }}</span
|
|
126
131
|
><br />
|
|
@@ -312,7 +317,9 @@ export default {
|
|
|
312
317
|
langs: {
|
|
313
318
|
// `Array<String>`
|
|
314
319
|
type: Array,
|
|
315
|
-
default() {
|
|
320
|
+
default() {
|
|
321
|
+
return this.$mapo.$options?.content?.languages || [];
|
|
322
|
+
},
|
|
316
323
|
},
|
|
317
324
|
// This is mainly an internal property. It is used by DetailField to pass the active language inherited from the Detail component.
|
|
318
325
|
currentLang: String,
|
|
@@ -321,7 +328,11 @@ export default {
|
|
|
321
328
|
watch: {
|
|
322
329
|
value(val) {
|
|
323
330
|
const isEmpty = (v) => !v || Object.keys(v).length == 0;
|
|
324
|
-
if (
|
|
331
|
+
if (
|
|
332
|
+
(isEmpty(val) && isEmpty(this.items)) ||
|
|
333
|
+
JSON.stringify(val) === JSON.stringify(this.items)
|
|
334
|
+
)
|
|
335
|
+
return;
|
|
325
336
|
this.items = (val && deepClone(val)) || [];
|
|
326
337
|
if (val.length != this.collapsedStack.length)
|
|
327
338
|
this.collapsedStack = (val || []).map(() => !!this.collapsable);
|
|
@@ -330,7 +341,7 @@ export default {
|
|
|
330
341
|
handler(val) {
|
|
331
342
|
this.$emit("input", deepClone(val));
|
|
332
343
|
},
|
|
333
|
-
deep: true
|
|
344
|
+
deep: true,
|
|
334
345
|
},
|
|
335
346
|
tModalOpen(val) {
|
|
336
347
|
!val && this.tModalCallback();
|
|
@@ -383,14 +394,18 @@ export default {
|
|
|
383
394
|
},
|
|
384
395
|
getFields(model) {
|
|
385
396
|
if (this.hasTemplates) {
|
|
386
|
-
const template = this.templates.find(
|
|
397
|
+
const template = this.templates.find(
|
|
398
|
+
(t) => model[t.tCodeField] == t.tCode
|
|
399
|
+
);
|
|
387
400
|
return template ? template.fields : [];
|
|
388
401
|
}
|
|
389
402
|
return this.fields;
|
|
390
403
|
},
|
|
391
404
|
templateSlots(model, slots) {
|
|
392
405
|
if (this.hasTemplates) {
|
|
393
|
-
const template = this.templates.find(
|
|
406
|
+
const template = this.templates.find(
|
|
407
|
+
(t) => model[t.tCodeField] == t.tCode
|
|
408
|
+
);
|
|
394
409
|
return nameSpacedSlots(slots, `template.${template.tCode}.`).reduce(
|
|
395
410
|
(acc, v) => ({ [`template.${template.tCode}.${v}`]: v, ...acc }),
|
|
396
411
|
{}
|
|
@@ -407,7 +422,7 @@ export default {
|
|
|
407
422
|
return this.collapsedLabel(model);
|
|
408
423
|
default:
|
|
409
424
|
const field = this.getFields(model).find(
|
|
410
|
-
(f) => !f.type || f.type.
|
|
425
|
+
(f) => !f.type || f.type.toLowerCase() == "text"
|
|
411
426
|
);
|
|
412
427
|
return getPointed(model, field.value, fallback);
|
|
413
428
|
}
|
|
@@ -452,8 +467,15 @@ export default {
|
|
|
452
467
|
},
|
|
453
468
|
maxHeightStyle() {
|
|
454
469
|
if (this.maxHeight !== undefined) {
|
|
455
|
-
const maxHeight = isNaN(this.maxHeight)
|
|
456
|
-
|
|
470
|
+
const maxHeight = isNaN(this.maxHeight)
|
|
471
|
+
? this.maxHeight
|
|
472
|
+
: `${this.maxHeight}px`;
|
|
473
|
+
return {
|
|
474
|
+
maxHeight,
|
|
475
|
+
paddingTop: "15px",
|
|
476
|
+
overflowX: "hidden",
|
|
477
|
+
overflowY: "auto",
|
|
478
|
+
};
|
|
457
479
|
}
|
|
458
480
|
},
|
|
459
481
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mapomodule/uikit",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.54",
|
|
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": "
|
|
18
|
+
"gitHead": "57f850d66b0ea3a72c3fcab6073a4efa3af62fc3"
|
|
19
19
|
}
|