@tunghtml/strapi-plugin-composite-field 1.1.3 → 1.1.5
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.
|
@@ -464,24 +464,23 @@ const CompositeInput = (props) => {
|
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
if (!fieldValue) {
|
|
467
|
-
const
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
467
|
+
const combobox = document.querySelector(
|
|
468
|
+
`div[role="combobox"][name="${fieldPath}"]`
|
|
469
|
+
);
|
|
470
|
+
if (combobox) {
|
|
471
|
+
const selectedText = combobox.textContent?.trim();
|
|
472
|
+
if (selectedText && selectedText !== "Select..." && selectedText !== "") {
|
|
473
|
+
fieldValue = selectedText;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (!fieldValue) {
|
|
478
|
+
const fieldById = document.getElementById(fieldPath);
|
|
479
|
+
if (fieldById) {
|
|
480
|
+
if (fieldById.tagName === "SELECT") {
|
|
481
|
+
fieldValue = fieldById.value;
|
|
482
|
+
} else if (fieldById.value) {
|
|
483
|
+
fieldValue = fieldById.value;
|
|
485
484
|
}
|
|
486
485
|
}
|
|
487
486
|
}
|
|
@@ -506,7 +505,7 @@ const CompositeInput = (props) => {
|
|
|
506
505
|
const listeners = [];
|
|
507
506
|
fields.forEach((fieldPath) => {
|
|
508
507
|
const elements = document.querySelectorAll(
|
|
509
|
-
`input[name="${fieldPath}"], textarea[name="${fieldPath}"], select[name="${fieldPath}"],
|
|
508
|
+
`input[name="${fieldPath}"], textarea[name="${fieldPath}"], select[name="${fieldPath}"], div[role="combobox"][name="${fieldPath}"]`
|
|
510
509
|
);
|
|
511
510
|
elements.forEach((element) => {
|
|
512
511
|
element.addEventListener("change", handleFieldChange);
|
|
@@ -483,24 +483,23 @@ const CompositeInput = (props) => {
|
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
485
|
if (!fieldValue) {
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}
|
|
486
|
+
const combobox = document.querySelector(
|
|
487
|
+
`div[role="combobox"][name="${fieldPath}"]`
|
|
488
|
+
);
|
|
489
|
+
if (combobox) {
|
|
490
|
+
const selectedText = combobox.textContent?.trim();
|
|
491
|
+
if (selectedText && selectedText !== "Select..." && selectedText !== "") {
|
|
492
|
+
fieldValue = selectedText;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
if (!fieldValue) {
|
|
497
|
+
const fieldById = document.getElementById(fieldPath);
|
|
498
|
+
if (fieldById) {
|
|
499
|
+
if (fieldById.tagName === "SELECT") {
|
|
500
|
+
fieldValue = fieldById.value;
|
|
501
|
+
} else if (fieldById.value) {
|
|
502
|
+
fieldValue = fieldById.value;
|
|
504
503
|
}
|
|
505
504
|
}
|
|
506
505
|
}
|
|
@@ -525,7 +524,7 @@ const CompositeInput = (props) => {
|
|
|
525
524
|
const listeners = [];
|
|
526
525
|
fields.forEach((fieldPath) => {
|
|
527
526
|
const elements = document.querySelectorAll(
|
|
528
|
-
`input[name="${fieldPath}"], textarea[name="${fieldPath}"], select[name="${fieldPath}"],
|
|
527
|
+
`input[name="${fieldPath}"], textarea[name="${fieldPath}"], select[name="${fieldPath}"], div[role="combobox"][name="${fieldPath}"]`
|
|
529
528
|
);
|
|
530
529
|
elements.forEach((element) => {
|
|
531
530
|
element.addEventListener("change", handleFieldChange);
|
package/dist/admin/index.js
CHANGED
|
@@ -37,7 +37,7 @@ const index = {
|
|
|
37
37
|
defaultMessage: "Combine multiple fields into one display value"
|
|
38
38
|
},
|
|
39
39
|
components: {
|
|
40
|
-
Input: async () => Promise.resolve().then(() => require("../_chunks/CompositeInput-
|
|
40
|
+
Input: async () => Promise.resolve().then(() => require("../_chunks/CompositeInput-C_wtVXHq.js"))
|
|
41
41
|
},
|
|
42
42
|
options: {
|
|
43
43
|
base: [
|
package/dist/admin/index.mjs
CHANGED
|
@@ -34,7 +34,7 @@ const index = {
|
|
|
34
34
|
defaultMessage: "Combine multiple fields into one display value"
|
|
35
35
|
},
|
|
36
36
|
components: {
|
|
37
|
-
Input: async () => import("../_chunks/CompositeInput-
|
|
37
|
+
Input: async () => import("../_chunks/CompositeInput-CF-LA05U.mjs")
|
|
38
38
|
},
|
|
39
39
|
options: {
|
|
40
40
|
base: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tunghtml/strapi-plugin-composite-field",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "A Strapi v5 plugin to create composite display fields by combining multiple text, string, and enum fields with auto-generate support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|