@kdcloudjs/kdesign 1.8.2 → 1.8.4
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/dist/kdesign-complete.less +53 -21
- package/dist/kdesign.css +43 -10
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +132 -106
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +7 -7
- package/dist/kdesign.min.js.map +1 -1
- package/es/base-data/base-data.js +1 -1
- package/es/carousel/carousel.js +29 -13
- package/es/carousel/slideList.js +1 -1
- package/es/color-picker/color-picker-panel.js +3 -2
- package/es/color-picker/style/index.css +19 -2
- package/es/color-picker/style/index.less +19 -1
- package/es/popper/index.d.ts +1 -0
- package/es/popper/index.js +3 -1
- package/es/popper/style/index.css +4 -4
- package/es/popper/style/index.less +4 -4
- package/es/select/select.js +2 -2
- package/es/signature/drawingBoard.js +2 -2
- package/es/signature/signature.js +9 -6
- package/es/signature/style/index.css +18 -2
- package/es/signature/style/index.less +28 -14
- package/es/style/core/reset.less +2 -2
- package/es/style/index.css +1 -1
- package/lib/base-data/base-data.js +1 -1
- package/lib/carousel/carousel.js +29 -13
- package/lib/carousel/slideList.js +1 -1
- package/lib/color-picker/color-picker-panel.js +3 -2
- package/lib/color-picker/style/index.css +19 -2
- package/lib/color-picker/style/index.less +19 -1
- package/lib/popper/index.d.ts +1 -0
- package/lib/popper/index.js +3 -1
- package/lib/popper/style/index.css +4 -4
- package/lib/popper/style/index.less +4 -4
- package/lib/select/select.js +2 -2
- package/lib/signature/drawingBoard.js +2 -2
- package/lib/signature/signature.js +9 -6
- package/lib/signature/style/index.css +18 -2
- package/lib/signature/style/index.less +28 -14
- package/lib/style/core/reset.less +2 -2
- package/lib/style/index.css +1 -1
- package/package.json +1 -1
|
@@ -200,7 +200,7 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
200
200
|
var _a;
|
|
201
201
|
var inputDom = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
|
|
202
202
|
if (!inputDom) return;
|
|
203
|
-
if (inputDom.scrollWidth - inputDom.offsetWidth > 0) {
|
|
203
|
+
if (inputDom.scrollWidth - inputDom.offsetWidth > 0 && inputValue) {
|
|
204
204
|
setShowTotal(true);
|
|
205
205
|
} else {
|
|
206
206
|
setShowTotal(false);
|
package/es/carousel/carousel.js
CHANGED
|
@@ -54,6 +54,17 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
54
54
|
var carouselRef = React.useRef();
|
|
55
55
|
var listRef = React.useRef();
|
|
56
56
|
var autoplayRef = React.useRef();
|
|
57
|
+
var processChildren = function processChildren(children) {
|
|
58
|
+
var childCount = React.Children.count(children);
|
|
59
|
+
if (childCount === 0) {
|
|
60
|
+
return [];
|
|
61
|
+
} else if (childCount === 1) {
|
|
62
|
+
return [children];
|
|
63
|
+
} else {
|
|
64
|
+
return React.Children.toArray(children);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var tempChild = processChildren(children);
|
|
57
68
|
var isScrollxEffect = React.useMemo(function () {
|
|
58
69
|
return effect === 'scrollx';
|
|
59
70
|
}, [effect]);
|
|
@@ -73,16 +84,18 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
73
84
|
}, [itemWidth]);
|
|
74
85
|
var setScrollXEffectStyle = React.useCallback(function () {
|
|
75
86
|
var _context;
|
|
76
|
-
|
|
87
|
+
var tempChild = processChildren(children);
|
|
88
|
+
if (!listRef.current || tempChild.length <= 1) return;
|
|
77
89
|
listRef.current.style.cssText = needAnimation ? _concatInstanceProperty(_context = "transform: translateX(".concat(posX, "px); transition:all 0.3s ")).call(_context, easing) : "transform: translateX(".concat(posX, "px); transition:none");
|
|
78
90
|
}, [children === null || children === void 0 ? void 0 : children.length, needAnimation, easing, posX]);
|
|
79
91
|
var jumpTo = React.useCallback(function (index, needAnimation) {
|
|
92
|
+
var tempChild = processChildren(children);
|
|
80
93
|
if (isFadeEffect) {
|
|
81
|
-
if (index === -1 || index ===
|
|
94
|
+
if (index === -1 || index === tempChild.length) index = 0;
|
|
82
95
|
beforeChange && beforeChange(currentIndex, index);
|
|
83
96
|
setCurrentIndex(index);
|
|
84
97
|
setNeedAnimation(needAnimation);
|
|
85
|
-
} else if (index >= -1 && index <=
|
|
98
|
+
} else if (index >= -1 && index <= tempChild.length) {
|
|
86
99
|
beforeChange && beforeChange(currentIndex, index);
|
|
87
100
|
setCurrentIndex(index);
|
|
88
101
|
setNeedAnimation(needAnimation);
|
|
@@ -169,8 +182,9 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
169
182
|
setNeedAnimation(true);
|
|
170
183
|
}, [beforeChange, currentIndex]);
|
|
171
184
|
var handleTransitionEnd = React.useCallback(function () {
|
|
172
|
-
|
|
173
|
-
|
|
185
|
+
var tempChild = processChildren(children);
|
|
186
|
+
if (!autoplay || !(tempChild === null || tempChild === void 0 ? void 0 : tempChild.length)) return;
|
|
187
|
+
var childrenL = tempChild.length;
|
|
174
188
|
var newCurrentIndex = currentIndex;
|
|
175
189
|
if (isScrollxEffect) {
|
|
176
190
|
if (currentIndex === -1) {
|
|
@@ -192,10 +206,11 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
192
206
|
}, [play, autoplay]);
|
|
193
207
|
var rootClassName = classNames(className, _defineProperty({}, "".concat(carouselPrefixCls, "-root"), true));
|
|
194
208
|
var renderDisplayList = function renderDisplayList() {
|
|
209
|
+
var tempChild = processChildren(children);
|
|
195
210
|
var content;
|
|
196
211
|
if (isFadeEffect) {
|
|
197
212
|
content = /*#__PURE__*/React.createElement(FadeList, {
|
|
198
|
-
items:
|
|
213
|
+
items: tempChild,
|
|
199
214
|
parentPrefixCls: carouselPrefixCls,
|
|
200
215
|
needAnimation: needAnimation,
|
|
201
216
|
currentIndex: currentIndex,
|
|
@@ -204,14 +219,14 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
204
219
|
});
|
|
205
220
|
} else if (isNoneEffect) {
|
|
206
221
|
content = /*#__PURE__*/React.createElement(DisplayList, {
|
|
207
|
-
items:
|
|
222
|
+
items: tempChild,
|
|
208
223
|
parentPrefixCls: carouselPrefixCls,
|
|
209
224
|
currentIndex: currentIndex,
|
|
210
225
|
ref: listRef
|
|
211
226
|
});
|
|
212
227
|
} else {
|
|
213
228
|
content = /*#__PURE__*/React.createElement(SlideList, {
|
|
214
|
-
items:
|
|
229
|
+
items: tempChild,
|
|
215
230
|
parentPrefixCls: carouselPrefixCls,
|
|
216
231
|
currentIndex: currentIndex,
|
|
217
232
|
ref: listRef
|
|
@@ -220,7 +235,8 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
220
235
|
return content;
|
|
221
236
|
};
|
|
222
237
|
var renderJumpNode = function renderJumpNode() {
|
|
223
|
-
|
|
238
|
+
var tempChild = processChildren(children);
|
|
239
|
+
if ((tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) && jumpNode) {
|
|
224
240
|
var jumpClassPrefix = "".concat(carouselPrefixCls, "-jump");
|
|
225
241
|
var leftClick = function leftClick(e) {
|
|
226
242
|
e.stopPropagation();
|
|
@@ -230,7 +246,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
230
246
|
};
|
|
231
247
|
var rightClick = function rightClick(e) {
|
|
232
248
|
e.stopPropagation();
|
|
233
|
-
if (currentIndex !==
|
|
249
|
+
if (currentIndex !== tempChild.length - 1) {
|
|
234
250
|
next();
|
|
235
251
|
}
|
|
236
252
|
};
|
|
@@ -258,7 +274,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
258
274
|
onClick: leftClick
|
|
259
275
|
}));
|
|
260
276
|
var rightNode = /*#__PURE__*/React.createElement("div", {
|
|
261
|
-
className: classNames(jumpClassPrefix, "".concat(jumpClassPrefix, "-right"), _defineProperty({}, "".concat(jumpClassPrefix, "-disabled"), currentIndex >=
|
|
277
|
+
className: classNames(jumpClassPrefix, "".concat(jumpClassPrefix, "-right"), _defineProperty({}, "".concat(jumpClassPrefix, "-disabled"), currentIndex >= tempChild.length - 1))
|
|
262
278
|
}, Array.isArray(jumpNode) && jumpNode.length > 1 && /*#__PURE__*/isValidElement(jumpNode[1]) ? /*#__PURE__*/React.cloneElement(jumpNode[1], mergeNode(jumpNode[1], 'right')) : /*#__PURE__*/React.createElement(Icon, {
|
|
263
279
|
className: "".concat(jumpClassPrefix, "-icon"),
|
|
264
280
|
type: 'arrow-right-circle-solid',
|
|
@@ -277,8 +293,8 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
277
293
|
style: style,
|
|
278
294
|
onMouseEnter: handleMouseEnter,
|
|
279
295
|
onMouseLeave: handleMouseLeave
|
|
280
|
-
}, (
|
|
281
|
-
number:
|
|
296
|
+
}, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) ? renderDisplayList() : null, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) && showDot() ? /*#__PURE__*/React.createElement(Slidebar, {
|
|
297
|
+
number: tempChild.length,
|
|
282
298
|
currentIndex: currentIndex,
|
|
283
299
|
dotsClassName: dots,
|
|
284
300
|
parentPrefixCls: carouselPrefixCls,
|
package/es/carousel/slideList.js
CHANGED
|
@@ -13,7 +13,7 @@ export var SlideList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
13
13
|
var listPrefixCls = "".concat(parentPrefixCls, "-list");
|
|
14
14
|
var renderItems = function renderItems() {
|
|
15
15
|
var _context;
|
|
16
|
-
var _items = _concatInstanceProperty(_context = _sliceInstanceProperty(items).call(items, -1)).call(_context, items, _sliceInstanceProperty(items).call(items, 0, 1)); // 首位分别添加一项
|
|
16
|
+
var _items = items.length > 1 ? _concatInstanceProperty(_context = _sliceInstanceProperty(items).call(items, -1)).call(_context, items, _sliceInstanceProperty(items).call(items, 0, 1)) : items; // 首位分别添加一项
|
|
17
17
|
return _mapInstanceProperty(_items).call(_items, function (item, index) {
|
|
18
18
|
return /*#__PURE__*/React.createElement("li", {
|
|
19
19
|
className: classNames("".concat(listPrefixCls, "-item"), _defineProperty({}, "".concat(listPrefixCls, "-item-active"), currentIndex === index - 1)),
|
|
@@ -14,8 +14,9 @@ import Color from 'color';
|
|
|
14
14
|
import { ChromePicker } from 'react-color';
|
|
15
15
|
import devWarning from '../_utils/devwarning';
|
|
16
16
|
import { useOnClickOutside } from '../_utils/hooks';
|
|
17
|
+
import { isIE } from '../_utils/ieUtil';
|
|
17
18
|
var ColorPickerPanel = function ColorPickerPanel(props) {
|
|
18
|
-
var _classNames, _context;
|
|
19
|
+
var _classNames, _classNames2, _context;
|
|
19
20
|
var setCorrectColorValue = props.setCorrectColorValue,
|
|
20
21
|
setInputColorValue = props.setInputColorValue,
|
|
21
22
|
setAlpha = props.setAlpha,
|
|
@@ -61,7 +62,7 @@ var ColorPickerPanel = function ColorPickerPanel(props) {
|
|
|
61
62
|
var panelContainerCls = classNames("".concat(colorPickerPrefixCls, "-panel-container"));
|
|
62
63
|
var panelInputCls = classNames("".concat(colorPickerPrefixCls, "-panel-container-input"));
|
|
63
64
|
var transparentCls = classNames("".concat(colorPickerPrefixCls, "-panel-container-transparent"));
|
|
64
|
-
var colorDivContainerCls = classNames("".concat(colorPickerPrefixCls, "-panel-colorDivContainer"),
|
|
65
|
+
var colorDivContainerCls = classNames("".concat(colorPickerPrefixCls, "-panel-colorDivContainer"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(colorPickerPrefixCls, "-panel-colorDivContainer-unset-color"), (presetColor === null || presetColor === void 0 ? void 0 : presetColor.length) === 0), _defineProperty(_classNames2, "".concat(colorPickerPrefixCls, "-panel-colorDivContainer-ie11"), isIE), _classNames2));
|
|
65
66
|
var colorLiClick = function colorLiClick(index, colorValue) {
|
|
66
67
|
var formatArr = colorFormat(colorValue, alpha);
|
|
67
68
|
var formatValue = toLowerCase(formatArr[valOfCorrespondingType(currentColorType)].value);
|
|
@@ -314,8 +314,8 @@
|
|
|
314
314
|
}
|
|
315
315
|
.kd-color-picker-pop .kd-color-picker-panel-container-transparent {
|
|
316
316
|
-webkit-box-flex: 0;
|
|
317
|
-
-ms-flex: 0
|
|
318
|
-
flex: 0
|
|
317
|
+
-ms-flex: 0 1 60px;
|
|
318
|
+
flex: 0 1 60px;
|
|
319
319
|
height: 28px;
|
|
320
320
|
margin-left: 8px;
|
|
321
321
|
text-align: center;
|
|
@@ -328,6 +328,23 @@
|
|
|
328
328
|
grid-row-gap: 8px;
|
|
329
329
|
margin-top: 12px;
|
|
330
330
|
}
|
|
331
|
+
.kd-color-picker-pop .kd-color-picker-panel-colorDivContainer-ie11 {
|
|
332
|
+
display: -webkit-box;
|
|
333
|
+
display: -ms-flexbox;
|
|
334
|
+
display: flex;
|
|
335
|
+
-ms-flex-wrap: wrap;
|
|
336
|
+
flex-wrap: wrap;
|
|
337
|
+
}
|
|
338
|
+
.kd-color-picker-pop .kd-color-picker-panel-colorDivContainer-ie11 li {
|
|
339
|
+
margin-right: 8px;
|
|
340
|
+
margin-top: 8px;
|
|
341
|
+
}
|
|
342
|
+
.kd-color-picker-pop .kd-color-picker-panel-colorDivContainer-ie11 li:nth-child(12n) {
|
|
343
|
+
margin-right: 0;
|
|
344
|
+
}
|
|
345
|
+
.kd-color-picker-pop .kd-color-picker-panel-colorDivContainer-ie11 li:nth-child(-n+12) {
|
|
346
|
+
margin-top: 0;
|
|
347
|
+
}
|
|
331
348
|
.kd-color-picker-pop .kd-color-picker-panel-colorDivContainer-unset-color {
|
|
332
349
|
margin-top: 0;
|
|
333
350
|
}
|
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
&-transparent {
|
|
260
|
-
flex: 0
|
|
260
|
+
flex: 0 1 60px;
|
|
261
261
|
height: 28px;
|
|
262
262
|
margin-left: 8px;
|
|
263
263
|
text-align: center;
|
|
@@ -272,6 +272,24 @@
|
|
|
272
272
|
grid-row-gap: 8px;
|
|
273
273
|
margin-top: 12px;
|
|
274
274
|
|
|
275
|
+
&-ie11 {
|
|
276
|
+
display: flex;
|
|
277
|
+
flex-wrap: wrap;
|
|
278
|
+
|
|
279
|
+
li {
|
|
280
|
+
margin-right: 8px;
|
|
281
|
+
margin-top: 8px;
|
|
282
|
+
|
|
283
|
+
&:nth-child(12n) {
|
|
284
|
+
margin-right: 0;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
&:nth-child(-n+12) {
|
|
288
|
+
margin-top: 0;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
275
293
|
&-unset-color {
|
|
276
294
|
margin-top: 0;
|
|
277
295
|
}
|
package/es/popper/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export declare type PopperProps = {
|
|
|
24
24
|
placement?: PlacementType;
|
|
25
25
|
tip?: any;
|
|
26
26
|
trigger?: TriggerType | Array<TriggerType>;
|
|
27
|
+
strategy?: 'fixed' | 'absolute';
|
|
27
28
|
clickToClose?: boolean;
|
|
28
29
|
onTrigger?: (trigger: TriggerType) => void;
|
|
29
30
|
onVisibleChange?: (visible: boolean) => void;
|
package/es/popper/index.js
CHANGED
|
@@ -124,6 +124,8 @@ export var Popper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
124
124
|
trigger = _props$trigger === void 0 ? 'click' : _props$trigger,
|
|
125
125
|
_props$placement = props.placement,
|
|
126
126
|
placement = _props$placement === void 0 ? 'top' : _props$placement,
|
|
127
|
+
_props$strategy = props.strategy,
|
|
128
|
+
strategy = _props$strategy === void 0 ? 'absolute' : _props$strategy,
|
|
127
129
|
visible = props.visible,
|
|
128
130
|
_props$arrowSize = props.arrowSize,
|
|
129
131
|
arrowSize = _props$arrowSize === void 0 ? 4.25 : _props$arrowSize,
|
|
@@ -421,7 +423,7 @@ export var Popper = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
421
423
|
var popperOptionsInner = {
|
|
422
424
|
placement: placementInner,
|
|
423
425
|
modifiers: popperModifiers,
|
|
424
|
-
strategy:
|
|
426
|
+
strategy: strategy
|
|
425
427
|
};
|
|
426
428
|
useEnhancedEffect(function () {
|
|
427
429
|
var _a, _b;
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
transform: rotate(45deg);
|
|
131
131
|
}
|
|
132
132
|
.kd-popper[data-popper-placement^='top'] .arrow {
|
|
133
|
-
bottom: calc(
|
|
133
|
+
bottom: calc(1.1 * var(--arrowSize));
|
|
134
134
|
}
|
|
135
135
|
.kd-popper[data-popper-placement^='top'] .arrow::before {
|
|
136
136
|
left: calc(-1 * var(--arrowSize));
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
border-left-color: transparent;
|
|
139
139
|
}
|
|
140
140
|
.kd-popper[data-popper-placement^='bottom'] .arrow {
|
|
141
|
-
top: calc(-0.
|
|
141
|
+
top: calc(-0.8 * var(--arrowSize));
|
|
142
142
|
}
|
|
143
143
|
.kd-popper[data-popper-placement^='bottom'] .arrow::before {
|
|
144
144
|
left: calc(-1 * var(--arrowSize));
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
border-right-color: transparent;
|
|
147
147
|
}
|
|
148
148
|
.kd-popper[data-popper-placement^='left'] .arrow {
|
|
149
|
-
right: calc(
|
|
149
|
+
right: calc(1.1 * var(--arrowSize));
|
|
150
150
|
}
|
|
151
151
|
.kd-popper[data-popper-placement^='left'] .arrow::before {
|
|
152
152
|
top: calc(-1 * var(--arrowSize));
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
border-bottom-color: transparent;
|
|
155
155
|
}
|
|
156
156
|
.kd-popper[data-popper-placement^='right'] .arrow {
|
|
157
|
-
left: calc(-0.
|
|
157
|
+
left: calc(-0.8 * var(--arrowSize));
|
|
158
158
|
}
|
|
159
159
|
.kd-popper[data-popper-placement^='right'] .arrow::before {
|
|
160
160
|
top: calc(-1 * var(--arrowSize));
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&[data-popper-placement^='top'] .arrow {
|
|
32
|
-
bottom: calc(
|
|
32
|
+
bottom: calc(1.1 * var(--arrowSize));
|
|
33
33
|
|
|
34
34
|
&::before {
|
|
35
35
|
left: calc(-1 * var(--arrowSize));
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&[data-popper-placement^='bottom'] .arrow {
|
|
42
|
-
top: calc(-0.
|
|
42
|
+
top: calc(-0.8 * var(--arrowSize));
|
|
43
43
|
|
|
44
44
|
&::before {
|
|
45
45
|
left: calc(-1 * var(--arrowSize));
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
&[data-popper-placement^='left'] .arrow {
|
|
52
|
-
right: calc(
|
|
52
|
+
right: calc(1.1 * var(--arrowSize));
|
|
53
53
|
|
|
54
54
|
&::before {
|
|
55
55
|
top: calc(-1 * var(--arrowSize));
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
&[data-popper-placement^='right'] .arrow {
|
|
62
|
-
left: calc(-0.
|
|
62
|
+
left: calc(-0.8 * var(--arrowSize));
|
|
63
63
|
|
|
64
64
|
&::before {
|
|
65
65
|
top: calc(-1 * var(--arrowSize));
|
package/es/select/select.js
CHANGED
|
@@ -162,12 +162,12 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
162
162
|
if (options && options.length) {
|
|
163
163
|
arr.push({
|
|
164
164
|
value: obj === null || obj === void 0 ? void 0 : obj.value,
|
|
165
|
-
label: (obj === null || obj === void 0 ? void 0 : obj.label) || (obj === null || obj === void 0 ? void 0 : obj.value)
|
|
165
|
+
label: getOptionLabel(obj) || (obj === null || obj === void 0 ? void 0 : obj.label) || (obj === null || obj === void 0 ? void 0 : obj.value)
|
|
166
166
|
});
|
|
167
167
|
} else {
|
|
168
168
|
arr.push({
|
|
169
169
|
value: (_a = obj.props) === null || _a === void 0 ? void 0 : _a.value,
|
|
170
|
-
label: (_b = obj.props) === null || _b === void 0 ? void 0 : _b.children
|
|
170
|
+
label: getOptionLabel(obj) || ((_b = obj.props) === null || _b === void 0 ? void 0 : _b.children)
|
|
171
171
|
});
|
|
172
172
|
}
|
|
173
173
|
} else {
|
|
@@ -148,13 +148,13 @@ var DrawingBoard = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
148
148
|
d: "M9.16767025,16.9762781 C9.5300869,17.3386948 9.5300869,17.9262881 9.16767025,18.2887049 C8.84552213,18.6108529 8.34545651,18.6466472 7.98377112,18.3960875 L7.85524348,18.2887049 L0.815437446,11.2488988 C-0.203859357,10.229602 -0.267565411,8.61657722 0.624319283,7.52306442 L0.815437446,7.31161852 L7.85524348,0.271812484 C8.21766013,-0.0906041612 8.80525361,-0.0906041612 9.16767025,0.271812484 C9.48981838,0.593960608 9.5256126,1.09402626 9.27505297,1.45571158 L9.16767025,1.58423925 L2.39801882,8.35223283 L18.7197413,8.35223283 C24.8235066,8.35223283 28,11.88167 28,18.5605173 C28,25.0286774 25.0409921,28.8154573 19.1996764,29.6367412 L18.7197413,29.6968277 L3.87132753,29.6968277 C3.358793,29.6968277 2.94330165,29.2813365 2.94330165,28.7688019 C2.94330165,28.3132156 3.27159111,27.9343054 3.70451369,27.8557278 L3.87132753,27.840776 L18.6172581,27.846452 C23.6969089,27.2820464 26.1439483,24.2912204 26.1439483,18.5605173 C26.1439483,13.0283959 23.8870007,10.3626156 19.1446408,10.2148013 L18.7197413,10.2082845 L2.39987488,10.2082845 L9.16767025,16.9762781 Z",
|
|
149
149
|
id: "\u8DEF\u5F84",
|
|
150
150
|
fill: "currentColor"
|
|
151
|
-
}))))) : null,
|
|
151
|
+
}))))) : null, /*#__PURE__*/React.createElement(Icon, {
|
|
152
152
|
type: "delete",
|
|
153
153
|
className: "".concat(prefixCls, "-drawing-board-clear"),
|
|
154
154
|
onClick: function onClick() {
|
|
155
155
|
return handleOnClear();
|
|
156
156
|
}
|
|
157
|
-
})
|
|
157
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
158
158
|
className: "".concat(prefixCls, "-drawing-board-tip")
|
|
159
159
|
}, isEmpty ? signatureLangMsg === null || signatureLangMsg === void 0 ? void 0 : signatureLangMsg.pleaseWriteHere : ''), /*#__PURE__*/React.createElement("canvas", {
|
|
160
160
|
ref: canvasRef
|
|
@@ -229,7 +229,12 @@ var Signature = function Signature(props) {
|
|
|
229
229
|
id: "\u5F62\u72B6",
|
|
230
230
|
fill: "#666666"
|
|
231
231
|
}))))));
|
|
232
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
232
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
233
|
+
className: signatureClass,
|
|
234
|
+
ref: triggerRef,
|
|
235
|
+
style: style
|
|
236
|
+
}, dataUrl ? /*#__PURE__*/React.createElement(Image, {
|
|
237
|
+
className: "".concat(signaturePrefixCls, "-image"),
|
|
233
238
|
preview: preview,
|
|
234
239
|
src: dataUrl,
|
|
235
240
|
title: "\u5220\u9664",
|
|
@@ -241,13 +246,11 @@ var Signature = function Signature(props) {
|
|
|
241
246
|
}
|
|
242
247
|
})] : undefined
|
|
243
248
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
244
|
-
className:
|
|
245
|
-
|
|
246
|
-
onClick: handleOnClick,
|
|
247
|
-
style: style
|
|
249
|
+
className: "".concat(signaturePrefixCls, "-empty"),
|
|
250
|
+
onClick: handleOnClick
|
|
248
251
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
249
252
|
type: "edit"
|
|
250
|
-
}), /*#__PURE__*/React.createElement("span", null, signatureLangMsg === null || signatureLangMsg === void 0 ? void 0 : signatureLangMsg.clickToSign)), /*#__PURE__*/React.createElement(Modal, _extends({
|
|
253
|
+
}), /*#__PURE__*/React.createElement("span", null, signatureLangMsg === null || signatureLangMsg === void 0 ? void 0 : signatureLangMsg.clickToSign))), /*#__PURE__*/React.createElement(Modal, _extends({
|
|
251
254
|
width: containerWidth,
|
|
252
255
|
height: containerHeight,
|
|
253
256
|
ref: modalRef,
|
|
@@ -106,9 +106,25 @@
|
|
|
106
106
|
.kd-signature {
|
|
107
107
|
-webkit-box-sizing: border-box;
|
|
108
108
|
box-sizing: border-box;
|
|
109
|
-
border: 1px dashed #e5e5e5;
|
|
110
109
|
width: 100%;
|
|
111
110
|
height: 100%;
|
|
111
|
+
}
|
|
112
|
+
.kd-signature-image {
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100%;
|
|
115
|
+
-webkit-box-sizing: border-box;
|
|
116
|
+
box-sizing: border-box;
|
|
117
|
+
}
|
|
118
|
+
.kd-signature-image img {
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 100%;
|
|
121
|
+
}
|
|
122
|
+
.kd-signature-empty {
|
|
123
|
+
-webkit-box-sizing: border-box;
|
|
124
|
+
box-sizing: border-box;
|
|
125
|
+
width: 100%;
|
|
126
|
+
height: 100%;
|
|
127
|
+
border: 1px dashed #e5e5e5;
|
|
112
128
|
display: -webkit-box;
|
|
113
129
|
display: -ms-flexbox;
|
|
114
130
|
display: flex;
|
|
@@ -130,7 +146,7 @@
|
|
|
130
146
|
-webkit-transition: border-color var(--kd-c-signature-motion-duration, var(--kd-g-duration, 0.3s)), background-color var(--kd-c-signature-motion-duration, var(--kd-g-duration, 0.3s));
|
|
131
147
|
transition: border-color var(--kd-c-signature-motion-duration, var(--kd-g-duration, 0.3s)), background-color var(--kd-c-signature-motion-duration, var(--kd-g-duration, 0.3s));
|
|
132
148
|
}
|
|
133
|
-
.kd-signature:hover {
|
|
149
|
+
.kd-signature-empty:hover {
|
|
134
150
|
border-color: var(--kd-c-signature-border-color-hover, var(--kd-g-color-theme-5, #87adff));
|
|
135
151
|
background-color: var(--kd-c-signature-bg-color-hover, var(--kd-g-color-theme-1, #f2f8ff));
|
|
136
152
|
}
|
|
@@ -5,22 +5,36 @@
|
|
|
5
5
|
|
|
6
6
|
.@{signature-prefix-cls} {
|
|
7
7
|
box-sizing: border-box;
|
|
8
|
-
border: 1px dashed #e5e5e5;
|
|
9
8
|
width: 100%;
|
|
10
9
|
height: 100%;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
&-image {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
img {
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&-empty {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
border: 1px dashed #e5e5e5;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background: @signature-bg-color;
|
|
29
|
+
color: @signature-color-text;
|
|
30
|
+
font-size: @signature-font-size;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
border-radius: @signature-border-radius;
|
|
33
|
+
transition: border-color @signature-transition-duration, background-color @signature-transition-duration;
|
|
34
|
+
&:hover {
|
|
35
|
+
border-color: @signature-border-color-hover;
|
|
36
|
+
background-color: @signature-bg-color-hover;
|
|
37
|
+
}
|
|
24
38
|
}
|
|
25
39
|
}
|
|
26
40
|
.@{signature-prefix-cls}.@{signature-prefix-cls}-disabled {
|
package/es/style/core/reset.less
CHANGED
|
@@ -24,8 +24,8 @@ input,
|
|
|
24
24
|
textarea,
|
|
25
25
|
select,
|
|
26
26
|
button {
|
|
27
|
-
font-family: '
|
|
28
|
-
'WenQuanYi Micro Hei', sans-serif;
|
|
27
|
+
font-family: 'Roboto', 'San Francisco', 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Hiragina Sans GB',
|
|
28
|
+
'WenQuanYi Micro Hei', 'microsoft yahei ui', 'microsoft yahei', sans-serif;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
body {
|
package/es/style/index.css
CHANGED
|
@@ -1687,7 +1687,7 @@ input,
|
|
|
1687
1687
|
textarea,
|
|
1688
1688
|
select,
|
|
1689
1689
|
button {
|
|
1690
|
-
font-family: '
|
|
1690
|
+
font-family: 'Roboto', 'San Francisco', 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Hiragina Sans GB', 'WenQuanYi Micro Hei', 'microsoft yahei ui', 'microsoft yahei', sans-serif;
|
|
1691
1691
|
}
|
|
1692
1692
|
body {
|
|
1693
1693
|
-webkit-box-sizing: border-box;
|
|
@@ -212,7 +212,7 @@ var InternalBaseData = function InternalBaseData(props, ref) {
|
|
|
212
212
|
var _a;
|
|
213
213
|
var inputDom = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input;
|
|
214
214
|
if (!inputDom) return;
|
|
215
|
-
if (inputDom.scrollWidth - inputDom.offsetWidth > 0) {
|
|
215
|
+
if (inputDom.scrollWidth - inputDom.offsetWidth > 0 && inputValue) {
|
|
216
216
|
setShowTotal(true);
|
|
217
217
|
} else {
|
|
218
218
|
setShowTotal(false);
|
package/lib/carousel/carousel.js
CHANGED
|
@@ -68,6 +68,17 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
68
68
|
var carouselRef = _react.default.useRef();
|
|
69
69
|
var listRef = _react.default.useRef();
|
|
70
70
|
var autoplayRef = _react.default.useRef();
|
|
71
|
+
var processChildren = function processChildren(children) {
|
|
72
|
+
var childCount = _react.default.Children.count(children);
|
|
73
|
+
if (childCount === 0) {
|
|
74
|
+
return [];
|
|
75
|
+
} else if (childCount === 1) {
|
|
76
|
+
return [children];
|
|
77
|
+
} else {
|
|
78
|
+
return _react.default.Children.toArray(children);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
var tempChild = processChildren(children);
|
|
71
82
|
var isScrollxEffect = _react.default.useMemo(function () {
|
|
72
83
|
return effect === 'scrollx';
|
|
73
84
|
}, [effect]);
|
|
@@ -87,16 +98,18 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
87
98
|
}, [itemWidth]);
|
|
88
99
|
var setScrollXEffectStyle = _react.default.useCallback(function () {
|
|
89
100
|
var _context;
|
|
90
|
-
|
|
101
|
+
var tempChild = processChildren(children);
|
|
102
|
+
if (!listRef.current || tempChild.length <= 1) return;
|
|
91
103
|
listRef.current.style.cssText = needAnimation ? (0, _concat.default)(_context = "transform: translateX(".concat(posX, "px); transition:all 0.3s ")).call(_context, easing) : "transform: translateX(".concat(posX, "px); transition:none");
|
|
92
104
|
}, [children === null || children === void 0 ? void 0 : children.length, needAnimation, easing, posX]);
|
|
93
105
|
var jumpTo = _react.default.useCallback(function (index, needAnimation) {
|
|
106
|
+
var tempChild = processChildren(children);
|
|
94
107
|
if (isFadeEffect) {
|
|
95
|
-
if (index === -1 || index ===
|
|
108
|
+
if (index === -1 || index === tempChild.length) index = 0;
|
|
96
109
|
beforeChange && beforeChange(currentIndex, index);
|
|
97
110
|
setCurrentIndex(index);
|
|
98
111
|
setNeedAnimation(needAnimation);
|
|
99
|
-
} else if (index >= -1 && index <=
|
|
112
|
+
} else if (index >= -1 && index <= tempChild.length) {
|
|
100
113
|
beforeChange && beforeChange(currentIndex, index);
|
|
101
114
|
setCurrentIndex(index);
|
|
102
115
|
setNeedAnimation(needAnimation);
|
|
@@ -183,8 +196,9 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
183
196
|
setNeedAnimation(true);
|
|
184
197
|
}, [beforeChange, currentIndex]);
|
|
185
198
|
var handleTransitionEnd = _react.default.useCallback(function () {
|
|
186
|
-
|
|
187
|
-
|
|
199
|
+
var tempChild = processChildren(children);
|
|
200
|
+
if (!autoplay || !(tempChild === null || tempChild === void 0 ? void 0 : tempChild.length)) return;
|
|
201
|
+
var childrenL = tempChild.length;
|
|
188
202
|
var newCurrentIndex = currentIndex;
|
|
189
203
|
if (isScrollxEffect) {
|
|
190
204
|
if (currentIndex === -1) {
|
|
@@ -206,10 +220,11 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
206
220
|
}, [play, autoplay]);
|
|
207
221
|
var rootClassName = (0, _classnames.default)(className, (0, _defineProperty2.default)({}, "".concat(carouselPrefixCls, "-root"), true));
|
|
208
222
|
var renderDisplayList = function renderDisplayList() {
|
|
223
|
+
var tempChild = processChildren(children);
|
|
209
224
|
var content;
|
|
210
225
|
if (isFadeEffect) {
|
|
211
226
|
content = /*#__PURE__*/_react.default.createElement(_fadeList.FadeList, {
|
|
212
|
-
items:
|
|
227
|
+
items: tempChild,
|
|
213
228
|
parentPrefixCls: carouselPrefixCls,
|
|
214
229
|
needAnimation: needAnimation,
|
|
215
230
|
currentIndex: currentIndex,
|
|
@@ -218,14 +233,14 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
218
233
|
});
|
|
219
234
|
} else if (isNoneEffect) {
|
|
220
235
|
content = /*#__PURE__*/_react.default.createElement(_displayList.DisplayList, {
|
|
221
|
-
items:
|
|
236
|
+
items: tempChild,
|
|
222
237
|
parentPrefixCls: carouselPrefixCls,
|
|
223
238
|
currentIndex: currentIndex,
|
|
224
239
|
ref: listRef
|
|
225
240
|
});
|
|
226
241
|
} else {
|
|
227
242
|
content = /*#__PURE__*/_react.default.createElement(_slideList.SlideList, {
|
|
228
|
-
items:
|
|
243
|
+
items: tempChild,
|
|
229
244
|
parentPrefixCls: carouselPrefixCls,
|
|
230
245
|
currentIndex: currentIndex,
|
|
231
246
|
ref: listRef
|
|
@@ -234,7 +249,8 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
234
249
|
return content;
|
|
235
250
|
};
|
|
236
251
|
var renderJumpNode = function renderJumpNode() {
|
|
237
|
-
|
|
252
|
+
var tempChild = processChildren(children);
|
|
253
|
+
if ((tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) && jumpNode) {
|
|
238
254
|
var jumpClassPrefix = "".concat(carouselPrefixCls, "-jump");
|
|
239
255
|
var leftClick = function leftClick(e) {
|
|
240
256
|
e.stopPropagation();
|
|
@@ -244,7 +260,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
244
260
|
};
|
|
245
261
|
var rightClick = function rightClick(e) {
|
|
246
262
|
e.stopPropagation();
|
|
247
|
-
if (currentIndex !==
|
|
263
|
+
if (currentIndex !== tempChild.length - 1) {
|
|
248
264
|
next();
|
|
249
265
|
}
|
|
250
266
|
};
|
|
@@ -272,7 +288,7 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
272
288
|
onClick: leftClick
|
|
273
289
|
}));
|
|
274
290
|
var rightNode = /*#__PURE__*/_react.default.createElement("div", {
|
|
275
|
-
className: (0, _classnames.default)(jumpClassPrefix, "".concat(jumpClassPrefix, "-right"), (0, _defineProperty2.default)({}, "".concat(jumpClassPrefix, "-disabled"), currentIndex >=
|
|
291
|
+
className: (0, _classnames.default)(jumpClassPrefix, "".concat(jumpClassPrefix, "-right"), (0, _defineProperty2.default)({}, "".concat(jumpClassPrefix, "-disabled"), currentIndex >= tempChild.length - 1))
|
|
276
292
|
}, Array.isArray(jumpNode) && jumpNode.length > 1 && /*#__PURE__*/(0, _react.isValidElement)(jumpNode[1]) ? /*#__PURE__*/_react.default.cloneElement(jumpNode[1], mergeNode(jumpNode[1], 'right')) : /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
277
293
|
className: "".concat(jumpClassPrefix, "-icon"),
|
|
278
294
|
type: 'arrow-right-circle-solid',
|
|
@@ -291,8 +307,8 @@ var InternalCarousel = function InternalCarousel(props, ref) {
|
|
|
291
307
|
style: style,
|
|
292
308
|
onMouseEnter: handleMouseEnter,
|
|
293
309
|
onMouseLeave: handleMouseLeave
|
|
294
|
-
}, (
|
|
295
|
-
number:
|
|
310
|
+
}, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) ? renderDisplayList() : null, (tempChild === null || tempChild === void 0 ? void 0 : tempChild.length) && showDot() ? /*#__PURE__*/_react.default.createElement(_slidebar.Slidebar, {
|
|
311
|
+
number: tempChild.length,
|
|
296
312
|
currentIndex: currentIndex,
|
|
297
313
|
dotsClassName: dots,
|
|
298
314
|
parentPrefixCls: carouselPrefixCls,
|
|
@@ -20,7 +20,7 @@ var SlideList = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
20
20
|
var listPrefixCls = "".concat(parentPrefixCls, "-list");
|
|
21
21
|
var renderItems = function renderItems() {
|
|
22
22
|
var _context;
|
|
23
|
-
var _items = (0, _concat.default)(_context = (0, _slice.default)(items).call(items, -1)).call(_context, items, (0, _slice.default)(items).call(items, 0, 1)); // 首位分别添加一项
|
|
23
|
+
var _items = items.length > 1 ? (0, _concat.default)(_context = (0, _slice.default)(items).call(items, -1)).call(_context, items, (0, _slice.default)(items).call(items, 0, 1)) : items; // 首位分别添加一项
|
|
24
24
|
return (0, _map.default)(_items).call(_items, function (item, index) {
|
|
25
25
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
26
26
|
className: (0, _classnames.default)("".concat(listPrefixCls, "-item"), (0, _defineProperty2.default)({}, "".concat(listPrefixCls, "-item-active"), currentIndex === index - 1)),
|