@measured/puck 0.9.0 → 0.9.1-canary.3c337be
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -0
- package/dist/index.js +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
@@ -3033,6 +3033,12 @@ var ExternalInput = ({
|
|
3033
3033
|
const [data, setData] = (0, import_react23.useState)([]);
|
3034
3034
|
const [isOpen, setOpen] = (0, import_react23.useState)(false);
|
3035
3035
|
const [selectedData, setSelectedData] = (0, import_react23.useState)(value);
|
3036
|
+
const keys = (0, import_react23.useMemo)(
|
3037
|
+
() => Object.keys(data).filter(
|
3038
|
+
(key) => typeof data[key] === "string" || typeof data[key] === "number"
|
3039
|
+
),
|
3040
|
+
[data]
|
3041
|
+
);
|
3036
3042
|
(0, import_react23.useEffect)(() => {
|
3037
3043
|
(() => __async(void 0, null, function* () {
|
3038
3044
|
if (field.adaptor) {
|
@@ -3089,7 +3095,7 @@ var ExternalInput = ({
|
|
3089
3095
|
children: [
|
3090
3096
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: getClassName5("modalHeading"), children: "Select content" }),
|
3091
3097
|
data.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: getClassName5("modalTableWrapper"), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("table", { children: [
|
3092
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("tr", { children:
|
3098
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("tr", { children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("th", { style: { textAlign: "left" }, children: key }, key)) }) }),
|
3093
3099
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("tbody", { children: data.map((item, i) => {
|
3094
3100
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
3095
3101
|
"tr",
|
@@ -3100,7 +3106,7 @@ var ExternalInput = ({
|
|
3100
3106
|
setOpen(false);
|
3101
3107
|
setSelectedData(item);
|
3102
3108
|
},
|
3103
|
-
children:
|
3109
|
+
children: keys.map((key) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("td", { children: item[key] }, key))
|
3104
3110
|
},
|
3105
3111
|
i
|
3106
3112
|
);
|