@pdg/react-form 1.0.35 → 1.0.36

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.js CHANGED
@@ -823,11 +823,11 @@ Form.displayName = 'Form';
823
823
  Form.defaultProps = FormDefaultProps;var FormButtonDefaultProps = {
824
824
  type: 'button',
825
825
  };var FormIconDefaultProps = {};var FormIcon = React__default["default"].forwardRef(function (_a, ref) {
826
- // Memo --------------------------------------------------------------------------------------------------------------
827
- var className = _a.className, initChildren = _a.children, props = __rest$3(_a, ["className", "children"]);
828
- var children = React.useMemo(function () { return initChildren.replace(/[A-Z]/g, function (letter, idx) { return "".concat(idx > 0 ? '_' : '').concat(letter.toLowerCase()); }); }, [initChildren]);
829
- // Render ----------------------------------------------------------------------------------------------------------
830
- return (React__default["default"].createElement(material.Icon, __assign$6({ ref: ref }, props, { className: classNames$1('FormIcon', className) }), children));
826
+ var className = _a.className, InitChildren = _a.children, props = __rest$3(_a, ["className", "children"]);
827
+ return React.useMemo(function () {
828
+ var iconProps = __assign$6(__assign$6({}, props), { className: classNames$1('FormIcon', className) });
829
+ return typeof InitChildren === 'string' ? (React__default["default"].createElement(material.Icon, __assign$6({ ref: ref }, iconProps), InitChildren.replace(/[A-Z]/g, function (letter, idx) { return "".concat(idx > 0 ? '_' : '').concat(letter.toLowerCase()); }))) : (React__default["default"].createElement(InitChildren, __assign$6({}, iconProps)));
830
+ }, [InitChildren, className, props, ref]);
831
831
  });
832
832
  FormIcon.displayName = 'FormIcon';
833
833
  FormIcon.defaultProps = FormIconDefaultProps;var FormButton = React__default["default"].forwardRef(function (_a, ref) {