@cleanweb/oore 1.2.0-alpha.7 → 1.2.0-alpha.8
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/build/slots/hook.js +3 -3
- package/package.json +1 -1
package/build/slots/hook.js
CHANGED
|
@@ -36,6 +36,9 @@ var getComponentSlotName = function (TargetComponent, child) {
|
|
|
36
36
|
var keyTypes = ['string', 'number', 'symbol'];
|
|
37
37
|
var slotName = child.props['data-slot-name'];
|
|
38
38
|
if (keyTypes.includes(typeof slotName)) {
|
|
39
|
+
if (typeof child.type === 'string') {
|
|
40
|
+
child.props.tagName = child.type;
|
|
41
|
+
}
|
|
39
42
|
return slotName;
|
|
40
43
|
}
|
|
41
44
|
else
|
|
@@ -47,7 +50,6 @@ var getComponentSlotName = function (TargetComponent, child) {
|
|
|
47
50
|
exports.getComponentSlotName = getComponentSlotName;
|
|
48
51
|
var useSlots = function (children, slotComponents, _requiredSlots) {
|
|
49
52
|
var useMemo = react_1.default.useMemo;
|
|
50
|
-
console.log({ slotComponents: slotComponents });
|
|
51
53
|
var slotsAliasLookup = useMemo(function () {
|
|
52
54
|
var entries = Object.entries(slotComponents);
|
|
53
55
|
var aliasLookup = {};
|
|
@@ -62,7 +64,6 @@ var useSlots = function (children, slotComponents, _requiredSlots) {
|
|
|
62
64
|
});
|
|
63
65
|
return aliasLookup;
|
|
64
66
|
}, [slotComponents]);
|
|
65
|
-
console.log({ slotsAliasLookup: slotsAliasLookup });
|
|
66
67
|
var result = useMemo(function () {
|
|
67
68
|
var slotNodes = {};
|
|
68
69
|
var unmatchedChildren = [];
|
|
@@ -98,7 +99,6 @@ var useSlots = function (children, slotComponents, _requiredSlots) {
|
|
|
98
99
|
else
|
|
99
100
|
unmatchedChildren.push(child);
|
|
100
101
|
});
|
|
101
|
-
console.log({ unmatchedChildren: unmatchedChildren, invalidChildren: invalidChildren });
|
|
102
102
|
requiredSlots.forEach(function (slotAlias) {
|
|
103
103
|
if (!slotNodes[slotAlias]) {
|
|
104
104
|
(0, errors_1.throwDevError)("Missing required slot \"".concat(String(slotAlias), "\"."));
|
package/package.json
CHANGED