pixelize-design-library 2.1.67 → 2.1.68
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/Utils/table.js +14 -11
- package/package.json +1 -1
package/dist/Utils/table.js
CHANGED
|
@@ -91,22 +91,25 @@ exports.calculateLeftOffset = calculateLeftOffset;
|
|
|
91
91
|
// return bMatchCount - aMatchCount;
|
|
92
92
|
// });
|
|
93
93
|
// };
|
|
94
|
+
var extractTextFromReactNode = function (node) {
|
|
95
|
+
if (typeof node === "string" || typeof node === "number") {
|
|
96
|
+
return String(node);
|
|
97
|
+
}
|
|
98
|
+
if (Array.isArray(node)) {
|
|
99
|
+
return node.map(extractTextFromReactNode).join(" ");
|
|
100
|
+
}
|
|
101
|
+
if (react_1.default.isValidElement(node)) {
|
|
102
|
+
var element = node;
|
|
103
|
+
return extractTextFromReactNode(element.props.children);
|
|
104
|
+
}
|
|
105
|
+
return "";
|
|
106
|
+
};
|
|
94
107
|
var getStringValue = function (value) {
|
|
95
108
|
if (typeof value === "string" || typeof value === "number") {
|
|
96
109
|
return String(value);
|
|
97
110
|
}
|
|
98
|
-
// Handle React elements
|
|
99
111
|
if (react_1.default.isValidElement(value)) {
|
|
100
|
-
|
|
101
|
-
var children = element.props.children;
|
|
102
|
-
if (typeof children === "string")
|
|
103
|
-
return children;
|
|
104
|
-
if (Array.isArray(children)) {
|
|
105
|
-
return children
|
|
106
|
-
.map(function (child) { return (typeof child === "string" ? child : ""); })
|
|
107
|
-
.join(" ");
|
|
108
|
-
}
|
|
109
|
-
return "";
|
|
112
|
+
return extractTextFromReactNode(value);
|
|
110
113
|
}
|
|
111
114
|
return "";
|
|
112
115
|
};
|