@kdcloudjs/kdesign 1.7.40 → 1.7.42
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/CHANGELOG.md +19 -0
- package/dist/kdesign-complete.less +79 -5
- package/dist/kdesign.css +69 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +439 -151
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +2 -2
- package/dist/kdesign.min.js +10 -10
- package/dist/kdesign.min.js.map +1 -1
- package/es/button/index.d.ts +2 -1
- package/es/carousel/index.d.ts +2 -2
- package/es/city-picker/index.d.ts +2 -0
- package/es/collapse/index.d.ts +2 -2
- package/es/config-provider/compDefaultProps.d.ts +1 -0
- package/es/config-provider/compDefaultProps.js +2 -1
- package/es/input/TextArea.js +16 -8
- package/es/input/style/index.css +3 -0
- package/es/input/style/index.less +9 -5
- package/es/modal/modal.d.ts +4 -0
- package/es/modal/modal.js +221 -20
- package/es/modal/style/index.css +65 -0
- package/es/modal/style/index.less +70 -0
- package/es/notification-base/notice.js +6 -1
- package/es/pagination/pagination.js +34 -31
- package/es/search/search-panel.d.ts +1 -1
- package/es/select/index.d.ts +1 -0
- package/es/select/index.js +1 -0
- package/es/tree/tree.d.ts +1 -1
- package/es/tree/treeHooks.js +1 -1
- package/lib/button/index.d.ts +2 -1
- package/lib/carousel/index.d.ts +2 -2
- package/lib/city-picker/index.d.ts +2 -0
- package/lib/collapse/index.d.ts +2 -2
- package/lib/config-provider/compDefaultProps.d.ts +1 -0
- package/lib/config-provider/compDefaultProps.js +2 -1
- package/lib/input/TextArea.js +16 -8
- package/lib/input/style/index.css +3 -0
- package/lib/input/style/index.less +9 -5
- package/lib/modal/modal.d.ts +4 -0
- package/lib/modal/modal.js +221 -20
- package/lib/modal/style/index.css +65 -0
- package/lib/modal/style/index.less +70 -0
- package/lib/notification-base/notice.js +6 -1
- package/lib/pagination/pagination.js +34 -31
- package/lib/search/search-panel.d.ts +1 -1
- package/lib/select/index.d.ts +1 -0
- package/lib/select/index.js +14 -0
- package/lib/tree/tree.d.ts +1 -1
- package/lib/tree/treeHooks.js +1 -1
- package/package.json +8 -2
package/es/button/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ import Dropdown from './group';
|
|
|
3
3
|
declare const Button: import("react").ForwardRefExoticComponent<import("./button").IButtonProps & import("react").RefAttributes<unknown>> & {
|
|
4
4
|
Dropdown: typeof Dropdown;
|
|
5
5
|
};
|
|
6
|
-
export { ButtonType, IButtonProps } from './button';
|
|
6
|
+
export { ButtonType, IButtonProps, ButtonSize, ButtonShape, ButtonIconPlace, ButtonHTMLType } from './button';
|
|
7
|
+
export { OverlayType, ButtonGroupType } from './group';
|
|
7
8
|
export default Button;
|
package/es/carousel/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Carousel, { CarouselProps } from './carousel';
|
|
1
|
+
import Carousel, { CarouselProps, DotPositionType, EffectType } from './carousel';
|
|
2
2
|
import { Slidebar } from './slidebar';
|
|
3
3
|
import { SlideList } from './slideList';
|
|
4
4
|
import { FadeList } from './fadeList';
|
|
5
5
|
export * from './carousel';
|
|
6
|
-
export { CarouselProps, Slidebar, FadeList, SlideList };
|
|
6
|
+
export { CarouselProps, DotPositionType, EffectType, Slidebar, FadeList, SlideList };
|
|
7
7
|
export default Carousel;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import CityPicker from './city-picker';
|
|
2
|
+
import { City, BorderType, Size, Type, CityList, CityPickerProps, ICityPickerOptionProps } from './interface';
|
|
3
|
+
export { City, BorderType, Size, Type, CityList, CityPickerProps, ICityPickerOptionProps };
|
|
2
4
|
export * from './city-picker';
|
|
3
5
|
export default CityPicker;
|
package/es/collapse/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { CollapseProps } from './collapse';
|
|
2
|
+
import { CollapseProps, IconPositionType } from './collapse';
|
|
3
3
|
import Panel from './panel';
|
|
4
4
|
export { PanelProps } from './panel';
|
|
5
5
|
interface CompoundedComponent extends React.ForwardRefExoticComponent<CollapseProps & React.RefAttributes<HTMLElement>> {
|
|
6
6
|
Panel: typeof Panel;
|
|
7
7
|
}
|
|
8
8
|
declare const Collapse: CompoundedComponent;
|
|
9
|
-
export { Panel };
|
|
9
|
+
export { Panel, IconPositionType };
|
|
10
10
|
export default Collapse;
|
package/es/input/TextArea.js
CHANGED
|
@@ -70,6 +70,10 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
70
70
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
71
|
showNumberMark = _useState6[0],
|
|
72
72
|
setShowNumberMark = _useState6[1];
|
|
73
|
+
var _useState7 = useState(false),
|
|
74
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
75
|
+
numberMarkError = _useState8[0],
|
|
76
|
+
setNumberMarkError = _useState8[1];
|
|
73
77
|
var resizeTextarea = useCallback(function () {
|
|
74
78
|
if (!autoSize || !textareaRef.current) {
|
|
75
79
|
return;
|
|
@@ -117,21 +121,25 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
117
121
|
onChange && onChange(event);
|
|
118
122
|
};
|
|
119
123
|
var renderNumberMark = function renderNumberMark() {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
if (count && showNumberMark && !disabled && maxLength !== '' && maxLength >= 0) {
|
|
125
|
-
var countClass = classNames("".concat(textAreaPrefixCls, "-textarea-mark"), _defineProperty({}, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'));
|
|
124
|
+
if (count && (showNumberMark || numberMarkError) && !disabled && maxLength !== '' && maxLength >= 0) {
|
|
125
|
+
var _classNames;
|
|
126
|
+
var countClass = classNames("".concat(textAreaPrefixCls, "-textarea-mark"), (_classNames = {}, _defineProperty(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'), _defineProperty(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-error"), numberMarkError), _classNames));
|
|
126
127
|
return /*#__PURE__*/React.createElement("div", {
|
|
127
128
|
className: countClass
|
|
128
|
-
},
|
|
129
|
+
}, value ? value.length : 0, "/", maxLength);
|
|
129
130
|
}
|
|
130
131
|
return null;
|
|
131
132
|
};
|
|
132
133
|
useEffect(function () {
|
|
133
134
|
resizeTextarea();
|
|
134
135
|
}, [value, resizeTextarea]);
|
|
136
|
+
useEffect(function () {
|
|
137
|
+
if (value && maxLength && value.length > maxLength) {
|
|
138
|
+
setNumberMarkError(true);
|
|
139
|
+
} else {
|
|
140
|
+
setNumberMarkError(false);
|
|
141
|
+
}
|
|
142
|
+
}, [value]);
|
|
135
143
|
useEffect(function () {
|
|
136
144
|
if (propsValue !== undefined) {
|
|
137
145
|
setValue(propsValue);
|
|
@@ -173,7 +181,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
|
|
|
173
181
|
ref: textareaRef,
|
|
174
182
|
disabled: disabled,
|
|
175
183
|
style: _extends({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
|
|
176
|
-
className: classNames("".concat(prefixCls, "-textarea"), (_classNames2 = {}, _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error'), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !allowClear && !hadCount)),
|
|
184
|
+
className: classNames("".concat(prefixCls, "-textarea"), (_classNames2 = {}, _defineProperty(_classNames2, _concatInstanceProperty(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), _defineProperty(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), _defineProperty(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), _defineProperty(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), _defineProperty(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), _defineProperty(_classNames2, "".concat(prefixCls, "-error"), status === 'error' || numberMarkError), _defineProperty(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), _defineProperty({}, className, className && !allowClear && !hadCount)),
|
|
177
185
|
onChange: handleChange,
|
|
178
186
|
onFocus: !disabled ? handleFocus : undefined,
|
|
179
187
|
onBlur: !disabled ? handleBlur : undefined,
|
package/es/input/style/index.css
CHANGED
|
@@ -43,12 +43,16 @@ textarea {
|
|
|
43
43
|
font-size: @input-small-font-size-inner;
|
|
44
44
|
line-height: 18px;
|
|
45
45
|
background-color: #fff;
|
|
46
|
-
}
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
&-inner {
|
|
48
|
+
top: auto;
|
|
49
|
+
bottom: 5px;
|
|
50
|
+
right: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-error {
|
|
54
|
+
color: @input-error-color;
|
|
55
|
+
}
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
|
package/es/modal/modal.d.ts
CHANGED
|
@@ -44,6 +44,10 @@ export interface IModalProps {
|
|
|
44
44
|
showline?: boolean;
|
|
45
45
|
bounds?: DraggableBounds | string | false;
|
|
46
46
|
overroll?: boolean;
|
|
47
|
+
resizable?: boolean;
|
|
48
|
+
onResizeStart?: (event: MouseEvent) => void;
|
|
49
|
+
onResize?: (event: MouseEvent) => void;
|
|
50
|
+
onResizeStop?: (event: MouseEvent) => void;
|
|
47
51
|
onDragStart?: DraggableEventHandler;
|
|
48
52
|
onDrag?: DraggableEventHandler;
|
|
49
53
|
onDragStop?: DraggableEventHandler;
|
package/es/modal/modal.js
CHANGED
|
@@ -26,8 +26,30 @@ import { getLangMsg } from '../locale/locale';
|
|
|
26
26
|
import { useHideDocumentScrollBar } from '../_utils/hooks';
|
|
27
27
|
export var ConfirmModalTypes = ['confirm', 'normal'];
|
|
28
28
|
export var ModalTypes = tuple('confirm', 'warning', 'error', 'normal');
|
|
29
|
+
var DragDirection;
|
|
30
|
+
(function (DragDirection) {
|
|
31
|
+
DragDirection["N"] = "n";
|
|
32
|
+
DragDirection["E"] = "e";
|
|
33
|
+
DragDirection["S"] = "s";
|
|
34
|
+
DragDirection["W"] = "w";
|
|
35
|
+
DragDirection["NE"] = "ne";
|
|
36
|
+
DragDirection["NW"] = "nw";
|
|
37
|
+
DragDirection["SE"] = "se";
|
|
38
|
+
DragDirection["SW"] = "sw";
|
|
39
|
+
})(DragDirection || (DragDirection = {}));
|
|
40
|
+
var initPosition = {
|
|
41
|
+
initialX: 0,
|
|
42
|
+
initialY: 0,
|
|
43
|
+
initialWidth: 0,
|
|
44
|
+
initialHeight: 0,
|
|
45
|
+
top: 0,
|
|
46
|
+
left: 0,
|
|
47
|
+
x: 0,
|
|
48
|
+
y: 0,
|
|
49
|
+
type: null
|
|
50
|
+
};
|
|
29
51
|
var InternalModal = function InternalModal(props, ref) {
|
|
30
|
-
var _classNames3, _classNames4, _context2, _context3, _context4;
|
|
52
|
+
var _classNames3, _classNames4, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12;
|
|
31
53
|
var _useContext = useContext(ConfigContext),
|
|
32
54
|
getPrefixCls = _useContext.getPrefixCls,
|
|
33
55
|
prefixCls = _useContext.prefixCls,
|
|
@@ -71,7 +93,8 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
71
93
|
onDragStop = modalProps.onDragStop,
|
|
72
94
|
bounds = modalProps.bounds,
|
|
73
95
|
overroll = modalProps.overroll,
|
|
74
|
-
|
|
96
|
+
resizable = modalProps.resizable,
|
|
97
|
+
others = __rest(modalProps, ["body", "bodyClassName", "bodyStyle", "cancelButtonProps", "cancelText", "className", "closable", "closeIcon", "destroyOnClose", "draggable", "focusTriggerAfterClose", "footer", "footerClassName", "footerStyle", "footerBtnOrder", "getContainer", "height", "keyboard", "mask", "maskClosable", "maskStyle", "maskClassName", "okButtonProps", "okText", "onCancel", "onOk", "prefixCls", "title", "titleIcon", "type", "visible", "width", "showline", "onDragStart", "onDrag", "onDragStop", "bounds", "overroll", "resizable"]);
|
|
75
98
|
var isForceController = visible !== undefined;
|
|
76
99
|
var _useState = useState(isForceController ? visible : true),
|
|
77
100
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -92,6 +115,16 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
92
115
|
}
|
|
93
116
|
modalContainer = document.body;
|
|
94
117
|
}
|
|
118
|
+
var _useState3 = useState(modalContainer && !overroll ? {
|
|
119
|
+
x: -(width / 2),
|
|
120
|
+
y: -(height / 2)
|
|
121
|
+
} : {
|
|
122
|
+
x: 0,
|
|
123
|
+
y: 0
|
|
124
|
+
}),
|
|
125
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
126
|
+
position = _useState4[0],
|
|
127
|
+
setPosition = _useState4[1];
|
|
95
128
|
useHideDocumentScrollBar(isForceController ? !!visible : !!innerVisible, modalContainer === document.body, !!mask);
|
|
96
129
|
var closeModal = useCallback(function () {
|
|
97
130
|
setInnerVisible(false);
|
|
@@ -182,6 +215,153 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
182
215
|
document.body.removeEventListener('keydown', escapeToCloseModal);
|
|
183
216
|
};
|
|
184
217
|
}, [keyboard, escapeToCloseModal, proxyCloseModal, onCancel]);
|
|
218
|
+
var isResizing = false;
|
|
219
|
+
var initPositionRef = useRef(initPosition);
|
|
220
|
+
var startResize = useCallback(function (event) {
|
|
221
|
+
var targetElement = event.target;
|
|
222
|
+
if (!targetElement.classList.contains("".concat(modalPrefixCls, "-resise-handle")) || !containerRef.current) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
var _containerRef$current = containerRef.current.getBoundingClientRect(),
|
|
226
|
+
initialWidth = _containerRef$current.width,
|
|
227
|
+
initialHeight = _containerRef$current.height,
|
|
228
|
+
top = _containerRef$current.top,
|
|
229
|
+
left = _containerRef$current.left;
|
|
230
|
+
initPositionRef.current = {
|
|
231
|
+
initialX: event.clientX,
|
|
232
|
+
initialY: event.clientY,
|
|
233
|
+
initialWidth: initialWidth,
|
|
234
|
+
initialHeight: initialHeight,
|
|
235
|
+
top: top,
|
|
236
|
+
left: left,
|
|
237
|
+
x: position.x,
|
|
238
|
+
y: position.y,
|
|
239
|
+
type: targetElement.dataset.type
|
|
240
|
+
};
|
|
241
|
+
event.preventDefault();
|
|
242
|
+
isResizing = true;
|
|
243
|
+
if (overroll && wrapperRef.current) {
|
|
244
|
+
wrapperRef.current.classList.add("".concat(modalPrefixCls, "-wrapper-resizable"));
|
|
245
|
+
setPosition({
|
|
246
|
+
x: left,
|
|
247
|
+
y: top
|
|
248
|
+
});
|
|
249
|
+
initPositionRef.current.x = left;
|
|
250
|
+
initPositionRef.current.y = top;
|
|
251
|
+
}
|
|
252
|
+
document.addEventListener('mousemove', resize);
|
|
253
|
+
document.addEventListener('mouseup', stopResize);
|
|
254
|
+
}, [position]);
|
|
255
|
+
useEffect(function () {
|
|
256
|
+
if (containerRef.current && visible) {
|
|
257
|
+
containerRef.current.addEventListener('mousedown', startResize);
|
|
258
|
+
}
|
|
259
|
+
return function () {
|
|
260
|
+
if (containerRef.current) {
|
|
261
|
+
containerRef.current.removeEventListener('mousedown', startResize);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}, [containerRef, startResize, visible]);
|
|
265
|
+
var resize = function resize(event) {
|
|
266
|
+
if (!containerRef.current) return;
|
|
267
|
+
if (!isResizing || !containerRef.current) return;
|
|
268
|
+
var _initPositionRef$curr = initPositionRef.current,
|
|
269
|
+
initialX = _initPositionRef$curr.initialX,
|
|
270
|
+
initialY = _initPositionRef$curr.initialY,
|
|
271
|
+
initialHeight = _initPositionRef$curr.initialHeight,
|
|
272
|
+
initialWidth = _initPositionRef$curr.initialWidth,
|
|
273
|
+
y = _initPositionRef$curr.y,
|
|
274
|
+
x = _initPositionRef$curr.x,
|
|
275
|
+
type = _initPositionRef$curr.type;
|
|
276
|
+
var curNHeight = initialY - event.clientY;
|
|
277
|
+
var curSHeight = -curNHeight;
|
|
278
|
+
var curEWidth = event.clientX - initialX;
|
|
279
|
+
var curWWidth = -curEWidth;
|
|
280
|
+
switch (type) {
|
|
281
|
+
case DragDirection.N:
|
|
282
|
+
{
|
|
283
|
+
containerRef.current.style.height = "".concat(curNHeight + initialHeight, "px");
|
|
284
|
+
setPosition(function (pre) {
|
|
285
|
+
return {
|
|
286
|
+
y: y - curNHeight,
|
|
287
|
+
x: pre.x
|
|
288
|
+
};
|
|
289
|
+
});
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
case DragDirection.E:
|
|
293
|
+
{
|
|
294
|
+
containerRef.current.style.width = "".concat(curEWidth + initialWidth, "px");
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
case DragDirection.S:
|
|
298
|
+
{
|
|
299
|
+
containerRef.current.style.height = "".concat(curSHeight + initialHeight, "px");
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
case DragDirection.W:
|
|
303
|
+
{
|
|
304
|
+
containerRef.current.style.width = "".concat(curWWidth + initialWidth, "px");
|
|
305
|
+
setPosition(function (pre) {
|
|
306
|
+
return {
|
|
307
|
+
y: pre.y,
|
|
308
|
+
x: x - curWWidth
|
|
309
|
+
};
|
|
310
|
+
});
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
case DragDirection.NE:
|
|
314
|
+
{
|
|
315
|
+
containerRef.current.style.height = "".concat(curNHeight + initialHeight, "px");
|
|
316
|
+
containerRef.current.style.width = "".concat(curEWidth + initialWidth, "px");
|
|
317
|
+
setPosition(function (pre) {
|
|
318
|
+
return {
|
|
319
|
+
y: y - curNHeight,
|
|
320
|
+
x: pre.x
|
|
321
|
+
};
|
|
322
|
+
});
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
case DragDirection.NW:
|
|
326
|
+
{
|
|
327
|
+
containerRef.current.style.height = "".concat(curNHeight + initialHeight, "px");
|
|
328
|
+
containerRef.current.style.width = "".concat(curWWidth + initialWidth, "px");
|
|
329
|
+
setPosition({
|
|
330
|
+
y: y - curNHeight,
|
|
331
|
+
x: x - curWWidth
|
|
332
|
+
});
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
case DragDirection.SE:
|
|
336
|
+
{
|
|
337
|
+
containerRef.current.style.height = "".concat(curSHeight + initialHeight, "px");
|
|
338
|
+
containerRef.current.style.width = "".concat(curEWidth + initialWidth, "px");
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
case DragDirection.SW:
|
|
342
|
+
{
|
|
343
|
+
containerRef.current.style.width = "".concat(curWWidth + initialWidth, "px");
|
|
344
|
+
containerRef.current.style.height = "".concat(curSHeight + initialHeight, "px");
|
|
345
|
+
setPosition(function (pre) {
|
|
346
|
+
return {
|
|
347
|
+
y: pre.y,
|
|
348
|
+
x: x - curWWidth
|
|
349
|
+
};
|
|
350
|
+
});
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
default:
|
|
354
|
+
{
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
var stopResize = function stopResize() {
|
|
360
|
+
isResizing = false;
|
|
361
|
+
initPositionRef.current = initPosition;
|
|
362
|
+
document.removeEventListener('mousemove', resize);
|
|
363
|
+
document.removeEventListener('mouseup', stopResize);
|
|
364
|
+
};
|
|
185
365
|
var handleMaskClick = useCallback(function () {
|
|
186
366
|
if (maskClosable) {
|
|
187
367
|
proxyCloseModal(onCancel);
|
|
@@ -204,7 +384,31 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
204
384
|
ref: containerRef,
|
|
205
385
|
tabIndex: -1,
|
|
206
386
|
onKeyDown: enterToCloseModal
|
|
207
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
387
|
+
}, resizable && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
388
|
+
"data-type": "n",
|
|
389
|
+
className: _concatInstanceProperty(_context2 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context2, modalPrefixCls, "-resise-n")
|
|
390
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
391
|
+
"data-type": "e",
|
|
392
|
+
className: _concatInstanceProperty(_context3 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context3, modalPrefixCls, "-resise-e")
|
|
393
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
394
|
+
"data-type": "s",
|
|
395
|
+
className: _concatInstanceProperty(_context4 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context4, modalPrefixCls, "-resise-s")
|
|
396
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
397
|
+
"data-type": "w",
|
|
398
|
+
className: _concatInstanceProperty(_context5 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context5, modalPrefixCls, "-resise-w")
|
|
399
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
400
|
+
"data-type": "ne",
|
|
401
|
+
className: _concatInstanceProperty(_context6 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context6, modalPrefixCls, "-resise-ne")
|
|
402
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
403
|
+
"data-type": "se",
|
|
404
|
+
className: _concatInstanceProperty(_context7 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context7, modalPrefixCls, "-resise-se")
|
|
405
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
406
|
+
"data-type": "sw",
|
|
407
|
+
className: _concatInstanceProperty(_context8 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context8, modalPrefixCls, "-resise-sw")
|
|
408
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
409
|
+
"data-type": "nw",
|
|
410
|
+
className: _concatInstanceProperty(_context9 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context9, modalPrefixCls, "-resise-nw")
|
|
411
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
208
412
|
className: headerClass
|
|
209
413
|
}, /*#__PURE__*/React.createElement("div", {
|
|
210
414
|
className: "".concat(modalPrefixCls, "-title-container")
|
|
@@ -223,7 +427,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
223
427
|
className: classNames("".concat(modalPrefixCls, "-body"), bodyClassName),
|
|
224
428
|
style: bodyStyle
|
|
225
429
|
}, body), footer !== null && /*#__PURE__*/React.createElement("div", {
|
|
226
|
-
className: classNames("".concat(modalPrefixCls, "-footer"), _concatInstanceProperty(
|
|
430
|
+
className: classNames("".concat(modalPrefixCls, "-footer"), _concatInstanceProperty(_context10 = "".concat(modalPrefixCls, "-")).call(_context10, type, "-footer"), footerClassName),
|
|
227
431
|
style: _extends({
|
|
228
432
|
flexDirection: !footer && (!footerBtnOrder || footerBtnOrder === 'normal') ? 'row' : 'row-reverse'
|
|
229
433
|
}, footerStyle || {})
|
|
@@ -233,12 +437,12 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
233
437
|
var handleDragStart = function handleDragStart(e, data) {
|
|
234
438
|
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(e, data);
|
|
235
439
|
};
|
|
236
|
-
var
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
440
|
+
var handleDrag = function handleDrag(e, ui) {
|
|
441
|
+
setPosition({
|
|
442
|
+
x: ui.x,
|
|
443
|
+
y: ui.y
|
|
444
|
+
});
|
|
445
|
+
onDrag === null || onDrag === void 0 ? void 0 : onDrag(e, ui);
|
|
242
446
|
};
|
|
243
447
|
var comp = /*#__PURE__*/React.createElement("div", _extends({
|
|
244
448
|
className: modalClasses
|
|
@@ -250,30 +454,27 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
250
454
|
tabIndex: -1,
|
|
251
455
|
className: classNames(_defineProperty({}, "".concat(modalPrefixCls, "-wrapper"), modalContainer && ((isForceController ? visible : innerVisible) || !destroyOnClose))),
|
|
252
456
|
ref: wrapperRef,
|
|
253
|
-
|
|
457
|
+
onMouseDown: handleWrapperClick
|
|
254
458
|
}, /*#__PURE__*/React.createElement("div", {
|
|
255
459
|
className: "".concat(modalPrefixCls, "-dialog")
|
|
256
460
|
}, /*#__PURE__*/React.createElement(Draggable, {
|
|
257
|
-
|
|
258
|
-
x: 0,
|
|
259
|
-
y: 0
|
|
260
|
-
},
|
|
461
|
+
position: position,
|
|
261
462
|
handle: ".".concat(headerClass),
|
|
262
463
|
disabled: !draggable,
|
|
263
464
|
onStart: handleDragStart,
|
|
264
|
-
onDrag:
|
|
465
|
+
onDrag: handleDrag,
|
|
265
466
|
onStop: onDragStop,
|
|
266
467
|
bounds: bounds,
|
|
267
|
-
cancel: _concatInstanceProperty(
|
|
468
|
+
cancel: _concatInstanceProperty(_context11 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context11, modalPrefixCls, "-close-icon")
|
|
268
469
|
}, container))) : /*#__PURE__*/React.createElement(Draggable, {
|
|
269
|
-
defaultPosition: defaultPosition,
|
|
270
470
|
handle: ".".concat(headerClass),
|
|
271
471
|
disabled: !draggable,
|
|
472
|
+
position: position,
|
|
272
473
|
onStart: handleDragStart,
|
|
273
|
-
onDrag:
|
|
474
|
+
onDrag: handleDrag,
|
|
274
475
|
onStop: onDragStop,
|
|
275
476
|
bounds: bounds,
|
|
276
|
-
cancel: _concatInstanceProperty(
|
|
477
|
+
cancel: _concatInstanceProperty(_context12 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context12, modalPrefixCls, "-close-icon")
|
|
277
478
|
}, container));
|
|
278
479
|
var renderComp = ((isForceController ? visible : innerVisible) || !destroyOnClose) && comp;
|
|
279
480
|
if (modalContainer && renderComp) return /*#__PURE__*/ReactDOM.createPortal(renderComp, modalContainer);
|
package/es/modal/style/index.css
CHANGED
|
@@ -249,6 +249,65 @@
|
|
|
249
249
|
-ms-flex-negative: 0;
|
|
250
250
|
flex-shrink: 0;
|
|
251
251
|
}
|
|
252
|
+
.kd-modal-container-box .kd-modal-resise-handle {
|
|
253
|
+
position: absolute;
|
|
254
|
+
}
|
|
255
|
+
.kd-modal-container-box .kd-modal-resise-n {
|
|
256
|
+
top: 0;
|
|
257
|
+
left: 0;
|
|
258
|
+
width: 100%;
|
|
259
|
+
height: 6px;
|
|
260
|
+
cursor: ns-resize;
|
|
261
|
+
}
|
|
262
|
+
.kd-modal-container-box .kd-modal-resise-e {
|
|
263
|
+
top: 0;
|
|
264
|
+
right: 0;
|
|
265
|
+
height: 100%;
|
|
266
|
+
width: 6px;
|
|
267
|
+
cursor: ew-resize;
|
|
268
|
+
}
|
|
269
|
+
.kd-modal-container-box .kd-modal-resise-s {
|
|
270
|
+
bottom: 0;
|
|
271
|
+
left: 0;
|
|
272
|
+
height: 6px;
|
|
273
|
+
width: 100%;
|
|
274
|
+
cursor: ns-resize;
|
|
275
|
+
}
|
|
276
|
+
.kd-modal-container-box .kd-modal-resise-w {
|
|
277
|
+
left: 0;
|
|
278
|
+
top: 0;
|
|
279
|
+
height: 100%;
|
|
280
|
+
width: 6px;
|
|
281
|
+
cursor: ew-resize;
|
|
282
|
+
}
|
|
283
|
+
.kd-modal-container-box .kd-modal-resise-ne {
|
|
284
|
+
top: 0;
|
|
285
|
+
right: 0;
|
|
286
|
+
width: 6px;
|
|
287
|
+
height: 6px;
|
|
288
|
+
cursor: nesw-resize;
|
|
289
|
+
}
|
|
290
|
+
.kd-modal-container-box .kd-modal-resise-se {
|
|
291
|
+
bottom: 0;
|
|
292
|
+
right: 0;
|
|
293
|
+
width: 6px;
|
|
294
|
+
height: 6px;
|
|
295
|
+
cursor: nwse-resize;
|
|
296
|
+
}
|
|
297
|
+
.kd-modal-container-box .kd-modal-resise-sw {
|
|
298
|
+
bottom: 0;
|
|
299
|
+
left: 0;
|
|
300
|
+
width: 6px;
|
|
301
|
+
height: 6px;
|
|
302
|
+
cursor: nesw-resize;
|
|
303
|
+
}
|
|
304
|
+
.kd-modal-container-box .kd-modal-resise-nw {
|
|
305
|
+
top: 0;
|
|
306
|
+
left: 0;
|
|
307
|
+
width: 6px;
|
|
308
|
+
height: 6px;
|
|
309
|
+
cursor: nwse-resize;
|
|
310
|
+
}
|
|
252
311
|
.kd-modal-margin-btn {
|
|
253
312
|
margin-right: var(--kd-c-modal-footer-button-spacing, 12px);
|
|
254
313
|
}
|
|
@@ -268,6 +327,12 @@
|
|
|
268
327
|
vertical-align: middle;
|
|
269
328
|
content: '';
|
|
270
329
|
}
|
|
330
|
+
.kd-modal-wrapper-resizable {
|
|
331
|
+
text-align: unset;
|
|
332
|
+
}
|
|
333
|
+
.kd-modal-wrapper-resizable::before {
|
|
334
|
+
height: 0;
|
|
335
|
+
}
|
|
271
336
|
.kd-modal-dialog {
|
|
272
337
|
display: inline-block;
|
|
273
338
|
vertical-align: middle;
|
|
@@ -114,6 +114,69 @@
|
|
|
114
114
|
color: @modal-footer-font-color;
|
|
115
115
|
flex-shrink: 0;
|
|
116
116
|
}
|
|
117
|
+
|
|
118
|
+
.@{modal-prefix-cls}-resise {
|
|
119
|
+
&-handle {
|
|
120
|
+
position: absolute;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&-n {
|
|
124
|
+
top: 0;
|
|
125
|
+
left: 0;
|
|
126
|
+
width: 100%;
|
|
127
|
+
height: 6px;
|
|
128
|
+
cursor: ns-resize;
|
|
129
|
+
}
|
|
130
|
+
&-e {
|
|
131
|
+
top: 0;
|
|
132
|
+
right: 0;
|
|
133
|
+
height: 100%;
|
|
134
|
+
width: 6px;
|
|
135
|
+
cursor: ew-resize;
|
|
136
|
+
}
|
|
137
|
+
&-s {
|
|
138
|
+
bottom: 0;
|
|
139
|
+
left: 0;
|
|
140
|
+
height: 6px;
|
|
141
|
+
width: 100%;
|
|
142
|
+
cursor: ns-resize;
|
|
143
|
+
}
|
|
144
|
+
&-w {
|
|
145
|
+
left: 0;
|
|
146
|
+
top: 0;
|
|
147
|
+
height: 100%;
|
|
148
|
+
width: 6px;
|
|
149
|
+
cursor: ew-resize;
|
|
150
|
+
}
|
|
151
|
+
&-ne {
|
|
152
|
+
top: 0;
|
|
153
|
+
right: 0;
|
|
154
|
+
width: 6px;
|
|
155
|
+
height: 6px;
|
|
156
|
+
cursor: nesw-resize;
|
|
157
|
+
}
|
|
158
|
+
&-se {
|
|
159
|
+
bottom: 0;
|
|
160
|
+
right: 0;
|
|
161
|
+
width: 6px;
|
|
162
|
+
height: 6px;
|
|
163
|
+
cursor: nwse-resize;
|
|
164
|
+
}
|
|
165
|
+
&-sw {
|
|
166
|
+
bottom: 0;
|
|
167
|
+
left: 0;
|
|
168
|
+
width: 6px;
|
|
169
|
+
height: 6px;
|
|
170
|
+
cursor: nesw-resize;
|
|
171
|
+
}
|
|
172
|
+
&-nw {
|
|
173
|
+
top: 0;
|
|
174
|
+
left: 0;
|
|
175
|
+
width: 6px;
|
|
176
|
+
height: 6px;
|
|
177
|
+
cursor: nwse-resize;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
117
180
|
}
|
|
118
181
|
|
|
119
182
|
&-margin-btn {
|
|
@@ -136,6 +199,13 @@
|
|
|
136
199
|
vertical-align: middle;
|
|
137
200
|
content: '';
|
|
138
201
|
}
|
|
202
|
+
|
|
203
|
+
&-resizable {
|
|
204
|
+
text-align: unset;
|
|
205
|
+
&::before {
|
|
206
|
+
height: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
139
209
|
}
|
|
140
210
|
&-dialog {
|
|
141
211
|
display: inline-block;
|
|
@@ -25,6 +25,7 @@ var Notice = function Notice(props) {
|
|
|
25
25
|
key = noticeProps.key;
|
|
26
26
|
var noticePrefixCls = getPrefixCls(prefixCls, suffixCls, customPrefixcls);
|
|
27
27
|
var timer = null;
|
|
28
|
+
var isTransition = false;
|
|
28
29
|
var noticeRef = useRef();
|
|
29
30
|
var noticeClasses = classNames(noticePrefixCls, className, (_classNames = {}, _defineProperty(_classNames, _concatInstanceProperty(_context = "".concat(noticePrefixCls, "-")).call(_context, type), type), _defineProperty(_classNames, "".concat(noticePrefixCls, "-closable"), closable), _classNames));
|
|
30
31
|
var animationEvent = function animationEvent() {
|
|
@@ -33,7 +34,10 @@ var Notice = function Notice(props) {
|
|
|
33
34
|
(_b = noticeRef.current) === null || _b === void 0 ? void 0 : _b.classList.add("".concat(noticePrefixCls, "-leave-after"));
|
|
34
35
|
};
|
|
35
36
|
var transitionEvent = function transitionEvent() {
|
|
36
|
-
|
|
37
|
+
if (!isTransition) {
|
|
38
|
+
onClose && onClose(key);
|
|
39
|
+
}
|
|
40
|
+
isTransition = true;
|
|
37
41
|
};
|
|
38
42
|
var clearEventListener = function clearEventListener() {
|
|
39
43
|
var _a, _b;
|
|
@@ -42,6 +46,7 @@ var Notice = function Notice(props) {
|
|
|
42
46
|
};
|
|
43
47
|
var handleClose = function handleClose() {
|
|
44
48
|
var _a, _b, _c;
|
|
49
|
+
isTransition = false;
|
|
45
50
|
(_a = noticeRef.current) === null || _a === void 0 ? void 0 : _a.classList.add("".concat(noticePrefixCls, "-leave"));
|
|
46
51
|
(_b = noticeRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('animationend', animationEvent);
|
|
47
52
|
(_c = noticeRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('transitionend', transitionEvent);
|