@os-design/core 1.0.293 → 1.0.294
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Popover/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAW9D,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAA2B,EACzB,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,+BAA+B,CAAC;AAEvC,KAAK,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7D,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,QAAQ;IACzD;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAChD;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IACrD;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAgED;;GAEG;AACH,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Popover/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAW9D,OAAO,EAGL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAA2B,EACzB,KAAK,SAAS,EACd,KAAK,IAAI,EAGV,MAAM,+BAA+B,CAAC;AAEvC,KAAK,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;AAC7D,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,QAAQ;IACzD;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAChD;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IACrD;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAgED;;GAEG;AACH,QAAA,MAAM,OAAO,yGAyNZ,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
package/dist/Popover/index.js
CHANGED
|
@@ -110,9 +110,7 @@ const Popover = /*#__PURE__*/forwardRef(({
|
|
|
110
110
|
}, [container]);
|
|
111
111
|
|
|
112
112
|
// Update the container size and its scroll offsets initially and when it has been changed.
|
|
113
|
-
// Must depend on `visible` to update the position when the popover is visible.
|
|
114
113
|
const containerListener = useCallback(() => {
|
|
115
|
-
if (!visible) return;
|
|
116
114
|
window.requestAnimationFrame(() => {
|
|
117
115
|
if (containerRef.current) {
|
|
118
116
|
if (containerRef.current === document.body) {
|
|
@@ -137,10 +135,11 @@ const Popover = /*#__PURE__*/forwardRef(({
|
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
});
|
|
140
|
-
}, [containerRef
|
|
138
|
+
}, [containerRef]);
|
|
139
|
+
// Must depend on `visible` to update the position when the popover is visible.
|
|
141
140
|
useBrowserLayoutEffect(() => {
|
|
142
141
|
containerListener();
|
|
143
|
-
}, [containerListener]);
|
|
142
|
+
}, [containerListener, visible]);
|
|
144
143
|
useEvent(typeof window !== 'undefined' && containerRef.current === document.body ? window : null, 'resize', containerListener);
|
|
145
144
|
useResizeObserver(typeof window !== 'undefined' && containerRef.current !== document.body ? containerRef.current : null, containerListener);
|
|
146
145
|
useEvent(typeof window !== 'undefined' ? containerRef.current === document.body ? document : containerRef.current : null, 'scroll', containerListener);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@os-design/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.294",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": "git@gitlab.com:os-team/libs/os-design.git",
|
|
6
6
|
"type": "module",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": "18",
|
|
59
59
|
"react-dom": "18"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "0c4c64eede699d13784ce558d17513a6fbb85888"
|
|
62
62
|
}
|
package/src/Popover/index.tsx
CHANGED
|
@@ -196,9 +196,7 @@ const Popover = forwardRef<HTMLDivElement, PopoverProps>(
|
|
|
196
196
|
}, [container]);
|
|
197
197
|
|
|
198
198
|
// Update the container size and its scroll offsets initially and when it has been changed.
|
|
199
|
-
// Must depend on `visible` to update the position when the popover is visible.
|
|
200
199
|
const containerListener = useCallback(() => {
|
|
201
|
-
if (!visible) return;
|
|
202
200
|
window.requestAnimationFrame(() => {
|
|
203
201
|
if (containerRef.current) {
|
|
204
202
|
if (containerRef.current === document.body) {
|
|
@@ -223,10 +221,11 @@ const Popover = forwardRef<HTMLDivElement, PopoverProps>(
|
|
|
223
221
|
}
|
|
224
222
|
}
|
|
225
223
|
});
|
|
226
|
-
}, [containerRef
|
|
224
|
+
}, [containerRef]);
|
|
225
|
+
// Must depend on `visible` to update the position when the popover is visible.
|
|
227
226
|
useBrowserLayoutEffect(() => {
|
|
228
227
|
containerListener();
|
|
229
|
-
}, [containerListener]);
|
|
228
|
+
}, [containerListener, visible]);
|
|
230
229
|
useEvent(
|
|
231
230
|
typeof window !== 'undefined' && containerRef.current === document.body
|
|
232
231
|
? window
|