@pronto-tools-and-more/components 14.24.0 → 14.26.0
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/main.js +35 -24
- package/dist/parts/MenuItems2/MenuItems2.d.ts +3 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
@@ -1275,13 +1275,20 @@ var MaskIcon = ({ src }) => {
|
|
1275
1275
|
var unrender10 = (element, renderElement) => {
|
1276
1276
|
const { render, language, ...rest } = element;
|
1277
1277
|
const contentKey = "'context'";
|
1278
|
-
const
|
1278
|
+
const renderContext = {
|
1279
1279
|
name: `$functions.id($context, ${contentKey}, 'name')`,
|
1280
1280
|
description: `$functions.id($context, ${contentKey}, 'description')`,
|
1281
1281
|
url: `$functions.id($context, ${contentKey}, 'url')`,
|
1282
1282
|
language
|
1283
|
-
}
|
1283
|
+
};
|
1284
|
+
const node = render(renderContext);
|
1284
1285
|
const innerFinal = renderElement(node);
|
1286
|
+
if (rest.dataSource.type === "context") {
|
1287
|
+
return {
|
1288
|
+
...rest,
|
1289
|
+
content: innerFinal
|
1290
|
+
};
|
1291
|
+
}
|
1285
1292
|
const content = {
|
1286
1293
|
content: innerFinal,
|
1287
1294
|
dataSource: {
|
@@ -1296,38 +1303,42 @@ var unrender10 = (element, renderElement) => {
|
|
1296
1303
|
content
|
1297
1304
|
};
|
1298
1305
|
};
|
1306
|
+
var getDataSource = ({ menuName, menuContext }) => {
|
1307
|
+
if (menuName) {
|
1308
|
+
return {
|
1309
|
+
type: "menu",
|
1310
|
+
filter: {
|
1311
|
+
name: {
|
1312
|
+
value: menuName
|
1313
|
+
}
|
1314
|
+
}
|
1315
|
+
};
|
1316
|
+
}
|
1317
|
+
if (menuContext) {
|
1318
|
+
if (!menuContext.startsWith("$context.") && !menuContext.startsWith("$functions.")) {
|
1319
|
+
throw new Error(`context id must start with $context or $functions.`);
|
1320
|
+
}
|
1321
|
+
const dataSource = {
|
1322
|
+
type: "context",
|
1323
|
+
data: menuContext,
|
1324
|
+
contextKey: "context"
|
1325
|
+
};
|
1326
|
+
return dataSource;
|
1327
|
+
}
|
1328
|
+
throw new Error(`menu items data source is required`);
|
1329
|
+
};
|
1299
1330
|
var MenuItems2 = ({
|
1300
1331
|
menuName,
|
1332
|
+
menuContext,
|
1301
1333
|
render,
|
1302
1334
|
noContentFound
|
1303
1335
|
}) => {
|
1304
|
-
const dataSource = {
|
1305
|
-
type: "menu",
|
1306
|
-
filter: {
|
1307
|
-
name: {
|
1308
|
-
value: menuName
|
1309
|
-
}
|
1310
|
-
}
|
1311
|
-
};
|
1336
|
+
const dataSource = getDataSource({ menuContext, menuName });
|
1312
1337
|
const json = {
|
1313
1338
|
render,
|
1314
1339
|
unrender: unrender10,
|
1315
1340
|
dataSource,
|
1316
1341
|
type: "list",
|
1317
|
-
tapEntry: {
|
1318
|
-
value: {
|
1319
|
-
type: "openUrl",
|
1320
|
-
url: "#",
|
1321
|
-
target: "#"
|
1322
|
-
},
|
1323
|
-
condition: {
|
1324
|
-
compareValue: "external_links",
|
1325
|
-
value: "#"
|
1326
|
-
},
|
1327
|
-
fallback: {
|
1328
|
-
type: "openContent"
|
1329
|
-
}
|
1330
|
-
},
|
1331
1342
|
class: "data-custom-list",
|
1332
1343
|
template: "horizontal",
|
1333
1344
|
pagination: {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { MenuItemRenderer } from "../MenuItemRenderer/MenuItemRenderer.ts";
|
2
|
-
export declare const MenuItems2: ({ menuName, render, noContentFound, }: {
|
3
|
-
menuName
|
2
|
+
export declare const MenuItems2: ({ menuName, menuContext, render, noContentFound, }: {
|
3
|
+
menuName?: string;
|
4
|
+
menuContext?: string;
|
4
5
|
noContentFound?: string;
|
5
6
|
render: MenuItemRenderer;
|
6
7
|
}) => import("react").JSX.Element;
|