@tunghtml/strapi-plugin-multiselect-checkbox 1.0.4 → 1.0.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.
|
@@ -27,7 +27,7 @@ const MultiSelect = ({
|
|
|
27
27
|
const { formatMessage } = reactIntl.useIntl();
|
|
28
28
|
const { onChange, value, error } = admin.useField(name);
|
|
29
29
|
const possibleOptions = react.useMemo(() => {
|
|
30
|
-
return (attribute["options"] || []).map((option) => {
|
|
30
|
+
return (attribute.options?.options || attribute["options"] || []).map((option) => {
|
|
31
31
|
const [label2, value2] = [...option.split(/:(.*)/s), option];
|
|
32
32
|
if (!label2 || !value2) return null;
|
|
33
33
|
return { label: label2, value: value2 };
|
|
@@ -76,7 +76,7 @@ const MultiSelect = ({
|
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
-
const gridCol = Math.floor(12 / (attribute.columns || 1));
|
|
79
|
+
const gridCol = Math.floor(12 / (attribute.options?.columns || attribute.columns || 1));
|
|
80
80
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
81
81
|
designSystem.Field.Root,
|
|
82
82
|
{
|
|
@@ -23,7 +23,7 @@ const MultiSelect = ({
|
|
|
23
23
|
const { formatMessage } = useIntl();
|
|
24
24
|
const { onChange, value, error } = useField(name);
|
|
25
25
|
const possibleOptions = useMemo(() => {
|
|
26
|
-
return (attribute["options"] || []).map((option) => {
|
|
26
|
+
return (attribute.options?.options || attribute["options"] || []).map((option) => {
|
|
27
27
|
const [label2, value2] = [...option.split(/:(.*)/s), option];
|
|
28
28
|
if (!label2 || !value2) return null;
|
|
29
29
|
return { label: label2, value: value2 };
|
|
@@ -72,7 +72,7 @@ const MultiSelect = ({
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
|
-
const gridCol = Math.floor(12 / (attribute.columns || 1));
|
|
75
|
+
const gridCol = Math.floor(12 / (attribute.options?.columns || attribute.columns || 1));
|
|
76
76
|
return /* @__PURE__ */ jsx(
|
|
77
77
|
Field.Root,
|
|
78
78
|
{
|
package/dist/admin/index.js
CHANGED
|
@@ -58,7 +58,7 @@ const index = {
|
|
|
58
58
|
defaultMessage: "Select multiple options using checkboxes. Data stored as JSON array."
|
|
59
59
|
},
|
|
60
60
|
components: {
|
|
61
|
-
Input: async () => Promise.resolve().then(() => require("../_chunks/index-
|
|
61
|
+
Input: async () => Promise.resolve().then(() => require("../_chunks/index-Cq8U74WF.js"))
|
|
62
62
|
},
|
|
63
63
|
options: {
|
|
64
64
|
base: [
|
|
@@ -66,7 +66,7 @@ const index = {
|
|
|
66
66
|
sectionTitle: null,
|
|
67
67
|
items: [
|
|
68
68
|
{
|
|
69
|
-
name: "options",
|
|
69
|
+
name: "options.options",
|
|
70
70
|
type: "textarea-enum",
|
|
71
71
|
intlLabel: {
|
|
72
72
|
id: prefixKey("options.available-options.label"),
|
|
@@ -82,7 +82,7 @@ const index = {
|
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
|
-
name: "columns",
|
|
85
|
+
name: "options.columns",
|
|
86
86
|
type: "number",
|
|
87
87
|
intlLabel: {
|
|
88
88
|
id: prefixKey("options.columns.label"),
|
package/dist/admin/index.mjs
CHANGED
|
@@ -55,7 +55,7 @@ const index = {
|
|
|
55
55
|
defaultMessage: "Select multiple options using checkboxes. Data stored as JSON array."
|
|
56
56
|
},
|
|
57
57
|
components: {
|
|
58
|
-
Input: async () => import("../_chunks/index-
|
|
58
|
+
Input: async () => import("../_chunks/index-DCyhdaV9.mjs")
|
|
59
59
|
},
|
|
60
60
|
options: {
|
|
61
61
|
base: [
|
|
@@ -63,7 +63,7 @@ const index = {
|
|
|
63
63
|
sectionTitle: null,
|
|
64
64
|
items: [
|
|
65
65
|
{
|
|
66
|
-
name: "options",
|
|
66
|
+
name: "options.options",
|
|
67
67
|
type: "textarea-enum",
|
|
68
68
|
intlLabel: {
|
|
69
69
|
id: prefixKey("options.available-options.label"),
|
|
@@ -79,7 +79,7 @@ const index = {
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
|
-
name: "columns",
|
|
82
|
+
name: "options.columns",
|
|
83
83
|
type: "number",
|
|
84
84
|
intlLabel: {
|
|
85
85
|
id: prefixKey("options.columns.label"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tunghtml/strapi-plugin-multiselect-checkbox",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "A Strapi v5 custom field plugin with checkbox UI that stores selected values as an array of strings (JSON type) instead of comma-separated strings.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strapi",
|