@kdcloudjs/kdesign 1.7.40 → 1.7.41

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 (44) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/kdesign-complete.less +79 -5
  3. package/dist/kdesign.css +69 -1
  4. package/dist/kdesign.css.map +1 -1
  5. package/dist/kdesign.js +331 -32
  6. package/dist/kdesign.js.map +1 -1
  7. package/dist/kdesign.min.css +2 -2
  8. package/dist/kdesign.min.js +10 -10
  9. package/dist/kdesign.min.js.map +1 -1
  10. package/es/button/index.d.ts +2 -1
  11. package/es/carousel/index.d.ts +2 -2
  12. package/es/city-picker/index.d.ts +2 -0
  13. package/es/collapse/index.d.ts +2 -2
  14. package/es/config-provider/compDefaultProps.d.ts +1 -0
  15. package/es/config-provider/compDefaultProps.js +2 -1
  16. package/es/input/TextArea.js +16 -8
  17. package/es/input/style/index.css +3 -0
  18. package/es/input/style/index.less +9 -5
  19. package/es/modal/modal.d.ts +4 -0
  20. package/es/modal/modal.js +221 -20
  21. package/es/modal/style/index.css +65 -0
  22. package/es/modal/style/index.less +70 -0
  23. package/es/notification-base/notice.js +6 -1
  24. package/es/search/search-panel.d.ts +1 -1
  25. package/es/select/index.d.ts +1 -0
  26. package/es/select/index.js +1 -0
  27. package/lib/button/index.d.ts +2 -1
  28. package/lib/carousel/index.d.ts +2 -2
  29. package/lib/city-picker/index.d.ts +2 -0
  30. package/lib/collapse/index.d.ts +2 -2
  31. package/lib/config-provider/compDefaultProps.d.ts +1 -0
  32. package/lib/config-provider/compDefaultProps.js +2 -1
  33. package/lib/input/TextArea.js +16 -8
  34. package/lib/input/style/index.css +3 -0
  35. package/lib/input/style/index.less +9 -5
  36. package/lib/modal/modal.d.ts +4 -0
  37. package/lib/modal/modal.js +221 -20
  38. package/lib/modal/style/index.css +65 -0
  39. package/lib/modal/style/index.less +70 -0
  40. package/lib/notification-base/notice.js +6 -1
  41. package/lib/search/search-panel.d.ts +1 -1
  42. package/lib/select/index.d.ts +1 -0
  43. package/lib/select/index.js +14 -0
  44. package/package.json +8 -2
@@ -5,4 +5,5 @@ interface CompoundedComponent extends React.ForwardRefExoticComponent<ISelectPro
5
5
  Option: typeof Option;
6
6
  }
7
7
  declare const Select: CompoundedComponent;
8
+ export * from './interface';
8
9
  export default Select;
@@ -2,4 +2,5 @@ import InternalSelect from './select';
2
2
  import Option from './option';
3
3
  var Select = InternalSelect;
4
4
  Select.Option = Option;
5
+ export * from './interface';
5
6
  export default Select;
@@ -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;
@@ -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;
@@ -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;
@@ -192,6 +192,7 @@ declare const compDefaultProps: {
192
192
  okButtonProps: {};
193
193
  showline: boolean;
194
194
  overroll: boolean;
195
+ resizable: boolean;
195
196
  };
196
197
  Menu: {
197
198
  mode: string;
@@ -207,7 +207,8 @@ var compDefaultProps = {
207
207
  cancelButtonProps: {},
208
208
  okButtonProps: {},
209
209
  showline: true,
210
- overroll: false
210
+ overroll: false,
211
+ resizable: false
211
212
  },
212
213
  Menu: {
213
214
  mode: 'vertical',
@@ -82,6 +82,10 @@ var InternalTextarea = function InternalTextarea(props, ref) {
82
82
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
83
83
  showNumberMark = _useState6[0],
84
84
  setShowNumberMark = _useState6[1];
85
+ var _useState7 = (0, _react.useState)(false),
86
+ _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
87
+ numberMarkError = _useState8[0],
88
+ setNumberMarkError = _useState8[1];
85
89
  var resizeTextarea = (0, _react.useCallback)(function () {
86
90
  if (!autoSize || !textareaRef.current) {
87
91
  return;
@@ -129,21 +133,25 @@ var InternalTextarea = function InternalTextarea(props, ref) {
129
133
  onChange && onChange(event);
130
134
  };
131
135
  var renderNumberMark = function renderNumberMark() {
132
- var enteredLength = value ? value.length : 0;
133
- if (enteredLength >= maxLength) {
134
- enteredLength = maxLength;
135
- }
136
- if (count && showNumberMark && !disabled && maxLength !== '' && maxLength >= 0) {
137
- var countClass = (0, _classnames.default)("".concat(textAreaPrefixCls, "-textarea-mark"), (0, _defineProperty2.default)({}, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'));
136
+ if (count && (showNumberMark || numberMarkError) && !disabled && maxLength !== '' && maxLength >= 0) {
137
+ var _classNames;
138
+ var countClass = (0, _classnames.default)("".concat(textAreaPrefixCls, "-textarea-mark"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-inner"), countPosition === 'inner'), (0, _defineProperty2.default)(_classNames, "".concat(textAreaPrefixCls, "-textarea-mark-error"), numberMarkError), _classNames));
138
139
  return /*#__PURE__*/_react.default.createElement("div", {
139
140
  className: countClass
140
- }, enteredLength, "/", maxLength);
141
+ }, value ? value.length : 0, "/", maxLength);
141
142
  }
142
143
  return null;
143
144
  };
144
145
  (0, _react.useEffect)(function () {
145
146
  resizeTextarea();
146
147
  }, [value, resizeTextarea]);
148
+ (0, _react.useEffect)(function () {
149
+ if (value && maxLength && value.length > maxLength) {
150
+ setNumberMarkError(true);
151
+ } else {
152
+ setNumberMarkError(false);
153
+ }
154
+ }, [value]);
147
155
  (0, _react.useEffect)(function () {
148
156
  if (propsValue !== undefined) {
149
157
  setValue(propsValue);
@@ -185,7 +193,7 @@ var InternalTextarea = function InternalTextarea(props, ref) {
185
193
  ref: textareaRef,
186
194
  disabled: disabled,
187
195
  style: (0, _extends2.default)({}, textareaStyles, hadCount || !!allowClear ? otherStyles : style),
188
- className: (0, _classnames.default)("".concat(prefixCls, "-textarea"), (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-error"), status === 'error'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), (0, _defineProperty2.default)({}, className, className && !allowClear && !hadCount)),
196
+ className: (0, _classnames.default)("".concat(prefixCls, "-textarea"), (_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context = "".concat(prefixCls, "-size-")).call(_context, size), size), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-borderless"), borderType === 'none'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-underline"), borderType === 'underline'), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-no-resize"), canResize !== true), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-allowClear-spacing"), !!allowClear), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-error"), status === 'error' || numberMarkError), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-disabled"), disabled), _classNames2), (0, _defineProperty2.default)({}, className, className && !allowClear && !hadCount)),
189
197
  onChange: handleChange,
190
198
  onFocus: !disabled ? handleFocus : undefined,
191
199
  onBlur: !disabled ? handleBlur : undefined,
@@ -215,6 +215,9 @@ textarea {
215
215
  bottom: 5px;
216
216
  right: 8px;
217
217
  }
218
+ .kd-input-textarea-mark-error {
219
+ color: var(--kd-c-input-color-error, var(--kd-g-color-error, #fb2323));
220
+ }
218
221
  .kd-input-no-resize {
219
222
  resize: none;
220
223
  }
@@ -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
- &-mark-inner {
49
- top: auto;
50
- bottom: 5px;
51
- right: 8px;
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
 
@@ -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;
@@ -40,8 +40,30 @@ var ConfirmModalTypes = ['confirm', 'normal'];
40
40
  exports.ConfirmModalTypes = ConfirmModalTypes;
41
41
  var ModalTypes = (0, _type.tuple)('confirm', 'warning', 'error', 'normal');
42
42
  exports.ModalTypes = ModalTypes;
43
+ var DragDirection;
44
+ (function (DragDirection) {
45
+ DragDirection["N"] = "n";
46
+ DragDirection["E"] = "e";
47
+ DragDirection["S"] = "s";
48
+ DragDirection["W"] = "w";
49
+ DragDirection["NE"] = "ne";
50
+ DragDirection["NW"] = "nw";
51
+ DragDirection["SE"] = "se";
52
+ DragDirection["SW"] = "sw";
53
+ })(DragDirection || (DragDirection = {}));
54
+ var initPosition = {
55
+ initialX: 0,
56
+ initialY: 0,
57
+ initialWidth: 0,
58
+ initialHeight: 0,
59
+ top: 0,
60
+ left: 0,
61
+ x: 0,
62
+ y: 0,
63
+ type: null
64
+ };
43
65
  var InternalModal = function InternalModal(props, ref) {
44
- var _classNames3, _classNames4, _context2, _context3, _context4;
66
+ var _classNames3, _classNames4, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12;
45
67
  var _useContext = (0, _react.useContext)(_ConfigContext.default),
46
68
  getPrefixCls = _useContext.getPrefixCls,
47
69
  prefixCls = _useContext.prefixCls,
@@ -85,7 +107,8 @@ var InternalModal = function InternalModal(props, ref) {
85
107
  onDragStop = modalProps.onDragStop,
86
108
  bounds = modalProps.bounds,
87
109
  overroll = modalProps.overroll,
88
- 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"]);
110
+ resizable = modalProps.resizable,
111
+ 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"]);
89
112
  var isForceController = visible !== undefined;
90
113
  var _useState = (0, _react.useState)(isForceController ? visible : true),
91
114
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -106,6 +129,16 @@ var InternalModal = function InternalModal(props, ref) {
106
129
  }
107
130
  modalContainer = document.body;
108
131
  }
132
+ var _useState3 = (0, _react.useState)(modalContainer && !overroll ? {
133
+ x: -(width / 2),
134
+ y: -(height / 2)
135
+ } : {
136
+ x: 0,
137
+ y: 0
138
+ }),
139
+ _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
140
+ position = _useState4[0],
141
+ setPosition = _useState4[1];
109
142
  (0, _hooks.useHideDocumentScrollBar)(isForceController ? !!visible : !!innerVisible, modalContainer === document.body, !!mask);
110
143
  var closeModal = (0, _react.useCallback)(function () {
111
144
  setInnerVisible(false);
@@ -196,6 +229,153 @@ var InternalModal = function InternalModal(props, ref) {
196
229
  document.body.removeEventListener('keydown', escapeToCloseModal);
197
230
  };
198
231
  }, [keyboard, escapeToCloseModal, proxyCloseModal, onCancel]);
232
+ var isResizing = false;
233
+ var initPositionRef = (0, _react.useRef)(initPosition);
234
+ var startResize = (0, _react.useCallback)(function (event) {
235
+ var targetElement = event.target;
236
+ if (!targetElement.classList.contains("".concat(modalPrefixCls, "-resise-handle")) || !containerRef.current) {
237
+ return;
238
+ }
239
+ var _containerRef$current = containerRef.current.getBoundingClientRect(),
240
+ initialWidth = _containerRef$current.width,
241
+ initialHeight = _containerRef$current.height,
242
+ top = _containerRef$current.top,
243
+ left = _containerRef$current.left;
244
+ initPositionRef.current = {
245
+ initialX: event.clientX,
246
+ initialY: event.clientY,
247
+ initialWidth: initialWidth,
248
+ initialHeight: initialHeight,
249
+ top: top,
250
+ left: left,
251
+ x: position.x,
252
+ y: position.y,
253
+ type: targetElement.dataset.type
254
+ };
255
+ event.preventDefault();
256
+ isResizing = true;
257
+ if (overroll && wrapperRef.current) {
258
+ wrapperRef.current.classList.add("".concat(modalPrefixCls, "-wrapper-resizable"));
259
+ setPosition({
260
+ x: left,
261
+ y: top
262
+ });
263
+ initPositionRef.current.x = left;
264
+ initPositionRef.current.y = top;
265
+ }
266
+ document.addEventListener('mousemove', resize);
267
+ document.addEventListener('mouseup', stopResize);
268
+ }, [position]);
269
+ (0, _react.useEffect)(function () {
270
+ if (containerRef.current && visible) {
271
+ containerRef.current.addEventListener('mousedown', startResize);
272
+ }
273
+ return function () {
274
+ if (containerRef.current) {
275
+ containerRef.current.removeEventListener('mousedown', startResize);
276
+ }
277
+ };
278
+ }, [containerRef, startResize, visible]);
279
+ var resize = function resize(event) {
280
+ if (!containerRef.current) return;
281
+ if (!isResizing || !containerRef.current) return;
282
+ var _initPositionRef$curr = initPositionRef.current,
283
+ initialX = _initPositionRef$curr.initialX,
284
+ initialY = _initPositionRef$curr.initialY,
285
+ initialHeight = _initPositionRef$curr.initialHeight,
286
+ initialWidth = _initPositionRef$curr.initialWidth,
287
+ y = _initPositionRef$curr.y,
288
+ x = _initPositionRef$curr.x,
289
+ type = _initPositionRef$curr.type;
290
+ var curNHeight = initialY - event.clientY;
291
+ var curSHeight = -curNHeight;
292
+ var curEWidth = event.clientX - initialX;
293
+ var curWWidth = -curEWidth;
294
+ switch (type) {
295
+ case DragDirection.N:
296
+ {
297
+ containerRef.current.style.height = "".concat(curNHeight + initialHeight, "px");
298
+ setPosition(function (pre) {
299
+ return {
300
+ y: y - curNHeight,
301
+ x: pre.x
302
+ };
303
+ });
304
+ break;
305
+ }
306
+ case DragDirection.E:
307
+ {
308
+ containerRef.current.style.width = "".concat(curEWidth + initialWidth, "px");
309
+ break;
310
+ }
311
+ case DragDirection.S:
312
+ {
313
+ containerRef.current.style.height = "".concat(curSHeight + initialHeight, "px");
314
+ break;
315
+ }
316
+ case DragDirection.W:
317
+ {
318
+ containerRef.current.style.width = "".concat(curWWidth + initialWidth, "px");
319
+ setPosition(function (pre) {
320
+ return {
321
+ y: pre.y,
322
+ x: x - curWWidth
323
+ };
324
+ });
325
+ break;
326
+ }
327
+ case DragDirection.NE:
328
+ {
329
+ containerRef.current.style.height = "".concat(curNHeight + initialHeight, "px");
330
+ containerRef.current.style.width = "".concat(curEWidth + initialWidth, "px");
331
+ setPosition(function (pre) {
332
+ return {
333
+ y: y - curNHeight,
334
+ x: pre.x
335
+ };
336
+ });
337
+ break;
338
+ }
339
+ case DragDirection.NW:
340
+ {
341
+ containerRef.current.style.height = "".concat(curNHeight + initialHeight, "px");
342
+ containerRef.current.style.width = "".concat(curWWidth + initialWidth, "px");
343
+ setPosition({
344
+ y: y - curNHeight,
345
+ x: x - curWWidth
346
+ });
347
+ break;
348
+ }
349
+ case DragDirection.SE:
350
+ {
351
+ containerRef.current.style.height = "".concat(curSHeight + initialHeight, "px");
352
+ containerRef.current.style.width = "".concat(curEWidth + initialWidth, "px");
353
+ break;
354
+ }
355
+ case DragDirection.SW:
356
+ {
357
+ containerRef.current.style.width = "".concat(curWWidth + initialWidth, "px");
358
+ containerRef.current.style.height = "".concat(curSHeight + initialHeight, "px");
359
+ setPosition(function (pre) {
360
+ return {
361
+ y: pre.y,
362
+ x: x - curWWidth
363
+ };
364
+ });
365
+ break;
366
+ }
367
+ default:
368
+ {
369
+ break;
370
+ }
371
+ }
372
+ };
373
+ var stopResize = function stopResize() {
374
+ isResizing = false;
375
+ initPositionRef.current = initPosition;
376
+ document.removeEventListener('mousemove', resize);
377
+ document.removeEventListener('mouseup', stopResize);
378
+ };
199
379
  var handleMaskClick = (0, _react.useCallback)(function () {
200
380
  if (maskClosable) {
201
381
  proxyCloseModal(onCancel);
@@ -218,7 +398,31 @@ var InternalModal = function InternalModal(props, ref) {
218
398
  ref: containerRef,
219
399
  tabIndex: -1,
220
400
  onKeyDown: enterToCloseModal
221
- }, /*#__PURE__*/_react.default.createElement("div", {
401
+ }, resizable && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
402
+ "data-type": "n",
403
+ className: (0, _concat.default)(_context2 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context2, modalPrefixCls, "-resise-n")
404
+ }), /*#__PURE__*/_react.default.createElement("div", {
405
+ "data-type": "e",
406
+ className: (0, _concat.default)(_context3 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context3, modalPrefixCls, "-resise-e")
407
+ }), /*#__PURE__*/_react.default.createElement("div", {
408
+ "data-type": "s",
409
+ className: (0, _concat.default)(_context4 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context4, modalPrefixCls, "-resise-s")
410
+ }), /*#__PURE__*/_react.default.createElement("div", {
411
+ "data-type": "w",
412
+ className: (0, _concat.default)(_context5 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context5, modalPrefixCls, "-resise-w")
413
+ }), /*#__PURE__*/_react.default.createElement("div", {
414
+ "data-type": "ne",
415
+ className: (0, _concat.default)(_context6 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context6, modalPrefixCls, "-resise-ne")
416
+ }), /*#__PURE__*/_react.default.createElement("div", {
417
+ "data-type": "se",
418
+ className: (0, _concat.default)(_context7 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context7, modalPrefixCls, "-resise-se")
419
+ }), /*#__PURE__*/_react.default.createElement("div", {
420
+ "data-type": "sw",
421
+ className: (0, _concat.default)(_context8 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context8, modalPrefixCls, "-resise-sw")
422
+ }), /*#__PURE__*/_react.default.createElement("div", {
423
+ "data-type": "nw",
424
+ className: (0, _concat.default)(_context9 = "".concat(modalPrefixCls, "-resise-handle ")).call(_context9, modalPrefixCls, "-resise-nw")
425
+ })), /*#__PURE__*/_react.default.createElement("div", {
222
426
  className: headerClass
223
427
  }, /*#__PURE__*/_react.default.createElement("div", {
224
428
  className: "".concat(modalPrefixCls, "-title-container")
@@ -237,7 +441,7 @@ var InternalModal = function InternalModal(props, ref) {
237
441
  className: (0, _classnames.default)("".concat(modalPrefixCls, "-body"), bodyClassName),
238
442
  style: bodyStyle
239
443
  }, body), footer !== null && /*#__PURE__*/_react.default.createElement("div", {
240
- className: (0, _classnames.default)("".concat(modalPrefixCls, "-footer"), (0, _concat.default)(_context2 = "".concat(modalPrefixCls, "-")).call(_context2, type, "-footer"), footerClassName),
444
+ className: (0, _classnames.default)("".concat(modalPrefixCls, "-footer"), (0, _concat.default)(_context10 = "".concat(modalPrefixCls, "-")).call(_context10, type, "-footer"), footerClassName),
241
445
  style: (0, _extends2.default)({
242
446
  flexDirection: !footer && (!footerBtnOrder || footerBtnOrder === 'normal') ? 'row' : 'row-reverse'
243
447
  }, footerStyle || {})
@@ -247,12 +451,12 @@ var InternalModal = function InternalModal(props, ref) {
247
451
  var handleDragStart = function handleDragStart(e, data) {
248
452
  onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(e, data);
249
453
  };
250
- var defaultPosition = modalContainer ? {
251
- x: -(width / 2),
252
- y: -(height / 2)
253
- } : {
254
- x: 0,
255
- y: 0
454
+ var handleDrag = function handleDrag(e, ui) {
455
+ setPosition({
456
+ x: ui.x,
457
+ y: ui.y
458
+ });
459
+ onDrag === null || onDrag === void 0 ? void 0 : onDrag(e, ui);
256
460
  };
257
461
  var comp = /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
258
462
  className: modalClasses
@@ -264,30 +468,27 @@ var InternalModal = function InternalModal(props, ref) {
264
468
  tabIndex: -1,
265
469
  className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(modalPrefixCls, "-wrapper"), modalContainer && ((isForceController ? visible : innerVisible) || !destroyOnClose))),
266
470
  ref: wrapperRef,
267
- onClick: handleWrapperClick
471
+ onMouseDown: handleWrapperClick
268
472
  }, /*#__PURE__*/_react.default.createElement("div", {
269
473
  className: "".concat(modalPrefixCls, "-dialog")
270
474
  }, /*#__PURE__*/_react.default.createElement(_reactDraggable.default, {
271
- defaultPosition: {
272
- x: 0,
273
- y: 0
274
- },
475
+ position: position,
275
476
  handle: ".".concat(headerClass),
276
477
  disabled: !draggable,
277
478
  onStart: handleDragStart,
278
- onDrag: onDrag,
479
+ onDrag: handleDrag,
279
480
  onStop: onDragStop,
280
481
  bounds: bounds,
281
- cancel: (0, _concat.default)(_context3 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context3, modalPrefixCls, "-close-icon")
482
+ cancel: (0, _concat.default)(_context11 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context11, modalPrefixCls, "-close-icon")
282
483
  }, container))) : /*#__PURE__*/_react.default.createElement(_reactDraggable.default, {
283
- defaultPosition: defaultPosition,
284
484
  handle: ".".concat(headerClass),
285
485
  disabled: !draggable,
486
+ position: position,
286
487
  onStart: handleDragStart,
287
- onDrag: onDrag,
488
+ onDrag: handleDrag,
288
489
  onStop: onDragStop,
289
490
  bounds: bounds,
290
- cancel: (0, _concat.default)(_context4 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context4, modalPrefixCls, "-close-icon")
491
+ cancel: (0, _concat.default)(_context12 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context12, modalPrefixCls, "-close-icon")
291
492
  }, container));
292
493
  var renderComp = ((isForceController ? visible : innerVisible) || !destroyOnClose) && comp;
293
494
  if (modalContainer && renderComp) return /*#__PURE__*/_reactDom.default.createPortal(renderComp, modalContainer);
@@ -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;