@kdcloudjs/kdesign 1.7.39 → 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.
- package/CHANGELOG.md +35 -0
- package/dist/kdesign-complete.less +182 -14
- package/dist/kdesign.css +249 -3
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +1664 -129
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +3 -3
- package/dist/kdesign.min.js +14 -9
- package/dist/kdesign.min.js.map +1 -1
- package/es/alert/style/index.css +4 -2
- package/es/alert/style/index.less +3 -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 +10 -0
- package/es/config-provider/compDefaultProps.js +11 -1
- package/es/date-picker/context.d.ts +4 -2
- package/es/date-picker/date-picker.d.ts +9 -0
- package/es/date-picker/date-picker.js +4 -2
- package/es/date-picker/panel/month/month.js +14 -9
- package/es/date-picker/panel/quarter/quarter.js +12 -4
- package/es/date-picker/panel/time/time-column.d.ts +2 -0
- package/es/date-picker/panel/time/time-column.js +14 -5
- package/es/date-picker/panel/time/time.js +8 -4
- package/es/date-picker/panel/week/week.js +20 -10
- package/es/date-picker/panel/year/year.js +12 -4
- package/es/date-picker/range-picker.js +11 -4
- package/es/index.d.ts +1 -0
- package/es/index.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 +5 -0
- package/es/modal/modal.js +242 -15
- package/es/modal/style/index.css +86 -0
- package/es/modal/style/index.less +95 -9
- package/es/notification-base/notice.js +6 -1
- package/es/qr-code/index.d.ts +3 -0
- package/es/qr-code/index.js +3 -0
- package/es/qr-code/qr-code.d.ts +42 -0
- package/es/qr-code/qr-code.js +80 -0
- package/es/qr-code/style/css.js +2 -0
- package/es/qr-code/style/index.css +154 -0
- package/es/qr-code/style/index.d.ts +2 -0
- package/es/qr-code/style/index.js +2 -0
- package/es/qr-code/style/index.less +42 -0
- package/es/qr-code/style/mixin.less +6 -0
- package/es/qr-code/style/token.less +24 -0
- 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.js +2 -2
- package/es/tree/treeHooks.d.ts +1 -1
- package/es/tree/treeHooks.js +2 -2
- package/lib/alert/style/index.css +4 -2
- package/lib/alert/style/index.less +3 -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 +10 -0
- package/lib/config-provider/compDefaultProps.js +11 -1
- package/lib/date-picker/context.d.ts +4 -2
- package/lib/date-picker/date-picker.d.ts +9 -0
- package/lib/date-picker/date-picker.js +4 -2
- package/lib/date-picker/panel/month/month.js +14 -9
- package/lib/date-picker/panel/quarter/quarter.js +12 -4
- package/lib/date-picker/panel/time/time-column.d.ts +2 -0
- package/lib/date-picker/panel/time/time-column.js +14 -5
- package/lib/date-picker/panel/time/time.js +8 -4
- package/lib/date-picker/panel/week/week.js +20 -10
- package/lib/date-picker/panel/year/year.js +12 -4
- package/lib/date-picker/range-picker.js +11 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +7 -0
- 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 +5 -0
- package/lib/modal/modal.js +242 -15
- package/lib/modal/style/index.css +86 -0
- package/lib/modal/style/index.less +95 -9
- package/lib/notification-base/notice.js +6 -1
- package/lib/qr-code/index.d.ts +3 -0
- package/lib/qr-code/index.js +27 -0
- package/lib/qr-code/qr-code.d.ts +42 -0
- package/lib/qr-code/qr-code.js +96 -0
- package/lib/qr-code/style/css.js +4 -0
- package/lib/qr-code/style/index.css +154 -0
- package/lib/qr-code/style/index.d.ts +2 -0
- package/lib/qr-code/style/index.js +4 -0
- package/lib/qr-code/style/index.less +42 -0
- package/lib/qr-code/style/mixin.less +6 -0
- package/lib/qr-code/style/token.less +24 -0
- 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/style/components.less +1 -0
- package/lib/tree/tree.js +2 -2
- package/lib/tree/treeHooks.d.ts +1 -1
- package/lib/tree/treeHooks.js +2 -2
- package/package.json +11 -3
package/lib/modal/modal.js
CHANGED
|
@@ -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;
|
|
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,
|
|
@@ -84,7 +106,9 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
84
106
|
onDrag = modalProps.onDrag,
|
|
85
107
|
onDragStop = modalProps.onDragStop,
|
|
86
108
|
bounds = modalProps.bounds,
|
|
87
|
-
|
|
109
|
+
overroll = modalProps.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"]);
|
|
88
112
|
var isForceController = visible !== undefined;
|
|
89
113
|
var _useState = (0, _react.useState)(isForceController ? visible : true),
|
|
90
114
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -92,6 +116,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
92
116
|
setInnerVisible = _useState2[1]; // 需要根据visible来判断,不能一开始为true再去设置false
|
|
93
117
|
var previousActiveElement = (0, _react.useRef)(null);
|
|
94
118
|
var innerRef = (0, _react.useRef)(null);
|
|
119
|
+
var wrapperRef = (0, _react.useRef)(null);
|
|
95
120
|
var containerRef = ref || innerRef;
|
|
96
121
|
var modalPrefixCls = getPrefixCls(prefixCls, 'modal', customPrefixcls);
|
|
97
122
|
(0, _devwarning.default)(ModalTypes.indexOf(type) === -1, 'modal', "cannot found modal type '".concat(type, "'"));
|
|
@@ -104,6 +129,16 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
104
129
|
}
|
|
105
130
|
modalContainer = document.body;
|
|
106
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];
|
|
107
142
|
(0, _hooks.useHideDocumentScrollBar)(isForceController ? !!visible : !!innerVisible, modalContainer === document.body, !!mask);
|
|
108
143
|
var closeModal = (0, _react.useCallback)(function () {
|
|
109
144
|
setInnerVisible(false);
|
|
@@ -194,16 +229,168 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
194
229
|
document.body.removeEventListener('keydown', escapeToCloseModal);
|
|
195
230
|
};
|
|
196
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
|
+
};
|
|
197
379
|
var handleMaskClick = (0, _react.useCallback)(function () {
|
|
198
380
|
if (maskClosable) {
|
|
199
381
|
proxyCloseModal(onCancel);
|
|
200
382
|
}
|
|
201
383
|
}, [proxyCloseModal, onCancel, maskClosable]);
|
|
384
|
+
var handleWrapperClick = function handleWrapperClick(e) {
|
|
385
|
+
if (wrapperRef.current === e.target) {
|
|
386
|
+
handleMaskClick();
|
|
387
|
+
}
|
|
388
|
+
};
|
|
202
389
|
var isHidden = !destroyOnClose && !(isForceController ? visible : innerVisible);
|
|
203
390
|
var modalClasses = (0, _classnames.default)(modalPrefixCls, className, (_classNames3 = {}, (0, _defineProperty2.default)(_classNames3, "".concat(modalPrefixCls, "-container"), true), (0, _defineProperty2.default)(_classNames3, "".concat(modalPrefixCls, "-container-hidden"), isHidden), (0, _defineProperty2.default)(_classNames3, "".concat(modalPrefixCls, "-container-show"), !isHidden), _classNames3));
|
|
204
391
|
var headerClass = "".concat(modalPrefixCls, "-header");
|
|
205
392
|
var container = /*#__PURE__*/_react.default.createElement("div", {
|
|
206
|
-
className: (0, _classnames.default)((_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-container-box"), true), (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-has-container-box"), modalContainer), (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-showline"), showline), _classNames4)),
|
|
393
|
+
className: (0, _classnames.default)((_classNames4 = {}, (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-container-box"), true), (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-has-container-box"), modalContainer && !overroll), (0, _defineProperty2.default)(_classNames4, "".concat(modalPrefixCls, "-showline"), showline), _classNames4)),
|
|
207
394
|
style: {
|
|
208
395
|
width: width,
|
|
209
396
|
height: height
|
|
@@ -211,7 +398,31 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
211
398
|
ref: containerRef,
|
|
212
399
|
tabIndex: -1,
|
|
213
400
|
onKeyDown: enterToCloseModal
|
|
214
|
-
}, /*#__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", {
|
|
215
426
|
className: headerClass
|
|
216
427
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
217
428
|
className: "".concat(modalPrefixCls, "-title-container")
|
|
@@ -230,7 +441,7 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
230
441
|
className: (0, _classnames.default)("".concat(modalPrefixCls, "-body"), bodyClassName),
|
|
231
442
|
style: bodyStyle
|
|
232
443
|
}, body), footer !== null && /*#__PURE__*/_react.default.createElement("div", {
|
|
233
|
-
className: (0, _classnames.default)("".concat(modalPrefixCls, "-footer"), (0, _concat.default)(
|
|
444
|
+
className: (0, _classnames.default)("".concat(modalPrefixCls, "-footer"), (0, _concat.default)(_context10 = "".concat(modalPrefixCls, "-")).call(_context10, type, "-footer"), footerClassName),
|
|
234
445
|
style: (0, _extends2.default)({
|
|
235
446
|
flexDirection: !footer && (!footerBtnOrder || footerBtnOrder === 'normal') ? 'row' : 'row-reverse'
|
|
236
447
|
}, footerStyle || {})
|
|
@@ -240,12 +451,12 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
240
451
|
var handleDragStart = function handleDragStart(e, data) {
|
|
241
452
|
onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(e, data);
|
|
242
453
|
};
|
|
243
|
-
var
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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);
|
|
249
460
|
};
|
|
250
461
|
var comp = /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
251
462
|
className: modalClasses
|
|
@@ -253,15 +464,31 @@ var InternalModal = function InternalModal(props, ref) {
|
|
|
253
464
|
onClick: handleMaskClick,
|
|
254
465
|
className: (0, _classnames.default)(maskClassName, (0, _defineProperty2.default)({}, "".concat(modalPrefixCls, "-mask"), true)),
|
|
255
466
|
style: maskStyle
|
|
256
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
257
|
-
|
|
467
|
+
}), overroll ? /*#__PURE__*/_react.default.createElement("div", {
|
|
468
|
+
tabIndex: -1,
|
|
469
|
+
className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(modalPrefixCls, "-wrapper"), modalContainer && ((isForceController ? visible : innerVisible) || !destroyOnClose))),
|
|
470
|
+
ref: wrapperRef,
|
|
471
|
+
onMouseDown: handleWrapperClick
|
|
472
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
473
|
+
className: "".concat(modalPrefixCls, "-dialog")
|
|
474
|
+
}, /*#__PURE__*/_react.default.createElement(_reactDraggable.default, {
|
|
475
|
+
position: position,
|
|
476
|
+
handle: ".".concat(headerClass),
|
|
477
|
+
disabled: !draggable,
|
|
478
|
+
onStart: handleDragStart,
|
|
479
|
+
onDrag: handleDrag,
|
|
480
|
+
onStop: onDragStop,
|
|
481
|
+
bounds: bounds,
|
|
482
|
+
cancel: (0, _concat.default)(_context11 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context11, modalPrefixCls, "-close-icon")
|
|
483
|
+
}, container))) : /*#__PURE__*/_react.default.createElement(_reactDraggable.default, {
|
|
258
484
|
handle: ".".concat(headerClass),
|
|
259
485
|
disabled: !draggable,
|
|
486
|
+
position: position,
|
|
260
487
|
onStart: handleDragStart,
|
|
261
|
-
onDrag:
|
|
488
|
+
onDrag: handleDrag,
|
|
262
489
|
onStop: onDragStop,
|
|
263
490
|
bounds: bounds,
|
|
264
|
-
cancel: (0, _concat.default)(
|
|
491
|
+
cancel: (0, _concat.default)(_context12 = ".".concat(modalPrefixCls, "-title-container, .")).call(_context12, modalPrefixCls, "-close-icon")
|
|
265
492
|
}, container));
|
|
266
493
|
var renderComp = ((isForceController ? visible : innerVisible) || !destroyOnClose) && comp;
|
|
267
494
|
if (modalContainer && renderComp) return /*#__PURE__*/_reactDom.default.createPortal(renderComp, modalContainer);
|
|
@@ -249,9 +249,95 @@
|
|
|
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
|
}
|
|
314
|
+
.kd-modal-wrapper {
|
|
315
|
+
position: fixed;
|
|
316
|
+
top: 0;
|
|
317
|
+
right: 0;
|
|
318
|
+
bottom: 0;
|
|
319
|
+
left: 0;
|
|
320
|
+
overflow: auto;
|
|
321
|
+
text-align: center;
|
|
322
|
+
}
|
|
323
|
+
.kd-modal-wrapper::before {
|
|
324
|
+
display: inline-block;
|
|
325
|
+
width: 0;
|
|
326
|
+
height: 100%;
|
|
327
|
+
vertical-align: middle;
|
|
328
|
+
content: '';
|
|
329
|
+
}
|
|
330
|
+
.kd-modal-wrapper-resizable {
|
|
331
|
+
text-align: unset;
|
|
332
|
+
}
|
|
333
|
+
.kd-modal-wrapper-resizable::before {
|
|
334
|
+
height: 0;
|
|
335
|
+
}
|
|
336
|
+
.kd-modal-dialog {
|
|
337
|
+
display: inline-block;
|
|
338
|
+
vertical-align: middle;
|
|
339
|
+
max-width: calc(100vw);
|
|
340
|
+
}
|
|
255
341
|
.kd-modal-showline .kd-modal-header {
|
|
256
342
|
border-bottom: var(--kd-c-modal-sizing-border, 1px) solid var(--kd-c-modal-color-border, var(--kd-g-color-border-strong-2, #d9d9d9));
|
|
257
343
|
}
|
|
@@ -29,15 +29,13 @@
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&-hidden {
|
|
32
|
-
display: none
|
|
32
|
+
display: none;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
&-mask {
|
|
36
36
|
.overlay(@modal-mask-color-background, 0);
|
|
37
37
|
}
|
|
38
|
-
// &-mask + &-container-box {
|
|
39
38
|
|
|
40
|
-
// }
|
|
41
39
|
&-has-container-box {
|
|
42
40
|
position: fixed;
|
|
43
41
|
left: 50%;
|
|
@@ -116,16 +114,104 @@
|
|
|
116
114
|
color: @modal-footer-font-color;
|
|
117
115
|
flex-shrink: 0;
|
|
118
116
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
+
}
|
|
124
180
|
}
|
|
125
181
|
|
|
126
182
|
&-margin-btn {
|
|
127
183
|
margin-right: @modal-footer-button-spacing;
|
|
128
184
|
}
|
|
185
|
+
|
|
186
|
+
&-wrapper {
|
|
187
|
+
position: fixed;
|
|
188
|
+
top: 0;
|
|
189
|
+
right: 0;
|
|
190
|
+
bottom: 0;
|
|
191
|
+
left: 0;
|
|
192
|
+
overflow: auto;
|
|
193
|
+
text-align: center;
|
|
194
|
+
|
|
195
|
+
&::before {
|
|
196
|
+
display: inline-block;
|
|
197
|
+
width: 0;
|
|
198
|
+
height: 100%;
|
|
199
|
+
vertical-align: middle;
|
|
200
|
+
content: '';
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&-resizable {
|
|
204
|
+
text-align: unset;
|
|
205
|
+
&::before {
|
|
206
|
+
height: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
&-dialog {
|
|
211
|
+
display: inline-block;
|
|
212
|
+
vertical-align: middle;
|
|
213
|
+
max-width: calc(100vw);
|
|
214
|
+
}
|
|
129
215
|
}
|
|
130
216
|
|
|
131
217
|
.@{modal-prefix-cls}-showline {
|
|
@@ -135,4 +221,4 @@
|
|
|
135
221
|
.@{modal-prefix-cls}-footer {
|
|
136
222
|
border-top: @modal-border-width solid @modal-border-color;
|
|
137
223
|
}
|
|
138
|
-
}
|
|
224
|
+
}
|
|
@@ -38,6 +38,7 @@ var Notice = function Notice(props) {
|
|
|
38
38
|
key = noticeProps.key;
|
|
39
39
|
var noticePrefixCls = getPrefixCls(prefixCls, suffixCls, customPrefixcls);
|
|
40
40
|
var timer = null;
|
|
41
|
+
var isTransition = false;
|
|
41
42
|
var noticeRef = (0, _react.useRef)();
|
|
42
43
|
var noticeClasses = (0, _classnames.default)(noticePrefixCls, className, (_classNames = {}, (0, _defineProperty2.default)(_classNames, (0, _concat.default)(_context = "".concat(noticePrefixCls, "-")).call(_context, type), type), (0, _defineProperty2.default)(_classNames, "".concat(noticePrefixCls, "-closable"), closable), _classNames));
|
|
43
44
|
var animationEvent = function animationEvent() {
|
|
@@ -46,7 +47,10 @@ var Notice = function Notice(props) {
|
|
|
46
47
|
(_b = noticeRef.current) === null || _b === void 0 ? void 0 : _b.classList.add("".concat(noticePrefixCls, "-leave-after"));
|
|
47
48
|
};
|
|
48
49
|
var transitionEvent = function transitionEvent() {
|
|
49
|
-
|
|
50
|
+
if (!isTransition) {
|
|
51
|
+
onClose && onClose(key);
|
|
52
|
+
}
|
|
53
|
+
isTransition = true;
|
|
50
54
|
};
|
|
51
55
|
var clearEventListener = function clearEventListener() {
|
|
52
56
|
var _a, _b;
|
|
@@ -55,6 +59,7 @@ var Notice = function Notice(props) {
|
|
|
55
59
|
};
|
|
56
60
|
var handleClose = function handleClose() {
|
|
57
61
|
var _a, _b, _c;
|
|
62
|
+
isTransition = false;
|
|
58
63
|
(_a = noticeRef.current) === null || _a === void 0 ? void 0 : _a.classList.add("".concat(noticePrefixCls, "-leave"));
|
|
59
64
|
(_b = noticeRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('animationend', animationEvent);
|
|
60
65
|
(_c = noticeRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('transitionend', transitionEvent);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime-corejs3/helpers/typeof");
|
|
4
|
+
var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map");
|
|
5
|
+
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor");
|
|
6
|
+
var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
var _exportNames = {};
|
|
11
|
+
exports.default = void 0;
|
|
12
|
+
var _qrCode = _interopRequireWildcard(require("./qr-code"));
|
|
13
|
+
_Object$keys(_qrCode).forEach(function (key) {
|
|
14
|
+
if (key === "default" || key === "__esModule") return;
|
|
15
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
+
if (key in exports && exports[key] === _qrCode[key]) return;
|
|
17
|
+
Object.defineProperty(exports, key, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function get() {
|
|
20
|
+
return _qrCode[key];
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
+
var _default = _qrCode.default;
|
|
27
|
+
exports.default = _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { CSSProperties, FunctionComponentElement } from 'react';
|
|
2
|
+
export declare type QRPropsCanvas = QRProps & React.CanvasHTMLAttributes<HTMLCanvasElement>;
|
|
3
|
+
export declare type QRPropsSvg = QRProps & React.SVGAttributes<SVGSVGElement>;
|
|
4
|
+
export declare const QRCodeTypes: ["canvas", "svg"];
|
|
5
|
+
export declare type QRCodeType = typeof QRCodeTypes[number];
|
|
6
|
+
export declare const QRCodeStatus: ["active", "expired", "loading"];
|
|
7
|
+
export declare type QRCodeStatus = typeof QRCodeStatus[number];
|
|
8
|
+
export declare const QRCodeErrorLevels: ["L", "M", "Q", "H"];
|
|
9
|
+
export declare type QRCodeErrorLevel = typeof QRCodeErrorLevels[number];
|
|
10
|
+
interface ImageSettings {
|
|
11
|
+
src: string;
|
|
12
|
+
height: number;
|
|
13
|
+
width: number;
|
|
14
|
+
excavate: boolean;
|
|
15
|
+
x?: number;
|
|
16
|
+
y?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface QRProps {
|
|
19
|
+
value: string;
|
|
20
|
+
type?: QRCodeType;
|
|
21
|
+
size?: number;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
color?: string;
|
|
24
|
+
bgColor?: string;
|
|
25
|
+
bordered?: boolean;
|
|
26
|
+
imageSettings?: ImageSettings;
|
|
27
|
+
}
|
|
28
|
+
export interface QRCodeProps extends QRProps {
|
|
29
|
+
className?: string;
|
|
30
|
+
prefixCls?: string;
|
|
31
|
+
icon?: string;
|
|
32
|
+
iconSize?: number;
|
|
33
|
+
status?: QRCodeStatus;
|
|
34
|
+
errorLevel?: QRCodeErrorLevel;
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
onRefresh?: () => void;
|
|
37
|
+
}
|
|
38
|
+
declare const QRCode: {
|
|
39
|
+
(props: QRCodeProps): FunctionComponentElement<QRCodeProps>;
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
42
|
+
export default QRCode;
|