strivui 1.22.62 → 1.22.63
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/index.esm.js +20 -8
- package/dist/index.js +20 -8
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -436,23 +436,35 @@ var Dialog = function Dialog(_ref7) {
|
|
|
436
436
|
function SectionList(_ref9) {
|
|
437
437
|
var sections = _ref9.sections,
|
|
438
438
|
renderItem = _ref9.renderItem,
|
|
439
|
-
renderSectionHeader = _ref9.renderSectionHeader
|
|
439
|
+
renderSectionHeader = _ref9.renderSectionHeader,
|
|
440
|
+
keyExtractor = _ref9.keyExtractor;
|
|
441
|
+
if (!renderItem) {
|
|
442
|
+
console.error("SectionList requires renderItem");
|
|
443
|
+
return null;
|
|
444
|
+
}
|
|
440
445
|
return jsx("div", {
|
|
441
|
-
className: "
|
|
442
|
-
children: sections.map(function (section,
|
|
446
|
+
className: "strivui-sectionlist",
|
|
447
|
+
children: sections.map(function (section, sectionIndex) {
|
|
443
448
|
return jsxs("div", {
|
|
444
|
-
children: [renderSectionHeader ? renderSectionHeader(
|
|
449
|
+
children: [renderSectionHeader ? renderSectionHeader({
|
|
450
|
+
title: section.title,
|
|
451
|
+
sectionIndex: sectionIndex
|
|
452
|
+
}) : jsx("h4", {
|
|
445
453
|
className: "text-lg font-semibold mb-2",
|
|
446
454
|
children: section.title
|
|
447
455
|
}), jsx("div", {
|
|
448
456
|
className: "space-y-2",
|
|
449
|
-
children: section.data.map(function (item,
|
|
457
|
+
children: section.data.map(function (item, index) {
|
|
458
|
+
var key = keyExtractor ? keyExtractor(item, index) : "".concat(sectionIndex, "-").concat(index);
|
|
450
459
|
return jsx("div", {
|
|
451
|
-
children: renderItem(
|
|
452
|
-
|
|
460
|
+
children: renderItem({
|
|
461
|
+
item: item,
|
|
462
|
+
index: index
|
|
463
|
+
})
|
|
464
|
+
}, key);
|
|
453
465
|
})
|
|
454
466
|
})]
|
|
455
|
-
},
|
|
467
|
+
}, sectionIndex);
|
|
456
468
|
})
|
|
457
469
|
});
|
|
458
470
|
}
|
package/dist/index.js
CHANGED
|
@@ -438,23 +438,35 @@ var Dialog = function Dialog(_ref7) {
|
|
|
438
438
|
function SectionList(_ref9) {
|
|
439
439
|
var sections = _ref9.sections,
|
|
440
440
|
renderItem = _ref9.renderItem,
|
|
441
|
-
renderSectionHeader = _ref9.renderSectionHeader
|
|
441
|
+
renderSectionHeader = _ref9.renderSectionHeader,
|
|
442
|
+
keyExtractor = _ref9.keyExtractor;
|
|
443
|
+
if (!renderItem) {
|
|
444
|
+
console.error("SectionList requires renderItem");
|
|
445
|
+
return null;
|
|
446
|
+
}
|
|
442
447
|
return jsxRuntime.jsx("div", {
|
|
443
|
-
className: "
|
|
444
|
-
children: sections.map(function (section,
|
|
448
|
+
className: "strivui-sectionlist",
|
|
449
|
+
children: sections.map(function (section, sectionIndex) {
|
|
445
450
|
return jsxRuntime.jsxs("div", {
|
|
446
|
-
children: [renderSectionHeader ? renderSectionHeader(
|
|
451
|
+
children: [renderSectionHeader ? renderSectionHeader({
|
|
452
|
+
title: section.title,
|
|
453
|
+
sectionIndex: sectionIndex
|
|
454
|
+
}) : jsxRuntime.jsx("h4", {
|
|
447
455
|
className: "text-lg font-semibold mb-2",
|
|
448
456
|
children: section.title
|
|
449
457
|
}), jsxRuntime.jsx("div", {
|
|
450
458
|
className: "space-y-2",
|
|
451
|
-
children: section.data.map(function (item,
|
|
459
|
+
children: section.data.map(function (item, index) {
|
|
460
|
+
var key = keyExtractor ? keyExtractor(item, index) : "".concat(sectionIndex, "-").concat(index);
|
|
452
461
|
return jsxRuntime.jsx("div", {
|
|
453
|
-
children: renderItem(
|
|
454
|
-
|
|
462
|
+
children: renderItem({
|
|
463
|
+
item: item,
|
|
464
|
+
index: index
|
|
465
|
+
})
|
|
466
|
+
}, key);
|
|
455
467
|
})
|
|
456
468
|
})]
|
|
457
|
-
},
|
|
469
|
+
}, sectionIndex);
|
|
458
470
|
})
|
|
459
471
|
});
|
|
460
472
|
}
|