@arco-design/mobile-react 2.19.2-ee92494.5 → 2.20.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.en-US.md +4 -4
  3. package/README.md +4 -4
  4. package/cjs/avatar/group.js +1 -1
  5. package/cjs/avatar/index.js +10 -13
  6. package/cjs/avatar/style/css/index.css +96 -126
  7. package/cjs/avatar/style/index.less +54 -72
  8. package/cjs/badge/index.js +6 -8
  9. package/cjs/badge/style/css/index.css +5 -5
  10. package/cjs/badge/style/index.less +5 -5
  11. package/cjs/button/demo/style/mobile.less +0 -4
  12. package/cjs/button/hooks.d.ts +1 -2
  13. package/cjs/button/hooks.js +5 -3
  14. package/cjs/button/index.d.ts +1 -1
  15. package/cjs/button/index.js +28 -33
  16. package/cjs/button/style/css/index.css +75 -310
  17. package/cjs/button/style/index.less +32 -38
  18. package/cjs/dropdown/dropdown.d.ts +3 -0
  19. package/cjs/dropdown/dropdown.js +306 -0
  20. package/cjs/dropdown/index.d.ts +3 -4
  21. package/cjs/dropdown/index.js +3 -303
  22. package/cjs/dropdown/options.js +2 -1
  23. package/cjs/dropdown/type.d.ts +20 -9
  24. package/cjs/dropdown-menu/dropdown-menu.d.ts +4 -0
  25. package/cjs/dropdown-menu/dropdown-menu.js +273 -0
  26. package/cjs/dropdown-menu/helper.d.ts +1 -1
  27. package/cjs/dropdown-menu/index.d.ts +2 -3
  28. package/cjs/dropdown-menu/index.js +2 -245
  29. package/cjs/dropdown-menu/type.d.ts +21 -20
  30. package/cjs/image/index.js +4 -1
  31. package/cjs/image/style/css/index.css +2 -1
  32. package/cjs/image/style/index.less +2 -1
  33. package/cjs/image-picker/index.d.ts +6 -6
  34. package/cjs/image-picker/index.js +4 -3
  35. package/cjs/nav-bar/index.js +7 -2
  36. package/cjs/show-monitor/index.js +31 -3
  37. package/dist/index.js +644 -604
  38. package/dist/index.min.js +3 -3
  39. package/dist/style.css +174 -438
  40. package/dist/style.min.css +1 -1
  41. package/esm/avatar/group.js +1 -1
  42. package/esm/avatar/index.js +10 -13
  43. package/esm/avatar/style/css/index.css +96 -126
  44. package/esm/avatar/style/index.less +54 -72
  45. package/esm/badge/index.js +6 -8
  46. package/esm/badge/style/css/index.css +5 -5
  47. package/esm/badge/style/index.less +5 -5
  48. package/esm/button/demo/style/mobile.less +0 -4
  49. package/esm/button/hooks.d.ts +1 -2
  50. package/esm/button/hooks.js +5 -3
  51. package/esm/button/index.d.ts +1 -1
  52. package/esm/button/index.js +30 -35
  53. package/esm/button/style/css/index.css +75 -310
  54. package/esm/button/style/index.less +32 -38
  55. package/esm/dropdown/dropdown.d.ts +3 -0
  56. package/esm/dropdown/dropdown.js +288 -0
  57. package/esm/dropdown/index.d.ts +3 -4
  58. package/esm/dropdown/index.js +3 -293
  59. package/esm/dropdown/options.js +2 -1
  60. package/esm/dropdown/type.d.ts +20 -9
  61. package/esm/dropdown-menu/dropdown-menu.d.ts +4 -0
  62. package/esm/dropdown-menu/dropdown-menu.js +256 -0
  63. package/esm/dropdown-menu/helper.d.ts +1 -1
  64. package/esm/dropdown-menu/index.d.ts +2 -3
  65. package/esm/dropdown-menu/index.js +2 -237
  66. package/esm/dropdown-menu/type.d.ts +21 -20
  67. package/esm/image/index.js +4 -1
  68. package/esm/image/style/css/index.css +2 -1
  69. package/esm/image/style/index.less +2 -1
  70. package/esm/image-picker/index.d.ts +6 -6
  71. package/esm/image-picker/index.js +4 -3
  72. package/esm/nav-bar/index.js +6 -2
  73. package/esm/show-monitor/index.js +31 -3
  74. package/package.json +3 -3
  75. package/tokens/app/arcodesign/default/css-variables.less +2 -1
  76. package/tokens/app/arcodesign/default/index.d.ts +2 -1
  77. package/tokens/app/arcodesign/default/index.js +2 -1
  78. package/tokens/app/arcodesign/default/index.json +27 -15
  79. package/tokens/app/arcodesign/default/index.less +2 -1
  80. package/umd/avatar/group.js +1 -1
  81. package/umd/avatar/index.js +10 -13
  82. package/umd/avatar/style/css/index.css +96 -126
  83. package/umd/avatar/style/index.less +54 -72
  84. package/umd/badge/index.js +6 -8
  85. package/umd/badge/style/css/index.css +5 -5
  86. package/umd/badge/style/index.less +5 -5
  87. package/umd/button/demo/style/mobile.less +0 -4
  88. package/umd/button/hooks.d.ts +1 -2
  89. package/umd/button/hooks.js +5 -3
  90. package/umd/button/index.d.ts +1 -1
  91. package/umd/button/index.js +28 -33
  92. package/umd/button/style/css/index.css +75 -310
  93. package/umd/button/style/index.less +32 -38
  94. package/umd/dropdown/dropdown.d.ts +3 -0
  95. package/umd/dropdown/dropdown.js +309 -0
  96. package/umd/dropdown/index.d.ts +3 -4
  97. package/umd/dropdown/index.js +5 -298
  98. package/umd/dropdown/options.js +2 -1
  99. package/umd/dropdown/type.d.ts +20 -9
  100. package/umd/dropdown-menu/dropdown-menu.d.ts +4 -0
  101. package/umd/dropdown-menu/dropdown-menu.js +278 -0
  102. package/umd/dropdown-menu/helper.d.ts +1 -1
  103. package/umd/dropdown-menu/index.d.ts +2 -3
  104. package/umd/dropdown-menu/index.js +5 -241
  105. package/umd/dropdown-menu/type.d.ts +21 -20
  106. package/umd/image/index.js +4 -1
  107. package/umd/image/style/css/index.css +2 -1
  108. package/umd/image/style/index.less +2 -1
  109. package/umd/image-picker/index.d.ts +6 -6
  110. package/umd/image-picker/index.js +4 -3
  111. package/umd/nav-bar/index.js +9 -6
  112. package/umd/show-monitor/index.js +31 -3
@@ -6,21 +6,29 @@
6
6
 
7
7
  .button-has-border(@color) {
8
8
  .use-var(border, @color, 1PX solid);
9
- &.half-border:not(.has-custom-border) {
9
+ &.half-border {
10
10
  border-width: 0;
11
11
  .hairline-var(@color);
12
12
  }
13
13
  }
14
14
 
15
+ .button-has-border-value(@value) {
16
+ border: 1PX solid @value;
17
+ &.half-border {
18
+ border-width: 0;
19
+ .hairline(@value);
20
+ }
21
+ }
22
+
15
23
  .button-no-border() {
16
24
  border-width: 0;
17
25
  box-shadow: none;
18
26
  }
19
27
 
20
28
  .button-text-size(@font-size) {
21
- .btn-icon,
29
+ .@{prefix}-button-icon,
22
30
  i,
23
- .btn-text,
31
+ .@{prefix}-button-text,
24
32
  svg {
25
33
  .use-var(font-size, @font-size);
26
34
  }
@@ -28,10 +36,10 @@
28
36
 
29
37
  .button-size-height(@height) {
30
38
  .use-var(height, @height);
31
- &.is-round {
39
+ &-is-round {
32
40
  .use-var(border-radius, @height);
33
41
  }
34
- &.is-square {
42
+ &-is-square {
35
43
  .rem(border-radius, 0);
36
44
  }
37
45
  }
@@ -44,45 +52,48 @@
44
52
  display: block;
45
53
  width: 100%;
46
54
  box-sizing: border-box;
55
+ .use-var(line-height, button-line-height);
47
56
  .use-var(border-radius, button-radius);
48
- .button-has-border(button-border-color);
49
57
  .noselect();
50
58
 
51
- &.inline {
59
+ &-inline {
52
60
  width: auto;
53
61
  display: inline-block;
54
62
  }
55
63
 
56
64
  .set-button-type(length(@type-map));
57
65
 
66
+ &-type-ghost {
67
+ .button-has-border-value(currentColor);
68
+ }
69
+
58
70
  .set-button-size(length(@size-map));
59
71
 
60
- &.android .btn-text {
72
+ &-text-android {
61
73
  .rem(padding-top, 2);
62
74
  }
63
75
 
64
- .btn-icon {
76
+ &-icon {
65
77
  vertical-align: middle;
66
78
  display: inline-flex;
67
79
  align-items: center;
68
80
  justify-content: center;
69
81
  }
70
- .btn-text {
71
- .rem(font-size, 15);
82
+ &-text {
72
83
  display: inline-block;
73
84
  vertical-align: middle;
74
85
  }
75
- .btn-text.has-icon {
76
- .rem(margin-left, 4);
86
+ &-text-has-icon {
87
+ .use-var(margin-left, button-icon-text-gutter);
77
88
  }
78
89
 
79
- .loading-icon {
90
+ &-loading-icon {
80
91
  display: inline-block;
81
92
  vertical-align: middle;
93
+ }
82
94
 
83
- & + .btn-text {
84
- .rem(margin-left, 8);
85
- }
95
+ &.has-custom-border {
96
+ border: 1PX solid;
86
97
  }
87
98
  }
88
99
 
@@ -90,33 +101,16 @@
90
101
  .set-button-type(@index) when (@index > 0) {
91
102
  @type: extract(@type-map, @index);
92
103
 
93
- &.type-@{type} {
94
- .button-has-border('button-@{type}-background');
104
+ &-type-@{type} {
95
105
  .use-var(background, 'button-@{type}-background');
96
106
  .use-var(color, 'button-@{type}-text-color');
97
107
  .set-loading-color-var('button-@{type}-text-color');
98
- &.disabled {
99
- &.ios,
100
- &.android {
101
- .button-no-border();
102
- }
108
+ &-disabled {
103
109
  .use-var(background, 'button-@{type}-disabled-background');
104
110
  .use-var(color, 'button-@{type}-disabled-text-color')
105
111
  }
106
- &.active {
112
+ &-active {
107
113
  .use-var(background, 'button-@{type}-clicked-background');
108
- .button-has-border('button-@{type}-clicked-background');
109
- }
110
- }
111
-
112
- &.type-ghost {
113
- &, &.active {
114
- .button-has-border(button-ghost-text-color);
115
- }
116
- &.disabled {
117
- &.ios, &.android {
118
- .button-has-border(button-ghost-disabled-text-color);
119
- }
120
114
  }
121
115
  }
122
116
 
@@ -126,7 +120,7 @@
126
120
  .set-button-size(@index) when (@index > 0) {
127
121
  @size: extract(@size-map, @index);
128
122
 
129
- &.size-@{size} {
123
+ &-size-@{size} {
130
124
  .use-var(padding, "button-@{size}-padding");
131
125
  .button-size-height("button-@{size}-height");
132
126
  .button-text-size("button-@{size}-text-size");
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { DropdownOptionsProps, DropdownOptionsRef, DropdownRef } from './type';
3
+ export declare function componentGenerator<P extends DropdownOptionsProps = DropdownOptionsProps, R extends DropdownOptionsRef = DropdownOptionsRef>(Comp: React.ForwardRefExoticComponent<P & React.RefAttributes<R>>): React.ForwardRefExoticComponent<(import("./type").DropdownBasicProps & import("./type").SingleOptionProps & React.RefAttributes<DropdownRef>) | (import("./type").DropdownBasicProps & import("./type").MultipleOptionProps & React.RefAttributes<DropdownRef>)>;
@@ -0,0 +1,288 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React, { useRef, useEffect, useCallback, forwardRef, useImperativeHandle, useState } from 'react';
3
+ import { cls, nextTick } from '@arco-design/mobile-utils';
4
+ import { CSSTransition } from 'react-transition-group';
5
+ import { ContextLayout } from '../context-provider';
6
+ import { getStyleWithVendor, usePopupScroll, usePreventBodyScroll, useSystem, useWindowSize } from '../_helpers';
7
+ import Portal from '../portal';
8
+ export function componentGenerator(Comp) {
9
+ return /*#__PURE__*/forwardRef(function (props, ref) {
10
+ var optionsWrapper = useRef(null);
11
+ var domRef = useRef(null);
12
+ var _props$className = props.className,
13
+ className = _props$className === void 0 ? '' : _props$className,
14
+ _props$style = props.style,
15
+ style = _props$style === void 0 ? {} : _props$style,
16
+ _props$options = props.options,
17
+ options = _props$options === void 0 ? [] : _props$options,
18
+ _props$showDropdown = props.showDropdown,
19
+ showDropdown = _props$showDropdown === void 0 ? false : _props$showDropdown,
20
+ _props$showMask = props.showMask,
21
+ showMask = _props$showMask === void 0 ? true : _props$showMask,
22
+ _props$direction = props.direction,
23
+ direction = _props$direction === void 0 ? 'down' : _props$direction,
24
+ height = props.height,
25
+ _props$maxHeight = props.maxHeight,
26
+ maxHeight = _props$maxHeight === void 0 ? 500 : _props$maxHeight,
27
+ _props$touchToClose = props.touchToClose,
28
+ touchToClose = _props$touchToClose === void 0 ? true : _props$touchToClose,
29
+ useColumn = props.useColumn,
30
+ optionIcon = props.optionIcon,
31
+ multiple = props.multiple,
32
+ defaultSelectedValue = props.defaultSelectedValue,
33
+ onCancel = props.onCancel,
34
+ getAnchorElement = props.getAnchorElement,
35
+ isStopTouchEl = props.isStopTouchEl,
36
+ getStopTouchElements = props.getStopTouchElements,
37
+ _props$getScrollConta = props.getScrollContainer,
38
+ getScrollContainer = _props$getScrollConta === void 0 ? function () {
39
+ return optionsWrapper.current;
40
+ } : _props$getScrollConta,
41
+ getPortalContainer = props.getPortalContainer,
42
+ _props$clickOtherToCl = props.clickOtherToClose,
43
+ clickOtherToClose = _props$clickOtherToCl === void 0 ? true : _props$clickOtherToCl,
44
+ _props$dropdownAnimat = props.dropdownAnimationTimeout,
45
+ dropdownAnimationTimeout = _props$dropdownAnimat === void 0 ? 300 : _props$dropdownAnimat,
46
+ _props$dropdownAnimat2 = props.dropdownAnimationFunction,
47
+ dropdownAnimationFunction = _props$dropdownAnimat2 === void 0 ? 'cubic-bezier(0.32, 0.96, 0.6, 1)' : _props$dropdownAnimat2,
48
+ _props$maskAnimationT = props.maskAnimationTimeout,
49
+ maskAnimationTimeout = _props$maskAnimationT === void 0 ? 500 : _props$maskAnimationT,
50
+ _props$maskAnimationF = props.maskAnimationFunction,
51
+ maskAnimationFunction = _props$maskAnimationF === void 0 ? 'cubic-bezier(0.32, 0.96, 0.6, 1)' : _props$maskAnimationF,
52
+ _props$mountOnEnter = props.mountOnEnter,
53
+ mountOnEnter = _props$mountOnEnter === void 0 ? true : _props$mountOnEnter,
54
+ _props$unmountOnExit = props.unmountOnExit,
55
+ unmountOnExit = _props$unmountOnExit === void 0 ? true : _props$unmountOnExit,
56
+ _props$preventBodyScr = props.preventBodyScroll,
57
+ preventBodyScroll = _props$preventBodyScr === void 0 ? true : _props$preventBodyScr,
58
+ initialBodyOverflow = props.initialBodyOverflow;
59
+ var system = useSystem();
60
+
61
+ var _useWindowSize = useWindowSize(),
62
+ windowHeight = _useWindowSize.windowHeight,
63
+ windowWidth = _useWindowSize.windowWidth;
64
+
65
+ var _useState = useState({
66
+ top: '',
67
+ bottom: ''
68
+ }),
69
+ positionStyle = _useState[0],
70
+ setPositionStyle = _useState[1];
71
+
72
+ var _useState2 = useState(function () {
73
+ var defaultValue = multiple ? [] : 0;
74
+ return defaultSelectedValue !== void 0 ? defaultSelectedValue : defaultValue;
75
+ }),
76
+ innerValue = _useState2[0],
77
+ setInnerValue = _useState2[1]; // down=0为向上展开,1为向下展开
78
+ // @en down=0 is to expand upwards, 1 is to expand downwards
79
+
80
+
81
+ var _useState3 = useState(direction === 'down'),
82
+ down = _useState3[0],
83
+ setDown = _useState3[1];
84
+
85
+ var maskHeight = useRef(0);
86
+ var optionsContainer = useRef(null);
87
+ var dropdownContainer = useRef(null);
88
+
89
+ var _useState4 = useState(0),
90
+ optionsWrapperHeight = _useState4[0],
91
+ setOptionsWrapperHeight = _useState4[1];
92
+ /**
93
+ * 判断是否阻止touch事件
94
+ * @en Determine whether to block touch events
95
+ * */
96
+
97
+
98
+ var ifStopTouch = function ifStopTouch(el) {
99
+ var _dropdownContainer$cu;
100
+
101
+ if (isStopTouchEl) return isStopTouchEl(el);
102
+ var tempEl = el;
103
+ var elements = getStopTouchElements ? getStopTouchElements() : [(_dropdownContainer$cu = dropdownContainer.current) == null ? void 0 : _dropdownContainer$cu.parentElement];
104
+
105
+ for (var i = 0; i < elements.length; i++) {
106
+ while (tempEl && elements[i]) {
107
+ if (tempEl === elements[i]) {
108
+ return true;
109
+ }
110
+
111
+ tempEl = tempEl.parentElement;
112
+ }
113
+ }
114
+
115
+ return false;
116
+ };
117
+
118
+ usePopupScroll(showDropdown, domRef.current, getScrollContainer);
119
+ usePreventBodyScroll(showDropdown, preventBodyScroll, initialBodyOverflow);
120
+ useEffect(function () {
121
+ var _dropdownContainer$cu2;
122
+
123
+ // 为0的时候不改变
124
+ // @en Does not change when it is 0
125
+ if (optionsWrapperHeight === 0) return;
126
+ var tempEl = getAnchorElement ? getAnchorElement() : (_dropdownContainer$cu2 = dropdownContainer.current) == null ? void 0 : _dropdownContainer$cu2.parentElement;
127
+
128
+ var _ref = (tempEl == null ? void 0 : tempEl.getBoundingClientRect()) || {
129
+ bottom: 0,
130
+ top: 0
131
+ },
132
+ bottom = _ref.bottom,
133
+ top = _ref.top;
134
+
135
+ var tempTop = props.top || bottom;
136
+ var tempBottom = props.bottom || windowHeight - top;
137
+ var tempMaskHeight = windowHeight - tempTop; // 没有指定方向,且空间足够时,或向上展开的空间不够,向下展开
138
+ // @en If there is no specified direction and there is enough space, or there is not enough space to expand upward, expand downward
139
+
140
+ var tempDown = direction !== 'up' && optionsWrapperHeight < tempMaskHeight || optionsWrapperHeight > tempTop;
141
+
142
+ if (tempDown) {
143
+ maskHeight.current = tempMaskHeight;
144
+ setPositionStyle({
145
+ top: tempTop + "px",
146
+ bottom: ''
147
+ });
148
+ } else {
149
+ maskHeight.current = windowHeight - tempBottom;
150
+ setPositionStyle({
151
+ top: '',
152
+ bottom: tempBottom + "px"
153
+ });
154
+ }
155
+
156
+ setDown(tempDown);
157
+ }, [dropdownContainer, optionsWrapperHeight, props.top, props.bottom, Boolean(getAnchorElement), direction, windowHeight]);
158
+ /**
159
+ * 取消选择
160
+ * @en Cancel selection
161
+ * */
162
+
163
+ var handleCancel = useCallback(function (e) {
164
+ var optionsWrapperDom = optionsWrapper.current;
165
+
166
+ if (!e || !optionsWrapperDom) {
167
+ return;
168
+ }
169
+
170
+ var target = e.target;
171
+
172
+ if (!optionsWrapperDom.contains(target) && !ifStopTouch(target)) {
173
+ onCancel();
174
+ }
175
+
176
+ e.stopPropagation();
177
+ }, [ifStopTouch, onCancel]);
178
+ /**
179
+ * 当面板放下时,给body添加事件监听,面板收起时,移除
180
+ * @en When the panel is down, add an event listener to the body, and when the panel is retracted, remove it
181
+ * */
182
+
183
+ useEffect(function () {
184
+ var needBind = showDropdown && clickOtherToClose;
185
+ var event = touchToClose ? 'touchstart' : 'click';
186
+
187
+ if (needBind) {
188
+ document.addEventListener(event, handleCancel);
189
+ }
190
+
191
+ return function () {
192
+ if (needBind) {
193
+ document.removeEventListener(event, handleCancel);
194
+ }
195
+ };
196
+ }, [showDropdown, clickOtherToClose, handleCancel]);
197
+ useEffect(function () {
198
+ nextTick(function () {
199
+ if (height !== void 0) {
200
+ // 受控模式下,完全交由外层控制
201
+ // @en In controlled mode, it is completely controlled by the outer layer
202
+ setOptionsWrapperHeight(height);
203
+ } else {
204
+ if (!optionsContainer.current) return;
205
+ if (!showDropdown) setOptionsWrapperHeight(0);else {
206
+ setOptionsWrapperHeight(optionsContainer.current.getBoundingClientRect().height);
207
+ }
208
+ }
209
+ });
210
+ }, [showDropdown, options.length, height]);
211
+ useImperativeHandle(ref, function () {
212
+ return {
213
+ dom: domRef.current
214
+ };
215
+ });
216
+
217
+ function getOptionsStyle() {
218
+ var trans = down ? 'translateY(-100%)' : 'translateY(100%)';
219
+ return getStyleWithVendor({
220
+ // height: `${optionsWrapperHeight}px`,
221
+ transform: optionsWrapperHeight ? '' : trans,
222
+ transition: "transform " + dropdownAnimationTimeout + "ms " + dropdownAnimationFunction,
223
+ overflow: optionsWrapperHeight > maxHeight || height ? 'auto' : 'hidden',
224
+ maxHeight: maxHeight + "px"
225
+ });
226
+ }
227
+
228
+ function renderInnerOptions() {
229
+ var value = props.selectedValue !== void 0 ? props.selectedValue : innerValue;
230
+ var optionProps = {
231
+ options: options,
232
+ useColumn: useColumn,
233
+ icon: optionIcon,
234
+ selectedValue: value,
235
+ multiple: props.multiple,
236
+ onOptionClick: props.onOptionClick,
237
+ onOptionChange: function onOptionChange(vals, op) {
238
+ setInnerValue(vals);
239
+ props.onOptionChange == null ? void 0 : props.onOptionChange(vals, op);
240
+ }
241
+ };
242
+ return /*#__PURE__*/React.createElement(Comp, optionProps);
243
+ }
244
+
245
+ return /*#__PURE__*/React.createElement(ContextLayout, null, function (_ref2) {
246
+ var prefixCls = _ref2.prefixCls;
247
+ return /*#__PURE__*/React.createElement("div", {
248
+ ref: dropdownContainer
249
+ }, /*#__PURE__*/React.createElement(Portal, {
250
+ getContainer: getPortalContainer
251
+ }, /*#__PURE__*/React.createElement(CSSTransition, {
252
+ in: showDropdown,
253
+ timeout: Math.max(dropdownAnimationTimeout, maskAnimationTimeout),
254
+ onEnter: function onEnter(el) {
255
+ el.style.visibility = 'visible';
256
+ },
257
+ onExited: function onExited(el) {
258
+ el.style.visibility = 'hidden';
259
+ },
260
+ mountOnEnter: mountOnEnter,
261
+ unmountOnExit: unmountOnExit
262
+ }, /*#__PURE__*/React.createElement("div", {
263
+ className: cls(prefixCls + "-dropdown all-border-box", system, className, {
264
+ 'drop-up': !down
265
+ }),
266
+ ref: domRef,
267
+ style: _extends({
268
+ height: maskHeight.current + "px",
269
+ maxWidth: windowWidth + "px"
270
+ }, style, positionStyle)
271
+ }, /*#__PURE__*/React.createElement("div", {
272
+ className: cls(prefixCls + "-dropdown-options"),
273
+ ref: optionsWrapper,
274
+ style: getOptionsStyle()
275
+ }, /*#__PURE__*/React.createElement("div", {
276
+ className: cls(prefixCls + "-dropdown-options-container"),
277
+ ref: optionsContainer
278
+ }, props.children || renderInnerOptions(), props.extraNode)), showMask && /*#__PURE__*/React.createElement("div", {
279
+ className: cls(prefixCls + "-dropdown-mask", {
280
+ 'is-show': optionsWrapperHeight
281
+ }),
282
+ style: {
283
+ transition: "opacity " + maskAnimationTimeout + "ms " + maskAnimationFunction
284
+ }
285
+ })))));
286
+ });
287
+ });
288
+ }
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
- import { DropdownRef } from './type';
1
+ /// <reference types="react" />
3
2
  export * from './type';
4
- declare const _default: React.ForwardRefExoticComponent<(import("./type").DropdownBasicProps & import("./type").SingleOptionProps & React.RefAttributes<DropdownRef>) | (import("./type").DropdownBasicProps & import("./type").MultipleOptionProps & React.RefAttributes<DropdownRef>)> & {
5
- Options: React.ForwardRefExoticComponent<(import("./type").DropdownOptionsBasicProps & import("./type").SingleOptionProps & React.RefAttributes<import("./type").DropdownOptionsRef>) | (import("./type").DropdownOptionsBasicProps & import("./type").MultipleOptionProps & React.RefAttributes<import("./type").DropdownOptionsRef>)>;
3
+ declare const _default: import("react").ForwardRefExoticComponent<(import("./type").DropdownBasicProps & import("./type").SingleOptionProps & import("react").RefAttributes<import("./type").DropdownRef>) | (import("./type").DropdownBasicProps & import("./type").MultipleOptionProps & import("react").RefAttributes<import("./type").DropdownRef>)> & {
4
+ Options: import("react").ForwardRefExoticComponent<(import("./type").DropdownOptionsBasicProps & import("./type").SingleOptionProps & import("react").RefAttributes<import("./type").DropdownOptionsRef>) | (import("./type").DropdownOptionsBasicProps & import("./type").MultipleOptionProps & import("react").RefAttributes<import("./type").DropdownOptionsRef>)>;
6
5
  };
7
6
  /**
8
7
  * 下拉面板,展示供选择的选择项