@para-ui/core 4.0.0-rc.5 → 4.0.0-rc.7
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/AutoTips/index.js +2 -2
- package/Button/index.js +1 -1
- package/Cascader/index.js +5 -4
- package/ComboSelect/index.js +27 -16
- package/ComboSelect/lang/en_US.d.ts +1 -0
- package/ComboSelect/lang/index.d.ts +2 -0
- package/ComboSelect/lang/zh_CN.d.ts +1 -0
- package/ComboSelect/utils.d.ts +6 -0
- package/DatePicker/index.js +3 -1
- package/DatePicker/util.d.ts +6 -6
- package/DynamicMultiBox/index.js +11 -562
- package/Form/index.js +9 -5
- package/FormItem/index.js +9 -5
- package/FunctionModal/index.js +2 -2
- package/Menu/index.js +1 -1
- package/OperateBtn/index.js +8 -6
- package/Pagination/index.js +1 -1
- package/QuickReply/QuickReplyCode/index.d.ts +10 -0
- package/QuickReply/index.d.ts +87 -0
- package/QuickReply/index.js +550 -0
- package/QuickReply/lang/en_US.d.ts +14 -0
- package/QuickReply/lang/index.d.ts +29 -0
- package/QuickReply/lang/zh_CN.d.ts +14 -0
- package/README.md +1 -0
- package/Select/index.js +4 -3
- package/Selector/index.js +3 -326
- package/SelectorPicker/index.js +7 -4
- package/Styles/theme.scss +1 -0
- package/Switch/index.js +2 -2
- package/Table/index.js +472 -410
- package/Tabs/index.js +3 -3
- package/Tag/index.js +84 -55
- package/TextEditor/index.js +3 -3
- package/TimePicker/index.js +3 -1
- package/Timeline/index.js +14 -20
- package/ToggleButton/index.js +25 -26
- package/Tooltip/index.js +26 -27
- package/Transfer/index.js +50 -45
- package/Tree/index.js +8 -4
- package/Upload/index.js +626 -409
- package/_verture/{index-f186b5e8.js → index-3156e3ef.js} +394 -312
- package/_verture/{index-0ced30f7.js → index-466a3496.js} +3 -18
- package/_verture/index-d6093d1c.js +559 -0
- package/_verture/index-d63bd287.js +327 -0
- package/_verture/{index-ef1235fb.js → index-f518e244.js} +1 -1
- package/_verture/{slicedToArray-8223a2ef.js → slicedToArray-75fa4188.js} +1 -1
- package/_verture/toConsumableArray-c7a8028f.js +19 -0
- package/_verture/{utils-46e99c9a.js → utils-c17b5265.js} +16 -1
- package/index.d.ts +2 -0
- package/index.js +15 -9
- package/locale/en-US.d.ts +14 -0
- package/locale/index.d.ts +28 -0
- package/locale/index.js +30 -2
- package/locale/zh-CN.d.ts +14 -0
- package/package.json +11 -10
- package/umd/AutoTips.js +1 -1
- package/umd/Breadcrumbs.js +1 -1
- package/umd/Button.js +1 -1
- package/umd/ButtonGroup.js +1 -1
- package/umd/Cascader.js +1 -1
- package/umd/ComboSelect.js +4 -4
- package/umd/CopyText.js +1 -1
- package/umd/DatePicker.js +7 -7
- package/umd/Descriptions.js +1 -1
- package/umd/Desktop.js +6 -6
- package/umd/Drawer.js +1 -1
- package/umd/DynamicMultiBox.js +4 -4
- package/umd/Form.js +4 -4
- package/umd/FormItem.js +4 -4
- package/umd/FunctionModal.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/Menu.js +1 -1
- package/umd/Modal.js +7 -7
- package/umd/MultiBox.js +1 -1
- package/umd/OperateBtn.js +2 -2
- package/umd/PageHeader.js +6 -6
- package/umd/Pagination.js +2 -2
- package/umd/PopConfirm.js +1 -1
- package/umd/QuickReply.js +55 -0
- package/umd/Search.js +1 -1
- package/umd/Select.js +2 -2
- package/umd/SelectInput.js +2 -2
- package/umd/Selector.js +1 -1
- package/umd/SelectorPicker.js +2 -2
- package/umd/SingleBox.js +1 -1
- package/umd/Stepper.js +1 -1
- package/umd/Table.js +2 -2
- package/umd/Tabs.js +1 -1
- package/umd/Tag.js +1 -1
- package/umd/TextField.js +1 -1
- package/umd/TimePicker.js +7 -7
- package/umd/Title.js +1 -1
- package/umd/ToggleButton.js +5 -5
- package/umd/Transfer.js +1 -1
- package/umd/Tree.js +4 -4
- package/umd/Upload.js +1 -1
- package/umd/locale.js +1 -1
- /package/_verture/{modalContext-5df08980.js → modalContext-7b512b0c.js} +0 -0
- /package/_verture/{typeof-c310ee4a.js → typeof-b240b062.js} +0 -0
package/DynamicMultiBox/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
3
3
|
import { Popover } from '../Popover/index.js';
|
|
4
4
|
import Label from '../Label/index.js';
|
|
5
5
|
import { CheckboxGroup } from '../CheckboxGroup/index.js';
|
|
@@ -17,7 +17,7 @@ import { ComboSelect } from '../ComboSelect/index.js';
|
|
|
17
17
|
import DatePicker from '../DatePicker/index.js';
|
|
18
18
|
import AutoTips from '../AutoTips/index.js';
|
|
19
19
|
import { UUID } from '@paraview/lib';
|
|
20
|
-
import {
|
|
20
|
+
import { d as dist } from '../_verture/index-d6093d1c.js';
|
|
21
21
|
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
22
22
|
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
23
23
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
@@ -52,10 +52,13 @@ import '@para-ui/icons/Up';
|
|
|
52
52
|
import '../MultiBox/index.js';
|
|
53
53
|
import '@para-ui/icons/Internet';
|
|
54
54
|
import '../Table/index.js';
|
|
55
|
+
import '../_verture/typeof-adeedc13.js';
|
|
56
|
+
import '../_verture/slicedToArray-75fa4188.js';
|
|
55
57
|
import '../Button/index.js';
|
|
56
58
|
import '@para-ui/icons/ScreenF';
|
|
57
59
|
import '@para-ui/icons/UpTriangleF';
|
|
58
60
|
import '@para-ui/icons/DownTriangleF';
|
|
61
|
+
import '../_verture/defineProperty-1d116156.js';
|
|
59
62
|
import '../Radio/index.js';
|
|
60
63
|
import '../OperateBtn/index.js';
|
|
61
64
|
import '@para-ui/icons/More';
|
|
@@ -70,50 +73,30 @@ import 'rc-pagination';
|
|
|
70
73
|
import '@para-ui/icons/Right';
|
|
71
74
|
import '@para-ui/icons/DoubleLeft';
|
|
72
75
|
import '@para-ui/icons/DoubleRight';
|
|
73
|
-
import '../_verture/index-
|
|
76
|
+
import '../_verture/index-3156e3ef.js';
|
|
77
|
+
import '../_verture/toConsumableArray-c7a8028f.js';
|
|
78
|
+
import '../_verture/index-d63bd287.js';
|
|
79
|
+
import '../_verture/typeof-b240b062.js';
|
|
74
80
|
import 'rc-tree';
|
|
75
|
-
import '../_verture/typeof-adeedc13.js';
|
|
76
81
|
import '@para-ui/icons/Document';
|
|
77
|
-
import '../_verture/slicedToArray-8223a2ef.js';
|
|
78
82
|
import 'react-dom';
|
|
79
83
|
import '@para-ui/icons/EditFile';
|
|
80
84
|
import '@para-ui/icons/PlusCircle';
|
|
81
85
|
import '@para-ui/icons/MoreCircle';
|
|
82
|
-
import '../_verture/utils-
|
|
86
|
+
import '../_verture/utils-c17b5265.js';
|
|
83
87
|
import '../Search/index.js';
|
|
84
88
|
import 'rc-picker/es/generate/dayjs';
|
|
85
89
|
import '../Tag/index.js';
|
|
86
90
|
import '@para-ui/icons/EditOutline';
|
|
87
91
|
import '../_verture/tinycolor-ece3542d.js';
|
|
88
92
|
import '@para-ui/icons/Plus';
|
|
89
|
-
import '../_verture/defineProperty-1d116156.js';
|
|
90
93
|
import 'rc-picker';
|
|
91
94
|
import '@para-ui/icons/Calendar';
|
|
92
95
|
import '@para-ui/icons/Time';
|
|
93
96
|
import 'rc-picker/lib/locale/en_US';
|
|
94
97
|
import 'rc-picker/lib/locale/zh_CN';
|
|
95
98
|
import '@para-ui/icons/SortRight';
|
|
96
|
-
|
|
97
|
-
function getAugmentedNamespace(n) {
|
|
98
|
-
var f = n.default;
|
|
99
|
-
if (typeof f == "function") {
|
|
100
|
-
var a = function () {
|
|
101
|
-
return f.apply(this, arguments);
|
|
102
|
-
};
|
|
103
|
-
a.prototype = f.prototype;
|
|
104
|
-
} else a = {};
|
|
105
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
106
|
-
Object.keys(n).forEach(function (k) {
|
|
107
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
108
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return n[k];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
return a;
|
|
116
|
-
}
|
|
99
|
+
import '../_verture/sortable.esm-49896035.js';
|
|
117
100
|
|
|
118
101
|
var FormItem = function FormItem(props) {
|
|
119
102
|
var onChange = props.onChange,
|
|
@@ -376,540 +359,6 @@ const RowForm = props => {
|
|
|
376
359
|
});
|
|
377
360
|
};
|
|
378
361
|
|
|
379
|
-
var dist = {exports: {}};
|
|
380
|
-
|
|
381
|
-
var require$$0 = /*@__PURE__*/getAugmentedNamespace(sortable_esm);
|
|
382
|
-
|
|
383
|
-
var classnames = {exports: {}};
|
|
384
|
-
|
|
385
|
-
/*!
|
|
386
|
-
Copyright (c) 2018 Jed Watson.
|
|
387
|
-
Licensed under the MIT License (MIT), see
|
|
388
|
-
http://jedwatson.github.io/classnames
|
|
389
|
-
*/
|
|
390
|
-
|
|
391
|
-
(function (module) {
|
|
392
|
-
/* global define */
|
|
393
|
-
|
|
394
|
-
(function () {
|
|
395
|
-
|
|
396
|
-
var hasOwn = {}.hasOwnProperty;
|
|
397
|
-
|
|
398
|
-
function classNames() {
|
|
399
|
-
var classes = [];
|
|
400
|
-
|
|
401
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
402
|
-
var arg = arguments[i];
|
|
403
|
-
if (!arg) continue;
|
|
404
|
-
|
|
405
|
-
var argType = typeof arg;
|
|
406
|
-
|
|
407
|
-
if (argType === 'string' || argType === 'number') {
|
|
408
|
-
classes.push(arg);
|
|
409
|
-
} else if (Array.isArray(arg)) {
|
|
410
|
-
if (arg.length) {
|
|
411
|
-
var inner = classNames.apply(null, arg);
|
|
412
|
-
if (inner) {
|
|
413
|
-
classes.push(inner);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
} else if (argType === 'object') {
|
|
417
|
-
if (arg.toString === Object.prototype.toString) {
|
|
418
|
-
for (var key in arg) {
|
|
419
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
420
|
-
classes.push(key);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
} else {
|
|
424
|
-
classes.push(arg.toString());
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
return classes.join(' ');
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
if (module.exports) {
|
|
433
|
-
classNames.default = classNames;
|
|
434
|
-
module.exports = classNames;
|
|
435
|
-
} else {
|
|
436
|
-
window.classNames = classNames;
|
|
437
|
-
}
|
|
438
|
-
}());
|
|
439
|
-
} (classnames));
|
|
440
|
-
|
|
441
|
-
var isProduction = process.env.NODE_ENV === 'production';
|
|
442
|
-
var prefix = 'Invariant failed';
|
|
443
|
-
function invariant(condition, message) {
|
|
444
|
-
if (condition) {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
if (isProduction) {
|
|
448
|
-
throw new Error(prefix);
|
|
449
|
-
}
|
|
450
|
-
var provided = typeof message === 'function' ? message() : message;
|
|
451
|
-
var value = provided ? prefix + ": " + provided : prefix;
|
|
452
|
-
throw new Error(value);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
var tinyInvariant_esm = /*#__PURE__*/Object.freeze({
|
|
456
|
-
__proto__: null,
|
|
457
|
-
'default': invariant
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
var require$$3 = /*@__PURE__*/getAugmentedNamespace(tinyInvariant_esm);
|
|
461
|
-
|
|
462
|
-
(function (module) {
|
|
463
|
-
var $8zHUo$sortablejs = require$$0;
|
|
464
|
-
var $8zHUo$classnames = classnames.exports;
|
|
465
|
-
var $8zHUo$react = React__default;
|
|
466
|
-
var $8zHUo$tinyinvariant = require$$3;
|
|
467
|
-
|
|
468
|
-
function $parcel$interopDefault(a) {
|
|
469
|
-
return a && a.__esModule ? a.default : a;
|
|
470
|
-
}
|
|
471
|
-
function $parcel$export(e, n, v, s) {
|
|
472
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
473
|
-
}
|
|
474
|
-
function $parcel$exportWildcard(dest, source) {
|
|
475
|
-
Object.keys(source).forEach(function(key) {
|
|
476
|
-
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
Object.defineProperty(dest, key, {
|
|
481
|
-
enumerable: true,
|
|
482
|
-
get: function get() {
|
|
483
|
-
return source[key];
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
return dest;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
$parcel$export(module.exports, "Sortable", () => $882b6d93070905b3$re_export$Sortable);
|
|
492
|
-
$parcel$export(module.exports, "Direction", () => $882b6d93070905b3$re_export$Direction);
|
|
493
|
-
$parcel$export(module.exports, "DOMRect", () => $882b6d93070905b3$re_export$DOMRect);
|
|
494
|
-
$parcel$export(module.exports, "GroupOptions", () => $882b6d93070905b3$re_export$GroupOptions);
|
|
495
|
-
$parcel$export(module.exports, "MoveEvent", () => $882b6d93070905b3$re_export$MoveEvent);
|
|
496
|
-
$parcel$export(module.exports, "Options", () => $882b6d93070905b3$re_export$Options);
|
|
497
|
-
$parcel$export(module.exports, "PullResult", () => $882b6d93070905b3$re_export$PullResult);
|
|
498
|
-
$parcel$export(module.exports, "PutResult", () => $882b6d93070905b3$re_export$PutResult);
|
|
499
|
-
$parcel$export(module.exports, "SortableEvent", () => $882b6d93070905b3$re_export$SortableEvent);
|
|
500
|
-
$parcel$export(module.exports, "SortableOptions", () => $882b6d93070905b3$re_export$SortableOptions);
|
|
501
|
-
$parcel$export(module.exports, "Utils", () => $882b6d93070905b3$re_export$Utils);
|
|
502
|
-
$parcel$export(module.exports, "ReactSortable", () => $7fe8e3ea572bda7a$export$11bbed9ee0012c13);
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
function $eb03e74f8f7db1f3$export$1d0aa160432dfea5(node) {
|
|
509
|
-
if (node.parentElement !== null) node.parentElement.removeChild(node);
|
|
510
|
-
}
|
|
511
|
-
function $eb03e74f8f7db1f3$export$6d240faa51aa562f(parent, newChild, index) {
|
|
512
|
-
const refChild = parent.children[index] || null;
|
|
513
|
-
parent.insertBefore(newChild, refChild);
|
|
514
|
-
}
|
|
515
|
-
function $eb03e74f8f7db1f3$export$77f49a256021c8de(customs) {
|
|
516
|
-
customs.forEach((curr)=>$eb03e74f8f7db1f3$export$1d0aa160432dfea5(curr.element)
|
|
517
|
-
);
|
|
518
|
-
}
|
|
519
|
-
function $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs) {
|
|
520
|
-
customs.forEach((curr)=>{
|
|
521
|
-
$eb03e74f8f7db1f3$export$6d240faa51aa562f(curr.parentElement, curr.element, curr.oldIndex);
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
function $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list) {
|
|
525
|
-
const mode = $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt);
|
|
526
|
-
const parentElement = {
|
|
527
|
-
parentElement: evt.from
|
|
528
|
-
};
|
|
529
|
-
let custom = [];
|
|
530
|
-
switch(mode){
|
|
531
|
-
case "normal":
|
|
532
|
-
/* eslint-disable */ const item = {
|
|
533
|
-
element: evt.item,
|
|
534
|
-
newIndex: evt.newIndex,
|
|
535
|
-
oldIndex: evt.oldIndex,
|
|
536
|
-
parentElement: evt.from
|
|
537
|
-
};
|
|
538
|
-
custom = [
|
|
539
|
-
item
|
|
540
|
-
];
|
|
541
|
-
break;
|
|
542
|
-
case "swap":
|
|
543
|
-
const drag = {
|
|
544
|
-
element: evt.item,
|
|
545
|
-
oldIndex: evt.oldIndex,
|
|
546
|
-
newIndex: evt.newIndex,
|
|
547
|
-
...parentElement
|
|
548
|
-
};
|
|
549
|
-
const swap = {
|
|
550
|
-
element: evt.swapItem,
|
|
551
|
-
oldIndex: evt.newIndex,
|
|
552
|
-
newIndex: evt.oldIndex,
|
|
553
|
-
...parentElement
|
|
554
|
-
};
|
|
555
|
-
custom = [
|
|
556
|
-
drag,
|
|
557
|
-
swap
|
|
558
|
-
];
|
|
559
|
-
break;
|
|
560
|
-
case "multidrag":
|
|
561
|
-
custom = evt.oldIndicies.map((curr, index)=>({
|
|
562
|
-
element: curr.multiDragElement,
|
|
563
|
-
oldIndex: curr.index,
|
|
564
|
-
newIndex: evt.newIndicies[index].index,
|
|
565
|
-
...parentElement
|
|
566
|
-
})
|
|
567
|
-
);
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
/* eslint-enable */ const customs = $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(custom, list);
|
|
571
|
-
return customs;
|
|
572
|
-
}
|
|
573
|
-
function $eb03e74f8f7db1f3$export$c25cf8080bd305ec(normalized, list) {
|
|
574
|
-
const a = $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list);
|
|
575
|
-
const b = $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, a);
|
|
576
|
-
return b;
|
|
577
|
-
}
|
|
578
|
-
function $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list) {
|
|
579
|
-
const newList = [
|
|
580
|
-
...list
|
|
581
|
-
];
|
|
582
|
-
normalized.concat().reverse().forEach((curr)=>newList.splice(curr.oldIndex, 1)
|
|
583
|
-
);
|
|
584
|
-
return newList;
|
|
585
|
-
}
|
|
586
|
-
function $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, list, evt, clone) {
|
|
587
|
-
const newList = [
|
|
588
|
-
...list
|
|
589
|
-
];
|
|
590
|
-
normalized.forEach((curr)=>{
|
|
591
|
-
const newItem = clone && evt && clone(curr.item, evt);
|
|
592
|
-
newList.splice(curr.newIndex, 0, newItem || curr.item);
|
|
593
|
-
});
|
|
594
|
-
return newList;
|
|
595
|
-
}
|
|
596
|
-
function $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt) {
|
|
597
|
-
if (evt.oldIndicies && evt.oldIndicies.length > 0) return "multidrag";
|
|
598
|
-
if (evt.swapItem) return "swap";
|
|
599
|
-
return "normal";
|
|
600
|
-
}
|
|
601
|
-
function $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(inputs, list) {
|
|
602
|
-
const normalized = inputs.map((curr)=>({
|
|
603
|
-
...curr,
|
|
604
|
-
item: list[curr.oldIndex]
|
|
605
|
-
})
|
|
606
|
-
).sort((a, b)=>a.oldIndex - b.oldIndex
|
|
607
|
-
);
|
|
608
|
-
return normalized;
|
|
609
|
-
}
|
|
610
|
-
function $eb03e74f8f7db1f3$export$7553c81e62e31b7e(props) {
|
|
611
|
-
/* eslint-disable */ const { list: // react sortable props
|
|
612
|
-
list , setList: setList , children: children , tag: tag , style: style , className: className , clone: clone , onAdd: // sortable options that have methods we want to overwrite
|
|
613
|
-
onAdd , onChange: onChange , onChoose: onChoose , onClone: onClone , onEnd: onEnd , onFilter: onFilter , onRemove: onRemove , onSort: onSort , onStart: onStart , onUnchoose: onUnchoose , onUpdate: onUpdate , onMove: onMove , onSpill: onSpill , onSelect: onSelect , onDeselect: onDeselect , ...options } = props;
|
|
614
|
-
/* eslint-enable */ return options;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
/** Holds a global reference for which react element is being dragged */ // @todo - use context to manage this. How does one use 2 different providers?
|
|
619
|
-
const $7fe8e3ea572bda7a$var$store = {
|
|
620
|
-
dragging: null
|
|
621
|
-
};
|
|
622
|
-
class $7fe8e3ea572bda7a$export$11bbed9ee0012c13 extends $8zHUo$react.Component {
|
|
623
|
-
constructor(props){
|
|
624
|
-
super(props);
|
|
625
|
-
// @todo forward ref this component
|
|
626
|
-
this.ref = /*#__PURE__*/ $8zHUo$react.createRef();
|
|
627
|
-
// make all state false because we can't change sortable unless a mouse gesture is made.
|
|
628
|
-
const newList = [
|
|
629
|
-
...props.list
|
|
630
|
-
];
|
|
631
|
-
newList.forEach((item)=>{
|
|
632
|
-
Object.assign(item, {
|
|
633
|
-
chosen: false,
|
|
634
|
-
selected: false
|
|
635
|
-
});
|
|
636
|
-
});
|
|
637
|
-
props.setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
638
|
-
($parcel$interopDefault($8zHUo$tinyinvariant))(//@ts-expect-error: Doesn't exist. Will deprecate soon.
|
|
639
|
-
!props.plugins, `
|
|
640
|
-
Plugins prop is no longer supported.
|
|
641
|
-
Instead, mount it with "Sortable.mount(new MultiDrag())"
|
|
642
|
-
Please read the updated README.md at https://github.com/SortableJS/react-sortablejs.
|
|
643
|
-
`);
|
|
644
|
-
}
|
|
645
|
-
componentDidMount() {
|
|
646
|
-
if (this.ref.current === null) return;
|
|
647
|
-
const newOptions = this.makeOptions();
|
|
648
|
-
($parcel$interopDefault($8zHUo$sortablejs)).create(this.ref.current, newOptions);
|
|
649
|
-
}
|
|
650
|
-
componentDidUpdate(prevProps) {
|
|
651
|
-
if (prevProps.disabled !== this.props.disabled && this.sortable) this.sortable.option("disabled", this.props.disabled);
|
|
652
|
-
}
|
|
653
|
-
render() {
|
|
654
|
-
const { tag: tag , style: style , className: className , id: id } = this.props;
|
|
655
|
-
const classicProps = {
|
|
656
|
-
style: style,
|
|
657
|
-
className: className,
|
|
658
|
-
id: id
|
|
659
|
-
};
|
|
660
|
-
// if no tag, default to a `div` element.
|
|
661
|
-
const newTag = !tag || tag === null ? "div" : tag;
|
|
662
|
-
return(/*#__PURE__*/ $8zHUo$react.createElement(newTag, {
|
|
663
|
-
// @todo - find a way (perhaps with the callback) to allow AntD components to work
|
|
664
|
-
ref: this.ref,
|
|
665
|
-
...classicProps
|
|
666
|
-
}, this.getChildren()));
|
|
667
|
-
}
|
|
668
|
-
getChildren() {
|
|
669
|
-
const { children: children , dataIdAttr: dataIdAttr , selectedClass: selectedClass = "sortable-selected" , chosenClass: chosenClass = "sortable-chosen" , dragClass: /* eslint-disable */ dragClass = "sortable-drag" , fallbackClass: fallbackClass = "sortable-falback" , ghostClass: ghostClass = "sortable-ghost" , swapClass: swapClass = "sortable-swap-highlight" , filter: /* eslint-enable */ filter = "sortable-filter" , list: list , } = this.props;
|
|
670
|
-
// if no children, don't do anything.
|
|
671
|
-
if (!children || children == null) return null;
|
|
672
|
-
const dataid = dataIdAttr || "data-id";
|
|
673
|
-
/* eslint-disable-next-line */ return $8zHUo$react.Children.map(children, (child, index)=>{
|
|
674
|
-
if (child === undefined) return undefined;
|
|
675
|
-
const item = list[index] || {
|
|
676
|
-
};
|
|
677
|
-
const { className: prevClassName } = child.props;
|
|
678
|
-
// @todo - handle the function if avalable. I don't think anyone will be doing this soon.
|
|
679
|
-
const filtered = typeof filter === "string" && {
|
|
680
|
-
[filter.replace(".", "")]: !!item.filtered
|
|
681
|
-
};
|
|
682
|
-
const className = ($parcel$interopDefault($8zHUo$classnames))(prevClassName, {
|
|
683
|
-
[selectedClass]: item.selected,
|
|
684
|
-
[chosenClass]: item.chosen,
|
|
685
|
-
...filtered
|
|
686
|
-
});
|
|
687
|
-
return(/*#__PURE__*/ $8zHUo$react.cloneElement(child, {
|
|
688
|
-
[dataid]: child.key,
|
|
689
|
-
className: className
|
|
690
|
-
}));
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
/** Appends the `sortable` property to this component */ get sortable() {
|
|
694
|
-
const el = this.ref.current;
|
|
695
|
-
if (el === null) return null;
|
|
696
|
-
const key = Object.keys(el).find((k)=>k.includes("Sortable")
|
|
697
|
-
);
|
|
698
|
-
if (!key) return null;
|
|
699
|
-
//@ts-expect-error: fix me.
|
|
700
|
-
return el[key];
|
|
701
|
-
}
|
|
702
|
-
/** Converts all the props from `ReactSortable` into the `options` object that `Sortable.create(el, [options])` can use. */ makeOptions() {
|
|
703
|
-
const DOMHandlers = [
|
|
704
|
-
"onAdd",
|
|
705
|
-
"onChoose",
|
|
706
|
-
"onDeselect",
|
|
707
|
-
"onEnd",
|
|
708
|
-
"onRemove",
|
|
709
|
-
"onSelect",
|
|
710
|
-
"onSpill",
|
|
711
|
-
"onStart",
|
|
712
|
-
"onUnchoose",
|
|
713
|
-
"onUpdate",
|
|
714
|
-
];
|
|
715
|
-
const NonDOMHandlers = [
|
|
716
|
-
"onChange",
|
|
717
|
-
"onClone",
|
|
718
|
-
"onFilter",
|
|
719
|
-
"onSort",
|
|
720
|
-
];
|
|
721
|
-
const newOptions = $eb03e74f8f7db1f3$export$7553c81e62e31b7e(this.props);
|
|
722
|
-
DOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerPropAndDOM(name)
|
|
723
|
-
);
|
|
724
|
-
NonDOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerProp(name)
|
|
725
|
-
);
|
|
726
|
-
/** onMove has 2 arguments and needs to be handled seperately. */ const onMove1 = (evt, originalEvt)=>{
|
|
727
|
-
const { onMove: onMove } = this.props;
|
|
728
|
-
const defaultValue = evt.willInsertAfter || -1;
|
|
729
|
-
if (!onMove) return defaultValue;
|
|
730
|
-
const result = onMove(evt, originalEvt, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
731
|
-
if (typeof result === "undefined") return false;
|
|
732
|
-
return result;
|
|
733
|
-
};
|
|
734
|
-
return {
|
|
735
|
-
...newOptions,
|
|
736
|
-
onMove: onMove1
|
|
737
|
-
};
|
|
738
|
-
}
|
|
739
|
-
/** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop & an `on[Handler]` ReactSortable method. */ prepareOnHandlerPropAndDOM(evtName) {
|
|
740
|
-
return (evt)=>{
|
|
741
|
-
// call the component prop
|
|
742
|
-
this.callOnHandlerProp(evt, evtName);
|
|
743
|
-
// calls state change
|
|
744
|
-
//@ts-expect-error: until @types multidrag item is in
|
|
745
|
-
this[evtName](evt);
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
/** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop */ prepareOnHandlerProp(evtName) {
|
|
749
|
-
return (evt)=>{
|
|
750
|
-
// call the component prop
|
|
751
|
-
this.callOnHandlerProp(evt, evtName);
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
/** Calls the `props.on[Handler]` function */ callOnHandlerProp(evt, evtName) {
|
|
755
|
-
const propEvent = this.props[evtName];
|
|
756
|
-
if (propEvent) propEvent(evt, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
757
|
-
}
|
|
758
|
-
// SORTABLE DOM HANDLING
|
|
759
|
-
onAdd(evt) {
|
|
760
|
-
const { list: list , setList: setList , clone: clone } = this.props;
|
|
761
|
-
/* eslint-disable-next-line */ const otherList = [
|
|
762
|
-
...$7fe8e3ea572bda7a$var$store.dragging.props.list
|
|
763
|
-
];
|
|
764
|
-
const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, otherList);
|
|
765
|
-
$eb03e74f8f7db1f3$export$77f49a256021c8de(customs);
|
|
766
|
-
const newList = $eb03e74f8f7db1f3$export$eca851ee65ae17e4(customs, list, evt, clone);
|
|
767
|
-
newList.forEach((item)=>{
|
|
768
|
-
Object.assign(item, {
|
|
769
|
-
selected: false
|
|
770
|
-
});
|
|
771
|
-
});
|
|
772
|
-
setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
773
|
-
}
|
|
774
|
-
onRemove(evt) {
|
|
775
|
-
const { list: list , setList: setList } = this.props;
|
|
776
|
-
const mode = $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt);
|
|
777
|
-
const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list);
|
|
778
|
-
$eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs);
|
|
779
|
-
let newList = [
|
|
780
|
-
...list
|
|
781
|
-
];
|
|
782
|
-
// remove state if not in clone mode. otherwise, keep.
|
|
783
|
-
if (evt.pullMode !== "clone") newList = $eb03e74f8f7db1f3$export$be2da95e6167b0bd(customs, newList);
|
|
784
|
-
else {
|
|
785
|
-
// switch used to get the clone
|
|
786
|
-
let customClones = customs;
|
|
787
|
-
switch(mode){
|
|
788
|
-
case "multidrag":
|
|
789
|
-
customClones = customs.map((item, index)=>({
|
|
790
|
-
...item,
|
|
791
|
-
element: evt.clones[index]
|
|
792
|
-
})
|
|
793
|
-
);
|
|
794
|
-
break;
|
|
795
|
-
case "normal":
|
|
796
|
-
customClones = customs.map((item)=>({
|
|
797
|
-
...item,
|
|
798
|
-
element: evt.clone
|
|
799
|
-
})
|
|
800
|
-
);
|
|
801
|
-
break;
|
|
802
|
-
case "swap":
|
|
803
|
-
default:
|
|
804
|
-
($parcel$interopDefault($8zHUo$tinyinvariant))(true, `mode "${mode}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${mode}" plugin`);
|
|
805
|
-
}
|
|
806
|
-
$eb03e74f8f7db1f3$export$77f49a256021c8de(customClones);
|
|
807
|
-
// replace selected items with cloned items
|
|
808
|
-
customs.forEach((curr)=>{
|
|
809
|
-
const index = curr.oldIndex;
|
|
810
|
-
/* eslint-disable-next-line */ const newItem = this.props.clone(curr.item, evt);
|
|
811
|
-
newList.splice(index, 1, newItem);
|
|
812
|
-
});
|
|
813
|
-
}
|
|
814
|
-
// remove item.selected from list
|
|
815
|
-
newList.forEach((item)=>{
|
|
816
|
-
Object.assign(item, {
|
|
817
|
-
selected: false
|
|
818
|
-
});
|
|
819
|
-
});
|
|
820
|
-
setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
821
|
-
}
|
|
822
|
-
onUpdate(evt) {
|
|
823
|
-
const { list: list , setList: setList } = this.props;
|
|
824
|
-
const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list);
|
|
825
|
-
$eb03e74f8f7db1f3$export$77f49a256021c8de(customs);
|
|
826
|
-
$eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs);
|
|
827
|
-
const newList = $eb03e74f8f7db1f3$export$c25cf8080bd305ec(customs, list);
|
|
828
|
-
return setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
829
|
-
}
|
|
830
|
-
onStart() {
|
|
831
|
-
$7fe8e3ea572bda7a$var$store.dragging = this;
|
|
832
|
-
}
|
|
833
|
-
onEnd() {
|
|
834
|
-
$7fe8e3ea572bda7a$var$store.dragging = null;
|
|
835
|
-
}
|
|
836
|
-
onChoose(evt) {
|
|
837
|
-
const { list: list , setList: setList } = this.props;
|
|
838
|
-
const newList = list.map((item, index)=>{
|
|
839
|
-
if (index === evt.oldIndex) Object.assign(item, {
|
|
840
|
-
chosen: true
|
|
841
|
-
});
|
|
842
|
-
return item;
|
|
843
|
-
});
|
|
844
|
-
setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
845
|
-
}
|
|
846
|
-
onUnchoose(evt) {
|
|
847
|
-
const { list: list , setList: setList } = this.props;
|
|
848
|
-
const newList = list.map((item, index)=>{
|
|
849
|
-
if (index === evt.oldIndex) Object.assign(item, {
|
|
850
|
-
chosen: false
|
|
851
|
-
});
|
|
852
|
-
return item;
|
|
853
|
-
});
|
|
854
|
-
setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
855
|
-
}
|
|
856
|
-
onSpill(evt) {
|
|
857
|
-
const { removeOnSpill: removeOnSpill , revertOnSpill: revertOnSpill } = this.props;
|
|
858
|
-
if (removeOnSpill && !revertOnSpill) $eb03e74f8f7db1f3$export$1d0aa160432dfea5(evt.item);
|
|
859
|
-
}
|
|
860
|
-
onSelect(evt) {
|
|
861
|
-
const { list: list , setList: setList } = this.props;
|
|
862
|
-
const newList = [
|
|
863
|
-
...list
|
|
864
|
-
];
|
|
865
|
-
newList.forEach((item)=>{
|
|
866
|
-
Object.assign(item, {
|
|
867
|
-
chosen: false
|
|
868
|
-
});
|
|
869
|
-
});
|
|
870
|
-
evt.newIndicies.forEach((curr)=>{
|
|
871
|
-
const index = curr.index;
|
|
872
|
-
if (index === -1) {
|
|
873
|
-
console.log(`"${evt.type}" had indice of "${curr.index}", which is probably -1 and doesn't usually happen here.`);
|
|
874
|
-
console.log(evt);
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
newList[index].selected = true;
|
|
878
|
-
});
|
|
879
|
-
setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
880
|
-
}
|
|
881
|
-
onDeselect(evt) {
|
|
882
|
-
const { list: list , setList: setList } = this.props;
|
|
883
|
-
const newList = [
|
|
884
|
-
...list
|
|
885
|
-
];
|
|
886
|
-
newList.forEach((item)=>{
|
|
887
|
-
Object.assign(item, {
|
|
888
|
-
chosen: false
|
|
889
|
-
});
|
|
890
|
-
});
|
|
891
|
-
evt.newIndicies.forEach((curr)=>{
|
|
892
|
-
const index = curr.index;
|
|
893
|
-
if (index === -1) return;
|
|
894
|
-
newList[index].selected = true;
|
|
895
|
-
});
|
|
896
|
-
setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
$7fe8e3ea572bda7a$export$11bbed9ee0012c13.defaultProps = {
|
|
900
|
-
clone: (item)=>item
|
|
901
|
-
};
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
var $faefaad95e5fcca0$exports = {};
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
$parcel$exportWildcard(module.exports, $faefaad95e5fcca0$exports);
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
} (dist));
|
|
912
|
-
|
|
913
362
|
var en = {
|
|
914
363
|
add: 'Newly Added',
|
|
915
364
|
titleForm: 'Form configuration (non mandatory)',
|
package/Form/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { DeepClone } from '@paraview/lib';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-
|
|
4
|
+
import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-f518e244.js';
|
|
5
5
|
import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
|
|
6
6
|
import { u as useFormatMessage } from '../_verture/useFormatMessage-eb13cf56.js';
|
|
7
7
|
import '../TextField/index.js';
|
|
@@ -28,7 +28,7 @@ import '../_verture/index-da9097d3.js';
|
|
|
28
28
|
import 'rc-dropdown';
|
|
29
29
|
import '../_verture/usePopupContainer-635f66f4.js';
|
|
30
30
|
import 'dayjs';
|
|
31
|
-
import '../_verture/slicedToArray-
|
|
31
|
+
import '../_verture/slicedToArray-75fa4188.js';
|
|
32
32
|
import '../RadioGroup/index.js';
|
|
33
33
|
import '../Radio/index.js';
|
|
34
34
|
import '../Select/index.js';
|
|
@@ -51,10 +51,12 @@ import 'rc-input-number';
|
|
|
51
51
|
import '@para-ui/icons/Up';
|
|
52
52
|
import '../ComboSelect/index.js';
|
|
53
53
|
import '../Table/index.js';
|
|
54
|
+
import '../_verture/typeof-adeedc13.js';
|
|
54
55
|
import '@para-ui/icons/ScreenF';
|
|
55
56
|
import '@para-ui/icons/UpTriangleF';
|
|
56
57
|
import '@para-ui/icons/DownTriangleF';
|
|
57
58
|
import '@para-ui/icons/Panel';
|
|
59
|
+
import '../_verture/defineProperty-1d116156.js';
|
|
58
60
|
import '../OperateBtn/index.js';
|
|
59
61
|
import '@para-ui/icons/More';
|
|
60
62
|
import '../PopConfirm/index.js';
|
|
@@ -68,15 +70,17 @@ import 'rc-pagination';
|
|
|
68
70
|
import '@para-ui/icons/Right';
|
|
69
71
|
import '@para-ui/icons/DoubleLeft';
|
|
70
72
|
import '@para-ui/icons/DoubleRight';
|
|
71
|
-
import '../_verture/index-
|
|
73
|
+
import '../_verture/index-3156e3ef.js';
|
|
74
|
+
import '../_verture/toConsumableArray-c7a8028f.js';
|
|
75
|
+
import '../_verture/index-d63bd287.js';
|
|
76
|
+
import '../_verture/typeof-b240b062.js';
|
|
72
77
|
import 'rc-tree';
|
|
73
|
-
import '../_verture/typeof-adeedc13.js';
|
|
74
78
|
import '@para-ui/icons/Document';
|
|
75
79
|
import 'react-dom';
|
|
76
80
|
import '@para-ui/icons/EditFile';
|
|
77
81
|
import '@para-ui/icons/PlusCircle';
|
|
78
82
|
import '@para-ui/icons/MoreCircle';
|
|
79
|
-
import '../_verture/utils-
|
|
83
|
+
import '../_verture/utils-c17b5265.js';
|
|
80
84
|
import '../Search/index.js';
|
|
81
85
|
|
|
82
86
|
/**
|