@ainias42/react-bootstrap-mobile 0.2.14 → 0.2.16
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/bootstrapReactMobile.js +32 -32
- package/dist/bootstrapReactMobile.js.map +1 -1
- package/dist/src/Components/SpoilerList/Spoiler/Spoiler.d.ts +2 -1
- package/package.json +1 -1
- package/src/Components/FormElements/Switch/Switch.tsx +0 -1
- package/src/Components/Menu/Menu.tsx +43 -42
- package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +3 -1
- package/src/Components/SpoilerList/Spoiler/spoiler.scss +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* @ainias42/react-bootstrap-mobile v0.2.
|
|
3
|
+
* @ainias42/react-bootstrap-mobile v0.2.15
|
|
4
4
|
* git+https://github.com/Ainias/Bootstrap-React-Mobile.git
|
|
5
5
|
* Copyright (c) Silas Günther and project contributors.
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
@@ -2434,7 +2434,7 @@ var ___CSS_LOADER_API_SOURCEMAP_IMPORT___ = __webpack_require__(1354);
|
|
|
2434
2434
|
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(6314);
|
|
2435
2435
|
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);
|
|
2436
2436
|
// Module
|
|
2437
|
-
___CSS_LOADER_EXPORT___.push([module.id, `@layer rbm{@keyframes spoilerContainerOpen__KywlX{0%{height:0}1%{height:initial}100%{height:initial}}@keyframes spoilerOpen__Afblf{0%{height:0;transform:translateY(-100%);opacity:0}1%{height:initial;transform:translateY(-100%);opacity:0}100%{height:initial;transform:
|
|
2437
|
+
___CSS_LOADER_EXPORT___.push([module.id, `@layer rbm{@keyframes spoilerContainerOpen__KywlX{0%{height:0}1%{height:initial}100%{height:initial}}@keyframes spoilerOpen__Afblf{0%{height:0;transform:translateY(-100%);opacity:0}1%{height:initial;transform:translateY(-100%);opacity:0}100%{height:initial;transform:none !important;opacity:1}}@keyframes spoilerContainerClose__c50mH{0%{height:initial}99%{height:initial}100%{height:0}}@keyframes spoilerClose__gNNJP{0%{height:initial;transform:translateY(0%);opacity:1}99%{height:initial;transform:translateY(-100%);opacity:0}100%{height:0;transform:translateY(-100%);opacity:0}}.spoiler__pBIFl{display:block;border-top:1px solid var(--border-strong);border-bottom:1px solid var(--border-strong)}.spoiler__pBIFl .icon__OiZu5{margin-right:.5rem}.spoiler__pBIFl.open__eXqd1 .bodyContainer__zAqHY,.spoiler__pBIFl.open__eXqd1.noClosingAnimation__f2QCy .bodyContainer__zAqHY{height:initial;animation-name:spoilerContainerOpen__KywlX}.spoiler__pBIFl.open__eXqd1 .bodyContainer__zAqHY .body__YDKcW,.spoiler__pBIFl.open__eXqd1.noClosingAnimation__f2QCy .bodyContainer__zAqHY .body__YDKcW{height:initial;transform:none;animation-name:spoilerOpen__Afblf}.spoiler__pBIFl.noAnimation__OccHB .bodyContainer__zAqHY,.spoiler__pBIFl.noAnimation__OccHB.open__eXqd1 .bodyContainer__zAqHY{animation:none}.spoiler__pBIFl.noAnimation__OccHB .bodyContainer__zAqHY .body__YDKcW,.spoiler__pBIFl.noAnimation__OccHB.open__eXqd1 .bodyContainer__zAqHY .body__YDKcW{animation:none}.spoiler__pBIFl.noClosingAnimation__f2QCy .bodyContainer__zAqHY{animation-name:none}.spoiler__pBIFl.noClosingAnimation__f2QCy .bodyContainer__zAqHY .body__YDKcW{animation-name:none}.spoiler__pBIFl .bodyContainer__zAqHY{height:0;overflow:hidden;animation-name:spoilerContainerClose__c50mH;animation-duration:.7s;animation-fill-mode:forwards}.spoiler__pBIFl .bodyContainer__zAqHY .body__YDKcW{height:0;overflow:hidden;transform-origin:left top;transform:translateY(-100%);animation-name:spoilerClose__gNNJP;animation-duration:.7s;animation-fill-mode:forwards}}`, "",{"version":3,"sources":["webpack://./src/Components/SpoilerList/Spoiler/spoiler.scss"],"names":[],"mappings":"AACA,WACC,uCACC,GACE,QAAA,CAEF,GACE,cAAA,CAEF,KACE,cAAA,CAAA,CAIJ,8BACE,GACE,QAAA,CACA,2BAAA,CACA,SAAA,CAEF,GACE,cAAA,CACA,2BAAA,CACA,SAAA,CAEF,KACE,cAAA,CACA,yBAAA,CACA,SAAA,CAAA,CAIJ,wCACE,GACE,cAAA,CAEF,IACE,cAAA,CAEF,KACE,QAAA,CAAA,CAIJ,+BACE,GACE,cAAA,CACA,wBAAA,CACA,SAAA,CAEF,IACE,cAAA,CACA,2BAAA,CACA,SAAA,CAEF,KACE,QAAA,CACA,2BAAA,CACA,SAAA,CAAA,CAIJ,gBACE,aAAA,CACA,yCAAA,CACA,4CAAA,CAEA,6BACE,kBAAA,CAIA,8HACE,cAAA,CACA,0CAAA,CAEA,wJACE,cAAA,CACA,cAAA,CACA,iCAAA,CAMJ,8HACE,cAAA,CAEA,wJACE,cAAA,CAMJ,gEACE,mBAAA,CAEA,6EACE,mBAAA,CAKN,sCACE,QAAA,CACA,eAAA,CACA,2CAAA,CACA,sBAAA,CACA,4BAAA,CAEA,mDACE,QAAA,CACA,eAAA,CACA,yBAAA,CACA,2BAAA,CACA,kCAAA,CACA,sBAAA,CACA,4BAAA,CAAA","sourcesContent":["\n@layer rbm {\n @keyframes spoilerContainerOpen {\n 0% {\n height: 0;\n }\n 1% {\n height: initial;\n }\n 100% {\n height: initial;\n }\n}\n\n@keyframes spoilerOpen {\n 0% {\n height: 0;\n transform: translateY(-100%);\n opacity: 0;\n }\n 1% {\n height: initial;\n transform: translateY(-100%);\n opacity: 0;\n }\n 100% {\n height: initial;\n transform: none !important;\n opacity: 1;\n }\n}\n\n@keyframes spoilerContainerClose {\n 0% {\n height: initial;\n }\n 99% {\n height: initial;\n }\n 100% {\n height: 0;\n }\n}\n\n@keyframes spoilerClose {\n 0% {\n height: initial;\n transform: translateY(0%);\n opacity: 1;\n }\n 99% {\n height: initial;\n transform: translateY(-100%);\n opacity: 0;\n }\n 100% {\n height: 0;\n transform: translateY(-100%);\n opacity: 0;\n }\n}\n\n.spoiler {\n display: block;\n border-top: 1px solid var(--border-strong);\n border-bottom: 1px solid var(--border-strong);\n\n .icon {\n margin-right: 0.5rem;\n }\n\n &.open, &.open.noClosingAnimation {\n .bodyContainer {\n height: initial;\n animation-name: spoilerContainerOpen;\n\n .body {\n height: initial;\n transform: none;\n animation-name: spoilerOpen;\n }\n }\n }\n\n &.noAnimation, &.noAnimation.open {\n .bodyContainer {\n animation: none;\n\n .body {\n animation: none;\n }\n }\n }\n\n &.noClosingAnimation {\n .bodyContainer {\n animation-name: none;\n\n .body {\n animation-name: none;\n }\n }\n }\n\n .bodyContainer {\n height: 0;\n overflow: hidden;\n animation-name: spoilerContainerClose;\n animation-duration: 0.7s;\n animation-fill-mode: forwards;\n\n .body {\n height: 0;\n overflow: hidden;\n transform-origin: left top;\n transform: translateY(-100%);\n animation-name: spoilerClose;\n animation-duration: 0.7s;\n animation-fill-mode: forwards;\n }\n }\n}\n \n}"],"sourceRoot":""}]);
|
|
2438
2438
|
// Exports
|
|
2439
2439
|
___CSS_LOADER_EXPORT___.locals = {
|
|
2440
2440
|
"spoiler": `spoiler__pBIFl`,
|
|
@@ -7581,35 +7581,35 @@ const Menu = withMemo(withRenderBrowserOnly(function Menu({
|
|
|
7581
7581
|
elem === null || elem === void 0 ? void 0 : elem.appendChild(portalContainer);
|
|
7582
7582
|
}, [isOpen, portalContainer, window === null || window === void 0 ? void 0 : window.document.body]);
|
|
7583
7583
|
useClientLayoutEffect(() => {
|
|
7584
|
-
var _a;
|
|
7585
7584
|
if (!menuRef.current) {
|
|
7586
|
-
return;
|
|
7587
|
-
}
|
|
7588
|
-
const width = parseFloat(getComputedStyle(menuRef.current).width);
|
|
7589
|
-
let newX = x;
|
|
7590
|
-
if (newX > ((_a = window === null || window === void 0 ? void 0 : window.innerWidth) !== null && _a !== void 0 ? _a : 0) - width) {
|
|
7591
|
-
newX -= width + offsetX;
|
|
7592
|
-
}
|
|
7593
|
-
if (newX < 0) {
|
|
7594
|
-
newX = 0;
|
|
7595
|
-
}
|
|
7596
|
-
setInnerX(newX);
|
|
7597
|
-
}, [offsetX, window === null || window === void 0 ? void 0 : window.innerWidth, x]);
|
|
7598
|
-
useClientLayoutEffect(() => {
|
|
7599
|
-
var _a;
|
|
7600
|
-
if (!menuRef.current) {
|
|
7601
|
-
return;
|
|
7602
|
-
}
|
|
7603
|
-
const height = parseFloat(getComputedStyle(menuRef.current).height);
|
|
7604
|
-
let newY = y;
|
|
7605
|
-
if (newY > ((_a = window === null || window === void 0 ? void 0 : window.innerHeight) !== null && _a !== void 0 ? _a : 0) - height) {
|
|
7606
|
-
newY -= height + offsetY;
|
|
7607
|
-
}
|
|
7608
|
-
if (newY < 0) {
|
|
7609
|
-
newY = 0;
|
|
7585
|
+
return undefined;
|
|
7610
7586
|
}
|
|
7611
|
-
|
|
7612
|
-
|
|
7587
|
+
const menuElement = menuRef.current;
|
|
7588
|
+
const updateInnerPositions = () => {
|
|
7589
|
+
var _a, _b;
|
|
7590
|
+
const computedStyle = getComputedStyle(menuElement);
|
|
7591
|
+
const height = parseFloat(computedStyle.height);
|
|
7592
|
+
let newY = y;
|
|
7593
|
+
if (newY > ((_a = window === null || window === void 0 ? void 0 : window.innerHeight) !== null && _a !== void 0 ? _a : 0) - height) {
|
|
7594
|
+
newY -= height + offsetY;
|
|
7595
|
+
}
|
|
7596
|
+
setInnerY(Math.max(0, newY));
|
|
7597
|
+
const width = parseFloat(computedStyle.width);
|
|
7598
|
+
let newX = x;
|
|
7599
|
+
if (newX > ((_b = window === null || window === void 0 ? void 0 : window.innerWidth) !== null && _b !== void 0 ? _b : 0) - width) {
|
|
7600
|
+
newX -= width + offsetX;
|
|
7601
|
+
}
|
|
7602
|
+
setInnerX(Math.max(0, newX));
|
|
7603
|
+
};
|
|
7604
|
+
const observer = new ResizeObserver(() => {
|
|
7605
|
+
updateInnerPositions();
|
|
7606
|
+
});
|
|
7607
|
+
observer.observe(menuElement);
|
|
7608
|
+
updateInnerPositions();
|
|
7609
|
+
return () => {
|
|
7610
|
+
observer.disconnect();
|
|
7611
|
+
};
|
|
7612
|
+
}, [window, x, y, offsetX, offsetY]);
|
|
7613
7613
|
// Other
|
|
7614
7614
|
// Render Functions
|
|
7615
7615
|
if (!isOpen) {
|
|
@@ -8735,7 +8735,6 @@ const Switch = withMemo(function Switch(_a) {
|
|
|
8735
8735
|
}, [onChange, onChangeChecked]);
|
|
8736
8736
|
const checkStopPropagation = (0,external_react_.useCallback)(ev => {
|
|
8737
8737
|
if (stopPropagation) {
|
|
8738
|
-
console.log("LOG-d stopPropagation inside checkStopPropagation", ev);
|
|
8739
8738
|
ev.stopPropagation();
|
|
8740
8739
|
ev.nativeEvent.stopPropagation();
|
|
8741
8740
|
}
|
|
@@ -13045,6 +13044,7 @@ function Spoiler(_a) {
|
|
|
13045
13044
|
children,
|
|
13046
13045
|
initialOpen = false,
|
|
13047
13046
|
noClosingAnimation = false,
|
|
13047
|
+
noAnimation = false,
|
|
13048
13048
|
openIcon = free_solid_svg_icons_namespaceObject.faChevronDown,
|
|
13049
13049
|
closeIcon = free_solid_svg_icons_namespaceObject.faChevronUp,
|
|
13050
13050
|
className,
|
|
@@ -13052,7 +13052,7 @@ function Spoiler(_a) {
|
|
|
13052
13052
|
style,
|
|
13053
13053
|
open
|
|
13054
13054
|
} = _a,
|
|
13055
|
-
listenerProps = Spoiler_rest(_a, ["title", "children", "initialOpen", "noClosingAnimation", "openIcon", "closeIcon", "className", "onlyTitleToggles", "style", "open"]);
|
|
13055
|
+
listenerProps = Spoiler_rest(_a, ["title", "children", "initialOpen", "noClosingAnimation", "noAnimation", "openIcon", "closeIcon", "className", "onlyTitleToggles", "style", "open"]);
|
|
13056
13056
|
// Refs
|
|
13057
13057
|
// States
|
|
13058
13058
|
const [isOpen, setIsOpen] = (0,external_react_.useState)(open !== null && open !== void 0 ? open : initialOpen);
|
|
@@ -13090,7 +13090,7 @@ function Spoiler(_a) {
|
|
|
13090
13090
|
onClick: onlyTitleToggles ? undefined : toggleOpen,
|
|
13091
13091
|
className: classnames_default()(className, (spoiler_default()).spoiler, {
|
|
13092
13092
|
[(spoiler_default()).open]: open !== null && open !== void 0 ? open : isOpen,
|
|
13093
|
-
[(spoiler_default()).noAnimation]: isInitialValue,
|
|
13093
|
+
[(spoiler_default()).noAnimation]: isInitialValue || noAnimation,
|
|
13094
13094
|
[(spoiler_default()).noClosingAnimation]: noClosingAnimation
|
|
13095
13095
|
}),
|
|
13096
13096
|
style: style
|