@janiscommerce/ui-web 1.6.0 → 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/CHANGELOG.md +12 -0
- package/dist/index.esm.js +17 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +17 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.7.0] - 2026-01-12
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- ref to wrapper element in Collapse component
|
|
15
|
+
- data-is-opened attribute to handle Collapse opening and closing states dynamically
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Refactored collapseState useMemo to include data-is-opened attribute updates in expandStart and collapseEnd handlers
|
|
20
|
+
- Removed isOpen prop from styled.Wrapper and styled.HeaderWrapper components in favor of data-is-opened attribute
|
|
21
|
+
|
|
10
22
|
## [1.6.0] - 2025-11-28
|
|
11
23
|
|
|
12
24
|
### Added
|
package/dist/index.esm.js
CHANGED
|
@@ -36297,6 +36297,7 @@ var Collapse = function Collapse(_ref) {
|
|
|
36297
36297
|
collapsingHandler = _ref$collapsingHandle === void 0 ? function () {} : _ref$collapsingHandle,
|
|
36298
36298
|
_ref$collapseEndHandl = _ref.collapseEndHandler,
|
|
36299
36299
|
collapseEndHandler = _ref$collapseEndHandl === void 0 ? function () {} : _ref$collapseEndHandl;
|
|
36300
|
+
var collapseRef = useRef(null);
|
|
36300
36301
|
|
|
36301
36302
|
var _useState = useState(isOpen),
|
|
36302
36303
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -36305,12 +36306,22 @@ var Collapse = function Collapse(_ref) {
|
|
|
36305
36306
|
|
|
36306
36307
|
var collapseState = useMemo(function () {
|
|
36307
36308
|
return {
|
|
36308
|
-
expandStart:
|
|
36309
|
+
expandStart: function expandStart() {
|
|
36310
|
+
var _collapseRef$current;
|
|
36311
|
+
|
|
36312
|
+
(_collapseRef$current = collapseRef.current) === null || _collapseRef$current === void 0 || _collapseRef$current.setAttribute('data-is-opened', String(true));
|
|
36313
|
+
expandStartHandler();
|
|
36314
|
+
},
|
|
36309
36315
|
expanding: expandingHandler,
|
|
36310
36316
|
expandEnd: expandEndHandler,
|
|
36311
36317
|
collapseStart: collapseStartHandler,
|
|
36312
36318
|
collapsing: collapsingHandler,
|
|
36313
|
-
collapseEnd:
|
|
36319
|
+
collapseEnd: function collapseEnd() {
|
|
36320
|
+
var _collapseRef$current2;
|
|
36321
|
+
|
|
36322
|
+
collapseEndHandler();
|
|
36323
|
+
(_collapseRef$current2 = collapseRef.current) === null || _collapseRef$current2 === void 0 || _collapseRef$current2.setAttribute('data-is-opened', String(false));
|
|
36324
|
+
}
|
|
36314
36325
|
};
|
|
36315
36326
|
}, [expandStartHandler, expandingHandler, expandEndHandler, collapseStartHandler, collapsingHandler, collapseEndHandler]);
|
|
36316
36327
|
|
|
@@ -36354,16 +36365,18 @@ var Collapse = function Collapse(_ref) {
|
|
|
36354
36365
|
disabled: disabled
|
|
36355
36366
|
};
|
|
36356
36367
|
useEffect(function () {
|
|
36368
|
+
var _collapseRef$current3;
|
|
36369
|
+
|
|
36370
|
+
if (collapseRef.current) (_collapseRef$current3 = collapseRef.current) === null || _collapseRef$current3 === void 0 || _collapseRef$current3.setAttribute('data-is-opened', String(isOpen));
|
|
36357
36371
|
setIsOpenState(isOpen);
|
|
36358
36372
|
}, [isOpen]);
|
|
36359
36373
|
if (!renderHeader || !isFunction(renderHeader) || !renderContent || !isFunction(renderContent)) return null;
|
|
36360
36374
|
return /*#__PURE__*/React__default.createElement(styled.Wrapper, {
|
|
36361
36375
|
className: "collapse",
|
|
36362
|
-
|
|
36376
|
+
ref: collapseRef
|
|
36363
36377
|
}, /*#__PURE__*/React__default.createElement(styled.HeaderWrapper, _extends$1({
|
|
36364
36378
|
className: "collapse__header"
|
|
36365
36379
|
}, getToggleProps(togglePropsParams), {
|
|
36366
|
-
isOpen: isOpenState,
|
|
36367
36380
|
position: position
|
|
36368
36381
|
}), /*#__PURE__*/React__default.createElement(styled.CollapseButton, buttonProps), renderHeader()), /*#__PURE__*/React__default.createElement("div", getCollapseProps(), /*#__PURE__*/React__default.createElement(styled.ContentWrapper, {
|
|
36369
36382
|
className: "collapse__content",
|