@para-ui/core 3.0.37 → 3.0.39

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 (138) hide show
  1. package/AutoBox/index.js +1 -1
  2. package/AutoTips/index.js +1 -1
  3. package/Breadcrumbs/index.js +2 -2
  4. package/Button/index.js +1 -1
  5. package/ButtonGroup/index.js +1 -1
  6. package/Cascader/index.js +16 -20
  7. package/Checkbox/index.js +1 -1
  8. package/CheckboxGroup/index.js +1 -1
  9. package/CollapseBox/index.js +1 -1
  10. package/CollapseLayout/index.js +1 -1
  11. package/ComboSelect/index.js +4 -4
  12. package/DatePicker/index.js +2 -2
  13. package/Desktop/index.js +2 -2
  14. package/DragVerify/index.d.ts +50 -0
  15. package/DragVerify/index.js +264 -0
  16. package/DragVerify/lang/en_US.d.ts +5 -0
  17. package/DragVerify/lang/index.d.ts +11 -0
  18. package/DragVerify/lang/zh_CN.d.ts +5 -0
  19. package/Drawer/index.js +4 -2
  20. package/DynamicMultiBox/formItem.d.ts +14 -0
  21. package/DynamicMultiBox/index.d.ts +5 -0
  22. package/DynamicMultiBox/index.js +1312 -0
  23. package/DynamicMultiBox/interface.d.ts +161 -0
  24. package/DynamicMultiBox/rowForm.d.ts +24 -0
  25. package/Form/index.js +5 -5
  26. package/FormItem/index.js +5 -5
  27. package/FunctionModal/index.js +5 -5
  28. package/Help/index.js +1 -1
  29. package/InputLang/index.js +2 -2
  30. package/InputNumber/index.js +1 -1
  31. package/Label/index.js +1 -1
  32. package/Menu/index.js +2 -2
  33. package/Modal/index.js +1 -1
  34. package/MultiBox/index.js +2 -2
  35. package/OperateBtn/index.js +43 -45
  36. package/PageHeader/index.js +2 -2
  37. package/Pagination/index.js +2 -2
  38. package/PopConfirm/index.js +1 -1
  39. package/Popover/index.js +2 -2
  40. package/README.md +13 -0
  41. package/Radio/index.js +1 -1
  42. package/RadioGroup/index.js +1 -1
  43. package/Search/index.js +1 -1
  44. package/Select/index.js +2 -2
  45. package/SelectInput/index.js +2 -2
  46. package/Selector/index.js +290 -306
  47. package/SelectorPicker/index.js +3 -3
  48. package/SingleBox/index.js +2 -2
  49. package/Slider/index.js +1 -1
  50. package/Split/index.js +1 -1
  51. package/Switch/index.js +1 -1
  52. package/Table/index.js +48 -50
  53. package/Table/interface.d.ts +1 -1
  54. package/Tabs/index.js +1 -1
  55. package/Tag/index.js +2 -2
  56. package/TextEditor/index.js +1 -1
  57. package/TextField/index.js +1 -1
  58. package/TimePicker/index.js +2 -2
  59. package/ToggleButton/index.js +1 -1
  60. package/Tooltip/index.js +1 -1
  61. package/Transfer/index.js +3 -3022
  62. package/Tree/index.js +5 -5
  63. package/Upload/index.js +345 -361
  64. package/_verture/{index-06fea29b.js → index-beef914f.js} +3 -9
  65. package/_verture/{index-c62ad493.js → index-c2a6ba28.js} +1 -1
  66. package/_verture/{index-257f53f9.js → index-da441266.js} +162 -168
  67. package/_verture/{modalContext-c749e1c6.js → modalContext-44e0b3ea.js} +28 -30
  68. package/_verture/{slicedToArray-77980792.js → slicedToArray-708dbb18.js} +2 -6
  69. package/_verture/sortable.esm-49896035.js +3791 -0
  70. package/_verture/{toConsumableArray-87c7d895.js → toConsumableArray-57dd2e23.js} +1 -1
  71. package/index.d.ts +4 -0
  72. package/index.js +11 -8
  73. package/package.json +3 -2
  74. package/umd/AutoBox.js +7 -7
  75. package/umd/AutoTips.js +3 -3
  76. package/umd/Breadcrumbs.js +7 -7
  77. package/umd/Button.js +6 -6
  78. package/umd/ButtonGroup.js +6 -6
  79. package/umd/Carousel.js +1 -1
  80. package/umd/Cascader.js +6 -6
  81. package/umd/Checkbox.js +6 -6
  82. package/umd/CheckboxGroup.js +6 -6
  83. package/umd/Collapse.js +3 -3
  84. package/umd/CollapseLayout.js +1 -1
  85. package/umd/ColorPicker.js +1 -1
  86. package/umd/ComboSelect.js +5 -5
  87. package/umd/Container.js +1 -1
  88. package/umd/DatePicker.js +6 -6
  89. package/umd/Desktop.js +7 -7
  90. package/umd/DragVerify.js +29 -0
  91. package/umd/Drawer.js +7 -7
  92. package/umd/Dropdown.js +3 -3
  93. package/umd/DynamicMultiBox.js +54 -0
  94. package/umd/Empty.js +2 -2
  95. package/umd/Form.js +5 -5
  96. package/umd/FormItem.js +5 -5
  97. package/umd/FunctionModal.js +5 -5
  98. package/umd/Help.js +6 -6
  99. package/umd/InputLang.js +7 -7
  100. package/umd/InputNumber.js +7 -7
  101. package/umd/Label.js +5 -5
  102. package/umd/Loading.js +1 -1
  103. package/umd/Menu.js +2 -2
  104. package/umd/Message.js +2 -2
  105. package/umd/Modal.js +5 -5
  106. package/umd/MultiBox.js +7 -7
  107. package/umd/Notification.js +3 -3
  108. package/umd/OperateBtn.js +7 -7
  109. package/umd/PageHeader.js +7 -7
  110. package/umd/Pagination.js +6 -6
  111. package/umd/ParauiProvider.js +1 -1
  112. package/umd/PasswordRules.js +1 -1
  113. package/umd/PopConfirm.js +7 -7
  114. package/umd/Popover.js +3 -3
  115. package/umd/Progress.js +1 -1
  116. package/umd/Querying.js +1 -1
  117. package/umd/Radio.js +5 -5
  118. package/umd/RadioGroup.js +6 -6
  119. package/umd/Search.js +7 -7
  120. package/umd/Select.js +5 -5
  121. package/umd/SelectInput.js +5 -5
  122. package/umd/Selector.js +6 -6
  123. package/umd/SelectorPicker.js +5 -5
  124. package/umd/SingleBox.js +7 -7
  125. package/umd/Slider.js +3 -3
  126. package/umd/Stepper.js +1 -1
  127. package/umd/Switch.js +5 -5
  128. package/umd/Table.js +5 -5
  129. package/umd/Tabs.js +6 -6
  130. package/umd/Tag.js +6 -6
  131. package/umd/TextEditor.js +19 -19
  132. package/umd/TextField.js +7 -7
  133. package/umd/TimePicker.js +6 -6
  134. package/umd/ToggleButton.js +7 -7
  135. package/umd/Tooltip.js +3 -3
  136. package/umd/Transfer.js +7 -7
  137. package/umd/Tree.js +7 -7
  138. package/umd/Upload.js +8 -8
@@ -0,0 +1,1312 @@
1
+ import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
2
+ import { _ as _toConsumableArray } from '../_verture/toConsumableArray-57dd2e23.js';
3
+ import { _ as _slicedToArray } from '../_verture/slicedToArray-708dbb18.js';
4
+ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
5
+ import React__default, { useState, useRef, useEffect, useMemo } from 'react';
6
+ import { Popover } from '../Popover/index.js';
7
+ import Label from '../Label/index.js';
8
+ import { CheckboxGroup } from '../CheckboxGroup/index.js';
9
+ import { Panel, Delete, Drag, PlusCircleF } from '@para-ui/icons';
10
+ import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
11
+ import { TextField } from '../TextField/index.js';
12
+ import Select from '../Select/index.js';
13
+ import { Switch } from '../Switch/index.js';
14
+ import { InputNumber } from '../InputNumber/index.js';
15
+ import { InputLang } from '../InputLang/index.js';
16
+ import { ComboSelect } from '../ComboSelect/index.js';
17
+ import DatePicker from '../DatePicker/index.js';
18
+ import AutoTips from '../AutoTips/index.js';
19
+ import { UUID } from '@paraview/lib';
20
+ import { s as sortable_esm } from '../_verture/sortable.esm-49896035.js';
21
+ import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
22
+ import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
23
+ import '../_verture/typeof-498dd2b1.js';
24
+ import '../Tooltip/index.js';
25
+ import 'rc-tooltip';
26
+ import 'rc-tooltip/lib/placements';
27
+ import 'clsx';
28
+ import '../_verture/usePopupContainer-87febeb9.js';
29
+ import '../Help/index.js';
30
+ import '@para-ui/icons/Help';
31
+ import '../Checkbox/index.js';
32
+ import '../HelperText/index.js';
33
+ import '@para-ui/icons/PreviewClose';
34
+ import '@para-ui/icons/PreviewOpen';
35
+ import '@para-ui/icons/CloseCircle';
36
+ import '../Loading/index.js';
37
+ import '@para-ui/icons/LoadingF';
38
+ import '../_verture/useGlobalProps-1b846a65.js';
39
+ import '@para-ui/core/GlobalContext';
40
+ import '../_verture/index-be4faaee.js';
41
+ import 'rc-dropdown';
42
+ import 'dayjs';
43
+ import '../Empty/index.js';
44
+ import '../_verture/useFormatMessage-703f8b20.js';
45
+ import '@para-ui/icons/Close';
46
+ import '@para-ui/icons/Down';
47
+ import '@para-ui/icons/Check';
48
+ import '@para-ui/icons/Search';
49
+ import 'rc-switch';
50
+ import 'rc-input-number';
51
+ import '@para-ui/icons/Up';
52
+ import '@para-ui/icons/Minus';
53
+ import '@para-ui/icons/Plus';
54
+ import '../MultiBox/index.js';
55
+ import '@para-ui/icons/Delete';
56
+ import '@para-ui/icons/PlusCircleF';
57
+ import '@para-ui/icons/Application';
58
+ import '../Table/index.js';
59
+ import '../_verture/index-beef914f.js';
60
+ import '../Button/index.js';
61
+ import '@para-ui/icons/Forbid';
62
+ import '@para-ui/icons/ScreenF';
63
+ import '@para-ui/icons/UpTriangleF';
64
+ import '@para-ui/icons/DownTriangleF';
65
+ import '@para-ui/icons/Panel';
66
+ import '../Radio/index.js';
67
+ import '../OperateBtn/index.js';
68
+ import '@para-ui/icons/More';
69
+ import '../Pagination/index.js';
70
+ import '@para-ui/icons/DoubleLeft';
71
+ import '@para-ui/icons/Left';
72
+ import 'rc-pagination';
73
+ import '@para-ui/icons/Right';
74
+ import '@para-ui/icons/DoubleRight';
75
+ import '../_verture/index-da441266.js';
76
+ import 'rc-tree';
77
+ import '@para-ui/icons/Document';
78
+ import 'react-dom';
79
+ import '@para-ui/icons/EditFile';
80
+ import '@para-ui/icons/PlusCircle';
81
+ import '@para-ui/icons/MoreCircle';
82
+ import 'rc-picker/es/generate/dayjs';
83
+ import '../Tag/index.js';
84
+ import 'rc-picker';
85
+ import '@para-ui/icons/Calendar';
86
+ import '@para-ui/icons/Time';
87
+ import 'rc-picker/lib/locale/en_US';
88
+ import 'rc-picker/lib/locale/zh_CN';
89
+ import '@para-ui/icons/SortRight';
90
+
91
+ function getAugmentedNamespace(n) {
92
+ var f = n.default;
93
+ if (typeof f == "function") {
94
+ var a = function () {
95
+ return f.apply(this, arguments);
96
+ };
97
+ a.prototype = f.prototype;
98
+ } else a = {};
99
+ Object.defineProperty(a, '__esModule', {value: true});
100
+ Object.keys(n).forEach(function (k) {
101
+ var d = Object.getOwnPropertyDescriptor(n, k);
102
+ Object.defineProperty(a, k, d.get ? d : {
103
+ enumerable: true,
104
+ get: function () {
105
+ return n[k];
106
+ }
107
+ });
108
+ });
109
+ return a;
110
+ }
111
+
112
+ var FormItem = function FormItem(props) {
113
+ var onChange = props.onChange,
114
+ formItemProps = props.formItemProps,
115
+ _props$valueList = props.valueList,
116
+ valueList = _props$valueList === void 0 ? [] : _props$valueList,
117
+ _props$errors = props.errors,
118
+ errors = _props$errors === void 0 ? [] : _props$errors;
119
+ var _a = formItemProps || {},
120
+ _a$name = _a.name,
121
+ name = _a$name === void 0 ? '' : _a$name,
122
+ inputType = _a.inputType,
123
+ customRender = _a.customRender,
124
+ rowIndex = _a.rowIndex,
125
+ id = _a.id,
126
+ list = _a.list,
127
+ isDisabled = _a.isDisabled;
128
+ _a.isFixed;
129
+ _a.selected;
130
+ var text = _a.text,
131
+ rest = __rest(_a, ["name", "inputType", "customRender", "rowIndex", "id", "list", "isDisabled", "isFixed", "selected", "text"]);
132
+ var disabled = typeof isDisabled === 'function' ? isDisabled(rowIndex, name, valueList) : isDisabled;
133
+ var getComponent = function getComponent() {
134
+ switch (inputType) {
135
+ case 'TextField':
136
+ return getTextField();
137
+ case 'Select':
138
+ return getSelection();
139
+ case 'InputNumber':
140
+ return getInputNumber();
141
+ case 'Switch':
142
+ return getSwitch();
143
+ case 'InputLang':
144
+ return getInputLang();
145
+ case 'ComboSelect':
146
+ return getComboSelect();
147
+ case 'DatePicker':
148
+ return getDatePicker();
149
+ case 'custom':
150
+ return getCustomCompo();
151
+ default:
152
+ return null;
153
+ }
154
+ };
155
+ /**
156
+ * @description: 输入框回调
157
+ * @param {any} value value值
158
+ */
159
+ var inputChange = function inputChange(value) {
160
+ onChange && onChange(id, value);
161
+ };
162
+ /**
163
+ * @description: 日期选择回调
164
+ * @return {*}
165
+ * @param {Dayjs} date 选择的日期moment类型
166
+ * @param {string} dateString 选择的日期
167
+ */
168
+ var onDatePickerChange = function onDatePickerChange(date, dateString) {
169
+ onChange && onChange(id, date ? date : dateString);
170
+ };
171
+ /**
172
+ * @description: 返回输入框组件
173
+ * @param {*} ReactNode
174
+ */
175
+ var getTextField = function getTextField() {
176
+ return jsx(TextField, Object.assign({}, rest, {
177
+ required: false,
178
+ label: '',
179
+ disabled: disabled,
180
+ onChange: function onChange(e) {
181
+ return inputChange(e.target.value);
182
+ }
183
+ }));
184
+ };
185
+ /**
186
+ * @description: 返回下拉框组件
187
+ * @return {*} ReactNode
188
+ */
189
+ var getSelection = function getSelection() {
190
+ var selectList = typeof list === 'function' ? list && list(rowIndex, id, name, valueList) : list || [];
191
+ return jsx(Select, Object.assign({}, rest, {
192
+ list: selectList,
193
+ required: false,
194
+ label: '',
195
+ disabled: disabled,
196
+ onChange: function onChange(value) {
197
+ return inputChange(value);
198
+ },
199
+ getPopupContainer: function getPopupContainer() {
200
+ return document.body;
201
+ }
202
+ }));
203
+ };
204
+ /**
205
+ * @description: 返回开关组件
206
+ * @return {*}
207
+ * @param {*} ReactNode
208
+ */
209
+ var getSwitch = function getSwitch() {
210
+ var switchText = typeof text === 'function' ? text(rowIndex, name, valueList) : text;
211
+ return jsxs("div", Object.assign({
212
+ className: 'multi-value-switch'
213
+ }, {
214
+ children: [switchText && jsx("div", Object.assign({
215
+ className: 'switch-text'
216
+ }, {
217
+ children: jsx(AutoTips, {
218
+ children: switchText
219
+ })
220
+ })), jsx("div", Object.assign({
221
+ className: 'switch'
222
+ }, {
223
+ children: jsx(Switch, Object.assign({}, rest, {
224
+ label: '',
225
+ labelPlacement: 'start',
226
+ onChange: function onChange(checked) {
227
+ return inputChange(checked);
228
+ }
229
+ }))
230
+ }))]
231
+ }));
232
+ };
233
+ /**
234
+ * @description: 返回数字输入框组件
235
+ * @return {*}
236
+ */
237
+ var getInputNumber = function getInputNumber() {
238
+ return jsx(InputNumber, Object.assign({}, rest, {
239
+ required: false,
240
+ label: '',
241
+ disabled: disabled,
242
+ onChange: function onChange(value) {
243
+ return inputChange(value);
244
+ }
245
+ }));
246
+ };
247
+ /**
248
+ * @description: 返回国际化输入框
249
+ * @return {*}
250
+ */
251
+ var getInputLang = function getInputLang() {
252
+ return jsx(InputLang, Object.assign({}, rest, {
253
+ required: false,
254
+ label: '',
255
+ onChange: function onChange(value) {
256
+ return inputChange(value);
257
+ }
258
+ }));
259
+ };
260
+ /**
261
+ * @description: 返回日期选择框组件
262
+ * @return {*}
263
+ */
264
+ var getDatePicker = function getDatePicker() {
265
+ return jsx(DatePicker, Object.assign({}, rest, {
266
+ required: false,
267
+ label: '',
268
+ disabled: disabled,
269
+ onChange: onDatePickerChange,
270
+ getPopupContainer: function getPopupContainer() {
271
+ return document.body;
272
+ }
273
+ }));
274
+ };
275
+ /**
276
+ * @description: 返回组合选择器下拉框
277
+ * @return {*}
278
+ */
279
+ var getComboSelect = function getComboSelect() {
280
+ return jsx(ComboSelect, Object.assign({}, rest, {
281
+ required: false,
282
+ label: '',
283
+ disabled: disabled,
284
+ onChange: function onChange(options) {
285
+ return inputChange(options);
286
+ }
287
+ }));
288
+ };
289
+ /**
290
+ * @description: 返回自定义组件
291
+ * @return {*}
292
+ */
293
+ var getCustomCompo = function getCustomCompo() {
294
+ return jsx(Fragment, {
295
+ children: customRender && customRender(name, rowIndex, valueList, errors)
296
+ });
297
+ };
298
+ return jsx(Fragment, {
299
+ children: getComponent()
300
+ });
301
+ };
302
+
303
+ var RowForm = function RowForm(props) {
304
+ var _props$valueList = props.valueList,
305
+ valueList = _props$valueList === void 0 ? [] : _props$valueList,
306
+ rowError = props.rowError,
307
+ _props$errors = props.errors,
308
+ errors = _props$errors === void 0 ? [] : _props$errors,
309
+ onFormItemChange = props.onFormItemChange,
310
+ _props$config = props.config,
311
+ config = _props$config === void 0 ? [] : _props$config,
312
+ rowIndex = props.rowIndex,
313
+ icon = props.icon;
314
+ /**
315
+ * @desc 回调
316
+ * @param id 表单所处行中的id
317
+ * @param value 表单值
318
+ * @param name 表单名
319
+ * */
320
+ var _onChange = function onChange(id, value, name) {
321
+ onFormItemChange && onFormItemChange(name, id, value);
322
+ };
323
+ var renderFormItem = function renderFormItem() {
324
+ var rowValue = valueList === null || valueList === void 0 ? void 0 : valueList[rowIndex];
325
+ return jsx(Fragment, {
326
+ children: (config === null || config === void 0 ? void 0 : config.length) > 0 && config.map(function (data) {
327
+ var formItemProps = (data === null || data === void 0 ? void 0 : data.inputType) !== 'Switch' ? Object.assign({
328
+ rowIndex: rowIndex,
329
+ id: rowValue.id,
330
+ value: rowValue === null || rowValue === void 0 ? void 0 : rowValue[data.name || ''],
331
+ error: !!(rowError === null || rowError === void 0 ? void 0 : rowError[data.name || '']),
332
+ helperText: rowError === null || rowError === void 0 ? void 0 : rowError[data.name || '']
333
+ }, data) : Object.assign({
334
+ rowIndex: rowIndex,
335
+ id: rowValue.id,
336
+ checked: rowValue === null || rowValue === void 0 ? void 0 : rowValue[data.name || '']
337
+ }, data);
338
+ return jsxs("div", Object.assign({
339
+ className: "form-item ".concat((data === null || data === void 0 ? void 0 : data.inputType) === 'Switch' ? 'row-form-switch' : '')
340
+ }, {
341
+ children: [jsx(FormItem, {
342
+ valueList: valueList,
343
+ errors: errors,
344
+ formItemProps: formItemProps,
345
+ onChange: function onChange(id, value) {
346
+ return _onChange(id, value, (data === null || data === void 0 ? void 0 : data.name) || '');
347
+ }
348
+ }), icon && icon]
349
+ }), data.name);
350
+ })
351
+ });
352
+ };
353
+ return jsx(Fragment, {
354
+ children: renderFormItem()
355
+ });
356
+ };
357
+
358
+ var dist = {exports: {}};
359
+
360
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(sortable_esm);
361
+
362
+ var classnames = {exports: {}};
363
+
364
+ /*!
365
+ Copyright (c) 2018 Jed Watson.
366
+ Licensed under the MIT License (MIT), see
367
+ http://jedwatson.github.io/classnames
368
+ */
369
+
370
+ (function (module) {
371
+ /* global define */
372
+
373
+ (function () {
374
+
375
+ var hasOwn = {}.hasOwnProperty;
376
+
377
+ function classNames() {
378
+ var classes = [];
379
+
380
+ for (var i = 0; i < arguments.length; i++) {
381
+ var arg = arguments[i];
382
+ if (!arg) continue;
383
+
384
+ var argType = typeof arg;
385
+
386
+ if (argType === 'string' || argType === 'number') {
387
+ classes.push(arg);
388
+ } else if (Array.isArray(arg)) {
389
+ if (arg.length) {
390
+ var inner = classNames.apply(null, arg);
391
+ if (inner) {
392
+ classes.push(inner);
393
+ }
394
+ }
395
+ } else if (argType === 'object') {
396
+ if (arg.toString === Object.prototype.toString) {
397
+ for (var key in arg) {
398
+ if (hasOwn.call(arg, key) && arg[key]) {
399
+ classes.push(key);
400
+ }
401
+ }
402
+ } else {
403
+ classes.push(arg.toString());
404
+ }
405
+ }
406
+ }
407
+
408
+ return classes.join(' ');
409
+ }
410
+
411
+ if (module.exports) {
412
+ classNames.default = classNames;
413
+ module.exports = classNames;
414
+ } else {
415
+ window.classNames = classNames;
416
+ }
417
+ }());
418
+ } (classnames));
419
+
420
+ var isProduction = process.env.NODE_ENV === 'production';
421
+ var prefix = 'Invariant failed';
422
+ function invariant(condition, message) {
423
+ if (condition) {
424
+ return;
425
+ }
426
+ if (isProduction) {
427
+ throw new Error(prefix);
428
+ }
429
+ var provided = typeof message === 'function' ? message() : message;
430
+ var value = provided ? prefix + ": " + provided : prefix;
431
+ throw new Error(value);
432
+ }
433
+
434
+ var tinyInvariant_esm = /*#__PURE__*/Object.freeze({
435
+ __proto__: null,
436
+ 'default': invariant
437
+ });
438
+
439
+ var require$$3 = /*@__PURE__*/getAugmentedNamespace(tinyInvariant_esm);
440
+
441
+ (function (module) {
442
+ var $8zHUo$sortablejs = require$$0;
443
+ var $8zHUo$classnames = classnames.exports;
444
+ var $8zHUo$react = React__default;
445
+ var $8zHUo$tinyinvariant = require$$3;
446
+
447
+ function $parcel$interopDefault(a) {
448
+ return a && a.__esModule ? a.default : a;
449
+ }
450
+ function $parcel$export(e, n, v, s) {
451
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
452
+ }
453
+ function $parcel$exportWildcard(dest, source) {
454
+ Object.keys(source).forEach(function(key) {
455
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
456
+ return;
457
+ }
458
+
459
+ Object.defineProperty(dest, key, {
460
+ enumerable: true,
461
+ get: function get() {
462
+ return source[key];
463
+ }
464
+ });
465
+ });
466
+
467
+ return dest;
468
+ }
469
+
470
+ $parcel$export(module.exports, "Sortable", () => $882b6d93070905b3$re_export$Sortable);
471
+ $parcel$export(module.exports, "Direction", () => $882b6d93070905b3$re_export$Direction);
472
+ $parcel$export(module.exports, "DOMRect", () => $882b6d93070905b3$re_export$DOMRect);
473
+ $parcel$export(module.exports, "GroupOptions", () => $882b6d93070905b3$re_export$GroupOptions);
474
+ $parcel$export(module.exports, "MoveEvent", () => $882b6d93070905b3$re_export$MoveEvent);
475
+ $parcel$export(module.exports, "Options", () => $882b6d93070905b3$re_export$Options);
476
+ $parcel$export(module.exports, "PullResult", () => $882b6d93070905b3$re_export$PullResult);
477
+ $parcel$export(module.exports, "PutResult", () => $882b6d93070905b3$re_export$PutResult);
478
+ $parcel$export(module.exports, "SortableEvent", () => $882b6d93070905b3$re_export$SortableEvent);
479
+ $parcel$export(module.exports, "SortableOptions", () => $882b6d93070905b3$re_export$SortableOptions);
480
+ $parcel$export(module.exports, "Utils", () => $882b6d93070905b3$re_export$Utils);
481
+ $parcel$export(module.exports, "ReactSortable", () => $7fe8e3ea572bda7a$export$11bbed9ee0012c13);
482
+
483
+
484
+
485
+
486
+
487
+ function $eb03e74f8f7db1f3$export$1d0aa160432dfea5(node) {
488
+ if (node.parentElement !== null) node.parentElement.removeChild(node);
489
+ }
490
+ function $eb03e74f8f7db1f3$export$6d240faa51aa562f(parent, newChild, index) {
491
+ const refChild = parent.children[index] || null;
492
+ parent.insertBefore(newChild, refChild);
493
+ }
494
+ function $eb03e74f8f7db1f3$export$77f49a256021c8de(customs) {
495
+ customs.forEach((curr)=>$eb03e74f8f7db1f3$export$1d0aa160432dfea5(curr.element)
496
+ );
497
+ }
498
+ function $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs) {
499
+ customs.forEach((curr)=>{
500
+ $eb03e74f8f7db1f3$export$6d240faa51aa562f(curr.parentElement, curr.element, curr.oldIndex);
501
+ });
502
+ }
503
+ function $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list) {
504
+ const mode = $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt);
505
+ const parentElement = {
506
+ parentElement: evt.from
507
+ };
508
+ let custom = [];
509
+ switch(mode){
510
+ case "normal":
511
+ /* eslint-disable */ const item = {
512
+ element: evt.item,
513
+ newIndex: evt.newIndex,
514
+ oldIndex: evt.oldIndex,
515
+ parentElement: evt.from
516
+ };
517
+ custom = [
518
+ item
519
+ ];
520
+ break;
521
+ case "swap":
522
+ const drag = {
523
+ element: evt.item,
524
+ oldIndex: evt.oldIndex,
525
+ newIndex: evt.newIndex,
526
+ ...parentElement
527
+ };
528
+ const swap = {
529
+ element: evt.swapItem,
530
+ oldIndex: evt.newIndex,
531
+ newIndex: evt.oldIndex,
532
+ ...parentElement
533
+ };
534
+ custom = [
535
+ drag,
536
+ swap
537
+ ];
538
+ break;
539
+ case "multidrag":
540
+ custom = evt.oldIndicies.map((curr, index)=>({
541
+ element: curr.multiDragElement,
542
+ oldIndex: curr.index,
543
+ newIndex: evt.newIndicies[index].index,
544
+ ...parentElement
545
+ })
546
+ );
547
+ break;
548
+ }
549
+ /* eslint-enable */ const customs = $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(custom, list);
550
+ return customs;
551
+ }
552
+ function $eb03e74f8f7db1f3$export$c25cf8080bd305ec(normalized, list) {
553
+ const a = $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list);
554
+ const b = $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, a);
555
+ return b;
556
+ }
557
+ function $eb03e74f8f7db1f3$export$be2da95e6167b0bd(normalized, list) {
558
+ const newList = [
559
+ ...list
560
+ ];
561
+ normalized.concat().reverse().forEach((curr)=>newList.splice(curr.oldIndex, 1)
562
+ );
563
+ return newList;
564
+ }
565
+ function $eb03e74f8f7db1f3$export$eca851ee65ae17e4(normalized, list, evt, clone) {
566
+ const newList = [
567
+ ...list
568
+ ];
569
+ normalized.forEach((curr)=>{
570
+ const newItem = clone && evt && clone(curr.item, evt);
571
+ newList.splice(curr.newIndex, 0, newItem || curr.item);
572
+ });
573
+ return newList;
574
+ }
575
+ function $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt) {
576
+ if (evt.oldIndicies && evt.oldIndicies.length > 0) return "multidrag";
577
+ if (evt.swapItem) return "swap";
578
+ return "normal";
579
+ }
580
+ function $eb03e74f8f7db1f3$export$bc06a3af7dc65f53(inputs, list) {
581
+ const normalized = inputs.map((curr)=>({
582
+ ...curr,
583
+ item: list[curr.oldIndex]
584
+ })
585
+ ).sort((a, b)=>a.oldIndex - b.oldIndex
586
+ );
587
+ return normalized;
588
+ }
589
+ function $eb03e74f8f7db1f3$export$7553c81e62e31b7e(props) {
590
+ /* eslint-disable */ const { list: // react sortable props
591
+ list , setList: setList , children: children , tag: tag , style: style , className: className , clone: clone , onAdd: // sortable options that have methods we want to overwrite
592
+ 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;
593
+ /* eslint-enable */ return options;
594
+ }
595
+
596
+
597
+ /** Holds a global reference for which react element is being dragged */ // @todo - use context to manage this. How does one use 2 different providers?
598
+ const $7fe8e3ea572bda7a$var$store = {
599
+ dragging: null
600
+ };
601
+ class $7fe8e3ea572bda7a$export$11bbed9ee0012c13 extends $8zHUo$react.Component {
602
+ constructor(props){
603
+ super(props);
604
+ // @todo forward ref this component
605
+ this.ref = /*#__PURE__*/ $8zHUo$react.createRef();
606
+ // make all state false because we can't change sortable unless a mouse gesture is made.
607
+ const newList = [
608
+ ...props.list
609
+ ];
610
+ newList.forEach((item)=>{
611
+ Object.assign(item, {
612
+ chosen: false,
613
+ selected: false
614
+ });
615
+ });
616
+ props.setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
617
+ ($parcel$interopDefault($8zHUo$tinyinvariant))(//@ts-expect-error: Doesn't exist. Will deprecate soon.
618
+ !props.plugins, `
619
+ Plugins prop is no longer supported.
620
+ Instead, mount it with "Sortable.mount(new MultiDrag())"
621
+ Please read the updated README.md at https://github.com/SortableJS/react-sortablejs.
622
+ `);
623
+ }
624
+ componentDidMount() {
625
+ if (this.ref.current === null) return;
626
+ const newOptions = this.makeOptions();
627
+ ($parcel$interopDefault($8zHUo$sortablejs)).create(this.ref.current, newOptions);
628
+ }
629
+ componentDidUpdate(prevProps) {
630
+ if (prevProps.disabled !== this.props.disabled && this.sortable) this.sortable.option("disabled", this.props.disabled);
631
+ }
632
+ render() {
633
+ const { tag: tag , style: style , className: className , id: id } = this.props;
634
+ const classicProps = {
635
+ style: style,
636
+ className: className,
637
+ id: id
638
+ };
639
+ // if no tag, default to a `div` element.
640
+ const newTag = !tag || tag === null ? "div" : tag;
641
+ return(/*#__PURE__*/ $8zHUo$react.createElement(newTag, {
642
+ // @todo - find a way (perhaps with the callback) to allow AntD components to work
643
+ ref: this.ref,
644
+ ...classicProps
645
+ }, this.getChildren()));
646
+ }
647
+ getChildren() {
648
+ 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;
649
+ // if no children, don't do anything.
650
+ if (!children || children == null) return null;
651
+ const dataid = dataIdAttr || "data-id";
652
+ /* eslint-disable-next-line */ return $8zHUo$react.Children.map(children, (child, index)=>{
653
+ if (child === undefined) return undefined;
654
+ const item = list[index] || {
655
+ };
656
+ const { className: prevClassName } = child.props;
657
+ // @todo - handle the function if avalable. I don't think anyone will be doing this soon.
658
+ const filtered = typeof filter === "string" && {
659
+ [filter.replace(".", "")]: !!item.filtered
660
+ };
661
+ const className = ($parcel$interopDefault($8zHUo$classnames))(prevClassName, {
662
+ [selectedClass]: item.selected,
663
+ [chosenClass]: item.chosen,
664
+ ...filtered
665
+ });
666
+ return(/*#__PURE__*/ $8zHUo$react.cloneElement(child, {
667
+ [dataid]: child.key,
668
+ className: className
669
+ }));
670
+ });
671
+ }
672
+ /** Appends the `sortable` property to this component */ get sortable() {
673
+ const el = this.ref.current;
674
+ if (el === null) return null;
675
+ const key = Object.keys(el).find((k)=>k.includes("Sortable")
676
+ );
677
+ if (!key) return null;
678
+ //@ts-expect-error: fix me.
679
+ return el[key];
680
+ }
681
+ /** Converts all the props from `ReactSortable` into the `options` object that `Sortable.create(el, [options])` can use. */ makeOptions() {
682
+ const DOMHandlers = [
683
+ "onAdd",
684
+ "onChoose",
685
+ "onDeselect",
686
+ "onEnd",
687
+ "onRemove",
688
+ "onSelect",
689
+ "onSpill",
690
+ "onStart",
691
+ "onUnchoose",
692
+ "onUpdate",
693
+ ];
694
+ const NonDOMHandlers = [
695
+ "onChange",
696
+ "onClone",
697
+ "onFilter",
698
+ "onSort",
699
+ ];
700
+ const newOptions = $eb03e74f8f7db1f3$export$7553c81e62e31b7e(this.props);
701
+ DOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerPropAndDOM(name)
702
+ );
703
+ NonDOMHandlers.forEach((name)=>newOptions[name] = this.prepareOnHandlerProp(name)
704
+ );
705
+ /** onMove has 2 arguments and needs to be handled seperately. */ const onMove1 = (evt, originalEvt)=>{
706
+ const { onMove: onMove } = this.props;
707
+ const defaultValue = evt.willInsertAfter || -1;
708
+ if (!onMove) return defaultValue;
709
+ const result = onMove(evt, originalEvt, this.sortable, $7fe8e3ea572bda7a$var$store);
710
+ if (typeof result === "undefined") return false;
711
+ return result;
712
+ };
713
+ return {
714
+ ...newOptions,
715
+ onMove: onMove1
716
+ };
717
+ }
718
+ /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop & an `on[Handler]` ReactSortable method. */ prepareOnHandlerPropAndDOM(evtName) {
719
+ return (evt)=>{
720
+ // call the component prop
721
+ this.callOnHandlerProp(evt, evtName);
722
+ // calls state change
723
+ //@ts-expect-error: until @types multidrag item is in
724
+ this[evtName](evt);
725
+ };
726
+ }
727
+ /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop */ prepareOnHandlerProp(evtName) {
728
+ return (evt)=>{
729
+ // call the component prop
730
+ this.callOnHandlerProp(evt, evtName);
731
+ };
732
+ }
733
+ /** Calls the `props.on[Handler]` function */ callOnHandlerProp(evt, evtName) {
734
+ const propEvent = this.props[evtName];
735
+ if (propEvent) propEvent(evt, this.sortable, $7fe8e3ea572bda7a$var$store);
736
+ }
737
+ // SORTABLE DOM HANDLING
738
+ onAdd(evt) {
739
+ const { list: list , setList: setList , clone: clone } = this.props;
740
+ /* eslint-disable-next-line */ const otherList = [
741
+ ...$7fe8e3ea572bda7a$var$store.dragging.props.list
742
+ ];
743
+ const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, otherList);
744
+ $eb03e74f8f7db1f3$export$77f49a256021c8de(customs);
745
+ const newList = $eb03e74f8f7db1f3$export$eca851ee65ae17e4(customs, list, evt, clone);
746
+ newList.forEach((item)=>{
747
+ Object.assign(item, {
748
+ selected: false
749
+ });
750
+ });
751
+ setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
752
+ }
753
+ onRemove(evt) {
754
+ const { list: list , setList: setList } = this.props;
755
+ const mode = $eb03e74f8f7db1f3$export$1fc0f6205829e19c(evt);
756
+ const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list);
757
+ $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs);
758
+ let newList = [
759
+ ...list
760
+ ];
761
+ // remove state if not in clone mode. otherwise, keep.
762
+ if (evt.pullMode !== "clone") newList = $eb03e74f8f7db1f3$export$be2da95e6167b0bd(customs, newList);
763
+ else {
764
+ // switch used to get the clone
765
+ let customClones = customs;
766
+ switch(mode){
767
+ case "multidrag":
768
+ customClones = customs.map((item, index)=>({
769
+ ...item,
770
+ element: evt.clones[index]
771
+ })
772
+ );
773
+ break;
774
+ case "normal":
775
+ customClones = customs.map((item)=>({
776
+ ...item,
777
+ element: evt.clone
778
+ })
779
+ );
780
+ break;
781
+ case "swap":
782
+ default:
783
+ ($parcel$interopDefault($8zHUo$tinyinvariant))(true, `mode "${mode}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${mode}" plugin`);
784
+ }
785
+ $eb03e74f8f7db1f3$export$77f49a256021c8de(customClones);
786
+ // replace selected items with cloned items
787
+ customs.forEach((curr)=>{
788
+ const index = curr.oldIndex;
789
+ /* eslint-disable-next-line */ const newItem = this.props.clone(curr.item, evt);
790
+ newList.splice(index, 1, newItem);
791
+ });
792
+ }
793
+ // remove item.selected from list
794
+ newList.forEach((item)=>{
795
+ Object.assign(item, {
796
+ selected: false
797
+ });
798
+ });
799
+ setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
800
+ }
801
+ onUpdate(evt) {
802
+ const { list: list , setList: setList } = this.props;
803
+ const customs = $eb03e74f8f7db1f3$export$4655efe700f887a(evt, list);
804
+ $eb03e74f8f7db1f3$export$77f49a256021c8de(customs);
805
+ $eb03e74f8f7db1f3$export$a6177d5829f70ebc(customs);
806
+ const newList = $eb03e74f8f7db1f3$export$c25cf8080bd305ec(customs, list);
807
+ return setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
808
+ }
809
+ onStart() {
810
+ $7fe8e3ea572bda7a$var$store.dragging = this;
811
+ }
812
+ onEnd() {
813
+ $7fe8e3ea572bda7a$var$store.dragging = null;
814
+ }
815
+ onChoose(evt) {
816
+ const { list: list , setList: setList } = this.props;
817
+ const newList = list.map((item, index)=>{
818
+ if (index === evt.oldIndex) Object.assign(item, {
819
+ chosen: true
820
+ });
821
+ return item;
822
+ });
823
+ setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
824
+ }
825
+ onUnchoose(evt) {
826
+ const { list: list , setList: setList } = this.props;
827
+ const newList = list.map((item, index)=>{
828
+ if (index === evt.oldIndex) Object.assign(item, {
829
+ chosen: false
830
+ });
831
+ return item;
832
+ });
833
+ setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
834
+ }
835
+ onSpill(evt) {
836
+ const { removeOnSpill: removeOnSpill , revertOnSpill: revertOnSpill } = this.props;
837
+ if (removeOnSpill && !revertOnSpill) $eb03e74f8f7db1f3$export$1d0aa160432dfea5(evt.item);
838
+ }
839
+ onSelect(evt) {
840
+ const { list: list , setList: setList } = this.props;
841
+ const newList = [
842
+ ...list
843
+ ];
844
+ newList.forEach((item)=>{
845
+ Object.assign(item, {
846
+ chosen: false
847
+ });
848
+ });
849
+ evt.newIndicies.forEach((curr)=>{
850
+ const index = curr.index;
851
+ if (index === -1) {
852
+ console.log(`"${evt.type}" had indice of "${curr.index}", which is probably -1 and doesn't usually happen here.`);
853
+ console.log(evt);
854
+ return;
855
+ }
856
+ newList[index].selected = true;
857
+ });
858
+ setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
859
+ }
860
+ onDeselect(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) return;
873
+ newList[index].selected = true;
874
+ });
875
+ setList(newList, this.sortable, $7fe8e3ea572bda7a$var$store);
876
+ }
877
+ }
878
+ $7fe8e3ea572bda7a$export$11bbed9ee0012c13.defaultProps = {
879
+ clone: (item)=>item
880
+ };
881
+
882
+
883
+ var $faefaad95e5fcca0$exports = {};
884
+
885
+
886
+ $parcel$exportWildcard(module.exports, $faefaad95e5fcca0$exports);
887
+
888
+
889
+
890
+ } (dist));
891
+
892
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-dynamic-multi-box {\n width: 100%;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content {\n width: 100%;\n position: relative;\n overflow-x: auto;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .title-config-row {\n display: flex;\n flex: 1;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .title-config-row .title-config-row-item {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 180px;\n margin-right: 12px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .title-config-row .row-form-switch {\n flex: 0;\n min-width: 80px;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .filter-panel {\n width: 36px;\n height: 36px;\n padding: 6px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .filter-panel svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .title-config .filter-panel svg:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 {\n width: 40px;\n display: flex;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel {\n width: 36px;\n height: 36px;\n padding: 6px;\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon-panel svg:hover {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon {\n width: 36px;\n height: 36px;\n padding: 6px;\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon svg {\n font-size: 24px;\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover {\n background: rgba(171, 176, 185, 0.12);\n border-radius: 4px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .operator-column-icon:hover svg {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .hidden-icon {\n display: none;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .center-line {\n width: 1px;\n height: 12px;\n border: 1px solid rgba(171, 176, 185, 0.4);\n margin: 0 3px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-40 .blank-block {\n width: 44px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .operator-column-80 {\n width: 80px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .content-row-form {\n width: 100%;\n display: flex;\n align-items: flex-start;\n height: 56px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .content-row-form .form-item {\n display: flex;\n align-items: flex-start;\n flex: 1;\n min-width: 180px;\n margin-right: 12px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-content .content-row-form .row-form-switch {\n flex: 0;\n box-sizing: content-box;\n align-items: center;\n height: 36px;\n min-width: 80px;\n}\n.paraui-v3-dynamic-multi-box .add-button {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 36px;\n background: rgba(171, 176, 185, 0.12);\n border: 1px dashed rgba(171, 176, 185, 0.4);\n border-radius: 4px;\n}\n.paraui-v3-dynamic-multi-box .add-button .text {\n font-size: 14px;\n margin-left: 8px;\n}\n.paraui-v3-dynamic-multi-box .multi-value-add-button-top-20 {\n margin-top: 20px;\n}\n.paraui-v3-dynamic-multi-box .normal-button {\n cursor: pointer;\n}\n.paraui-v3-dynamic-multi-box .normal-button .text {\n color: rgb(54, 102, 214);\n}\n.paraui-v3-dynamic-multi-box .normal-button:hover {\n background: rgba(54, 102, 214, 0.05);\n border: 1px dashed rgba(54, 102, 214, 0.4);\n}\n.paraui-v3-dynamic-multi-box .disabled-add .text {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-dynamic-multi-box .disabled-add svg {\n color: rgba(46, 55, 67, 0.4);\n}\n.paraui-v3-dynamic-multi-box .paraui-v3-comboselect,\n.paraui-v3-dynamic-multi-box .paraui-v3-picker-wrapper {\n width: 100%;\n}\n.paraui-v3-dynamic-multi-box .multi-value-switch {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.paraui-v3-dynamic-multi-box .multi-value-switch .switch-text {\n color: rgba(46, 55, 67, 0.4);\n margin-right: 4px;\n overflow: hidden;\n}\n.paraui-v3-dynamic-multi-box .multi-value-switch .switch {\n flex: 1;\n}\n\n.paraui-v3-dynamic-multi-box-popover .filter-config {\n width: 200px;\n max-height: 300px;\n padding-top: 16px;\n overflow-y: auto;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list {\n padding: 0 12px;\n overflow-y: auto;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list .title {\n font-size: 12px;\n color: rgba(46, 55, 67, 0.4);\n margin-bottom: 12px;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list .paraui-v3-check-box {\n margin-bottom: 22px;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .check-list .paraui-v3-check-box:last-child {\n margin-bottom: 22px;\n}\n.paraui-v3-dynamic-multi-box-popover .filter-config .restore-default {\n display: flex;\n justify-content: center;\n align-items: center;\n position: sticky;\n width: 100%;\n left: 0;\n bottom: 0;\n top: -2px;\n height: 44px;\n color: rgb(54, 102, 214);\n cursor: pointer;\n border-top: 1px solid rgba(171, 176, 185, 0.12);\n background-color: #fff;\n}\n.paraui-v3-dynamic-multi-box-popover .no-other-property {\n width: 200px;\n padding: 16px 0;\n text-align: center;\n font-size: 12px;\n color: rgba(46, 55, 67, 0.4);\n}";
893
+ styleInject(css_248z);
894
+
895
+ var DynamicMultiBox = function DynamicMultiBox(props) {
896
+ var valueList = props.valueList,
897
+ _props$config = props.config,
898
+ config = _props$config === void 0 ? [] : _props$config,
899
+ _props$errors = props.errors,
900
+ errors = _props$errors === void 0 ? [] : _props$errors,
901
+ _props$isSort = props.isSort,
902
+ isSort = _props$isSort === void 0 ? false : _props$isSort,
903
+ _props$isFilter = props.isFilter,
904
+ isFilter = _props$isFilter === void 0 ? false : _props$isFilter,
905
+ className = props.className,
906
+ _props$disabledAdd = props.disabledAdd,
907
+ disabledAdd = _props$disabledAdd === void 0 ? false : _props$disabledAdd,
908
+ _props$titleMode = props.titleMode,
909
+ titleMode = _props$titleMode === void 0 ? 'all' : _props$titleMode,
910
+ checkedValue = props.checkedValue,
911
+ icon = props.icon,
912
+ _props$deleteDisable = props.deleteDisable,
913
+ deleteDisable = _props$deleteDisable === void 0 ? [] : _props$deleteDisable,
914
+ singleTitle = props.singleTitle,
915
+ initValue = props.initValue,
916
+ popoverClassName = props.popoverClassName,
917
+ onChange = props.onChange,
918
+ onAdd = props.onAdd,
919
+ onFilter = props.onFilter,
920
+ onDelete = props.onDelete,
921
+ onSort = props.onSort;
922
+ var _useState = useState([]),
923
+ _useState2 = _slicedToArray(_useState, 2),
924
+ checked = _useState2[0],
925
+ setChecked = _useState2[1];
926
+ var domRef = useRef(null);
927
+ var _useState3 = useState([]),
928
+ _useState4 = _slicedToArray(_useState3, 2),
929
+ fixedConfig = _useState4[0],
930
+ setFixedConfig = _useState4[1];
931
+ var _useState5 = useState([]),
932
+ _useState6 = _slicedToArray(_useState5, 2),
933
+ selectedConfig = _useState6[0],
934
+ setSelectedConfig = _useState6[1];
935
+ useEffect(function () {
936
+ if (checkedValue) setChecked(checkedValue);
937
+ }, [checkedValue]);
938
+ useEffect(function () {
939
+ if (!(config === null || config === void 0 ? void 0 : config.length)) return;
940
+ // 筛选出固定字段
941
+ var fixedArr = (config === null || config === void 0 ? void 0 : config.filter(function (item) {
942
+ return item.isFixed;
943
+ })) || [];
944
+ setFixedConfig(fixedArr);
945
+ }, [config]);
946
+ useEffect(function () {
947
+ if (!(config === null || config === void 0 ? void 0 : config.length)) return;
948
+ // 通过透传的checkedValue映射出对应的配置
949
+ var selectedArr = (config === null || config === void 0 ? void 0 : config.filter(function (item) {
950
+ return !item.isFixed && (checked === null || checked === void 0 ? void 0 : checked.includes(item.name));
951
+ })) || [];
952
+ setSelectedConfig(selectedArr);
953
+ }, [config, checked]);
954
+ /**
955
+ * @desc 内容产生滚动时,给新增按增加marginTop: 20
956
+ * */
957
+ useEffect(function () {
958
+ monitorScroll();
959
+ }, []);
960
+ /**
961
+ * @desc 筛选回调
962
+ * */
963
+ var onCheckChange = function onCheckChange(val) {
964
+ // 1、更新selectedConfig配置 2、更新valueList 3、更新errors
965
+ // 区分正选反选
966
+ var bool = (val === null || val === void 0 ? void 0 : val.length) > (checked === null || checked === void 0 ? void 0 : checked.length);
967
+ // 当前选中数据和上一次选择数据取差值
968
+ var currentVal = getArrDiffSet(val, checked);
969
+ var valueArr = _toConsumableArray(valueList);
970
+ var errorArr = _toConsumableArray(errors);
971
+ if (bool) {
972
+ valueArr = handleCheckedConfig(valueArr, currentVal);
973
+ errorArr = handleCheckedConfig(errorArr, currentVal);
974
+ } else {
975
+ handleUncheckedConfig(valueArr, currentVal);
976
+ handleUncheckedConfig(errorArr, currentVal);
977
+ }
978
+ setChecked(val);
979
+ onFilter && onFilter({
980
+ name: currentVal,
981
+ checkedVal: val,
982
+ valueList: valueArr,
983
+ errors: errorArr
984
+ });
985
+ monitorScroll();
986
+ };
987
+ /** 监听内容是否产生横向滚动*/
988
+ var monitorScroll = function monitorScroll() {
989
+ setTimeout(function () {
990
+ var dom = document.querySelector('#multi-value-add-button');
991
+ if ((domRef === null || domRef === void 0 ? void 0 : domRef.current.offsetWidth) < (domRef === null || domRef === void 0 ? void 0 : domRef.current.scrollWidth)) dom === null || dom === void 0 ? void 0 : dom.classList.add('multi-value-add-button-top-20');else dom === null || dom === void 0 ? void 0 : dom.classList.remove('multi-value-add-button-top-20');
992
+ }, 0);
993
+ };
994
+ /**
995
+ * @desc 筛选恢复默认,
996
+ * */
997
+ var onRestoreDefault = function onRestoreDefault() {
998
+ if (!(checked === null || checked === void 0 ? void 0 : checked.length)) return;
999
+ var valueArr = _toConsumableArray(valueList);
1000
+ var errorArr = _toConsumableArray(errors);
1001
+ restoreData(valueArr, checked);
1002
+ restoreData(errorArr, checked);
1003
+ setChecked([]);
1004
+ setSelectedConfig([]);
1005
+ onFilter && onFilter({
1006
+ valueList: valueArr,
1007
+ errors: errorArr
1008
+ });
1009
+ };
1010
+ /**
1011
+ * @desc 数据重置
1012
+ * */
1013
+ var restoreData = function restoreData(data, checked) {
1014
+ data.forEach(function (item) {
1015
+ for (var key in item) {
1016
+ if (checked.includes(key)) delete item[key];
1017
+ }
1018
+ });
1019
+ };
1020
+ /**
1021
+ * @desc 反选时更新错误集合errors和valueList集合
1022
+ * @param dataArr 错误集合errors或者valueList集合
1023
+ * @param currentVal 反选值
1024
+ * */
1025
+ var handleUncheckedConfig = function handleUncheckedConfig() {
1026
+ var dataArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1027
+ var currentVal = arguments.length > 1 ? arguments[1] : undefined;
1028
+ dataArr.forEach(function (item) {
1029
+ for (var itemKey in item) {
1030
+ if (itemKey === currentVal) delete item[itemKey];
1031
+ }
1032
+ });
1033
+ };
1034
+ /**
1035
+ * @desc 正选时更新错误集合errors和valueList集合
1036
+ * @param dataArr 错误集合errors或者valueList集合
1037
+ * @param currentVal 正选值
1038
+ * */
1039
+ var handleCheckedConfig = function handleCheckedConfig(dataArr, currentVal) {
1040
+ return dataArr.map(function (item) {
1041
+ return Object.assign(Object.assign({}, item), _defineProperty({}, currentVal, ''));
1042
+ });
1043
+ };
1044
+ /**
1045
+ * 弹窗筛选器内容
1046
+ * */
1047
+ var renderPopoverContent = function renderPopoverContent() {
1048
+ var filterConfig = config.filter(function (item) {
1049
+ return !item.isFixed;
1050
+ });
1051
+ return jsx(Fragment, {
1052
+ children: filterConfig && (filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.length) > 0 ? jsxs("div", Object.assign({
1053
+ className: "filter-config"
1054
+ }, {
1055
+ children: [jsxs("div", Object.assign({
1056
+ className: "check-list"
1057
+ }, {
1058
+ children: [jsx("div", Object.assign({
1059
+ className: "title"
1060
+ }, {
1061
+ children: "\u8868\u5355\u914D\u7F6E (\u975E\u5FC5\u586B\u9879)"
1062
+ })), jsx(CheckboxGroup, {
1063
+ list: filterConfig,
1064
+ row: false,
1065
+ value: checked,
1066
+ onChange: onCheckChange
1067
+ })]
1068
+ })), jsx("div", Object.assign({
1069
+ className: "restore-default",
1070
+ onClick: onRestoreDefault
1071
+ }, {
1072
+ children: "\u6062\u590D\u9ED8\u8BA4"
1073
+ }))]
1074
+ })) : jsx("div", Object.assign({
1075
+ className: "no-other-property"
1076
+ }, {
1077
+ children: "\u6682\u65E0\u5176\u4ED6\u5C5E\u6027"
1078
+ }))
1079
+ });
1080
+ };
1081
+ var popoverHandClass = function popoverHandClass() {
1082
+ var str = $prefixCls + '-dynamic-multi-box-popover';
1083
+ if (popoverClassName) str += ' ' + popoverClassName;
1084
+ return str;
1085
+ };
1086
+ /**
1087
+ * 渲染表头
1088
+ * */
1089
+ var renderTitle = useMemo(function () {
1090
+ var _a, _b;
1091
+ if (!((_a = [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig))) === null || _a === void 0 ? void 0 : _a.length)) return null;
1092
+ return jsxs("div", Object.assign({
1093
+ className: 'title-config'
1094
+ }, {
1095
+ children: [titleMode === 'all' ? jsx("div", Object.assign({
1096
+ className: 'title-config-row'
1097
+ }, {
1098
+ children: (_b = [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig))) === null || _b === void 0 ? void 0 : _b.map(function (item, index) {
1099
+ var label = item.label,
1100
+ required = item.required,
1101
+ className = item.className,
1102
+ inputType = item.inputType;
1103
+ return jsx("div", Object.assign({
1104
+ className: "title-config-row-item ".concat(inputType === 'Switch' ? 'row-form-switch' : '', " ").concat(className)
1105
+ }, {
1106
+ children: jsx(Label, {
1107
+ required: required,
1108
+ label: label
1109
+ })
1110
+ }), index);
1111
+ })
1112
+ })) : titleMode === 'single' ? jsx(Label, {
1113
+ required: singleTitle === null || singleTitle === void 0 ? void 0 : singleTitle.required,
1114
+ label: singleTitle === null || singleTitle === void 0 ? void 0 : singleTitle.label
1115
+ }) : null, jsxs("div", Object.assign({
1116
+ className: "operator-column-40 ".concat(isSort ? 'operator-column-80' : '')
1117
+ }, {
1118
+ children: [isSort && jsx("div", {
1119
+ className: 'blank-block'
1120
+ }), isFilter && jsx(Popover, Object.assign({
1121
+ placement: 'bottom-end',
1122
+ content: renderPopoverContent(),
1123
+ getPopupContainer: function getPopupContainer() {
1124
+ return document.body;
1125
+ },
1126
+ overlayClassName: popoverHandClass()
1127
+ }, {
1128
+ children: jsx("div", Object.assign({
1129
+ className: 'operator-column-icon-panel'
1130
+ }, {
1131
+ children: jsx(Panel, {})
1132
+ }))
1133
+ }))]
1134
+ }))]
1135
+ }));
1136
+ }, [titleMode, fixedConfig, selectedConfig, isSort, isFilter, checked, onCheckChange, onRestoreDefault]);
1137
+ /**
1138
+ *@desc 渲染内容
1139
+ * */
1140
+ var renderContent = useMemo(function () {
1141
+ if (valueList && (valueList === null || valueList === void 0 ? void 0 : valueList.length) > 0) {
1142
+ var showDeleteIcon = valueList.length > 1;
1143
+ return jsx(Fragment, {
1144
+ children: valueList.map(function (item, rowIndex) {
1145
+ var _a;
1146
+ var id = item.id;
1147
+ var rowError = (_a = errors === null || errors === void 0 ? void 0 : errors.filter(function (item) {
1148
+ return item.id === id;
1149
+ })) === null || _a === void 0 ? void 0 : _a[0];
1150
+ return jsxs("div", Object.assign({
1151
+ className: 'content-row-form'
1152
+ }, {
1153
+ children: [jsx(RowForm, {
1154
+ rowIndex: rowIndex,
1155
+ valueList: valueList,
1156
+ errors: errors,
1157
+ rowError: rowError,
1158
+ onFormItemChange: function onFormItemChange(name, id, value) {
1159
+ return _onFormItemChange(name, id, value, rowIndex);
1160
+ },
1161
+ icon: icon,
1162
+ config: [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig))
1163
+ }), jsxs("div", Object.assign({
1164
+ className: "operator-column-40 ".concat(isSort && showDeleteIcon ? 'operator-column-80' : '')
1165
+ }, {
1166
+ children: [jsx("div", Object.assign({
1167
+ className: "operator-column-icon delete-icon ".concat(!showDeleteIcon || deleteDisable.includes(id) ? 'hidden-icon' : ''),
1168
+ onClick: function onClick() {
1169
+ return onDeleteEvent(rowIndex);
1170
+ }
1171
+ }, {
1172
+ children: jsx(Delete, {})
1173
+ })), jsx("div", {
1174
+ className: 'blank-block'
1175
+ }), isSort && jsx("div", Object.assign({
1176
+ className: !showDeleteIcon || deleteDisable.includes(id) ? 'hidden-icon' : 'center-line'
1177
+ }, {
1178
+ children: jsx("div", {
1179
+ className: 'line'
1180
+ })
1181
+ })), isSort && jsx("div", Object.assign({
1182
+ className: "sort-handler operator-column-icon ".concat(!showDeleteIcon ? 'hidden-icon' : '')
1183
+ }, {
1184
+ children: jsx(Drag, {})
1185
+ }))]
1186
+ }))]
1187
+ }), rowIndex);
1188
+ })
1189
+ });
1190
+ } else return null;
1191
+ }, [valueList, isSort, isFilter, errors, fixedConfig, selectedConfig]);
1192
+ /**
1193
+ * @desc 删除事件
1194
+ * */
1195
+ var onDeleteEvent = function onDeleteEvent(rowIndex) {
1196
+ var valueArr = _toConsumableArray(valueList);
1197
+ var errorArr = _toConsumableArray(errors);
1198
+ valueArr.splice(rowIndex, 1);
1199
+ errorArr.splice(rowIndex, 1);
1200
+ onDelete && onDelete(valueArr, errorArr);
1201
+ };
1202
+ /**
1203
+ * @desc 表单回调
1204
+ * @param value 表单回调值
1205
+ * @param name
1206
+ * @param rowIndex 表单所处行下标
1207
+ * @param id 表单所处行中的id
1208
+ * */
1209
+ var _onFormItemChange = function _onFormItemChange(name, id, value, rowIndex) {
1210
+ var valueArr = _toConsumableArray(valueList);
1211
+ Object.keys(valueArr[rowIndex]).forEach(function (key) {
1212
+ if (name === key) valueArr[rowIndex][key] = value;
1213
+ });
1214
+ onChange && onChange(valueArr, {
1215
+ name: name,
1216
+ id: id,
1217
+ value: value,
1218
+ rowIndex: rowIndex
1219
+ });
1220
+ };
1221
+ /**
1222
+ * @desc 新增事件
1223
+ * */
1224
+ var onAddEvent = function onAddEvent() {
1225
+ // 根据配置进行valueList更新
1226
+ var valueArr = _toConsumableArray(valueList || []);
1227
+ var errorArr = _toConsumableArray(errors);
1228
+ var id = UUID();
1229
+ // 取出已经筛选的配置数据
1230
+ var configArr = [].concat(_toConsumableArray(fixedConfig), _toConsumableArray(selectedConfig));
1231
+ valueArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'value')), {
1232
+ id: id
1233
+ }));
1234
+ errorArr.push(Object.assign(Object.assign({}, getNewItem(configArr, 'error')), {
1235
+ id: id
1236
+ }));
1237
+ onAdd && onAdd(valueArr, errorArr);
1238
+ };
1239
+ /**
1240
+ * @desc 新增时,获取valueList和errors的新增项
1241
+ * @param configArr 配置表
1242
+ * @param type 区分值和错误
1243
+ * */
1244
+ var getNewItem = function getNewItem(configArr, type) {
1245
+ return configArr.reduce(function (acc, cur) {
1246
+ return Object.assign(Object.assign({}, acc), _defineProperty({}, cur.name, type === 'value' ? initValue === null || initValue === void 0 ? void 0 : initValue[cur.name] : ''));
1247
+ }, {});
1248
+ };
1249
+ /**
1250
+ * @desc 排序
1251
+ * @param newValueList 排序后的数组
1252
+ * */
1253
+ var onDragSort = function onDragSort(newValueList) {
1254
+ // 获取排序后 id映射下标集合
1255
+ var idMapIndex = newValueList.reduce(function (acc, cur, index) {
1256
+ return Object.assign(Object.assign({}, acc), _defineProperty({}, cur.id, index));
1257
+ }, {});
1258
+ // 需要交换的下标集合
1259
+ var swapIds = [];
1260
+ valueList.forEach(function (item, idx) {
1261
+ if (idx !== idMapIndex[item.id]) swapIds.push(idx);
1262
+ });
1263
+ onSort && onSort(newValueList, swapIds);
1264
+ };
1265
+ /**
1266
+ * @description: 获取两个数组的差值
1267
+ * @param {string} currentVal
1268
+ * @param {string} preVal
1269
+ */
1270
+ var getArrDiffSet = function getArrDiffSet(currentVal, preVal) {
1271
+ return currentVal.concat(preVal).filter(function (v) {
1272
+ return !currentVal.includes(v) || !preVal.includes(v);
1273
+ })[0];
1274
+ };
1275
+ /**
1276
+ * @desc 处理className
1277
+ * */
1278
+ var handClass = function handClass() {
1279
+ var str = $prefixCls + '-dynamic-multi-box';
1280
+ if (className) str += ' ' + className;
1281
+ return str;
1282
+ };
1283
+ return jsxs("div", Object.assign({
1284
+ className: handClass()
1285
+ }, {
1286
+ children: [jsxs("div", Object.assign({
1287
+ className: 'multi-value-content',
1288
+ ref: domRef
1289
+ }, {
1290
+ children: [renderTitle, jsx(dist.exports.ReactSortable, Object.assign({
1291
+ list: valueList,
1292
+ handle: '.sort-handler',
1293
+ animation: 150,
1294
+ setList: onDragSort
1295
+ }, {
1296
+ children: renderContent
1297
+ }))]
1298
+ })), jsxs("div", Object.assign({
1299
+ className: "add-button ".concat(disabledAdd ? 'disabled-add' : 'normal-button'),
1300
+ onClick: onAddEvent,
1301
+ id: 'multi-value-add-button'
1302
+ }, {
1303
+ children: [jsx(PlusCircleF, {}), jsx("span", Object.assign({
1304
+ className: 'text'
1305
+ }, {
1306
+ children: "\u65B0 \u589E"
1307
+ }))]
1308
+ }))]
1309
+ }));
1310
+ };
1311
+
1312
+ export { DynamicMultiBox as default };