forstok-ui-lib 5.8.8 → 5.9.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.d.ts +1 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/dropdown/index.tsx +11 -5
- package/src/components/index.ts +1 -2
package/package.json
CHANGED
|
@@ -14,7 +14,8 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
|
|
|
14
14
|
const portalContainerRef = document.querySelector(`#${portalId} ._refDropdownPortal`) as HTMLElement;
|
|
15
15
|
if (portalContainerRef) {
|
|
16
16
|
const wrapperRef = portalContainerRef.querySelector('._refDropdownWrapper') as HTMLElement;
|
|
17
|
-
|
|
17
|
+
const value = offsetPos.left + offsetPos.width - wrapperRef.getBoundingClientRect().width;
|
|
18
|
+
portalContainerRef.style.left = (value > 0 ? value : offsetPos.left) + 'px';
|
|
18
19
|
portalContainerRef.style.top = offsetPos.top + parseInt($top || '0') - 32 + 'px';
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -22,8 +23,12 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
|
|
|
22
23
|
|
|
23
24
|
const evResetDropdown = () => {
|
|
24
25
|
const containerRef = document.getElementsByClassName('_refContainer is-shown') as HTMLCollectionOf<HTMLElement>;
|
|
26
|
+
const bodyEl = document.getElementsByTagName('BODY')[0] as HTMLBodyElement;
|
|
25
27
|
if (containerRef.length) {
|
|
28
|
+
bodyEl.classList.remove('is-immuned');
|
|
26
29
|
for (let i = 0; i < containerRef.length; i++) {
|
|
30
|
+
const overlayEl = containerRef[i].querySelector(`._refDropdownOverlay`) as HTMLDivElement;
|
|
31
|
+
overlayEl.style.display = 'none';
|
|
27
32
|
containerRef[i].classList.remove('is-shown');
|
|
28
33
|
}
|
|
29
34
|
}
|
|
@@ -51,7 +56,7 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
|
|
|
51
56
|
return;
|
|
52
57
|
}
|
|
53
58
|
const containerEl = buttonEl.closest('._refContainer') as HTMLElement;
|
|
54
|
-
const bodyEl = document.getElementsByTagName(
|
|
59
|
+
const bodyEl = document.getElementsByTagName('BODY')[0] as HTMLBodyElement;
|
|
55
60
|
if (containerEl) {
|
|
56
61
|
const overlayEl = containerEl.querySelector(`._refDropdownOverlay`) as HTMLDivElement;
|
|
57
62
|
const isCurOpen = containerEl.classList.contains('is-shown');
|
|
@@ -60,7 +65,7 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
|
|
|
60
65
|
if (!isCurOpen) {
|
|
61
66
|
evResetDropdown();
|
|
62
67
|
overlayEl.style.display = 'block';
|
|
63
|
-
bodyEl.classList.add(
|
|
68
|
+
bodyEl.classList.add('is-immuned');
|
|
64
69
|
containerEl.classList.add('is-shown');
|
|
65
70
|
setTimeout(() => {
|
|
66
71
|
if (portalId) {
|
|
@@ -72,7 +77,8 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
|
|
|
72
77
|
if (wrapperRef) {
|
|
73
78
|
setTimeout(() => {
|
|
74
79
|
wrapperRef.style.right = 'auto';
|
|
75
|
-
|
|
80
|
+
const value = offsetPos.left + offsetPos.width - wrapperRef.getBoundingClientRect().width;
|
|
81
|
+
portalContainerRef.style.left = (value > 0 ? value : offsetPos.left) + 'px';
|
|
76
82
|
portalContainerRef.style.top = offsetPos.top + parseInt($top || '0') - 32 + 'px';
|
|
77
83
|
portalContainerRef.style.zIndex = '8';
|
|
78
84
|
refScrollContainerEl && refScrollContainerEl.addEventListener('scroll', evScrollDropdown, true);
|
|
@@ -89,7 +95,7 @@ const DropDownComponent = ({ children, title, subTitle, $externalWidth, $externa
|
|
|
89
95
|
onClick && onClick(e);
|
|
90
96
|
} else {
|
|
91
97
|
overlayEl.style.display = 'none';
|
|
92
|
-
bodyEl.classList.remove(
|
|
98
|
+
bodyEl.classList.remove('is-immuned');
|
|
93
99
|
containerEl.classList.remove('is-shown');
|
|
94
100
|
setTimeout(() => {
|
|
95
101
|
if (portalId) {
|
package/src/components/index.ts
CHANGED
|
@@ -7,11 +7,10 @@ export { default as ButtonComponent } from './button';
|
|
|
7
7
|
export { default as LabelComponent } from './label';
|
|
8
8
|
export { default as IconComponent } from './icon';
|
|
9
9
|
export { default as LoadingComponent } from './loading';
|
|
10
|
-
export { default as
|
|
10
|
+
export { default as DropDownComponent } from './dropdown';
|
|
11
11
|
export { default as MessageComponent } from './message';
|
|
12
12
|
export { default as MessageQuestionComponent } from './message/question';
|
|
13
13
|
export { default as PopupComponent } from './popup';
|
|
14
|
-
export { default as ReactPortalComponent } from './portal';
|
|
15
14
|
export { default as ImageComponent } from './image';
|
|
16
15
|
export { default as SelectComponent } from './select';
|
|
17
16
|
export { default as MenuList } from './select/menulist';
|