@gaddario98/react-core 2.1.4 → 2.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.
package/dist/pages/index.js
CHANGED
|
@@ -313,7 +313,7 @@ const PageContentItemInner = ({
|
|
|
313
313
|
pageId
|
|
314
314
|
});
|
|
315
315
|
const isHidden = react.useMemo(() => {
|
|
316
|
-
if (typeof item.hidden ===
|
|
316
|
+
if (typeof item.hidden === "function") {
|
|
317
317
|
return item.hidden({
|
|
318
318
|
get,
|
|
319
319
|
set
|
|
@@ -326,12 +326,12 @@ const PageContentItemInner = ({
|
|
|
326
326
|
content: item,
|
|
327
327
|
ns: ns,
|
|
328
328
|
pageId: pageId
|
|
329
|
-
}, (_a = item.key) !== null && _a !== void 0 ? _a :
|
|
329
|
+
}, (_a = item.key) !== null && _a !== void 0 ? _a : "");
|
|
330
330
|
};
|
|
331
331
|
const PageContentItem = react.memo(PageContentItemInner);
|
|
332
332
|
const useGenerateContentRender = ({
|
|
333
333
|
pageId,
|
|
334
|
-
ns =
|
|
334
|
+
ns = "",
|
|
335
335
|
contents = [],
|
|
336
336
|
formData
|
|
337
337
|
}) => {
|
|
@@ -342,7 +342,7 @@ const useGenerateContentRender = ({
|
|
|
342
342
|
pageId
|
|
343
343
|
});
|
|
344
344
|
const contentsWithQueriesDeps = react.useMemo(() => {
|
|
345
|
-
if (typeof contents ===
|
|
345
|
+
if (typeof contents === "function") {
|
|
346
346
|
return contents({
|
|
347
347
|
get,
|
|
348
348
|
set
|
|
@@ -374,7 +374,10 @@ const useGenerateContentRender = ({
|
|
|
374
374
|
};
|
|
375
375
|
}), [contentsWithQueriesDeps, ns, pageId]);
|
|
376
376
|
// Merge and sort - only when either array changes
|
|
377
|
-
const memorizedContents = react.useMemo(() =>
|
|
377
|
+
const memorizedContents = react.useMemo(() => {
|
|
378
|
+
var _a_0, _b;
|
|
379
|
+
return (_b = (_a_0 = [...dynamicElements, ...formElementsWithKey].sort((a, b) => a.index - b.index || String(a.key).localeCompare(String(b.key)))) === null || _a_0 === void 0 ? void 0 : _a_0.filter(item => item.element !== null)) !== null && _b !== void 0 ? _b : [];
|
|
380
|
+
}, [dynamicElements, formElementsWithKey]);
|
|
378
381
|
return {
|
|
379
382
|
components: memorizedContents,
|
|
380
383
|
allContents: [...contentsWithQueriesDeps, ...formData.formContents]
|