@autobest-ui/components 2.13.12 → 2.14.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/esm/affix/index.d.ts +0 -10
- package/esm/affix/index.js +9 -50
- package/esm/carousel/index.d.ts +4 -0
- package/esm/carousel/index.js +10 -1
- package/esm/checkbox/Checkbox.js +3 -19
- package/esm/checkbox/style/index.css +1 -1
- package/esm/confirm/style/index.css +1 -1
- package/esm/index.d.ts +6 -0
- package/esm/index.js +4 -1
- package/esm/input/Adorn.d.ts +4 -0
- package/esm/input/Adorn.js +7 -3
- package/esm/input/Input.d.ts +1 -0
- package/esm/input/Input.js +5 -1
- package/esm/input/TextArea.d.ts +1 -0
- package/esm/input/TextArea.js +4 -1
- package/esm/input-number/index.d.ts +1 -0
- package/esm/input-number/index.js +5 -1
- package/esm/input-phone/index.d.ts +1 -0
- package/esm/input-phone/index.js +1 -0
- package/esm/lazy-image/index.d.ts +10 -30
- package/esm/lazy-image/index.js +30 -51
- package/esm/lazy-image/style/index.css +1 -1
- package/esm/loading-container/index.d.ts +1 -19
- package/esm/loading-container/index.js +16 -122
- package/esm/loading-icon/index.d.ts +1 -1
- package/esm/loading-icon/index.js +3 -21
- package/esm/modal/Affix.d.ts +4 -0
- package/esm/modal/Affix.js +7 -0
- package/esm/modal/index.d.ts +5 -19
- package/esm/modal/index.js +17 -18
- package/esm/modal/style/index.css +1 -1
- package/esm/move/index.d.ts +10 -0
- package/esm/move/index.js +12 -7
- package/esm/radio/Radio.js +10 -7
- package/esm/radio/RadioGroup.js +3 -6
- package/esm/radio/style/index.css +1 -1
- package/esm/radio/type.d.ts +0 -2
- package/esm/read-more/index.d.ts +92 -0
- package/esm/read-more/index.js +377 -0
- package/esm/read-more/style/index.css +1 -0
- package/esm/read-more-html/index.d.ts +89 -0
- package/esm/read-more-html/index.js +362 -0
- package/esm/read-more-html/style/index.css +1 -0
- package/esm/select/index.d.ts +0 -3
- package/esm/select/index.js +4 -25
- package/esm/select/style/index.css +1 -1
- package/esm/show-more/index.d.ts +27 -12
- package/esm/show-more/index.js +87 -41
- package/esm/show-more/style/index.css +1 -1
- package/esm/style.css +1 -1
- package/esm/table/style/index.css +1 -1
- package/esm/trigger/index.d.ts +3 -10
- package/esm/trigger/index.js +19 -39
- package/lib/affix/index.d.ts +0 -10
- package/lib/affix/index.js +8 -49
- package/lib/carousel/index.d.ts +4 -0
- package/lib/carousel/index.js +10 -1
- package/lib/checkbox/Checkbox.js +3 -19
- package/lib/checkbox/style/index.css +1 -1
- package/lib/confirm/style/index.css +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/index.js +21 -0
- package/lib/input/Adorn.d.ts +4 -0
- package/lib/input/Adorn.js +7 -3
- package/lib/input/Input.d.ts +1 -0
- package/lib/input/Input.js +5 -1
- package/lib/input/TextArea.d.ts +1 -0
- package/lib/input/TextArea.js +4 -1
- package/lib/input-number/index.d.ts +1 -0
- package/lib/input-number/index.js +5 -1
- package/lib/input-phone/index.d.ts +1 -0
- package/lib/input-phone/index.js +1 -0
- package/lib/lazy-image/index.d.ts +10 -30
- package/lib/lazy-image/index.js +30 -51
- package/lib/lazy-image/style/index.css +1 -1
- package/lib/loading-container/index.d.ts +1 -19
- package/lib/loading-container/index.js +16 -125
- package/lib/loading-icon/index.d.ts +1 -1
- package/lib/loading-icon/index.js +3 -21
- package/lib/modal/Affix.d.ts +4 -0
- package/lib/modal/Affix.js +14 -0
- package/lib/modal/index.d.ts +5 -19
- package/lib/modal/index.js +17 -18
- package/lib/modal/style/index.css +1 -1
- package/lib/move/index.d.ts +10 -0
- package/lib/move/index.js +12 -7
- package/lib/radio/Radio.js +10 -7
- package/lib/radio/RadioGroup.js +3 -6
- package/lib/radio/style/index.css +1 -1
- package/lib/radio/type.d.ts +0 -2
- package/lib/read-more/index.d.ts +92 -0
- package/lib/read-more/index.js +388 -0
- package/lib/read-more/style/index.css +1 -0
- package/lib/read-more-html/index.d.ts +89 -0
- package/lib/read-more-html/index.js +373 -0
- package/lib/read-more-html/style/index.css +1 -0
- package/lib/select/index.d.ts +0 -3
- package/lib/select/index.js +4 -25
- package/lib/select/style/index.css +1 -1
- package/lib/show-more/index.d.ts +27 -12
- package/lib/show-more/index.js +86 -40
- package/lib/show-more/style/index.css +1 -1
- package/lib/style.css +1 -1
- package/lib/table/style/index.css +1 -1
- package/lib/trigger/index.d.ts +3 -10
- package/lib/trigger/index.js +19 -39
- package/package.json +3 -3
- package/esm/affix/observe.d.ts +0 -8
- package/esm/affix/observe.js +0 -6
- package/lib/affix/observe.d.ts +0 -8
- package/lib/affix/observe.js +0 -12
package/esm/affix/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AddListenerEventRemoveHandler, getOffsetAndSize } from '@autobest-ui/utils';
|
|
3
|
-
import { CurrentResizeObserver } from './observe';
|
|
4
3
|
export interface GetFixedStateParams {
|
|
5
4
|
positionInfo: OffsetInfo;
|
|
6
5
|
scrollTop: number;
|
|
@@ -50,10 +49,6 @@ export interface AffixProps {
|
|
|
50
49
|
* 是否忽略水平方向固定定位, true将跟着鼠标左右移动
|
|
51
50
|
*/
|
|
52
51
|
ignoreHorizontalFixed?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* 是否监听children的大小变化(仅用于非自定义renderAffix的情况)
|
|
55
|
-
*/
|
|
56
|
-
observeSize?: boolean;
|
|
57
52
|
}
|
|
58
53
|
interface AffixStates {
|
|
59
54
|
visible: boolean;
|
|
@@ -69,7 +64,6 @@ declare class Affix extends React.Component<AffixProps, AffixStates> {
|
|
|
69
64
|
isFixed: boolean;
|
|
70
65
|
wrapRef: React.RefObject<HTMLDivElement>;
|
|
71
66
|
customRef: React.RefObject<HTMLDivElement>;
|
|
72
|
-
resizeObserver: CurrentResizeObserver;
|
|
73
67
|
static defaultProps: {
|
|
74
68
|
offsetTop: number;
|
|
75
69
|
allWidth: boolean;
|
|
@@ -80,10 +74,6 @@ declare class Affix extends React.Component<AffixProps, AffixStates> {
|
|
|
80
74
|
constructor(props: AffixProps);
|
|
81
75
|
componentDidMount(): void;
|
|
82
76
|
componentWillUnmount(): void;
|
|
83
|
-
onVisibleChange: (visible: any) => void;
|
|
84
|
-
addElementObserve: () => void;
|
|
85
|
-
removeElementObserve: () => void;
|
|
86
|
-
refreshWrap: () => void;
|
|
87
77
|
onHandlerScroll: (isResize?: boolean) => void;
|
|
88
78
|
renderContent(): JSX.Element;
|
|
89
79
|
render(): JSX.Element;
|
package/esm/affix/index.js
CHANGED
|
@@ -34,9 +34,8 @@ var __assign = this && this.__assign || function () {
|
|
|
34
34
|
};
|
|
35
35
|
import React from 'react';
|
|
36
36
|
import classNames from 'classnames';
|
|
37
|
-
import { throttleWithRAF, addEventListener, getOffsetAndSize, getScrollOffset, getOffset
|
|
37
|
+
import { throttleWithRAF, addEventListener, getOffsetAndSize, getScrollOffset, getOffset } from '@autobest-ui/utils';
|
|
38
38
|
import PortalAffix from './PortalAffix';
|
|
39
|
-
import getResizeObserver from './observe';
|
|
40
39
|
var Affix = /** @class */function (_super) {
|
|
41
40
|
__extends(Affix, _super);
|
|
42
41
|
function Affix(props) {
|
|
@@ -45,46 +44,16 @@ var Affix = /** @class */function (_super) {
|
|
|
45
44
|
_this.resizeHandler = null;
|
|
46
45
|
_this.wrapRef = /*#__PURE__*/React.createRef();
|
|
47
46
|
_this.customRef = /*#__PURE__*/React.createRef();
|
|
48
|
-
_this.onVisibleChange = function (visible) {
|
|
49
|
-
var _a = _this.props,
|
|
50
|
-
onChange = _a.onChange,
|
|
51
|
-
observeSize = _a.observeSize,
|
|
52
|
-
renderAffix = _a.renderAffix;
|
|
53
|
-
onChange(visible);
|
|
54
|
-
if (visible && observeSize && !renderAffix) {
|
|
55
|
-
_this.addElementObserve();
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
_this.removeElementObserve();
|
|
59
|
-
};
|
|
60
|
-
_this.addElementObserve = function () {
|
|
61
|
-
var element = _this.wrapRef.current;
|
|
62
|
-
var CurrentResizeObserve = getResizeObserver();
|
|
63
|
-
if (_this.resizeObserver || !element || !CurrentResizeObserve) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
_this.resizeObserver = new CurrentResizeObserve(_this.refreshWrap);
|
|
67
|
-
_this.resizeObserver.observe(element);
|
|
68
|
-
};
|
|
69
|
-
_this.removeElementObserve = function () {
|
|
70
|
-
if (_this.resizeObserver) {
|
|
71
|
-
_this.resizeObserver.disconnect();
|
|
72
|
-
_this.resizeObserver = null;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
_this.refreshWrap = function () {
|
|
76
|
-
_this.onHandlerScroll();
|
|
77
|
-
};
|
|
78
47
|
_this.onHandlerScroll = function (isResize) {
|
|
79
48
|
var _a = _this.props,
|
|
80
49
|
offsetTop = _a.offsetTop,
|
|
50
|
+
onChange = _a.onChange,
|
|
81
51
|
onScroll = _a.onScroll,
|
|
82
52
|
renderAffix = _a.renderAffix,
|
|
83
53
|
allWidth = _a.allWidth,
|
|
84
54
|
fadeEffect = _a.fadeEffect,
|
|
85
55
|
getFixedStatus = _a.getFixedStatus,
|
|
86
|
-
ignoreHorizontalFixed = _a.ignoreHorizontalFixed
|
|
87
|
-
observeSize = _a.observeSize;
|
|
56
|
+
ignoreHorizontalFixed = _a.ignoreHorizontalFixed;
|
|
88
57
|
var element = _this.wrapRef.current;
|
|
89
58
|
if (!element) {
|
|
90
59
|
return;
|
|
@@ -94,22 +63,12 @@ var Affix = /** @class */function (_super) {
|
|
|
94
63
|
scrollLeft = _b.left;
|
|
95
64
|
var parentElement = element.parentNode;
|
|
96
65
|
// 元素信息
|
|
97
|
-
var
|
|
98
|
-
var positionInfo =
|
|
66
|
+
var positionElement = _this.isFixed && !renderAffix ? parentElement : element;
|
|
67
|
+
var positionInfo = getOffsetAndSize(positionElement);
|
|
99
68
|
if (ignoreHorizontalFixed) {
|
|
100
|
-
var ignoreScrollLeft = getOffset(
|
|
69
|
+
var ignoreScrollLeft = getOffset(positionElement, true).left;
|
|
101
70
|
positionInfo.left = ignoreScrollLeft;
|
|
102
71
|
}
|
|
103
|
-
var sizeChanged = false;
|
|
104
|
-
if (observeSize && isOriginalFixed) {
|
|
105
|
-
// 如果监听元素size变化,需要获取原元素的width和height信息
|
|
106
|
-
var _c = getElementSize(element),
|
|
107
|
-
elementWidth = _c.width,
|
|
108
|
-
elementHeight = _c.height;
|
|
109
|
-
sizeChanged = elementWidth !== positionInfo.width || elementHeight !== positionInfo.height;
|
|
110
|
-
positionInfo.width = elementWidth;
|
|
111
|
-
positionInfo.height = elementHeight;
|
|
112
|
-
}
|
|
113
72
|
var currentFixed = getFixedStatus({
|
|
114
73
|
positionInfo: positionInfo,
|
|
115
74
|
scrollTop: scrollTop,
|
|
@@ -129,8 +88,8 @@ var Affix = /** @class */function (_super) {
|
|
|
129
88
|
parentElement.style.width = '';
|
|
130
89
|
parentElement.style.height = '';
|
|
131
90
|
}
|
|
132
|
-
|
|
133
|
-
} else if ((!_this.isFixed || isResize
|
|
91
|
+
onChange(false);
|
|
92
|
+
} else if ((!_this.isFixed || isResize) && currentFixed) {
|
|
134
93
|
_this.isFixed = true;
|
|
135
94
|
var documentWidth = document.body.offsetWidth;
|
|
136
95
|
var allWidthLeft = ignoreHorizontalFixed ? "-".concat(scrollLeft, "px") : '0px';
|
|
@@ -149,7 +108,7 @@ var Affix = /** @class */function (_super) {
|
|
|
149
108
|
parentElement.style.width = "".concat(positionInfo.width, "px");
|
|
150
109
|
parentElement.style.height = "".concat(positionInfo.height, "px");
|
|
151
110
|
}
|
|
152
|
-
|
|
111
|
+
onChange(true);
|
|
153
112
|
} else if (_this.isFixed && currentFixed && ignoreHorizontalFixed) {
|
|
154
113
|
var allWidthLeft = "-".concat(scrollLeft, "px");
|
|
155
114
|
if (renderAffix || fadeEffect) {
|
package/esm/carousel/index.d.ts
CHANGED
package/esm/carousel/index.js
CHANGED
|
@@ -40,12 +40,21 @@ var Carousel = /** @class */function (_super) {
|
|
|
40
40
|
_this.autoplayTimer = null;
|
|
41
41
|
_this.fadeEffectTimer = null;
|
|
42
42
|
_this.next = function (transition) {
|
|
43
|
+
if (transition === void 0) {
|
|
44
|
+
transition = Transition.TransformEaseInOut;
|
|
45
|
+
}
|
|
43
46
|
_this.interceptorChangePage(_this.state.currentPage + 1, transition);
|
|
44
47
|
};
|
|
45
48
|
_this.prev = function (transition) {
|
|
49
|
+
if (transition === void 0) {
|
|
50
|
+
transition = Transition.TransformEaseInOut;
|
|
51
|
+
}
|
|
46
52
|
_this.interceptorChangePage(_this.state.currentPage - 1, transition);
|
|
47
53
|
};
|
|
48
54
|
_this.goTo = function (nextIndex, transition) {
|
|
55
|
+
if (transition === void 0) {
|
|
56
|
+
transition = Transition.TransformEaseInOut;
|
|
57
|
+
}
|
|
49
58
|
_this.interceptorChangePage(nextIndex - 1, transition);
|
|
50
59
|
};
|
|
51
60
|
/**
|
|
@@ -154,7 +163,7 @@ var Carousel = /** @class */function (_super) {
|
|
|
154
163
|
element.style.visibility = '';
|
|
155
164
|
});
|
|
156
165
|
} else {
|
|
157
|
-
element.style.transition = transition
|
|
166
|
+
element.style.transition = transition;
|
|
158
167
|
}
|
|
159
168
|
element.style.transform = "translateX(".concat(translateX, "px)");
|
|
160
169
|
};
|
package/esm/checkbox/Checkbox.js
CHANGED
|
@@ -39,30 +39,14 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
39
39
|
type: "checkbox",
|
|
40
40
|
checked: checked,
|
|
41
41
|
disabled: disabled,
|
|
42
|
-
onChange: onCheckboxChange
|
|
43
|
-
style: {
|
|
44
|
-
width: size,
|
|
45
|
-
height: size
|
|
46
|
-
}
|
|
42
|
+
onChange: onCheckboxChange
|
|
47
43
|
}), /*#__PURE__*/React.createElement("span", {
|
|
48
|
-
className: "".concat(cls, "-
|
|
49
|
-
style: {
|
|
50
|
-
width: size,
|
|
51
|
-
height: size,
|
|
52
|
-
fontSize: size
|
|
53
|
-
}
|
|
54
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
55
|
-
className: "".concat(cls, "-outer"),
|
|
44
|
+
className: "".concat(cls, "-inner"),
|
|
56
45
|
style: {
|
|
57
46
|
width: size,
|
|
58
47
|
height: size
|
|
59
48
|
}
|
|
60
|
-
}),
|
|
61
|
-
className: "".concat(cls, "-check"),
|
|
62
|
-
viewBox: "0 0 18 18"
|
|
63
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
64
|
-
d: "M2.8284 8.4853 7.7782 13.435 15.5563 5.6569 14.1421 4.2426 7.7782 10.6066 4.2426 7.0711 2.8284 8.4853Z"
|
|
65
|
-
}))), children);
|
|
49
|
+
}), children);
|
|
66
50
|
});
|
|
67
51
|
Checkbox.defaultProps = {
|
|
68
52
|
disabled: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-checkbox{
|
|
1
|
+
.ab-checkbox{cursor:pointer;display:inline-flex;align-items:center;user-select:none;position:relative}.ab-checkbox-input{cursor:pointer;position:absolute;opacity:0;margin:0;padding:0;z-index:2}.ab-checkbox-inner{display:inline-block;margin-right:.06rem;position:relative;border:1px solid #b0b0b0;border-radius:.02rem;background-color:#fff;transition:.3s;flex-shrink:0}.ab-checkbox-inner::after{box-sizing:border-box;position:absolute;top:45%;left:22%;display:table;width:37.5%;height:62.5%;border-style:solid;border-width:2px;border-top:0;border-inline-start:0;transform:rotate(45deg) scale(0) translate(-50%,-50%);opacity:0;content:"";transition:.2s cubic-bezier(.71,-.46,.88,.6),opacity .1s}.ab-checkbox-checked .ab-checkbox-inner::after{opacity:1;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:.2s cubic-bezier(.12,.4,.29,1.46) .1s}.ab-checkbox-disabled{cursor:not-allowed;color:rgba(0,0,0,.25)}.ab-checkbox-disabled .ab-checkbox-inner{border-color:#f0f0f0;background-color:#f5f5f5}.ab-checkbox-disabled .ab-checkbox-input{cursor:not-allowed}.ab-checkbox-white .ab-checkbox-inner::after{border-color:#e84040}.ab-checkbox-white.ab-checkbox-disabled .ab-checkbox-inner::after{border-color:#cecece}.ab-checkbox-blue .ab-checkbox-inner::after{border-color:#fff}.ab-checkbox-blue.ab-checkbox-checked .ab-checkbox-inner{transition:none;background-color:#0075ff;border-color:#0075ff}.ab-checkbox-blue.ab-checkbox-disabled .ab-checkbox-inner{border-color:#f0f0f0;background-color:#f5f5f5}.ab-checkbox-blue.ab-checkbox-disabled .ab-checkbox-inner::after{border-color:#cecece}.ab-checkbox-group{display:flex;flex-wrap:wrap}.ab-checkbox-group .ab-checkbox{margin-right:.08rem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-mask{position:fixed;top:0;left:0;z-index:101;width:100%;height:100%;background-color:rgba(0,0,0,.45);transition:opacity .4s cubic-bezier(.7,.3,.1,1)}.ab-mask-fade-appear,.ab-mask-fade-enter{opacity:0}.ab-mask-fade-appear-active,.ab-mask-fade-enter-active,.ab-mask-fade-enter-done,.ab-mask-fade-exit{opacity:1}.ab-mask-fade-exit-active{opacity:0}.ab-mask-fade-exit-done{display:none}.ab-modal{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;outline:0}.ab-modal.ab-modal-center{text-align:center}.ab-modal.ab-modal-center::before{display:inline-block;width:0;height:100%;vertical-align:middle;content:""}.ab-modal.ab-modal-center .ab-modal-content{top:0;text-align:left;display:inline-block;vertical-align:middle}.ab-modal-content{position:relative;background-color:#fff;max-width:calc(100vw - .3rem);margin-left:auto;margin-right:auto;overflow:auto;-webkit-overflow-scrolling:touch;transition:transform .3s,opacity .3s cubic-bezier(.7,.3,.1,1);z-index:101}.ab-modal-title{position:relative;width:100%}.ab-modal-title .ab-modal-times{top:50%;transform:translateY(-50%)}.ab-modal-times{position:absolute;top:.12rem;right:.12rem;font-size:.15rem;color:#b0b0b0;cursor:pointer}.ab-modal-times svg{display:block}.ab-modal-times:hover{color:#333}.ab-modal-hidden{display:none}@media only screen and (max-width:767px){.ab-modal-content{width:calc(100vw - .3rem)}}.ab-modal-fade-appear,.ab-modal-fade-enter{transform:translate3d(0,-30px,0);opacity:0}.ab-modal-fade-appear-active,.ab-modal-fade-enter-active,.ab-modal-fade-enter-done,.ab-modal-fade-exit{transform:translateZ(0);opacity:1}.ab-modal-fade-exit-active{transform:translate3d(0,-30px,0);opacity:0}.ab-modal-fade-exit-done{display:none}.ab-confirm-btns{display:flex;justify-content:flex-end;padding-top:.42rem}.ab-confirm-cancel,.ab-confirm-ok{overflow:hidden;position:relative;font-size:.12rem;border-width:1px;border-style:solid;outline:0;cursor:pointer;font-weight:700;padding:.05rem .3rem;display:inline-block;color:#fff;margin-left:.3rem}.ab-confirm-ok{border-color:#bc0000;background:linear-gradient(180deg,#c00000 0,#c00000 0,#a00000 100%,#a00000 100%)}.ab-confirm-ok:hover{border-color:#bc0000;background:#bc0000}.ab-confirm-cancel{border-color:grey;background:linear-gradient(180deg,#909090 0,#909090 0,#707070 100%,#707070 100%)}.ab-confirm-cancel:hover{border-color:grey;background:grey}
|
|
1
|
+
.ab-mask{position:fixed;top:0;left:0;z-index:101;width:100%;height:100%;background-color:rgba(0,0,0,.45);transition:opacity .4s cubic-bezier(.7,.3,.1,1)}.ab-mask-fade-appear,.ab-mask-fade-enter{opacity:0}.ab-mask-fade-appear-active,.ab-mask-fade-enter-active,.ab-mask-fade-enter-done,.ab-mask-fade-exit{opacity:1}.ab-mask-fade-exit-active{opacity:0}.ab-mask-fade-exit-done{display:none}.ab-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:101;overflow:auto;outline:0}.ab-modal.ab-modal-center{text-align:center}.ab-modal.ab-modal-center::before{display:inline-block;width:0;height:100%;vertical-align:middle;content:""}.ab-modal.ab-modal-center .ab-modal-content{top:0;text-align:left;display:inline-block;vertical-align:middle}.ab-modal-content{position:relative;background-color:#fff;max-width:calc(100vw - .3rem);margin-left:auto;margin-right:auto;overflow:auto;-webkit-overflow-scrolling:touch;transition:transform .3s,opacity .3s cubic-bezier(.7,.3,.1,1);z-index:101}.ab-modal-title{position:relative;width:100%}.ab-modal-title .ab-modal-times{top:50%;transform:translateY(-50%)}.ab-modal-times{position:absolute;top:.12rem;right:.12rem;font-size:.15rem;color:#b0b0b0;cursor:pointer}.ab-modal-times svg{display:block}.ab-modal-times:hover{color:#333}.ab-modal-hidden{display:none}@media only screen and (max-width:767px){.ab-modal-content{width:calc(100vw - .3rem)}}.ab-modal-fade-appear,.ab-modal-fade-enter{transform:translate3d(0,-30px,0);opacity:0}.ab-modal-fade-appear-active,.ab-modal-fade-enter-active,.ab-modal-fade-enter-done,.ab-modal-fade-exit{transform:translateZ(0);opacity:1}.ab-modal-fade-exit-active{transform:translate3d(0,-30px,0);opacity:0}.ab-modal-fade-exit-done{display:none}.ab-confirm-btns{display:flex;justify-content:flex-end;padding-top:.42rem}.ab-confirm-cancel,.ab-confirm-ok{overflow:hidden;position:relative;font-size:.12rem;border-width:1px;border-style:solid;outline:0;cursor:pointer;font-weight:700;padding:.05rem .3rem;display:inline-block;color:#fff;margin-left:.3rem}.ab-confirm-ok{border-color:#bc0000;background:linear-gradient(180deg,#c00000 0,#c00000 0,#a00000 100%,#a00000 100%)}.ab-confirm-ok:hover{border-color:#bc0000;background:#bc0000}.ab-confirm-cancel{border-color:grey;background:linear-gradient(180deg,#909090 0,#909090 0,#707070 100%,#707070 100%)}.ab-confirm-cancel:hover{border-color:grey;background:grey}
|
package/esm/index.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export type { MoveProps } from './move';
|
|
|
14
14
|
export { default as Move } from './move';
|
|
15
15
|
export type { ShowMoreProps } from './show-more';
|
|
16
16
|
export { default as ShowMore } from './show-more';
|
|
17
|
+
export type { ReadMoreProps } from './read-more';
|
|
18
|
+
export { default as ReadMore } from './read-more';
|
|
19
|
+
export type { ReadMoreHtmlProps } from './read-more-html';
|
|
20
|
+
export { default as ReadMoreHtml } from './read-more-html';
|
|
17
21
|
export type { SelectOptionItem, SelectProps, SelectPlacement } from './select';
|
|
18
22
|
export { default as Select } from './select';
|
|
19
23
|
export type { ConfirmProps } from './confirm';
|
|
@@ -61,3 +65,5 @@ export { default as Trigger } from './trigger';
|
|
|
61
65
|
export { composeRef, supportRef, fillRef } from './trigger/ref';
|
|
62
66
|
export type { RadioProps, RadioGroupProps, RadioValue, RadioOptionItem } from './radio';
|
|
63
67
|
export { Radio, RadioGroup } from './radio';
|
|
68
|
+
export type { PortalProps } from './portal';
|
|
69
|
+
export { default as Portal } from './portal';
|
package/esm/index.js
CHANGED
|
@@ -6,6 +6,8 @@ export { default as Popover } from './popover';
|
|
|
6
6
|
export { default as Skeleton } from './skeleton';
|
|
7
7
|
export { default as Move } from './move';
|
|
8
8
|
export { default as ShowMore } from './show-more';
|
|
9
|
+
export { default as ReadMore } from './read-more';
|
|
10
|
+
export { default as ReadMoreHtml } from './read-more-html';
|
|
9
11
|
export { default as Select } from './select';
|
|
10
12
|
export { default as Confirm } from './confirm';
|
|
11
13
|
export { default as Collapse } from './collapse';
|
|
@@ -29,4 +31,5 @@ export { default as LoadingBar } from './loading-bar';
|
|
|
29
31
|
export { default as LoadingIcon } from './loading-icon';
|
|
30
32
|
export { default as Trigger } from './trigger';
|
|
31
33
|
export { composeRef, supportRef, fillRef } from './trigger/ref';
|
|
32
|
-
export { Radio, RadioGroup } from './radio';
|
|
34
|
+
export { Radio, RadioGroup } from './radio';
|
|
35
|
+
export { default as Portal } from './portal';
|
package/esm/input/Adorn.d.ts
CHANGED
package/esm/input/Adorn.js
CHANGED
|
@@ -47,17 +47,21 @@ var Adorn = function Adorn(props) {
|
|
|
47
47
|
onBlur(ev);
|
|
48
48
|
}
|
|
49
49
|
}, [onBlur, disabled]);
|
|
50
|
-
|
|
50
|
+
var WrapTagName = props.wrapTagName;
|
|
51
|
+
return /*#__PURE__*/React.createElement(WrapTagName, {
|
|
51
52
|
className: classNames(prefixCls, className, (_a = {}, _a["".concat(prefixCls, "-enter")] = isEnter || isFocus, _a), (_b = {}, _b["".concat(prefixCls, "-focus")] = isFocus, _b), (_c = {}, _c["".concat(prefixCls, "-disabled")] = disabled, _c)),
|
|
52
53
|
onMouseEnter: onMouseEnterCallback,
|
|
53
54
|
onMouseLeave: onMouseLeaveCallback
|
|
54
|
-
}, !isBlank(prefix) ? /*#__PURE__*/React.createElement("
|
|
55
|
+
}, !isBlank(prefix) ? /*#__PURE__*/React.createElement("span", {
|
|
55
56
|
className: "".concat(prefixCls, "-prefix")
|
|
56
57
|
}, prefix) : null, /*#__PURE__*/React.cloneElement(children, {
|
|
57
58
|
onFocus: onFocusCallback,
|
|
58
59
|
onBlur: onBlurCallback
|
|
59
|
-
}), !isBlank(suffix) ? /*#__PURE__*/React.createElement("
|
|
60
|
+
}), !isBlank(suffix) ? /*#__PURE__*/React.createElement("span", {
|
|
60
61
|
className: "".concat(prefixCls, "-suffix")
|
|
61
62
|
}, suffix) : null);
|
|
62
63
|
};
|
|
64
|
+
Adorn.defaultProps = {
|
|
65
|
+
wrapTagName: 'div'
|
|
66
|
+
};
|
|
63
67
|
export default Adorn;
|
package/esm/input/Input.d.ts
CHANGED
package/esm/input/Input.js
CHANGED
|
@@ -207,10 +207,12 @@ var InputNotRef = /** @class */function (_super) {
|
|
|
207
207
|
title = _a.title,
|
|
208
208
|
onKeyUp = _a.onKeyUp,
|
|
209
209
|
name = _a.name,
|
|
210
|
-
autoComplete = _a.autoComplete
|
|
210
|
+
autoComplete = _a.autoComplete,
|
|
211
|
+
wrapTagName = _a.wrapTagName;
|
|
211
212
|
var value = this.state.value;
|
|
212
213
|
var isFileUpload = this.isFileUpload();
|
|
213
214
|
return /*#__PURE__*/React.createElement(Adorn, {
|
|
215
|
+
wrapTagName: wrapTagName,
|
|
214
216
|
prefixCls: cls,
|
|
215
217
|
onFocus: this.onFocus,
|
|
216
218
|
onBlur: this.onBlur,
|
|
@@ -239,6 +241,8 @@ var InputNotRef = /** @class */function (_super) {
|
|
|
239
241
|
};
|
|
240
242
|
InputNotRef.defaultProps = {
|
|
241
243
|
defaultValue: '',
|
|
244
|
+
// TODO:: 在改动最小的情况下设置默认是div, 后续升级时默认需改成label
|
|
245
|
+
wrapTagName: 'div',
|
|
242
246
|
type: 'text',
|
|
243
247
|
checkValueOnMounted: false
|
|
244
248
|
};
|
package/esm/input/TextArea.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export declare class TextAreaNotRef extends React.Component<TextAreaPropsWithRef
|
|
|
54
54
|
textareaRef: React.RefObject<HTMLTextAreaElement>;
|
|
55
55
|
static defaultProps: {
|
|
56
56
|
defaultValue: string;
|
|
57
|
+
wrapTagName: string;
|
|
57
58
|
rows: number;
|
|
58
59
|
maxlength: number;
|
|
59
60
|
checkValueOnMounted: boolean;
|
package/esm/input/TextArea.js
CHANGED
|
@@ -176,10 +176,12 @@ var TextAreaNotRef = /** @class */function (_super) {
|
|
|
176
176
|
prefix = _a.prefix,
|
|
177
177
|
rows = _a.rows,
|
|
178
178
|
maxLength = _a.maxLength,
|
|
179
|
-
name = _a.name
|
|
179
|
+
name = _a.name,
|
|
180
|
+
wrapTagName = _a.wrapTagName;
|
|
180
181
|
var value = this.state.value;
|
|
181
182
|
return /*#__PURE__*/React.createElement(Adorn, {
|
|
182
183
|
prefixCls: cls,
|
|
184
|
+
wrapTagName: wrapTagName,
|
|
183
185
|
onFocus: this.onFocus,
|
|
184
186
|
onBlur: this.onBlur,
|
|
185
187
|
className: className,
|
|
@@ -202,6 +204,7 @@ var TextAreaNotRef = /** @class */function (_super) {
|
|
|
202
204
|
};
|
|
203
205
|
TextAreaNotRef.defaultProps = {
|
|
204
206
|
defaultValue: '',
|
|
207
|
+
wrapTagName: 'div',
|
|
205
208
|
rows: 5,
|
|
206
209
|
maxlength: 0,
|
|
207
210
|
checkValueOnMounted: false
|
|
@@ -81,6 +81,7 @@ export declare class InputNumberNotRef extends React.Component<InputNumberPropsW
|
|
|
81
81
|
keyboardHandler: AddListenerEventRemoveHandler;
|
|
82
82
|
static defaultProps: {
|
|
83
83
|
defaultValue: string;
|
|
84
|
+
wrapTagName: string;
|
|
84
85
|
controls: boolean;
|
|
85
86
|
isAllowNumberWithDotAndMinus: boolean;
|
|
86
87
|
isOnlyAllowNumber: boolean;
|
|
@@ -282,7 +282,8 @@ var InputNumberNotRef = /** @class */function (_super) {
|
|
|
282
282
|
controls = _b.controls,
|
|
283
283
|
isValueToString = _b.isValueToString,
|
|
284
284
|
checkValueOnMounted = _b.checkValueOnMounted,
|
|
285
|
-
maxLength = _b.maxLength
|
|
285
|
+
maxLength = _b.maxLength,
|
|
286
|
+
wrapTagName = _b.wrapTagName;
|
|
286
287
|
var originalValueStr = this.state.originalValueStr;
|
|
287
288
|
var hasControls = controls && !isValueToString;
|
|
288
289
|
return /*#__PURE__*/React.createElement(Input, {
|
|
@@ -290,12 +291,14 @@ var InputNumberNotRef = /** @class */function (_super) {
|
|
|
290
291
|
className: classNames(cls, className, (_a = {}, _a["".concat(cls, "-has-controls")] = hasControls, _a)),
|
|
291
292
|
placeholder: placeholder,
|
|
292
293
|
disabled: disabled,
|
|
294
|
+
wrapTagName: wrapTagName,
|
|
293
295
|
style: style,
|
|
294
296
|
prefix: prefix,
|
|
295
297
|
name: name,
|
|
296
298
|
value: originalValueStr,
|
|
297
299
|
onChange: this.onChange,
|
|
298
300
|
onKeyDown: this.onKeyDown,
|
|
301
|
+
"aria-label": this.props['aria-label'],
|
|
299
302
|
onBlur: this.onBlur,
|
|
300
303
|
onFocus: this.onFocus,
|
|
301
304
|
suffix: hasControls ? /*#__PURE__*/React.createElement(ControlArrow, {
|
|
@@ -309,6 +312,7 @@ var InputNumberNotRef = /** @class */function (_super) {
|
|
|
309
312
|
};
|
|
310
313
|
InputNumberNotRef.defaultProps = {
|
|
311
314
|
defaultValue: '',
|
|
315
|
+
wrapTagName: 'div',
|
|
312
316
|
controls: true,
|
|
313
317
|
isAllowNumberWithDotAndMinus: false,
|
|
314
318
|
isOnlyAllowNumber: false,
|
package/esm/input-phone/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import React
|
|
2
|
-
export interface LazyImageProps {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface LazyImageProps extends React.AllHTMLAttributes<HTMLElement> {
|
|
3
|
+
/**
|
|
4
|
+
* 标签名,默认div
|
|
5
|
+
*/
|
|
6
|
+
tagName?: string;
|
|
3
7
|
/**
|
|
4
8
|
* 需要显示的图片
|
|
5
9
|
*/
|
|
@@ -9,34 +13,13 @@ export interface LazyImageProps {
|
|
|
9
13
|
*/
|
|
10
14
|
alt: string;
|
|
11
15
|
/**
|
|
12
|
-
*
|
|
16
|
+
* 图片额外的属性
|
|
13
17
|
*/
|
|
14
|
-
|
|
18
|
+
imgHTMLAttributes?: React.ImgHTMLAttributes<HTMLImageElement>;
|
|
15
19
|
/**
|
|
16
20
|
* 类名
|
|
17
21
|
*/
|
|
18
22
|
className?: string;
|
|
19
|
-
/**
|
|
20
|
-
* hover 图片,图片透明度(需要注意不要少了isMobile属性)
|
|
21
|
-
*/
|
|
22
|
-
hoverOpacity?: number;
|
|
23
|
-
/**
|
|
24
|
-
* 判断是否是移动端,如果是移动端,将不再执行hoverOpacity, onMouseOver, onMouseOut
|
|
25
|
-
*/
|
|
26
|
-
isMobile?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 判断是否需要动态loading效果,如果提供了defaultImage,则不再有loading
|
|
29
|
-
*/
|
|
30
|
-
active?: boolean;
|
|
31
|
-
onClick?: MouseEventHandler<HTMLImageElement>;
|
|
32
|
-
/**
|
|
33
|
-
* 鼠标放上去的回调(方便自定义样式)
|
|
34
|
-
*/
|
|
35
|
-
onMouseOver?: MouseEventHandler<HTMLImageElement>;
|
|
36
|
-
/**
|
|
37
|
-
* 鼠标离开的回调(方便自定义样式)
|
|
38
|
-
*/
|
|
39
|
-
onMouseOut?: MouseEventHandler<HTMLImageElement>;
|
|
40
23
|
/**
|
|
41
24
|
* 加载图片时的回调
|
|
42
25
|
*/
|
|
@@ -55,10 +38,9 @@ interface LazyImageStates {
|
|
|
55
38
|
}
|
|
56
39
|
declare class LazyImage extends React.Component<LazyImageProps, LazyImageStates> {
|
|
57
40
|
static defaultProps: {
|
|
41
|
+
tagName: string;
|
|
58
42
|
className: string;
|
|
59
|
-
|
|
60
|
-
isMobile: boolean;
|
|
61
|
-
active: boolean;
|
|
43
|
+
imgHTMLAttributes: {};
|
|
62
44
|
};
|
|
63
45
|
prefixCls: string;
|
|
64
46
|
rootRef: React.RefObject<HTMLImageElement>;
|
|
@@ -71,8 +53,6 @@ declare class LazyImage extends React.Component<LazyImageProps, LazyImageStates>
|
|
|
71
53
|
* 监听原生lazy loading, 并回调不同的事件
|
|
72
54
|
*/
|
|
73
55
|
originalLazyLoad: () => void;
|
|
74
|
-
onMouseOut: (ev: MouseEvent<HTMLImageElement>) => void;
|
|
75
|
-
onMouseOver: (ev: MouseEvent<HTMLImageElement>) => void;
|
|
76
56
|
render(): JSX.Element;
|
|
77
57
|
}
|
|
78
58
|
export default LazyImage;
|
package/esm/lazy-image/index.js
CHANGED
|
@@ -32,6 +32,16 @@ var __assign = this && this.__assign || function () {
|
|
|
32
32
|
};
|
|
33
33
|
return __assign.apply(this, arguments);
|
|
34
34
|
};
|
|
35
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) {
|
|
38
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
39
|
+
}
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
35
45
|
import React from 'react';
|
|
36
46
|
import classNames from 'classnames';
|
|
37
47
|
function noop() {}
|
|
@@ -90,36 +100,6 @@ var LazyImage = /** @class */function (_super) {
|
|
|
90
100
|
};
|
|
91
101
|
}
|
|
92
102
|
};
|
|
93
|
-
_this.onMouseOut = function (ev) {
|
|
94
|
-
if (_this.props.isMobile) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
var _a = _this.props,
|
|
98
|
-
hoverOpacity = _a.hoverOpacity,
|
|
99
|
-
onMouseOut = _a.onMouseOut;
|
|
100
|
-
var el = ev.target;
|
|
101
|
-
if (hoverOpacity) {
|
|
102
|
-
el.style.opacity = '1';
|
|
103
|
-
}
|
|
104
|
-
if (onMouseOut) {
|
|
105
|
-
onMouseOut(ev);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
_this.onMouseOver = function (ev) {
|
|
109
|
-
if (_this.props.isMobile) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
var _a = _this.props,
|
|
113
|
-
hoverOpacity = _a.hoverOpacity,
|
|
114
|
-
onMouseOver = _a.onMouseOver;
|
|
115
|
-
var el = ev.target;
|
|
116
|
-
if (hoverOpacity) {
|
|
117
|
-
el.style.opacity = hoverOpacity.toString();
|
|
118
|
-
}
|
|
119
|
-
if (onMouseOver) {
|
|
120
|
-
onMouseOver(ev);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
103
|
_this.state = {
|
|
124
104
|
loading: true
|
|
125
105
|
};
|
|
@@ -141,34 +121,33 @@ var LazyImage = /** @class */function (_super) {
|
|
|
141
121
|
var cls = this.prefixCls;
|
|
142
122
|
var _b = this.props,
|
|
143
123
|
className = _b.className,
|
|
144
|
-
|
|
124
|
+
alt = _b.alt,
|
|
125
|
+
src = _b.src,
|
|
126
|
+
imgHTMLAttributes = _b.imgHTMLAttributes,
|
|
127
|
+
tagName = _b.tagName,
|
|
128
|
+
onError = _b.onError,
|
|
129
|
+
onLoading = _b.onLoading,
|
|
130
|
+
onLoaded = _b.onLoaded,
|
|
131
|
+
extraProps = __rest(_b, ["className", "alt", "src", "imgHTMLAttributes", "tagName", "onError", "onLoading", "onLoaded"]);
|
|
145
132
|
var loading = this.state.loading;
|
|
146
|
-
var
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
delete props.isMobile;
|
|
152
|
-
delete props.active;
|
|
153
|
-
delete props.onLoading;
|
|
154
|
-
delete props.onLoaded;
|
|
155
|
-
return /*#__PURE__*/React.createElement("img", __assign({
|
|
156
|
-
alt: ""
|
|
157
|
-
}, props, {
|
|
158
|
-
className: classNames(cls, className, (_a = {}, _a["".concat(cls, "-loading")] = loading, _a["".concat(cls, "-active")] = loading && active, _a)),
|
|
159
|
-
onMouseOver: this.onMouseOver,
|
|
160
|
-
onMouseOut: this.onMouseOut,
|
|
133
|
+
var Wrapper = tagName;
|
|
134
|
+
// 需要图片根据容器自适应时,需增加mask
|
|
135
|
+
return /*#__PURE__*/React.createElement(Wrapper, __assign({}, extraProps, {
|
|
136
|
+
className: classNames(cls, className, (_a = {}, _a["".concat(cls, "-loading")] = loading, _a))
|
|
137
|
+
}), /*#__PURE__*/React.createElement("img", __assign({
|
|
161
138
|
onFocus: noop,
|
|
162
|
-
onBlur: noop
|
|
139
|
+
onBlur: noop
|
|
140
|
+
}, imgHTMLAttributes, {
|
|
141
|
+
src: src,
|
|
142
|
+
alt: alt,
|
|
163
143
|
ref: this.rootRef,
|
|
164
144
|
loading: "lazy"
|
|
165
|
-
}));
|
|
145
|
+
})));
|
|
166
146
|
};
|
|
167
147
|
LazyImage.defaultProps = {
|
|
148
|
+
tagName: 'div',
|
|
168
149
|
className: '',
|
|
169
|
-
|
|
170
|
-
isMobile: false,
|
|
171
|
-
active: true
|
|
150
|
+
imgHTMLAttributes: {}
|
|
172
151
|
};
|
|
173
152
|
return LazyImage;
|
|
174
153
|
}(React.Component);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ab-lazy-image{transition:opacity .5s}.ab-lazy-image
|
|
1
|
+
.ab-lazy-image{position:relative;overflow:hidden;transition:opacity .5s;display:flex;align-items:center;justify-content:center}.ab-lazy-image::after{display:none;content:"";position:absolute;left:0;top:0;width:100%;height:100%}.ab-lazy-image-loading::after{display:block;background:linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 37%,#f2f2f2 63%);background-size:400% 100%;animation:1.4s infinite ab-skeleton-loading}.ab-lazy-image img{display:block;max-width:100%;max-height:100%}@keyframes ab-skeleton-loading{0%{background-position:100% 50%}100%{background-position:0 50%}}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AddListenerEventRemoveHandler } from '@autobest-ui/utils';
|
|
3
2
|
export interface LoadingContainerProps {
|
|
4
3
|
/**
|
|
5
4
|
* 容器是否loading
|
|
@@ -13,23 +12,6 @@ export interface LoadingContainerProps {
|
|
|
13
12
|
* 内容区域
|
|
14
13
|
*/
|
|
15
14
|
children?: React.ReactElement | React.ReactElement[];
|
|
16
|
-
/**
|
|
17
|
-
* LoadingIcon是否需要保持在可视区域内
|
|
18
|
-
*/
|
|
19
|
-
loadingInView?: boolean;
|
|
20
|
-
}
|
|
21
|
-
declare class LoadingContainer extends React.Component<LoadingContainerProps> {
|
|
22
|
-
prefixCls: string;
|
|
23
|
-
addScrollHandlerListener: AddListenerEventRemoveHandler;
|
|
24
|
-
wrapRef: React.RefObject<HTMLDivElement>;
|
|
25
|
-
iconRef: React.RefObject<HTMLSpanElement>;
|
|
26
|
-
componentDidMount(): void;
|
|
27
|
-
componentDidUpdate(prevProps: Readonly<LoadingContainerProps>): void;
|
|
28
|
-
componentWillUnmount(): void;
|
|
29
|
-
addScrollListener: () => void;
|
|
30
|
-
removeScrollListener: () => void;
|
|
31
|
-
setIconTopStyle: (top: string) => void;
|
|
32
|
-
onHandlerScroll: () => void;
|
|
33
|
-
render(): JSX.Element;
|
|
34
15
|
}
|
|
16
|
+
declare function LoadingContainer(props: LoadingContainerProps): JSX.Element;
|
|
35
17
|
export default LoadingContainer;
|