@knovator/pagecreator 1.0.5 → 1.0.7
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/index.js +35 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -578,6 +578,35 @@ function TabWidget(_ref) {
|
|
|
578
578
|
}));
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
+
function LinksWidget(_ref) {
|
|
582
|
+
var widgetData = _ref.widgetData,
|
|
583
|
+
formatItem = _ref.formatItem,
|
|
584
|
+
className = _ref.className,
|
|
585
|
+
itemsContainer = _ref.itemsContainer;
|
|
586
|
+
var gridClasses = "grid grid-cols-".concat(widgetData.mobilePerRow, " md:grid-cols-").concat(widgetData.tabletPerRow, " lg:grid-cols-").concat(widgetData.webPerRow);
|
|
587
|
+
var collectionItems = Array.isArray(widgetData.collectionItems) ? widgetData.collectionItems : [];
|
|
588
|
+
if (typeof itemsContainer === 'function') return itemsContainer(widgetData.itemsType === 'Image' ? widgetData.items.filter(filterItemData).map(function (item, index) {
|
|
589
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
590
|
+
key: index
|
|
591
|
+
}, formatItem(item));
|
|
592
|
+
}) : collectionItems.map(function (item, index) {
|
|
593
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
594
|
+
key: index
|
|
595
|
+
}, formatItem(item));
|
|
596
|
+
}));
|
|
597
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
598
|
+
className: "kpc_links-widget ".concat(className || gridClasses)
|
|
599
|
+
}, widgetData.itemsType === 'Image' ? widgetData.items.filter(filterItemData).map(function (item, index) {
|
|
600
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
601
|
+
key: index
|
|
602
|
+
}, formatItem(item));
|
|
603
|
+
}) : collectionItems.map(function (item, index) {
|
|
604
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
605
|
+
key: index
|
|
606
|
+
}, formatItem(item));
|
|
607
|
+
}));
|
|
608
|
+
}
|
|
609
|
+
|
|
581
610
|
function Widget(_ref) {
|
|
582
611
|
var widgetData = _ref.widgetData,
|
|
583
612
|
imageBaseUrl = _ref.imageBaseUrl,
|
|
@@ -652,6 +681,12 @@ function Widget(_ref) {
|
|
|
652
681
|
widgetData: widgetData,
|
|
653
682
|
className: className,
|
|
654
683
|
itemsContainer: itemsContainer
|
|
684
|
+
})) : widgetData.widgetType === 'Links' ? (/*#__PURE__*/React.createElement(LinksWidget, {
|
|
685
|
+
widgetData: widgetData,
|
|
686
|
+
formatItem: formatItems,
|
|
687
|
+
className: className,
|
|
688
|
+
itemsContainer: itemsContainer,
|
|
689
|
+
formatTabTitle: formatTabTitles
|
|
655
690
|
})) : (/*#__PURE__*/React.createElement(FixedWidget, {
|
|
656
691
|
widgetData: widgetData,
|
|
657
692
|
formatItem: formatItems,
|