@janiscommerce/ui-web 1.7.0-beta.2 → 1.7.0

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.umd.js CHANGED
@@ -36331,10 +36331,11 @@
36331
36331
  setIsOpenState = _useState2[1];
36332
36332
 
36333
36333
  var collapseState = React.useMemo(function () {
36334
- var collapseElement = collapseRef.current;
36335
36334
  return {
36336
36335
  expandStart: function expandStart() {
36337
- collapseElement.setAttribute('data-is-opened', true);
36336
+ var _collapseRef$current;
36337
+
36338
+ (_collapseRef$current = collapseRef.current) === null || _collapseRef$current === void 0 || _collapseRef$current.setAttribute('data-is-opened', String(true));
36338
36339
  expandStartHandler();
36339
36340
  },
36340
36341
  expanding: expandingHandler,
@@ -36342,8 +36343,10 @@
36342
36343
  collapseStart: collapseStartHandler,
36343
36344
  collapsing: collapsingHandler,
36344
36345
  collapseEnd: function collapseEnd() {
36346
+ var _collapseRef$current2;
36347
+
36345
36348
  collapseEndHandler();
36346
- collapseElement.setAttribute('data-is-opened', false);
36349
+ (_collapseRef$current2 = collapseRef.current) === null || _collapseRef$current2 === void 0 || _collapseRef$current2.setAttribute('data-is-opened', String(false));
36347
36350
  }
36348
36351
  };
36349
36352
  }, [expandStartHandler, expandingHandler, expandEndHandler, collapseStartHandler, collapsingHandler, collapseEndHandler]);
@@ -36388,7 +36391,9 @@
36388
36391
  disabled: disabled
36389
36392
  };
36390
36393
  React.useEffect(function () {
36391
- collapseRef.current.setAttribute('data-is-opened', isOpenState);
36394
+ var _collapseRef$current3;
36395
+
36396
+ if (collapseRef.current) (_collapseRef$current3 = collapseRef.current) === null || _collapseRef$current3 === void 0 || _collapseRef$current3.setAttribute('data-is-opened', String(isOpen));
36392
36397
  setIsOpenState(isOpen);
36393
36398
  }, [isOpen]);
36394
36399
  if (!renderHeader || !isFunction(renderHeader) || !renderContent || !isFunction(renderContent)) return null;