@zohodesk/components 1.0.0-temp-220.11 → 1.0.0-temp-231
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/.cli/propValidation_report.html +1 -1
- package/README.md +17 -1
- package/assets/Appearance/dark/mode/Component_DarkMode.module.css +2 -2
- package/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css +1 -1
- package/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css +1 -1
- package/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css +1 -1
- package/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css +1 -1
- package/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css +1 -1
- package/assets/Appearance/light/mode/Component_LightMode.module.css +2 -2
- package/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css +1 -1
- package/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css +1 -1
- package/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css +1 -1
- package/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css +1 -1
- package/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css +1 -1
- package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +2 -2
- package/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css +1 -1
- package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css +1 -1
- package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css +1 -1
- package/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css +1 -1
- package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css +1 -1
- package/es/Accordion/Accordion.js +1 -1
- package/es/AppContainer/AppContainer.js +1 -1
- package/es/Card/Card.js +48 -14
- package/es/Card/__tests__/Card.spec.js +81 -2
- package/es/Card/__tests__/__snapshots__/Card.spec.js.snap +44 -0
- package/es/Card/props/defaultProps.js +2 -1
- package/es/Card/props/propTypes.js +2 -1
- package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +7 -0
- package/es/MultiSelect/MultiSelect.js +1 -1
- package/es/Popup/Popup.js +3 -3
- package/es/Select/Select.js +1 -1
- package/es/Select/__tests__/Select.spec.js +15 -0
- package/es/Select/__tests__/__snapshots__/Select.spec.js.snap +281 -0
- package/es/common/basic.module.css +0 -2
- package/es/components_layer.module.css +1 -0
- package/es/v1/Popup/Popup.js +1 -1
- package/es/v1/Select/Select.js +1 -1
- package/lib/Accordion/Accordion.js +2 -2
- package/lib/AppContainer/AppContainer.js +1 -1
- package/lib/Card/Card.js +64 -30
- package/lib/Card/__tests__/Card.spec.js +118 -1
- package/lib/Card/__tests__/__snapshots__/Card.spec.js.snap +44 -0
- package/lib/Card/props/defaultProps.js +2 -1
- package/lib/Card/props/propTypes.js +2 -1
- package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +7 -0
- package/lib/MultiSelect/MultiSelect.js +2 -2
- package/lib/Popup/Popup.js +4 -4
- package/lib/Select/Select.js +2 -2
- package/lib/Select/__tests__/Select.spec.js +165 -148
- package/lib/Select/__tests__/__snapshots__/Select.spec.js.snap +281 -0
- package/lib/common/basic.module.css +0 -2
- package/lib/components_layer.module.css +1 -0
- package/lib/v1/Popup/Popup.js +2 -2
- package/lib/v1/Select/Select.js +2 -2
- package/package.json +27 -13
- package/css_error.log +0 -1
- package/install.md +0 -10
- package/postPublish.js +0 -8
- package/prePublish.js +0 -70
- package/react-cli.config.js +0 -24
- package/result.json +0 -1
- /package/.cli/{stringContains.js → themeValidate/stringContains.js} +0 -0
|
@@ -1926,6 +1926,287 @@ exports[`Select - Should render the only options matching search value 1`] = `
|
|
|
1926
1926
|
</DocumentFragment>
|
|
1927
1927
|
`;
|
|
1928
1928
|
|
|
1929
|
+
exports[`Select - Should render the only options matching search value even with additional spaces before and after 1`] = `
|
|
1930
|
+
<DocumentFragment>
|
|
1931
|
+
<div
|
|
1932
|
+
class="container box_medium "
|
|
1933
|
+
data-selector-id="select"
|
|
1934
|
+
>
|
|
1935
|
+
<div
|
|
1936
|
+
class=""
|
|
1937
|
+
data-id="selectComponent"
|
|
1938
|
+
data-test-id="selectComponent"
|
|
1939
|
+
>
|
|
1940
|
+
<div
|
|
1941
|
+
class="container effect effectFocused input flex rowdir"
|
|
1942
|
+
data-id="containerComponent"
|
|
1943
|
+
data-selector-id="textBoxIcon"
|
|
1944
|
+
data-test-id="containerComponent"
|
|
1945
|
+
>
|
|
1946
|
+
<div
|
|
1947
|
+
class="grow basis shrinkOff"
|
|
1948
|
+
data-id="boxComponent"
|
|
1949
|
+
data-selector-id="box"
|
|
1950
|
+
data-test-id="boxComponent"
|
|
1951
|
+
>
|
|
1952
|
+
<input
|
|
1953
|
+
aria-activedescendant="1"
|
|
1954
|
+
aria-controls="1"
|
|
1955
|
+
aria-expanded="true"
|
|
1956
|
+
aria-haspopup="true"
|
|
1957
|
+
aria-label="click to select options"
|
|
1958
|
+
aria-owns="1"
|
|
1959
|
+
aria-readonly="true"
|
|
1960
|
+
autocomplete="off"
|
|
1961
|
+
class=" pointer container medium default effect focus borderColor_default inputDotted "
|
|
1962
|
+
data-id="selectComponent_textBox"
|
|
1963
|
+
data-selector-id="textBoxIcon"
|
|
1964
|
+
data-test-id="selectComponent_textBox"
|
|
1965
|
+
data-title="Option 1"
|
|
1966
|
+
maxlength="250"
|
|
1967
|
+
placeholder=""
|
|
1968
|
+
readonly=""
|
|
1969
|
+
role="Menuitem"
|
|
1970
|
+
type="text"
|
|
1971
|
+
value="Option 1"
|
|
1972
|
+
/>
|
|
1973
|
+
</div>
|
|
1974
|
+
<div
|
|
1975
|
+
class="iconContainer shrinkOff"
|
|
1976
|
+
data-id="boxComponent"
|
|
1977
|
+
data-selector-id="box"
|
|
1978
|
+
data-test-id="boxComponent"
|
|
1979
|
+
>
|
|
1980
|
+
<div
|
|
1981
|
+
class="flex cover rowdir"
|
|
1982
|
+
data-id="containerComponent"
|
|
1983
|
+
data-selector-id="container"
|
|
1984
|
+
data-test-id="containerComponent"
|
|
1985
|
+
>
|
|
1986
|
+
<div
|
|
1987
|
+
class="icon rotated shrinkOff"
|
|
1988
|
+
data-id="boxComponent"
|
|
1989
|
+
data-selector-id="box"
|
|
1990
|
+
data-test-id="boxComponent"
|
|
1991
|
+
>
|
|
1992
|
+
<div
|
|
1993
|
+
class="rightPlaceholder inflex rowdir both"
|
|
1994
|
+
data-id="containerComponent"
|
|
1995
|
+
data-selector-id="container"
|
|
1996
|
+
data-test-id="containerComponent"
|
|
1997
|
+
>
|
|
1998
|
+
<div
|
|
1999
|
+
aria-hidden="true"
|
|
2000
|
+
class="arrowIcon flex cover coldir both"
|
|
2001
|
+
data-id="selectComponent_downIcon"
|
|
2002
|
+
data-selector-id="container"
|
|
2003
|
+
data-test-id="selectComponent_downIcon"
|
|
2004
|
+
>
|
|
2005
|
+
<i
|
|
2006
|
+
aria-hidden="true"
|
|
2007
|
+
class="zd_font_icons basic icon-down "
|
|
2008
|
+
data-id="fontIcon"
|
|
2009
|
+
data-selector-id="fontIcon"
|
|
2010
|
+
data-test-id="fontIcon"
|
|
2011
|
+
style="--zd-iconfont-size: var(--zd_font_size7);"
|
|
2012
|
+
/>
|
|
2013
|
+
</div>
|
|
2014
|
+
</div>
|
|
2015
|
+
</div>
|
|
2016
|
+
</div>
|
|
2017
|
+
</div>
|
|
2018
|
+
<div
|
|
2019
|
+
class="line borderColor_default "
|
|
2020
|
+
/>
|
|
2021
|
+
</div>
|
|
2022
|
+
</div>
|
|
2023
|
+
<div
|
|
2024
|
+
class="main container bottomMid default"
|
|
2025
|
+
data-a11y-focus-main-area="true"
|
|
2026
|
+
data-arrow-position="mid"
|
|
2027
|
+
data-box-direction="bottom"
|
|
2028
|
+
data-id="selectComponent_suggestions"
|
|
2029
|
+
data-position="bottomMid"
|
|
2030
|
+
data-selector-id="dropBox"
|
|
2031
|
+
data-test-id="selectComponent_suggestions"
|
|
2032
|
+
dot-ui-element="dropbox"
|
|
2033
|
+
style="z-index: 4;"
|
|
2034
|
+
>
|
|
2035
|
+
<div
|
|
2036
|
+
class="subContainer shadow radius bounce defaultPalette"
|
|
2037
|
+
data-id="selectComponent_suggestions_subcontainer"
|
|
2038
|
+
data-selector-id="dropBox_subcontainer"
|
|
2039
|
+
data-test-id="selectComponent_suggestions_subcontainer"
|
|
2040
|
+
tabindex="-1"
|
|
2041
|
+
>
|
|
2042
|
+
<div
|
|
2043
|
+
class="flex rowdir"
|
|
2044
|
+
data-id="containerComponent"
|
|
2045
|
+
data-selector-id="container"
|
|
2046
|
+
data-test-id="containerComponent"
|
|
2047
|
+
>
|
|
2048
|
+
<div
|
|
2049
|
+
class="grow basis shrinkOff"
|
|
2050
|
+
data-id="boxComponent"
|
|
2051
|
+
data-selector-id="box"
|
|
2052
|
+
data-test-id="boxComponent"
|
|
2053
|
+
>
|
|
2054
|
+
<div
|
|
2055
|
+
class="flex cover coldir"
|
|
2056
|
+
data-id="containerComponent"
|
|
2057
|
+
data-selector-id="container"
|
|
2058
|
+
data-test-id="containerComponent"
|
|
2059
|
+
>
|
|
2060
|
+
<div
|
|
2061
|
+
class="notScroll shrinkOff"
|
|
2062
|
+
data-id="CardHeader"
|
|
2063
|
+
data-selector-id="cardHeader"
|
|
2064
|
+
data-test-id="CardHeader"
|
|
2065
|
+
>
|
|
2066
|
+
<div
|
|
2067
|
+
class="search medium"
|
|
2068
|
+
>
|
|
2069
|
+
<div
|
|
2070
|
+
class="container effect effectFocused flex rowdir"
|
|
2071
|
+
data-id="containerComponent"
|
|
2072
|
+
data-selector-id="textBoxIcon"
|
|
2073
|
+
data-test-id="containerComponent"
|
|
2074
|
+
>
|
|
2075
|
+
<div
|
|
2076
|
+
class="grow basis shrinkOff"
|
|
2077
|
+
data-id="boxComponent"
|
|
2078
|
+
data-selector-id="box"
|
|
2079
|
+
data-test-id="boxComponent"
|
|
2080
|
+
>
|
|
2081
|
+
<input
|
|
2082
|
+
aria-autocomplete="list"
|
|
2083
|
+
aria-controls="1"
|
|
2084
|
+
aria-describedby="2"
|
|
2085
|
+
autocomplete="off"
|
|
2086
|
+
class=" container small default effect borderColor_default "
|
|
2087
|
+
data-id="selectComponent_search"
|
|
2088
|
+
data-selector-id="textBoxIcon"
|
|
2089
|
+
data-test-id="selectComponent_search"
|
|
2090
|
+
maxlength="250"
|
|
2091
|
+
placeholder="Search"
|
|
2092
|
+
type="text"
|
|
2093
|
+
value=" 2 "
|
|
2094
|
+
/>
|
|
2095
|
+
</div>
|
|
2096
|
+
<div
|
|
2097
|
+
class="iconContainer shrinkOff"
|
|
2098
|
+
data-id="boxComponent"
|
|
2099
|
+
data-selector-id="box"
|
|
2100
|
+
data-test-id="boxComponent"
|
|
2101
|
+
>
|
|
2102
|
+
<div
|
|
2103
|
+
class="flex cover rowdir"
|
|
2104
|
+
data-id="containerComponent"
|
|
2105
|
+
data-selector-id="container"
|
|
2106
|
+
data-test-id="containerComponent"
|
|
2107
|
+
>
|
|
2108
|
+
<button
|
|
2109
|
+
class="buttonReset icon shrinkOff"
|
|
2110
|
+
data-id="selectComponent_search_ClearIcon"
|
|
2111
|
+
data-selector-id="box"
|
|
2112
|
+
data-test-id="selectComponent_search_ClearIcon"
|
|
2113
|
+
data-title="Clear"
|
|
2114
|
+
>
|
|
2115
|
+
<div
|
|
2116
|
+
aria-hidden="true"
|
|
2117
|
+
class="flex cover coldir both"
|
|
2118
|
+
data-id="containerComponent"
|
|
2119
|
+
data-selector-id="container"
|
|
2120
|
+
data-test-id="containerComponent"
|
|
2121
|
+
>
|
|
2122
|
+
<i
|
|
2123
|
+
aria-hidden="true"
|
|
2124
|
+
class="zd_font_icons basic icon-delete rtl "
|
|
2125
|
+
data-id="fontIcon"
|
|
2126
|
+
data-selector-id="fontIcon"
|
|
2127
|
+
data-test-id="fontIcon"
|
|
2128
|
+
style="--zd-iconfont-size: var(--zd_font_size14);"
|
|
2129
|
+
/>
|
|
2130
|
+
</div>
|
|
2131
|
+
</button>
|
|
2132
|
+
</div>
|
|
2133
|
+
</div>
|
|
2134
|
+
<div
|
|
2135
|
+
class="line borderColor_default "
|
|
2136
|
+
/>
|
|
2137
|
+
</div>
|
|
2138
|
+
</div>
|
|
2139
|
+
</div>
|
|
2140
|
+
<div
|
|
2141
|
+
class="small grow basis shrinkOn scrolly"
|
|
2142
|
+
data-id="CardContent"
|
|
2143
|
+
data-selector-id="cardContent"
|
|
2144
|
+
data-test-id="CardContent"
|
|
2145
|
+
>
|
|
2146
|
+
<div
|
|
2147
|
+
class="flex coldir"
|
|
2148
|
+
data-id="containerComponent"
|
|
2149
|
+
data-selector-id="container"
|
|
2150
|
+
data-test-id="containerComponent"
|
|
2151
|
+
id="1"
|
|
2152
|
+
role="listbox"
|
|
2153
|
+
tabindex="0"
|
|
2154
|
+
>
|
|
2155
|
+
<div
|
|
2156
|
+
class="listItemContainer shrinkOff"
|
|
2157
|
+
data-id="selectComponent_Options"
|
|
2158
|
+
data-selector-id="box"
|
|
2159
|
+
data-test-id="selectComponent_Options"
|
|
2160
|
+
>
|
|
2161
|
+
<li
|
|
2162
|
+
aria-label="Option 2"
|
|
2163
|
+
aria-selected="false"
|
|
2164
|
+
ariaparentrole="listbox"
|
|
2165
|
+
class="list medium default defaultHover mediumwithTick flex rowdir vCenter"
|
|
2166
|
+
data-a11y-inset-focus="true"
|
|
2167
|
+
data-a11y-list-active="true"
|
|
2168
|
+
data-id="Option 2"
|
|
2169
|
+
data-selector-id="listItem"
|
|
2170
|
+
data-test-id="Option 2"
|
|
2171
|
+
data-title="Option 2"
|
|
2172
|
+
role="option"
|
|
2173
|
+
tabindex="0"
|
|
2174
|
+
>
|
|
2175
|
+
<div
|
|
2176
|
+
class="leftBox grow basis shrinkOff"
|
|
2177
|
+
data-id="boxComponent"
|
|
2178
|
+
data-selector-id="box"
|
|
2179
|
+
data-test-id="boxComponent"
|
|
2180
|
+
>
|
|
2181
|
+
<div
|
|
2182
|
+
class="titleBox shrinkOff"
|
|
2183
|
+
data-id="boxComponent"
|
|
2184
|
+
data-selector-id="box"
|
|
2185
|
+
data-test-id="boxComponent"
|
|
2186
|
+
>
|
|
2187
|
+
<div
|
|
2188
|
+
class="value basisAuto shrinkOn"
|
|
2189
|
+
data-id="boxComponent"
|
|
2190
|
+
data-selector-id="box"
|
|
2191
|
+
data-test-id="boxComponent"
|
|
2192
|
+
>
|
|
2193
|
+
Option 2
|
|
2194
|
+
</div>
|
|
2195
|
+
</div>
|
|
2196
|
+
</div>
|
|
2197
|
+
</li>
|
|
2198
|
+
</div>
|
|
2199
|
+
</div>
|
|
2200
|
+
</div>
|
|
2201
|
+
</div>
|
|
2202
|
+
</div>
|
|
2203
|
+
</div>
|
|
2204
|
+
</div>
|
|
2205
|
+
</div>
|
|
2206
|
+
</div>
|
|
2207
|
+
</DocumentFragment>
|
|
2208
|
+
`;
|
|
2209
|
+
|
|
1929
2210
|
exports[`Select - Should render the placeholder when there is no default value 1`] = `
|
|
1930
2211
|
<DocumentFragment>
|
|
1931
2212
|
<div
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer dot-components, dot-components.theme, dot-components.core, dot-components.reset, dot-components.base, dot-components.animation, dot-components.transition, dot-components.utility, dot-components.layout, dot-components.semantic, dot-components.atom, dot-components.molecule, dot-components.organism, dot-components.page, dot-components.effect;
|
package/es/v1/Popup/Popup.js
CHANGED
package/es/v1/Select/Select.js
CHANGED
|
@@ -119,7 +119,7 @@ export class SelectComponent extends Component {
|
|
|
119
119
|
// suggestionContainer.addEventListener('scroll', this.handleScroll);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
123
123
|
let {
|
|
124
124
|
selectedValue,
|
|
125
125
|
isDefaultSelectValue,
|
|
@@ -69,8 +69,8 @@ var Accordion = /*#__PURE__*/function (_React$Component) {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
}, {
|
|
72
|
-
key: "
|
|
73
|
-
value: function
|
|
72
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
73
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
74
74
|
if (this.props.selectedItem !== nextProps.selectedItem && !this.props.disableInternalState) {
|
|
75
75
|
this.setState({
|
|
76
76
|
selectedItem: nextProps.selectedItem
|
|
@@ -27,7 +27,7 @@ require("@zohodesk/variables/assets/sizeVariables.module.css");
|
|
|
27
27
|
|
|
28
28
|
require("@zohodesk/variables/assets/fontsizeVariables.module.css");
|
|
29
29
|
|
|
30
|
-
require("@zohodesk/variables/
|
|
30
|
+
require("@zohodesk/variables/es/fontFamilyVariables.module.css");
|
|
31
31
|
|
|
32
32
|
require("@zohodesk/variables/assets/transitionVariables.module.css");
|
|
33
33
|
|
package/lib/Card/Card.js
CHANGED
|
@@ -175,15 +175,17 @@ var Card = /*#__PURE__*/function (_Component3) {
|
|
|
175
175
|
_this2.to = from + 3 * limit;
|
|
176
176
|
_this2.isFetching = false;
|
|
177
177
|
_this2.lastScrollTop = 0;
|
|
178
|
-
_this2.onScroll = _this2.onScroll.bind(_assertThisInitialized(_this2));
|
|
178
|
+
_this2.onScroll = _this2.onScroll.bind(_assertThisInitialized(_this2));
|
|
179
|
+
_this2.setScrollRef = _this2.setScrollRef.bind(_assertThisInitialized(_this2));
|
|
180
|
+
_this2.childEleRef = null; //this.onSetScroll = debounce(this.setScroll.bind(this, true), 10, true);
|
|
179
181
|
//this.onClearScroll = debounce(this.setScroll.bind(this, false), 500);
|
|
180
182
|
|
|
181
183
|
return _this2;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
_createClass(Card, [{
|
|
185
|
-
key: "
|
|
186
|
-
value: function
|
|
187
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
188
|
+
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
187
189
|
if (this.from !== nextProps.from) {
|
|
188
190
|
this.from = nextProps.from;
|
|
189
191
|
}
|
|
@@ -204,24 +206,35 @@ var Card = /*#__PURE__*/function (_Component3) {
|
|
|
204
206
|
noMoreData = _this$props3.noMoreData,
|
|
205
207
|
scrollAt = _this$props3.scrollAt,
|
|
206
208
|
noNeedUpScroll = _this$props3.noNeedUpScroll,
|
|
207
|
-
isPercentageScroll = _this$props3.isPercentageScroll
|
|
209
|
+
isPercentageScroll = _this$props3.isPercentageScroll,
|
|
210
|
+
scrollDirection = _this$props3.scrollDirection;
|
|
211
|
+
var scrollLimitHeight = scrollHeight - scrollAt;
|
|
212
|
+
var currentVisibleBottom = scrollTop + offsetHeight;
|
|
208
213
|
|
|
209
214
|
if (scrollTop > this.lastScrollTop) {
|
|
210
|
-
this.
|
|
215
|
+
this.scrollingDirection = 'down';
|
|
211
216
|
} else {
|
|
212
|
-
this.
|
|
217
|
+
this.scrollingDirection = 'up';
|
|
213
218
|
}
|
|
214
219
|
|
|
215
220
|
this.lastScrollTop = scrollTop;
|
|
216
221
|
|
|
217
222
|
if (fetchData && !this.isFetching) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
var fetchDirection = scrollDirection === 'bottomToTop' ? 'up' : 'down';
|
|
224
|
+
|
|
225
|
+
if (this.scrollingDirection === fetchDirection && !noMoreData) {
|
|
226
|
+
var prefetch = false;
|
|
227
|
+
|
|
228
|
+
if (isPercentageScroll) {
|
|
229
|
+
var scrollingPercentage = scrollDirection === 'bottomToTop' ? (scrollHeight - scrollTop) / scrollLimitHeight * 100 : currentVisibleBottom / scrollLimitHeight * 100;
|
|
230
|
+
prefetch = scrollingPercentage >= (0, _Config.getLibraryConfig)('scrollFetchLimit');
|
|
231
|
+
} else {
|
|
232
|
+
prefetch = scrollDirection === 'bottomToTop' ? scrollTop <= scrollAt : scrollLimitHeight <= currentVisibleBottom;
|
|
233
|
+
}
|
|
221
234
|
|
|
222
235
|
if (prefetch) {
|
|
223
236
|
this.isFetching = true;
|
|
224
|
-
fetchData(this.from + this.limit, this.limit + this.to, this.
|
|
237
|
+
fetchData(this.from + this.limit, this.limit + this.to, this.scrollingDirection).then(function () {
|
|
225
238
|
_this3.to = _this3.limit + _this3.to;
|
|
226
239
|
_this3.isFetching = false;
|
|
227
240
|
}, function () {
|
|
@@ -229,9 +242,11 @@ var Card = /*#__PURE__*/function (_Component3) {
|
|
|
229
242
|
});
|
|
230
243
|
}
|
|
231
244
|
} else {
|
|
232
|
-
|
|
245
|
+
var _prefetch = scrollDirection === 'bottomToTop' ? scrollLimitHeight <= currentVisibleBottom : 0 >= scrollTop - scrollAt;
|
|
246
|
+
|
|
247
|
+
if (_prefetch && this.from !== 0 && !noNeedUpScroll) {
|
|
233
248
|
this.isFetching = true;
|
|
234
|
-
fetchData(this.from - this.limit, this.to - this.limit, this.
|
|
249
|
+
fetchData(this.from - this.limit, this.to - this.limit, this.scrollingDirection).then(function () {
|
|
235
250
|
_this3.to = _this3.to - _this3.limit;
|
|
236
251
|
_this3.isFetching = false;
|
|
237
252
|
}, function () {
|
|
@@ -242,9 +257,12 @@ var Card = /*#__PURE__*/function (_Component3) {
|
|
|
242
257
|
}
|
|
243
258
|
|
|
244
259
|
if (fetchData && !noNeedUpScroll) {
|
|
245
|
-
|
|
260
|
+
var topFetch = scrollDirection === 'bottomToTop' ? !noMoreData : !noNeedUpScroll && this.from !== 0;
|
|
261
|
+
var bottomFetch = scrollDirection === 'bottomToTop' ? !noNeedUpScroll && this.from !== 0 : !noMoreData;
|
|
262
|
+
|
|
263
|
+
if (scrollTop === 0 && topFetch) {
|
|
246
264
|
scrollContainerObj.scrollTop = scrollTop + offsetHeight / 3;
|
|
247
|
-
} else if (scrollHeight ===
|
|
265
|
+
} else if (scrollHeight === currentVisibleBottom && bottomFetch) {
|
|
248
266
|
scrollContainerObj.scrollTop = scrollTop - offsetHeight / 2;
|
|
249
267
|
}
|
|
250
268
|
} // if (isScrollShadow) {
|
|
@@ -262,21 +280,36 @@ var Card = /*#__PURE__*/function (_Component3) {
|
|
|
262
280
|
// }
|
|
263
281
|
// }
|
|
264
282
|
|
|
283
|
+
}, {
|
|
284
|
+
key: "setScrollRef",
|
|
285
|
+
value: function setScrollRef(el) {
|
|
286
|
+
var _this$props4 = this.props,
|
|
287
|
+
scrollAt = _this$props4.scrollAt,
|
|
288
|
+
scrollDirection = _this$props4.scrollDirection;
|
|
289
|
+
|
|
290
|
+
if (el && scrollDirection === 'bottomToTop') {
|
|
291
|
+
requestAnimationFrame(function () {
|
|
292
|
+
el.scrollTop = el.scrollHeight + Number(scrollAt);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
this.childEleRef && this.childEleRef(el);
|
|
297
|
+
}
|
|
265
298
|
}, {
|
|
266
299
|
key: "render",
|
|
267
300
|
value: function render() {
|
|
268
301
|
var _this4 = this;
|
|
269
302
|
|
|
270
|
-
var _this$
|
|
271
|
-
onClick = _this$
|
|
272
|
-
children = _this$
|
|
273
|
-
isScrollAttribute = _this$
|
|
274
|
-
dataId = _this$
|
|
275
|
-
eleRef = _this$
|
|
276
|
-
_this$
|
|
277
|
-
customClass = _this$
|
|
278
|
-
htmlId = _this$
|
|
279
|
-
a11y = _this$
|
|
303
|
+
var _this$props5 = this.props,
|
|
304
|
+
onClick = _this$props5.onClick,
|
|
305
|
+
children = _this$props5.children,
|
|
306
|
+
isScrollAttribute = _this$props5.isScrollAttribute,
|
|
307
|
+
dataId = _this$props5.dataId,
|
|
308
|
+
eleRef = _this$props5.eleRef,
|
|
309
|
+
_this$props5$customCl = _this$props5.customClass,
|
|
310
|
+
customClass = _this$props5$customCl === void 0 ? '' : _this$props5$customCl,
|
|
311
|
+
htmlId = _this$props5.htmlId,
|
|
312
|
+
a11y = _this$props5.a11y;
|
|
280
313
|
var isScroll = this.state.isScroll;
|
|
281
314
|
var role = a11y.role;
|
|
282
315
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -295,6 +328,7 @@ var Card = /*#__PURE__*/function (_Component3) {
|
|
|
295
328
|
isScroll: isScroll
|
|
296
329
|
});
|
|
297
330
|
} else if (child.type === CardContent || _this4.props.childTypes && child.type === _this4.props.childTypes.cardContent) {
|
|
331
|
+
_this4.childEleRef = child.props.eleRef;
|
|
298
332
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
299
333
|
id: htmlId,
|
|
300
334
|
role: role,
|
|
@@ -302,7 +336,7 @@ var Card = /*#__PURE__*/function (_Component3) {
|
|
|
302
336
|
scroll: child.props.scroll,
|
|
303
337
|
preventParentScroll: child.props.preventParentScroll,
|
|
304
338
|
onScroll: _this4.onScroll,
|
|
305
|
-
eleRef:
|
|
339
|
+
eleRef: _this4.setScrollRef,
|
|
306
340
|
isScrollAttribute: child.props.isScrollAttribute,
|
|
307
341
|
dataId: child.props.dataId,
|
|
308
342
|
shrink: child.props.shrink,
|
|
@@ -344,11 +378,11 @@ var CardFooter = /*#__PURE__*/function (_Component4) {
|
|
|
344
378
|
_createClass(CardFooter, [{
|
|
345
379
|
key: "render",
|
|
346
380
|
value: function render() {
|
|
347
|
-
var _this$
|
|
348
|
-
children = _this$
|
|
349
|
-
dataId = _this$
|
|
350
|
-
customClass = _this$
|
|
351
|
-
dataSelectorId = _this$
|
|
381
|
+
var _this$props6 = this.props,
|
|
382
|
+
children = _this$props6.children,
|
|
383
|
+
dataId = _this$props6.dataId,
|
|
384
|
+
customClass = _this$props6.customClass,
|
|
385
|
+
dataSelectorId = _this$props6.dataSelectorId;
|
|
352
386
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
353
387
|
className: "".concat(customClass),
|
|
354
388
|
dataId: dataId,
|