@mjhls/mjh-framework 1.0.111 → 1.0.112

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
@@ -13812,22 +13812,21 @@ var FigureComponent = function FigureComponent(_ref) {
13812
13812
  _node$alignment = node$$1.alignment,
13813
13813
  alignment = _node$alignment === undefined ? 'center' : _node$alignment;
13814
13814
 
13815
-
13816
- var imgWidth = widthP ? widthP + '%' : 'auto';
13815
+ var imgWidth = widthP ? widthP + '%' : '100%';
13817
13816
 
13818
13817
  var figureMargin = void 0;
13819
13818
  if (imgFloat === 'none') {
13820
13819
  figureMargin = '0 auto 1rem';
13821
13820
  }
13822
13821
  if (imgFloat === 'left') {
13823
- figureMargin = '0 1rem 1rem 10%';
13822
+ figureMargin = '0 10% 1rem 1rem';
13824
13823
  }
13825
13824
  if (imgFloat === 'right') {
13826
- figureMargin = '0 10% 1rem 1rem';
13825
+ figureMargin = '0 1rem 1rem 10%';
13827
13826
  }
13828
13827
 
13829
13828
  var loadImg = function loadImg() {
13830
- setcaptionWidth(imgElement.current.naturalWidth);
13829
+ setcaptionWidth(imgElement.current.width);
13831
13830
  };
13832
13831
 
13833
13832
  React.useEffect(function () {
@@ -13835,14 +13834,13 @@ var FigureComponent = function FigureComponent(_ref) {
13835
13834
  if (screenWidth > 1000) {
13836
13835
  var align = alignment.toLowerCase() === 'center' ? 'none' : alignment.toLowerCase();
13837
13836
  setimgFloat(align);
13838
- loadImg();
13839
13837
  }
13840
13838
  // eslint-disable-next-line react-hooks/exhaustive-deps
13841
13839
  }, []);
13842
13840
 
13843
13841
  return React__default.createElement(
13844
13842
  reactBootstrap.Figure,
13845
- { className: 'd-block text-center mb-3', style: { width: imgWidth, clear: 'both', float: imgFloat, margin: figureMargin } },
13843
+ { className: 'd-block text-center mb-3', style: { width: imgWidth, float: imgFloat, clear: 'both', margin: figureMargin } },
13846
13844
  link ? React__default.createElement(
13847
13845
  'a',
13848
13846
  { href: link, target: blank ? '_blank' : '_self' },