@zohodesk/components 1.0.0-temp-199.18 → 1.0.0-temp-242.1
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/README.md +31 -1
- package/es/AppContainer/AppContainer.js +1 -0
- package/es/AppContainer/AppContainer.module.css +3 -2
- package/es/Button/css/Button.module.css +13 -4
- package/es/ColorSelect/ColorSingleSelect.js +0 -1
- package/es/ColorSelect/__tests__/ColorMultiSelect.spec.js +15 -3
- package/es/ColorSelect/__tests__/ColorSingleSelect.spec.js +15 -3
- package/es/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +2 -2
- package/es/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +8 -8
- package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +7 -3
- package/es/ColorSelect/_shared/ColorIndicator/__tests__/ColorIndicator.spec.js +17 -4
- package/es/ColorSelect/_shared/ColorIndicator/__tests__/__snapshots__/ColorIndicator.spec.js.snap +3 -3
- package/es/ColorSelect/_shared/ColorIndicator/props/propTypes.js +1 -1
- package/es/ColorSelect/_shared/ColoredTag/props/propTypes.js +1 -0
- package/es/ColorSelect/_shared/helpers/renderHelpers.js +14 -10
- package/es/ColorSelect/props/propTypes.js +1 -0
- package/es/DateTime/DateTime.module.css +12 -9
- package/es/DateTime/YearView.module.css +1 -1
- package/es/DropBox/DropBoxElement/DropBoxElement.js +1 -1
- package/es/DropBox/utils/isMobilePopover.js +3 -14
- package/es/Heading/Heading.module.css +1 -1
- package/es/Label/Label.module.css +8 -8
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -6
- package/es/MultiSelect/MultiSelect.js +2 -2
- package/es/MultiSelect/MultiSelect.module.css +1 -1
- package/es/MultiSelect/Suggestions.js +2 -7
- package/es/MultiSelect/props/defaultProps.js +0 -2
- package/es/MultiSelect/props/propTypes.js +3 -11
- package/es/Popup/Popup.js +21 -1045
- package/es/Select/GroupSelect.js +1 -1
- package/es/Select/SelectWithAvatar.js +3 -3
- package/es/Select/SelectWithIcon.js +3 -10
- package/es/Select/props/defaultProps.js +2 -4
- package/es/Select/props/propTypes.js +3 -11
- package/es/Tab/Tabs.module.css +1 -1
- package/es/TextBox/TextBox.module.css +4 -4
- package/es/TextBoxIcon/TextBoxIcon.module.css +0 -6
- package/es/Textarea/Textarea.module.css +1 -1
- package/es/Tooltip/Tooltip.module.css +1 -1
- package/es/Typography/Typography.js +9 -2
- package/es/Typography/__tests__/Typography.spec.js +427 -0
- package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/es/Typography/css/Typography.module.css +4 -4
- package/es/Typography/props/defaultProps.js +2 -1
- package/es/Typography/props/propTypes.js +24 -5
- package/es/Typography/utils/textHighlighter.js +139 -0
- package/es/common/basic.module.css +39 -6
- package/es/common/basicReset.module.css +2 -2
- package/es/common/common.module.css +6 -6
- package/es/shared/ArrowIcon/ArrowIcon.js +6 -3
- package/es/shared/ArrowIcon/ArrowIcon.module.css +9 -0
- package/es/shared/ArrowIcon/__tests__/ArrowIcon.spec.js +24 -0
- package/es/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +70 -7
- package/es/shared/ArrowIcon/props/defaultProps.js +2 -0
- package/es/shared/ArrowIcon/props/propTypes.js +3 -1
- package/es/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/es/utils/Common.js +1 -1
- package/es/utils/dropDownUtils.js +3 -3
- package/es/v1/Popup/Popup.js +1 -1
- package/es/v1/Tab/v1Tabs.module.css +1 -1
- package/es/v1/Typography/css/v1_Typography.module.css +4 -4
- package/lib/AppContainer/AppContainer.js +2 -0
- package/lib/AppContainer/AppContainer.module.css +3 -2
- package/lib/Button/css/Button.module.css +13 -4
- package/lib/ColorSelect/ColorSingleSelect.js +1 -2
- package/lib/ColorSelect/__tests__/ColorMultiSelect.spec.js +15 -3
- package/lib/ColorSelect/__tests__/ColorSingleSelect.spec.js +15 -3
- package/lib/ColorSelect/__tests__/__snapshots__/ColorMultiSelect.spec.js.snap +2 -2
- package/lib/ColorSelect/__tests__/__snapshots__/ColorSingleSelect.spec.js.snap +8 -8
- package/lib/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +10 -4
- package/lib/ColorSelect/_shared/ColorIndicator/__tests__/ColorIndicator.spec.js +17 -4
- package/lib/ColorSelect/_shared/ColorIndicator/__tests__/__snapshots__/ColorIndicator.spec.js.snap +3 -3
- package/lib/ColorSelect/_shared/ColorIndicator/props/propTypes.js +1 -1
- package/lib/ColorSelect/_shared/ColoredTag/props/propTypes.js +1 -0
- package/lib/ColorSelect/_shared/helpers/renderHelpers.js +19 -13
- package/lib/ColorSelect/props/propTypes.js +1 -0
- package/lib/DateTime/DateTime.module.css +12 -9
- package/lib/DateTime/YearView.module.css +1 -1
- package/lib/DropBox/DropBoxElement/DropBoxElement.js +5 -5
- package/lib/DropBox/utils/isMobilePopover.js +4 -14
- package/lib/Heading/Heading.module.css +1 -1
- package/lib/Label/Label.module.css +8 -8
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
- package/lib/MultiSelect/MultiSelect.js +2 -2
- package/lib/MultiSelect/MultiSelect.module.css +1 -1
- package/lib/MultiSelect/Suggestions.js +2 -6
- package/lib/MultiSelect/props/defaultProps.js +0 -2
- package/lib/MultiSelect/props/propTypes.js +5 -13
- package/lib/Popup/Popup.js +25 -1152
- package/lib/Select/GroupSelect.js +1 -2
- package/lib/Select/SelectWithAvatar.js +3 -4
- package/lib/Select/SelectWithIcon.js +3 -10
- package/lib/Select/props/defaultProps.js +3 -5
- package/lib/Select/props/propTypes.js +3 -11
- package/lib/Tab/Tabs.module.css +1 -1
- package/lib/TextBox/TextBox.module.css +4 -4
- package/lib/TextBoxIcon/TextBoxIcon.module.css +0 -6
- package/lib/Textarea/Textarea.module.css +1 -1
- package/lib/Tooltip/Tooltip.module.css +1 -1
- package/lib/Typography/Typography.js +9 -2
- package/lib/Typography/__tests__/Typography.spec.js +436 -0
- package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/lib/Typography/css/Typography.module.css +4 -4
- package/lib/Typography/props/defaultProps.js +2 -1
- package/lib/Typography/props/propTypes.js +31 -6
- package/lib/Typography/utils/textHighlighter.js +160 -0
- package/lib/common/basic.module.css +39 -6
- package/lib/common/basicReset.module.css +2 -2
- package/lib/common/common.module.css +6 -6
- package/lib/shared/ArrowIcon/ArrowIcon.js +6 -3
- package/lib/shared/ArrowIcon/ArrowIcon.module.css +9 -0
- package/lib/shared/ArrowIcon/__tests__/ArrowIcon.spec.js +34 -10
- package/lib/shared/ArrowIcon/__tests__/__snapshots__/ArrowIcon.spec.js.snap +70 -7
- package/lib/shared/ArrowIcon/props/defaultProps.js +2 -0
- package/lib/shared/ArrowIcon/props/propTypes.js +3 -1
- package/lib/shared/InputFieldLine/InputFieldLine.module.css +1 -1
- package/lib/utils/Common.js +1 -1
- package/lib/utils/dropDownUtils.js +3 -3
- package/lib/v1/Popup/Popup.js +1 -1
- package/lib/v1/Tab/v1Tabs.module.css +1 -1
- package/lib/v1/Typography/css/v1_Typography.module.css +4 -4
- package/package.json +6 -6
- package/es/DropBox/DropBoxPositionMapping.js +0 -142
- package/es/Popup/PositionMapping.js +0 -72
- package/es/Popup/Registry.js +0 -36
- package/es/Popup/intersectionObserver.js +0 -49
- package/es/Popup/viewPort.js +0 -373
- package/lib/DropBox/DropBoxPositionMapping.js +0 -149
- package/lib/Popup/PositionMapping.js +0 -81
- package/lib/Popup/Registry.js +0 -46
- package/lib/Popup/intersectionObserver.js +0 -72
- package/lib/Popup/viewPort.js +0 -367
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-242.1",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"build:css:umd": "npm run clean && npm run init && react-cli build:css:umd",
|
|
40
40
|
"coverage": "react-cli coverage",
|
|
41
41
|
"prepare": "npm run init && npm run css:build ",
|
|
42
|
-
"prepublishOnly": "node prePublish.js && npm run css:review",
|
|
42
|
+
"prepublishOnly": "node prePublish.js && npm run css:review && npm run review:props ",
|
|
43
43
|
"postpublish": "node postPublish.js",
|
|
44
44
|
"report": "react-cli publish:report",
|
|
45
45
|
"test": "react-cli test",
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
81
81
|
"@zohodesk/a11y": "2.3.8",
|
|
82
82
|
"@zohodesk/docstool": "1.0.0-alpha-2",
|
|
83
|
-
"@zohodesk/dotkit": "1.0.
|
|
83
|
+
"@zohodesk/dotkit": "1.0.0-temp-2.2",
|
|
84
84
|
"@zohodesk/hooks": "2.0.6",
|
|
85
85
|
"@zohodesk/icons": "1.1.3",
|
|
86
86
|
"@zohodesk/layout": "3.1.0",
|
|
87
87
|
"@zohodesk/svg": "1.2.3",
|
|
88
88
|
"@zohodesk/utils": "1.3.15",
|
|
89
|
-
"@zohodesk/variables": "1.
|
|
89
|
+
"@zohodesk/variables": "1.2.0",
|
|
90
90
|
"@zohodesk/virtualizer": "1.0.13",
|
|
91
91
|
"react-sortable-hoc": "^0.8.3",
|
|
92
92
|
"velocity-react": "1.4.3",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@zohodesk/icons": "1.1.3",
|
|
104
|
-
"@zohodesk/variables": "1.
|
|
104
|
+
"@zohodesk/variables": "1.2.0",
|
|
105
105
|
"@zohodesk/svg": "1.2.3",
|
|
106
106
|
"@zohodesk/virtualizer": "1.0.13",
|
|
107
107
|
"velocity-react": "1.4.3",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@zohodesk/utils": "1.3.15",
|
|
111
111
|
"@zohodesk/a11y": "2.3.8",
|
|
112
112
|
"@zohodesk/layout": "3.1.0",
|
|
113
|
-
"@zohodesk/dotkit": "1.0.
|
|
113
|
+
"@zohodesk/dotkit": "1.0.0-temp-2.2",
|
|
114
114
|
"color": "4.2.3"
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
export const positionMapping = {
|
|
2
|
-
"bottomCenter": {
|
|
3
|
-
"direction": "bottom",
|
|
4
|
-
"arrowPosition": "mid",
|
|
5
|
-
"positionStyle": "bottomMid"
|
|
6
|
-
},
|
|
7
|
-
"bottomLeftToRight": {
|
|
8
|
-
"direction": "bottom",
|
|
9
|
-
"arrowPosition": "start",
|
|
10
|
-
"positionStyle": "bottomEnd"
|
|
11
|
-
},
|
|
12
|
-
"bottomCenterToRight": {
|
|
13
|
-
"direction": "bottom",
|
|
14
|
-
"arrowPosition": "start",
|
|
15
|
-
"positionStyle": "bottomEnd"
|
|
16
|
-
},
|
|
17
|
-
"bottomRightToLeft": {
|
|
18
|
-
"direction": "bottom",
|
|
19
|
-
"arrowPosition": "end",
|
|
20
|
-
"positionStyle": "bottomStart"
|
|
21
|
-
},
|
|
22
|
-
"bottomCenterToLeft": {
|
|
23
|
-
"direction": "bottom",
|
|
24
|
-
"arrowPosition": "end",
|
|
25
|
-
"positionStyle": "bottomStart"
|
|
26
|
-
},
|
|
27
|
-
"topCenter": {
|
|
28
|
-
"direction": "top",
|
|
29
|
-
"arrowPosition": "mid",
|
|
30
|
-
"positionStyle": "topMid"
|
|
31
|
-
},
|
|
32
|
-
"topLeftToRight": {
|
|
33
|
-
"direction": "top",
|
|
34
|
-
"arrowPosition": "start",
|
|
35
|
-
"positionStyle": "topEnd"
|
|
36
|
-
},
|
|
37
|
-
"topCenterToRight": {
|
|
38
|
-
"direction": "top",
|
|
39
|
-
"arrowPosition": "start",
|
|
40
|
-
"positionStyle": "topEnd"
|
|
41
|
-
},
|
|
42
|
-
"topRightToLeft": {
|
|
43
|
-
"direction": "top",
|
|
44
|
-
"arrowPosition": "end",
|
|
45
|
-
"positionStyle": "topStart"
|
|
46
|
-
},
|
|
47
|
-
"topCenterToLeft": {
|
|
48
|
-
"direction": "top",
|
|
49
|
-
"arrowPosition": "end",
|
|
50
|
-
"positionStyle": "topStart"
|
|
51
|
-
},
|
|
52
|
-
"rightCenter": {
|
|
53
|
-
"direction": "right",
|
|
54
|
-
"arrowPosition": "mid",
|
|
55
|
-
"positionStyle": "rightMid"
|
|
56
|
-
},
|
|
57
|
-
"rightTopToBottom": {
|
|
58
|
-
"direction": "right",
|
|
59
|
-
"arrowPosition": "start",
|
|
60
|
-
"positionStyle": "rightEnd"
|
|
61
|
-
},
|
|
62
|
-
"rightCenterToBottom": {
|
|
63
|
-
"direction": "right",
|
|
64
|
-
"arrowPosition": "start",
|
|
65
|
-
"positionStyle": "rightEnd"
|
|
66
|
-
},
|
|
67
|
-
"rightBottomToTop": {
|
|
68
|
-
"direction": "right",
|
|
69
|
-
"arrowPosition": "end",
|
|
70
|
-
"positionStyle": "rightStart"
|
|
71
|
-
},
|
|
72
|
-
"rightCenterToTop": {
|
|
73
|
-
"direction": "right",
|
|
74
|
-
"arrowPosition": "end",
|
|
75
|
-
"positionStyle": "rightStart"
|
|
76
|
-
},
|
|
77
|
-
"leftCenter": {
|
|
78
|
-
"direction": "left",
|
|
79
|
-
"arrowPosition": "mid",
|
|
80
|
-
"positionStyle": "leftMid"
|
|
81
|
-
},
|
|
82
|
-
"leftTopToBottom": {
|
|
83
|
-
"direction": "left",
|
|
84
|
-
"arrowPosition": "start",
|
|
85
|
-
"positionStyle": "leftEnd"
|
|
86
|
-
},
|
|
87
|
-
"leftCenterToBottom": {
|
|
88
|
-
"direction": "left",
|
|
89
|
-
"arrowPosition": "start",
|
|
90
|
-
"positionStyle": "leftEnd"
|
|
91
|
-
},
|
|
92
|
-
"leftBottomToTop": {
|
|
93
|
-
"direction": "left",
|
|
94
|
-
"arrowPosition": "end",
|
|
95
|
-
"positionStyle": "leftStart"
|
|
96
|
-
},
|
|
97
|
-
"leftCenterToTop": {
|
|
98
|
-
"direction": "left",
|
|
99
|
-
"arrowPosition": "end",
|
|
100
|
-
"positionStyle": "leftStart"
|
|
101
|
-
},
|
|
102
|
-
"bottomRight": {
|
|
103
|
-
"direction": "bottom",
|
|
104
|
-
"arrowPosition": "start",
|
|
105
|
-
"positionStyle": "bottomEnd"
|
|
106
|
-
},
|
|
107
|
-
"bottomLeft": {
|
|
108
|
-
"direction": "bottom",
|
|
109
|
-
"arrowPosition": "end",
|
|
110
|
-
"positionStyle": "bottomStart"
|
|
111
|
-
},
|
|
112
|
-
"topRight": {
|
|
113
|
-
"direction": "top",
|
|
114
|
-
"arrowPosition": "start",
|
|
115
|
-
"positionStyle": "topEnd"
|
|
116
|
-
},
|
|
117
|
-
"topLeft": {
|
|
118
|
-
"direction": "top",
|
|
119
|
-
"arrowPosition": "end",
|
|
120
|
-
"positionStyle": "topStart"
|
|
121
|
-
},
|
|
122
|
-
"rightBottom": {
|
|
123
|
-
"direction": "right",
|
|
124
|
-
"arrowPosition": "start",
|
|
125
|
-
"positionStyle": "rightEnd"
|
|
126
|
-
},
|
|
127
|
-
"rightTop": {
|
|
128
|
-
"direction": "right",
|
|
129
|
-
"arrowPosition": "end",
|
|
130
|
-
"positionStyle": "rightStart"
|
|
131
|
-
},
|
|
132
|
-
"leftBottom": {
|
|
133
|
-
"direction": "left",
|
|
134
|
-
"arrowPosition": "start",
|
|
135
|
-
"positionStyle": "leftEnd"
|
|
136
|
-
},
|
|
137
|
-
"leftTop": {
|
|
138
|
-
"direction": "left",
|
|
139
|
-
"arrowPosition": "end",
|
|
140
|
-
"positionStyle": "leftStart"
|
|
141
|
-
}
|
|
142
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export const absolutePositionMapping = {
|
|
2
|
-
"bottomCenter": "bottomCenter",
|
|
3
|
-
"bottomRight": "bottomLeftToRight",
|
|
4
|
-
"bottomLeft": "bottomRightToLeft",
|
|
5
|
-
"topCenter": "topCenter",
|
|
6
|
-
"topRight": "topLeftToRight",
|
|
7
|
-
"topLeft": "topRightToLeft",
|
|
8
|
-
"rightCenter": "rightCenter",
|
|
9
|
-
"rightBottom": "rightTopToBottom",
|
|
10
|
-
"rightTop": "rightBottomToTop",
|
|
11
|
-
"leftCenter": "leftCenter",
|
|
12
|
-
"leftBottom": "leftTopToBottom",
|
|
13
|
-
"leftTop": "leftBottomToTop",
|
|
14
|
-
"bottomLeftToRight": "bottomLeftToRight",
|
|
15
|
-
"bottomRightToLeft": "bottomRightToLeft",
|
|
16
|
-
"topLeftToRight": "topLeftToRight",
|
|
17
|
-
"topRightToLeft": "topRightToLeft",
|
|
18
|
-
"rightTopToBottom": "rightTopToBottom",
|
|
19
|
-
"rightBottomToTop": "rightBottomToTop",
|
|
20
|
-
"leftTopToBottom": "leftTopToBottom"
|
|
21
|
-
};
|
|
22
|
-
export const rtlAbsolutePositionMapping = {
|
|
23
|
-
"bottomCenter": "bottomCenter",
|
|
24
|
-
"bottomRight": "bottomRightToLeft",
|
|
25
|
-
"bottomLeft": "bottomLeftToRight",
|
|
26
|
-
"topCenter": "topCenter",
|
|
27
|
-
"topRight": "topRightToLeft",
|
|
28
|
-
"topLeft": "topLeftToRight",
|
|
29
|
-
"rightCenter": "leftCenter",
|
|
30
|
-
"rightBottom": "leftTopToBottom",
|
|
31
|
-
"rightTop": "leftBottomToTop",
|
|
32
|
-
"leftCenter": "rightCenter",
|
|
33
|
-
"leftBottom": "rightTopToBottom",
|
|
34
|
-
"leftTop": "rightBottomToTop",
|
|
35
|
-
"bottomLeftToRight": "bottomLeftToRight",
|
|
36
|
-
"bottomRightToLeft": "bottomRightToLeft",
|
|
37
|
-
"topLeftToRight": "topLeftToRight",
|
|
38
|
-
"topRightToLeft": "topRightToLeft",
|
|
39
|
-
"rightTopToBottom": "rightTopToBottom",
|
|
40
|
-
"rightBottomToTop": "rightBottomToTop",
|
|
41
|
-
"leftTopToBottom": "leftTopToBottom"
|
|
42
|
-
};
|
|
43
|
-
export const rtlFixedPositionMapping = {
|
|
44
|
-
"bottomCenter": "bottomCenter",
|
|
45
|
-
"bottomLeftToRight": "bottomRightToLeft",
|
|
46
|
-
"bottomCenterToRight": "bottomCenterToLeft",
|
|
47
|
-
"bottomRightToLeft": "bottomLeftToRight",
|
|
48
|
-
"bottomCenterToLeft": "bottomCenterToRight",
|
|
49
|
-
"topCenter": "topCenter",
|
|
50
|
-
"topLeftToRight": "topRightToLeft",
|
|
51
|
-
"topCenterToRight": "topCenterToLeft",
|
|
52
|
-
"topRightToLeft": "topLeftToRight",
|
|
53
|
-
"topCenterToLeft": "topCenterToRight",
|
|
54
|
-
"rightTopToBottom": "leftTopToBottom",
|
|
55
|
-
"rightCenterToBottom": "leftCenterToBottom",
|
|
56
|
-
"rightCenter": "leftCenter",
|
|
57
|
-
"rightBottomToTop": "leftBottomToTop",
|
|
58
|
-
"rightCenterToTop": "leftCenterToTop",
|
|
59
|
-
"leftTopToBottom": "rightTopToBottom",
|
|
60
|
-
"leftCenterToBottom": "rightCenterToBottom",
|
|
61
|
-
"leftCenter": "rightCenter",
|
|
62
|
-
"leftBottomToTop": "rightBottomToTop",
|
|
63
|
-
"leftCenterToTop": "rightCenterToTop",
|
|
64
|
-
"bottomRight": "bottomLeft",
|
|
65
|
-
"bottomLeft": "bottomRight",
|
|
66
|
-
"topRight": "topLeft",
|
|
67
|
-
"topLeft": "topRight",
|
|
68
|
-
"rightBottom": "leftBottom",
|
|
69
|
-
"rightTop": "leftTop",
|
|
70
|
-
"leftBottom": "rightBottom",
|
|
71
|
-
"leftTop": "rightTop"
|
|
72
|
-
};
|
package/es/Popup/Registry.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { getLibraryConfig } from "../Provider/Config.js";
|
|
2
|
-
const Registry = {
|
|
3
|
-
lastOpenedGroup: [],
|
|
4
|
-
popups: {},
|
|
5
|
-
listenerPopupRef: undefined,
|
|
6
|
-
scrollBlockedListenerPopupRef: undefined,
|
|
7
|
-
scrollableListenerPopupRef: undefined,
|
|
8
|
-
|
|
9
|
-
getOpenedPopups() {
|
|
10
|
-
return Object.values(Registry.popups).flat().filter(popup => popup.state.isPopupOpen);
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
getOpenedScrollBlockedFixedPopups() {
|
|
14
|
-
return Registry.getOpenedPopups().filter(popup => popup.getIsOutsideScrollBlocked(popup) && !popup.getIsAbsolutePopup(popup));
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
getOpenedScrollableFixedPopups() {
|
|
18
|
-
return Registry.getOpenedPopups().filter(popup => !popup.getIsOutsideScrollBlocked(popup) && !popup.getIsAbsolutePopup(popup));
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
getRootElement() {
|
|
22
|
-
const getRootElement = getLibraryConfig('getRootElement');
|
|
23
|
-
|
|
24
|
-
if (getRootElement && typeof getRootElement === 'function') {
|
|
25
|
-
const parent = getRootElement();
|
|
26
|
-
|
|
27
|
-
if (parent) {
|
|
28
|
-
return parent;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return document;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
export default Registry;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
let observerCallbacks = null;
|
|
2
|
-
let intersectionObserver = null;
|
|
3
|
-
|
|
4
|
-
function handleObserverCallbacks(entries) {
|
|
5
|
-
entries.forEach(entry => {
|
|
6
|
-
let oldCallbacks = observerCallbacks.get(entry.target);
|
|
7
|
-
|
|
8
|
-
if (Array.isArray(oldCallbacks) && oldCallbacks.length) {
|
|
9
|
-
oldCallbacks.forEach(callback => {
|
|
10
|
-
callback && callback(entry);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function addIntersectionObserver(element, callback, options) {
|
|
17
|
-
if (!!element && typeof callback == 'function') {
|
|
18
|
-
if (intersectionObserver === null && observerCallbacks === null) {
|
|
19
|
-
intersectionObserver = new IntersectionObserver(entries => {
|
|
20
|
-
handleObserverCallbacks(entries);
|
|
21
|
-
}, options);
|
|
22
|
-
observerCallbacks = new Map();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
intersectionObserver.observe(element);
|
|
26
|
-
let oldCallbacks = observerCallbacks.get(element) || [];
|
|
27
|
-
observerCallbacks.set(element, [...oldCallbacks, callback]);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export function removeIntersectionObserver(element, callback) {
|
|
31
|
-
if (!!element && typeof callback == 'function') {
|
|
32
|
-
let oldCallbacks = observerCallbacks ? observerCallbacks.get(element) : null;
|
|
33
|
-
|
|
34
|
-
if (Array.isArray(oldCallbacks)) {
|
|
35
|
-
let callbacks = oldCallbacks.filter(handler => handler !== callback);
|
|
36
|
-
|
|
37
|
-
if (intersectionObserver && callbacks.length === 0) {
|
|
38
|
-
observerCallbacks.delete(element);
|
|
39
|
-
intersectionObserver.unobserve(element);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (intersectionObserver && observerCallbacks && observerCallbacks.size === 0) {
|
|
44
|
-
intersectionObserver.disconnect();
|
|
45
|
-
intersectionObserver = null;
|
|
46
|
-
observerCallbacks = null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|