shineout 1.8.1 → 1.8.2

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.
@@ -101,10 +101,13 @@ export function open(props, isPortal) {
101
101
  div.style.display = 'block';
102
102
  var parsed = parseInt(zIndex, 10);
103
103
  if (!Number.isNaN(parsed)) div.style.zIndex = parsed;
104
- var scrollWidth = window.innerWidth - docSize.width;
105
104
  var doc = document.body.parentNode;
106
- doc.style.overflow = 'hidden';
107
- doc.style.paddingRight = scrollWidth + "px";
105
+
106
+ if (!doc.style.paddingRight) {
107
+ var scrollWidth = window.innerWidth - docSize.width;
108
+ doc.style.overflow = 'hidden';
109
+ doc.style.paddingRight = scrollWidth + "px";
110
+ }
108
111
 
109
112
  var handleClose = function handleClose() {
110
113
  if (onClose) onClose();
@@ -314,13 +314,17 @@ function (_PureComponent) {
314
314
 
315
315
 
316
316
  if (treeColumnsName && changedByExpand) {
317
+ // Blank space may appear after clicking the top or bottom collapse button
317
318
  if (fullHeight - this.lastScrollTop < (1 - this.lastScrollArgs[1]) * scrollHeight) {
318
- this.tbody.style.marginTop = scrollHeight + "px";
319
- setTranslate(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
320
- this.lastScrollTop = fullHeight;
319
+ if (fullHeight <= scrollHeight) {
320
+ index = 0;
321
+ } else {
322
+ this.tbody.style.marginTop = scrollHeight + "px";
323
+ setTranslate(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
324
+ this.lastScrollTop = fullHeight;
325
+ return;
326
+ }
321
327
  }
322
-
323
- return;
324
328
  }
325
329
 
326
330
  if (index === 0) {
@@ -2,6 +2,8 @@
2
2
  @import '../../styles/themes/@{so-theme}.less';
3
3
  @tooltip-prefix: ~'@{so-prefix}-tooltip';
4
4
 
5
+ @arrowOffset: (-@tooltip-arrow-width + 1px);
6
+
5
7
  .@{tooltip-prefix} {
6
8
  @keyframe-opacity: ~'@{tooltip-prefix}-kf-opacity';
7
9
  @keyframe-top: ~'@{tooltip-prefix}-kf-top';
@@ -98,7 +100,7 @@
98
100
  transform: translate(-50%, -100%);
99
101
 
100
102
  .@{tooltip-prefix}-arrow {
101
- top: 100%;
103
+ bottom: @arrowOffset;
102
104
  left: 50%;
103
105
  border-top: @tooltip-arrow-width solid @tooltip-bg;
104
106
  border-right: @tooltip-arrow-width solid transparent;
@@ -117,7 +119,7 @@
117
119
 
118
120
  .@{tooltip-prefix}-arrow {
119
121
  top: 50%;
120
- right: 100%;
122
+ left: @arrowOffset;
121
123
  border-top: @tooltip-arrow-width solid transparent;
122
124
  border-right: @tooltip-arrow-width solid @tooltip-bg;
123
125
  border-bottom: @tooltip-arrow-width solid transparent;
@@ -135,7 +137,7 @@
135
137
 
136
138
  .@{tooltip-prefix}-arrow {
137
139
  top: 50%;
138
- left: 100%;
140
+ right: @arrowOffset;
139
141
  border-top: @tooltip-arrow-width solid transparent;
140
142
  border-bottom: @tooltip-arrow-width solid transparent;
141
143
  border-left: @tooltip-arrow-width solid @tooltip-bg;
@@ -152,12 +154,12 @@
152
154
  transform: translateX(-50%);
153
155
 
154
156
  .@{tooltip-prefix}-arrow {
155
- top: 0;
157
+ top: @arrowOffset;
156
158
  left: 50%;
157
159
  border-right: @tooltip-arrow-width solid transparent;
158
160
  border-bottom: @tooltip-arrow-width solid @tooltip-bg;
159
161
  border-left: @tooltip-arrow-width solid transparent;
160
- transform: translate(-50%, -100%);
162
+ transform: translate(-50%, 0);
161
163
  }
162
164
  }
163
165
 
package/es/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.8.1' }
5
+ export default { utils, version: '1.8.2' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
package/es/index.js CHANGED
@@ -3,7 +3,7 @@ import './styles/normalize.less';
3
3
  import * as utils from './utils';
4
4
  export default {
5
5
  utils: utils,
6
- version: '1.8.1'
6
+ version: '1.8.2'
7
7
  };
8
8
  export { utils };
9
9
  export { setLocale } from './locale';
@@ -539,7 +539,7 @@
539
539
  @tooltip-opacity: .9;
540
540
 
541
541
  // Tooltip arrow width
542
- @tooltip-arrow-width: 5px;
542
+ @tooltip-arrow-width: 6px;
543
543
  // Tooltip arrow color
544
544
  @tooltip-arrow-color: @tooltip-bg;
545
545
 
@@ -129,10 +129,13 @@ function open(props, isPortal) {
129
129
  div.style.display = 'block';
130
130
  var parsed = parseInt(zIndex, 10);
131
131
  if (!Number.isNaN(parsed)) div.style.zIndex = parsed;
132
- var scrollWidth = window.innerWidth - _document.docSize.width;
133
132
  var doc = document.body.parentNode;
134
- doc.style.overflow = 'hidden';
135
- doc.style.paddingRight = scrollWidth + "px";
133
+
134
+ if (!doc.style.paddingRight) {
135
+ var scrollWidth = window.innerWidth - _document.docSize.width;
136
+ doc.style.overflow = 'hidden';
137
+ doc.style.paddingRight = scrollWidth + "px";
138
+ }
136
139
 
137
140
  var handleClose = function handleClose() {
138
141
  if (onClose) onClose();
@@ -344,13 +344,17 @@ function (_PureComponent) {
344
344
 
345
345
 
346
346
  if (treeColumnsName && changedByExpand) {
347
+ // Blank space may appear after clicking the top or bottom collapse button
347
348
  if (fullHeight - this.lastScrollTop < (1 - this.lastScrollArgs[1]) * scrollHeight) {
348
- this.tbody.style.marginTop = scrollHeight + "px";
349
- (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
350
- this.lastScrollTop = fullHeight;
349
+ if (fullHeight <= scrollHeight) {
350
+ index = 0;
351
+ } else {
352
+ this.tbody.style.marginTop = scrollHeight + "px";
353
+ (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + fullHeight + "px");
354
+ this.lastScrollTop = fullHeight;
355
+ return;
356
+ }
351
357
  }
352
-
353
- return;
354
358
  }
355
359
 
356
360
  if (index === 0) {
@@ -2,6 +2,8 @@
2
2
  @import '../../styles/themes/@{so-theme}.less';
3
3
  @tooltip-prefix: ~'@{so-prefix}-tooltip';
4
4
 
5
+ @arrowOffset: (-@tooltip-arrow-width + 1px);
6
+
5
7
  .@{tooltip-prefix} {
6
8
  @keyframe-opacity: ~'@{tooltip-prefix}-kf-opacity';
7
9
  @keyframe-top: ~'@{tooltip-prefix}-kf-top';
@@ -98,7 +100,7 @@
98
100
  transform: translate(-50%, -100%);
99
101
 
100
102
  .@{tooltip-prefix}-arrow {
101
- top: 100%;
103
+ bottom: @arrowOffset;
102
104
  left: 50%;
103
105
  border-top: @tooltip-arrow-width solid @tooltip-bg;
104
106
  border-right: @tooltip-arrow-width solid transparent;
@@ -117,7 +119,7 @@
117
119
 
118
120
  .@{tooltip-prefix}-arrow {
119
121
  top: 50%;
120
- right: 100%;
122
+ left: @arrowOffset;
121
123
  border-top: @tooltip-arrow-width solid transparent;
122
124
  border-right: @tooltip-arrow-width solid @tooltip-bg;
123
125
  border-bottom: @tooltip-arrow-width solid transparent;
@@ -135,7 +137,7 @@
135
137
 
136
138
  .@{tooltip-prefix}-arrow {
137
139
  top: 50%;
138
- left: 100%;
140
+ right: @arrowOffset;
139
141
  border-top: @tooltip-arrow-width solid transparent;
140
142
  border-bottom: @tooltip-arrow-width solid transparent;
141
143
  border-left: @tooltip-arrow-width solid @tooltip-bg;
@@ -152,12 +154,12 @@
152
154
  transform: translateX(-50%);
153
155
 
154
156
  .@{tooltip-prefix}-arrow {
155
- top: 0;
157
+ top: @arrowOffset;
156
158
  left: 50%;
157
159
  border-right: @tooltip-arrow-width solid transparent;
158
160
  border-bottom: @tooltip-arrow-width solid @tooltip-bg;
159
161
  border-left: @tooltip-arrow-width solid transparent;
160
- transform: translate(-50%, -100%);
162
+ transform: translate(-50%, 0);
161
163
  }
162
164
  }
163
165
 
package/lib/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.8.1' }
5
+ export default { utils, version: '1.8.2' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
package/lib/index.js CHANGED
@@ -222,6 +222,6 @@ exports.Upload = _Upload.default;
222
222
  // Created by scripts/src-index.js.
223
223
  var _default = {
224
224
  utils: utils,
225
- version: '1.8.1'
225
+ version: '1.8.2'
226
226
  };
227
227
  exports.default = _default;
@@ -539,7 +539,7 @@
539
539
  @tooltip-opacity: .9;
540
540
 
541
541
  // Tooltip arrow width
542
- @tooltip-arrow-width: 5px;
542
+ @tooltip-arrow-width: 6px;
543
543
  // Tooltip arrow color
544
544
  @tooltip-arrow-color: @tooltip-bg;
545
545
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "description": "Shein 前端组件库",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",