funda-ui 4.5.677 → 4.5.682
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/ColorPicker/index.js +3 -1
- package/DragDropList/index.css +188 -0
- package/DragDropList/index.d.ts +43 -0
- package/DragDropList/index.js +1589 -0
- package/LICENSE +21 -0
- package/MultipleSelect/index.css +237 -144
- package/MultipleSelect/index.d.ts +23 -10
- package/MultipleSelect/index.js +2242 -1225
- package/README.md +3 -1
- package/Utils/useBoundedDrag.d.ts +127 -0
- package/Utils/useBoundedDrag.js +382 -0
- package/Utils/useDragDropPosition.d.ts +169 -0
- package/Utils/useDragDropPosition.js +456 -0
- package/all.d.ts +1 -0
- package/all.js +1 -0
- package/lib/cjs/ColorPicker/index.js +3 -1
- package/lib/cjs/DragDropList/index.d.ts +43 -0
- package/lib/cjs/DragDropList/index.js +1589 -0
- package/lib/cjs/MultipleSelect/index.d.ts +23 -10
- package/lib/cjs/MultipleSelect/index.js +2242 -1225
- package/lib/cjs/Utils/useBoundedDrag.d.ts +127 -0
- package/lib/cjs/Utils/useBoundedDrag.js +382 -0
- package/lib/cjs/Utils/useDragDropPosition.d.ts +169 -0
- package/lib/cjs/Utils/useDragDropPosition.js +456 -0
- package/lib/cjs/index.d.ts +1 -0
- package/lib/cjs/index.js +1 -0
- package/lib/css/DragDropList/index.css +188 -0
- package/lib/css/MultipleSelect/index.css +237 -144
- package/lib/esm/ColorPicker/index.tsx +53 -49
- package/lib/esm/DragDropList/index.scss +245 -0
- package/lib/esm/DragDropList/index.tsx +493 -0
- package/lib/esm/MultipleSelect/index.scss +288 -183
- package/lib/esm/MultipleSelect/index.tsx +304 -166
- package/lib/esm/MultipleSelect/utils/func.ts +21 -1
- package/lib/esm/Tabs/Tabs.tsx +1 -1
- package/lib/esm/Utils/hooks/useBoundedDrag.tsx +303 -0
- package/lib/esm/Utils/hooks/useDragDropPosition.tsx +420 -0
- package/lib/esm/index.js +1 -0
- package/package.json +1 -1
- package/lib/esm/MultipleSelect/ItemList.tsx +0 -323
package/ColorPicker/index.js
CHANGED
|
@@ -603,6 +603,8 @@ var ColorPicker = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)
|
|
|
603
603
|
htmlFor: idRes,
|
|
604
604
|
className: "form-label"
|
|
605
605
|
}, label)) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
606
|
+
className: "position-relative"
|
|
607
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
606
608
|
className: "input-group"
|
|
607
609
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", _extends({
|
|
608
610
|
ref: function ref(node) {
|
|
@@ -649,7 +651,7 @@ var ColorPicker = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)
|
|
|
649
651
|
className: "text-danger"
|
|
650
652
|
}, "*"))) : '', changedVal === '' ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
651
653
|
className: "custom-colorpicker__transparent-placeholder"
|
|
652
|
-
})) : null));
|
|
654
|
+
})) : null)));
|
|
653
655
|
});
|
|
654
656
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ColorPicker);
|
|
655
657
|
})();
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/* ======================================================
|
|
2
|
+
<!-- DragDrop List -->
|
|
3
|
+
/* ====================================================== */
|
|
4
|
+
.custom-draggable-list {
|
|
5
|
+
--custom-draggable-content-bg: transparent;
|
|
6
|
+
--custom-draggable-content-color: inherit;
|
|
7
|
+
--custom-draggable-border-color: #ddd;
|
|
8
|
+
--custom-draggable-wrapper-radius: 0.25rem;
|
|
9
|
+
--custom-draggable-control-radius: 0.25rem;
|
|
10
|
+
--custom-draggable-primary-color: #ffa940;
|
|
11
|
+
--custom-draggable-content-diff-bg: #fafafa;
|
|
12
|
+
--custom-draggable-content-diff-border-color: #d9d9d9;
|
|
13
|
+
--custom-draggable-control-fs: 0.75rem;
|
|
14
|
+
--custom-draggable-control-w: 100px;
|
|
15
|
+
--custom-draggable-btn-confirm-bg: #52c41a;
|
|
16
|
+
--custom-draggable-btn-cancel-bg: #ff4d4f;
|
|
17
|
+
--custom-draggable-btn-color: #fff;
|
|
18
|
+
list-style: none;
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
width: 100%;
|
|
22
|
+
position: relative;
|
|
23
|
+
border: 1px solid var(--custom-draggable-border-color);
|
|
24
|
+
border-radius: var(--custom-draggable-wrapper-radius);
|
|
25
|
+
/* Fix the problem that mobile terminals cannot be touched, DO NOT USE "<svg>" */
|
|
26
|
+
/* FORM */
|
|
27
|
+
}
|
|
28
|
+
.custom-draggable-list li {
|
|
29
|
+
margin: 0;
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
32
|
+
.custom-draggable-list .custom-draggable-list__item {
|
|
33
|
+
padding: 0;
|
|
34
|
+
position: relative;
|
|
35
|
+
transition: transform 0.15s ease;
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
.custom-draggable-list .custom-draggable-list__item .custom-draggable-list__itemcontent {
|
|
39
|
+
padding: 10px 15px;
|
|
40
|
+
background: var(--custom-draggable-content-bg);
|
|
41
|
+
color: var(--custom-draggable-content-color);
|
|
42
|
+
border-bottom: 1px solid var(--custom-draggable-border-color);
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
user-select: none;
|
|
46
|
+
transition: all 0.15s ease;
|
|
47
|
+
}
|
|
48
|
+
.custom-draggable-list .custom-draggable-list__item .custom-draggable-list__itemcontent .custom-draggable-list__itemcontent-inner {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
.custom-draggable-list .custom-draggable-list__item:last-child .custom-draggable-list__itemcontent {
|
|
55
|
+
border-bottom: none;
|
|
56
|
+
}
|
|
57
|
+
.custom-draggable-list .custom-draggable-list__item.disabled {
|
|
58
|
+
pointer-events: none !important;
|
|
59
|
+
opacity: 0.4 !important;
|
|
60
|
+
}
|
|
61
|
+
.custom-draggable-list.alternate-collapse .custom-draggable-list__collapse-arrow {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
display: inline-block;
|
|
64
|
+
width: 20px;
|
|
65
|
+
text-align: center;
|
|
66
|
+
user-select: none;
|
|
67
|
+
margin-left: 0.2rem;
|
|
68
|
+
}
|
|
69
|
+
.custom-draggable-list.alternate-collapse .custom-draggable-list__collapse-arrow svg {
|
|
70
|
+
transition: all 0.15s ease;
|
|
71
|
+
}
|
|
72
|
+
.custom-draggable-list.alternate-collapse .custom-draggable-list__collapse-arrow:hover {
|
|
73
|
+
opacity: 0.7;
|
|
74
|
+
}
|
|
75
|
+
.custom-draggable-list.alternate-collapse .custom-draggable-list__item.has-children {
|
|
76
|
+
position: relative;
|
|
77
|
+
}
|
|
78
|
+
.custom-draggable-list.alternate-collapse .custom-draggable-list__item.collapsed .custom-draggable-list__collapse-arrow svg {
|
|
79
|
+
transform: rotate(-90deg);
|
|
80
|
+
}
|
|
81
|
+
.custom-draggable-list .custom-draggable-list__item.draggable .custom-draggable-list__itemcontent {
|
|
82
|
+
padding-left: 1.5em;
|
|
83
|
+
}
|
|
84
|
+
.custom-draggable-list.handle-pos-right .custom-draggable-list__item.draggable .custom-draggable-list__itemcontent, .custom-draggable-list.icon-hide .custom-draggable-list__item.draggable .custom-draggable-list__itemcontent {
|
|
85
|
+
padding-left: 0.5rem;
|
|
86
|
+
}
|
|
87
|
+
.custom-draggable-list .custom-draggable-list__item.block.draggable {
|
|
88
|
+
cursor: move;
|
|
89
|
+
}
|
|
90
|
+
.custom-draggable-list .custom-draggable-list__item.dragging .custom-draggable-list__itemcontent {
|
|
91
|
+
background: #fff9e6;
|
|
92
|
+
border: 1px dashed #ffd591;
|
|
93
|
+
opacity: 0.8;
|
|
94
|
+
}
|
|
95
|
+
.custom-draggable-list .custom-draggable-list__item.drag-over .custom-draggable-list__itemcontent {
|
|
96
|
+
background: #fff9e6;
|
|
97
|
+
border: 2px solid #ffd591;
|
|
98
|
+
}
|
|
99
|
+
.custom-draggable-list .custom-draggable-list__item.drag-over-top::before {
|
|
100
|
+
content: "";
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: -3px;
|
|
103
|
+
left: 0;
|
|
104
|
+
right: 0;
|
|
105
|
+
height: 2px;
|
|
106
|
+
background: var(--custom-draggable-primary-color);
|
|
107
|
+
border-radius: 1px;
|
|
108
|
+
}
|
|
109
|
+
.custom-draggable-list .custom-draggable-list__item.drag-over-bottom::after {
|
|
110
|
+
content: "";
|
|
111
|
+
position: absolute;
|
|
112
|
+
bottom: -3px;
|
|
113
|
+
left: 0;
|
|
114
|
+
right: 0;
|
|
115
|
+
height: 2px;
|
|
116
|
+
background: var(--custom-draggable-primary-color);
|
|
117
|
+
border-radius: 1px;
|
|
118
|
+
}
|
|
119
|
+
.custom-draggable-list .custom-draggable-list__handle {
|
|
120
|
+
color: #999;
|
|
121
|
+
padding: 5px;
|
|
122
|
+
cursor: move;
|
|
123
|
+
transition: color 0.15s ease;
|
|
124
|
+
position: absolute;
|
|
125
|
+
width: 1em;
|
|
126
|
+
height: 1em;
|
|
127
|
+
top: 50%;
|
|
128
|
+
transform: translateY(-50%);
|
|
129
|
+
z-index: 1;
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
font-size: 0.75rem;
|
|
133
|
+
}
|
|
134
|
+
.custom-draggable-list .custom-draggable-list__handle.left {
|
|
135
|
+
left: 0;
|
|
136
|
+
}
|
|
137
|
+
.custom-draggable-list .custom-draggable-list__handle.right {
|
|
138
|
+
right: 1em;
|
|
139
|
+
}
|
|
140
|
+
.custom-draggable-list .custom-draggable-list__item,
|
|
141
|
+
.custom-draggable-list .custom-draggable-list__itemcontent {
|
|
142
|
+
transition: all 0.15s ease;
|
|
143
|
+
}
|
|
144
|
+
.custom-draggable-list .custom-draggable-list__item.editing .custom-draggable-list__itemcontent, .custom-draggable-list .custom-draggable-list__item:hover .custom-draggable-list__itemcontent {
|
|
145
|
+
background: var(--custom-draggable-content-diff-bg);
|
|
146
|
+
border-color: var(--custom-draggable-content-diff-border-color);
|
|
147
|
+
}
|
|
148
|
+
.custom-draggable-list .custom-draggable-list__item.block:hover .custom-draggable-list__handle {
|
|
149
|
+
color: var(--custom-draggable-primary-color);
|
|
150
|
+
}
|
|
151
|
+
.custom-draggable-list.handle .custom-draggable-list__handle:hover {
|
|
152
|
+
color: var(--custom-draggable-primary-color);
|
|
153
|
+
}
|
|
154
|
+
.custom-draggable-list .custom-draggable-list__edit-form {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex: 1;
|
|
157
|
+
gap: 10px;
|
|
158
|
+
align-items: center;
|
|
159
|
+
}
|
|
160
|
+
.custom-draggable-list .custom-draggable-list__edit-form input {
|
|
161
|
+
padding: 4px 8px;
|
|
162
|
+
border: 1px solid var(--custom-draggable-border-color);
|
|
163
|
+
border-radius: var(--custom-draggable-control-radius);
|
|
164
|
+
font-size: var(--custom-draggable-control-fs);
|
|
165
|
+
width: var(--custom-draggable-control-w);
|
|
166
|
+
}
|
|
167
|
+
.custom-draggable-list .custom-draggable-list__edit-buttons {
|
|
168
|
+
display: flex;
|
|
169
|
+
gap: 5px;
|
|
170
|
+
}
|
|
171
|
+
.custom-draggable-list .custom-draggable-list__edit-buttons button {
|
|
172
|
+
padding: 0.2rem 0.5rem;
|
|
173
|
+
border: none;
|
|
174
|
+
font-size: 0.75rem;
|
|
175
|
+
border-radius: var(--custom-draggable-control-radius);
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
}
|
|
178
|
+
.custom-draggable-list .custom-draggable-list__edit-buttons button:first-child {
|
|
179
|
+
background: var(--custom-draggable-btn-confirm-bg);
|
|
180
|
+
color: var(--custom-draggable-btn-color);
|
|
181
|
+
}
|
|
182
|
+
.custom-draggable-list .custom-draggable-list__edit-buttons button:last-child {
|
|
183
|
+
background: var(--custom-draggable-btn-cancel-bg);
|
|
184
|
+
color: var(--custom-draggable-btn-color);
|
|
185
|
+
}
|
|
186
|
+
.custom-draggable-list .custom-draggable-list__edit-buttons button:hover {
|
|
187
|
+
opacity: 0.8;
|
|
188
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ListItem {
|
|
3
|
+
id: number;
|
|
4
|
+
parentId?: number;
|
|
5
|
+
label: string;
|
|
6
|
+
listItemLabel: string;
|
|
7
|
+
value: string;
|
|
8
|
+
queryString: string;
|
|
9
|
+
depth?: number;
|
|
10
|
+
children?: ListItem[];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
appendControl?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface DragDropListProps {
|
|
15
|
+
wrapperClassName?: string;
|
|
16
|
+
prefix?: string;
|
|
17
|
+
data?: ListItem[];
|
|
18
|
+
draggable?: boolean;
|
|
19
|
+
handleHide?: boolean;
|
|
20
|
+
handleIcon?: string;
|
|
21
|
+
handlePos?: 'left' | 'right';
|
|
22
|
+
dragMode?: 'handle' | 'block';
|
|
23
|
+
editable?: boolean;
|
|
24
|
+
itemStyle?: React.CSSProperties;
|
|
25
|
+
hierarchical?: boolean;
|
|
26
|
+
indentation?: string;
|
|
27
|
+
doubleIndent?: boolean;
|
|
28
|
+
alternateCollapse?: boolean;
|
|
29
|
+
arrow?: React.ReactNode;
|
|
30
|
+
onUpdate?: (items: ListItem[], curId: number) => void;
|
|
31
|
+
}
|
|
32
|
+
export interface EditValue {
|
|
33
|
+
[propName: string]: string | number;
|
|
34
|
+
}
|
|
35
|
+
export interface TouchOffset {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
}
|
|
39
|
+
export interface OptionConfig {
|
|
40
|
+
[propName: string]: string | number | boolean | Function | any[];
|
|
41
|
+
}
|
|
42
|
+
declare const DragDropList: React.ForwardRefExoticComponent<DragDropListProps & React.RefAttributes<unknown>>;
|
|
43
|
+
export default DragDropList;
|