@react-aria/dnd 3.0.0-alpha.0 → 3.0.0-alpha.11
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/dist/main.js +2725 -1839
- package/dist/main.js.map +1 -1
- package/dist/module.js +2717 -1783
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +34 -30
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/DragManager.ts +91 -43
- package/src/DragPreview.tsx +54 -0
- package/src/constants.ts +3 -1
- package/src/index.ts +17 -7
- package/src/useClipboard.ts +5 -5
- package/src/useDrag.ts +40 -39
- package/src/useDraggableItem.ts +9 -11
- package/src/useDrop.ts +9 -4
- package/src/useDropIndicator.ts +10 -10
- package/src/useDroppableCollection.ts +170 -31
- package/src/useDroppableItem.ts +2 -2
- package/src/useVirtualDrop.ts +5 -5
- package/src/utils.ts +6 -24
package/dist/main.js
CHANGED
|
@@ -1,2066 +1,2952 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
isIOS,
|
|
13
|
-
isWebKit,
|
|
14
|
-
chain
|
|
15
|
-
} = require("@react-aria/utils");
|
|
16
|
-
|
|
17
|
-
var {
|
|
18
|
-
getInteractionModality,
|
|
19
|
-
useInteractionModality,
|
|
20
|
-
useFocus
|
|
21
|
-
} = require("@react-aria/interactions");
|
|
22
|
-
|
|
23
|
-
var _babelRuntimeHelpersWrapAsyncGenerator = $parcel$interopDefault(require("@babel/runtime/helpers/wrapAsyncGenerator"));
|
|
24
|
-
|
|
25
|
-
var _babelRuntimeHelpersAwaitAsyncGenerator = $parcel$interopDefault(require("@babel/runtime/helpers/awaitAsyncGenerator"));
|
|
26
|
-
|
|
27
|
-
var {
|
|
28
|
-
ariaHideOutside
|
|
29
|
-
} = require("@react-aria/overlays");
|
|
30
|
-
|
|
31
|
-
var {
|
|
32
|
-
announce
|
|
33
|
-
} = require("@react-aria/live-announcer");
|
|
34
|
-
|
|
35
|
-
var {
|
|
36
|
-
useRef,
|
|
37
|
-
useState,
|
|
38
|
-
useEffect,
|
|
39
|
-
useLayoutEffect,
|
|
40
|
-
useCallback
|
|
41
|
-
} = require("react");
|
|
42
|
-
|
|
43
|
-
var _babelRuntimeHelpersInteropRequireDefault = $parcel$interopDefault(require("@babel/runtime/helpers/interopRequireDefault"));
|
|
44
|
-
|
|
45
|
-
var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
|
|
46
|
-
|
|
1
|
+
var $4vY0V$react = require("react");
|
|
2
|
+
var $4vY0V$reactariautils = require("@react-aria/utils");
|
|
3
|
+
var $4vY0V$reactariai18n = require("@react-aria/i18n");
|
|
4
|
+
var $4vY0V$reactarialiveannouncer = require("@react-aria/live-announcer");
|
|
5
|
+
var $4vY0V$reactariaoverlays = require("@react-aria/overlays");
|
|
6
|
+
var $4vY0V$reactariainteractions = require("@react-aria/interactions");
|
|
7
|
+
var $4vY0V$reactdom = require("react-dom");
|
|
8
|
+
|
|
9
|
+
function $parcel$export(e, n, v, s) {
|
|
10
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
11
|
+
}
|
|
47
12
|
function $parcel$interopDefault(a) {
|
|
48
13
|
return a && a.__esModule ? a.default : a;
|
|
49
14
|
}
|
|
50
15
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
linkMove: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link | $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.move,
|
|
80
|
-
all: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.all,
|
|
81
|
-
uninitialized: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.all
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$EFFECT_ALLOWED = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_ALLOWED);
|
|
85
|
-
const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT = $b29ea0269b2ea2bf4827b4fa19ddc83e$var$invert($b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION);
|
|
86
|
-
const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION = {
|
|
87
|
-
none: 'cancel',
|
|
88
|
-
link: 'link',
|
|
89
|
-
copy: 'copy',
|
|
90
|
-
move: 'move'
|
|
16
|
+
$parcel$export(module.exports, "useDrag", () => $dc204e8ec58447a6$export$7941f8aafa4b6021);
|
|
17
|
+
$parcel$export(module.exports, "useDrop", () => $1ca228bc9257ca16$export$ccdee5eaf73cf661);
|
|
18
|
+
$parcel$export(module.exports, "useDroppableCollection", () => $7f93a158ac20b90a$export$f4e2f423c21f7b04);
|
|
19
|
+
$parcel$export(module.exports, "useDroppableItem", () => $fc1876157e07bcec$export$f7b0c5d28b66b6a5);
|
|
20
|
+
$parcel$export(module.exports, "useDropIndicator", () => $c5557edbed563ebf$export$8d0e41d2815afac5);
|
|
21
|
+
$parcel$export(module.exports, "useDraggableItem", () => $0cbbd00cda972c67$export$b35afafff42da2d9);
|
|
22
|
+
$parcel$export(module.exports, "useClipboard", () => $74f3dedaa4d234b4$export$2314ca2a3e892862);
|
|
23
|
+
$parcel$export(module.exports, "DragPreview", () => $2dccaca1f4baa446$export$905ab40ac2179daa);
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
let $76b1e110a27b1ccd$export$60b7b4bcf3903d8e;
|
|
28
|
+
(function($76b1e110a27b1ccd$export$60b7b4bcf3903d8e) {
|
|
29
|
+
$76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["none"] = 0] = "none";
|
|
30
|
+
$76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["cancel"] = 0] = "cancel";
|
|
31
|
+
$76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["move"] = 1] = "move";
|
|
32
|
+
$76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["copy"] = 2] = "copy";
|
|
33
|
+
$76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["link"] = 4] = "link";
|
|
34
|
+
$76b1e110a27b1ccd$export$60b7b4bcf3903d8e[$76b1e110a27b1ccd$export$60b7b4bcf3903d8e["all"] = 7] = "all";
|
|
35
|
+
})($76b1e110a27b1ccd$export$60b7b4bcf3903d8e || ($76b1e110a27b1ccd$export$60b7b4bcf3903d8e = {
|
|
36
|
+
}));
|
|
37
|
+
const $76b1e110a27b1ccd$export$9bbdfc78cf083e16 = {
|
|
38
|
+
...$76b1e110a27b1ccd$export$60b7b4bcf3903d8e,
|
|
39
|
+
copyMove: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.copy | $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.move,
|
|
40
|
+
copyLink: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.copy | $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.link,
|
|
41
|
+
linkMove: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.link | $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.move,
|
|
42
|
+
all: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.all,
|
|
43
|
+
uninitialized: $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.all
|
|
91
44
|
};
|
|
92
|
-
const $
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
45
|
+
const $76b1e110a27b1ccd$export$dd0165308d8bff45 = $76b1e110a27b1ccd$var$invert($76b1e110a27b1ccd$export$9bbdfc78cf083e16);
|
|
46
|
+
const $76b1e110a27b1ccd$export$d7ebf00f36b7a95e = $76b1e110a27b1ccd$var$invert($76b1e110a27b1ccd$export$60b7b4bcf3903d8e);
|
|
47
|
+
const $76b1e110a27b1ccd$export$608ecc6f1b23c35d = {
|
|
48
|
+
none: 'cancel',
|
|
49
|
+
link: 'link',
|
|
50
|
+
copy: 'copy',
|
|
51
|
+
move: 'move'
|
|
52
|
+
};
|
|
53
|
+
const $76b1e110a27b1ccd$export$5eacb0769d26d3b2 = $76b1e110a27b1ccd$var$invert($76b1e110a27b1ccd$export$608ecc6f1b23c35d);
|
|
54
|
+
function $76b1e110a27b1ccd$var$invert(object) {
|
|
55
|
+
let res = {
|
|
56
|
+
};
|
|
57
|
+
for(let key in object)res[object[key]] = key;
|
|
58
|
+
return res;
|
|
102
59
|
}
|
|
60
|
+
const $76b1e110a27b1ccd$export$4a7729b856e9a690 = new Set([
|
|
61
|
+
'text/plain',
|
|
62
|
+
'text/uri-list',
|
|
63
|
+
'text/html'
|
|
64
|
+
]);
|
|
65
|
+
const $76b1e110a27b1ccd$export$fd9f9fc120c5402d = 'application/vnd.react-aria.items+json';
|
|
66
|
+
const $76b1e110a27b1ccd$export$f8fc6581787339b3 = 'application/octet-stream';
|
|
103
67
|
|
|
104
|
-
const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$NATIVE_DRAG_TYPES = new Set(['text/plain', 'text/uri-list', 'text/html']);
|
|
105
|
-
const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE = 'application/vnd.react-aria.items+json';
|
|
106
|
-
const $b29ea0269b2ea2bf4827b4fa19ddc83e$export$GENERIC_TYPE = 'application/octet-stream';
|
|
107
|
-
const $bc29619458500c186021634c18dc$var$droppableCollectionIds = new WeakMap();
|
|
108
|
-
|
|
109
|
-
function $bc29619458500c186021634c18dc$export$useDroppableCollectionId(state) {
|
|
110
|
-
let id = useId();
|
|
111
|
-
$bc29619458500c186021634c18dc$var$droppableCollectionIds.set(state, id);
|
|
112
|
-
return id;
|
|
113
|
-
}
|
|
114
68
|
|
|
115
|
-
function $bc29619458500c186021634c18dc$export$getDroppableCollectionId(state) {
|
|
116
|
-
let id = $bc29619458500c186021634c18dc$var$droppableCollectionIds.get(state);
|
|
117
69
|
|
|
118
|
-
if (!id) {
|
|
119
|
-
throw new Error('Droppable item outside a droppable collection');
|
|
120
|
-
}
|
|
121
70
|
|
|
122
|
-
|
|
71
|
+
const $4620ae0dc40f0031$var$droppableCollectionIds = new WeakMap();
|
|
72
|
+
function $4620ae0dc40f0031$export$b1601eb39394a581(state) {
|
|
73
|
+
let id = $4vY0V$reactariautils.useId();
|
|
74
|
+
$4620ae0dc40f0031$var$droppableCollectionIds.set(state, id);
|
|
75
|
+
return id;
|
|
123
76
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
for (let item of items) {
|
|
129
|
-
for (let type of Object.keys(item)) {
|
|
130
|
-
types.add(type);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return types;
|
|
77
|
+
function $4620ae0dc40f0031$export$3093291712f09a77(state) {
|
|
78
|
+
let id = $4620ae0dc40f0031$var$droppableCollectionIds.get(state);
|
|
79
|
+
if (!id) throw new Error('Droppable item outside a droppable collection');
|
|
80
|
+
return id;
|
|
135
81
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (modality === 'pointer') {
|
|
143
|
-
modality = 'virtual';
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (modality === 'virtual' && 'ontouchstart' in window) {
|
|
147
|
-
modality = 'touch';
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return modality;
|
|
82
|
+
function $4620ae0dc40f0031$export$e1d41611756c6326(items) {
|
|
83
|
+
let types = new Set();
|
|
84
|
+
for (let item of items)for (let type of Object.keys(item))types.add(type);
|
|
85
|
+
return types;
|
|
151
86
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
87
|
+
function $4620ae0dc40f0031$var$mapModality(modality) {
|
|
88
|
+
if (!modality) modality = 'virtual';
|
|
89
|
+
if (modality === 'pointer') modality = 'virtual';
|
|
90
|
+
if (modality === 'virtual' && 'ontouchstart' in window) modality = 'touch';
|
|
91
|
+
return modality;
|
|
155
92
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return $bc29619458500c186021634c18dc$var$mapModality(getInteractionModality());
|
|
93
|
+
function $4620ae0dc40f0031$export$49bac5d6d4b352ea() {
|
|
94
|
+
return $4620ae0dc40f0031$var$mapModality($4vY0V$reactariainteractions.useInteractionModality());
|
|
159
95
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
// The data transfer API doesn't support more than one item of a given type at once.
|
|
163
|
-
// In addition, only a small set of types are supported natively for transfer between applications.
|
|
164
|
-
// We allow for both multiple items, as well as multiple representations of a single item.
|
|
165
|
-
// In order to make our API work with the native API, we serialize all items to JSON and
|
|
166
|
-
// store as a single native item. We only need to do this if there is more than one item
|
|
167
|
-
// of the same type, or if an item has more than one representation. Otherwise the native
|
|
168
|
-
// API is sufficient.
|
|
169
|
-
//
|
|
170
|
-
// The DataTransferItemList API also theoretically supports adding files, which would enable
|
|
171
|
-
// dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
|
|
172
|
-
// this does not currently work in any browser, so it is not currently supported by our API.
|
|
173
|
-
// See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
|
|
174
|
-
let groupedByType = new Map();
|
|
175
|
-
let needsCustomData = false;
|
|
176
|
-
let customData = [];
|
|
177
|
-
|
|
178
|
-
for (let item of items) {
|
|
179
|
-
let types = Object.keys(item);
|
|
180
|
-
|
|
181
|
-
if (types.length > 1) {
|
|
182
|
-
needsCustomData = true;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
let dataByType = {};
|
|
186
|
-
|
|
187
|
-
for (let type of types) {
|
|
188
|
-
let typeItems = groupedByType.get(type);
|
|
189
|
-
|
|
190
|
-
if (!typeItems) {
|
|
191
|
-
typeItems = [];
|
|
192
|
-
groupedByType.set(type, typeItems);
|
|
193
|
-
} else {
|
|
194
|
-
needsCustomData = true;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
let data = item[type];
|
|
198
|
-
dataByType[type] = data;
|
|
199
|
-
typeItems.push(data);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
customData.push(dataByType);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
for (let [type, items] of groupedByType) {
|
|
206
|
-
if ($b29ea0269b2ea2bf4827b4fa19ddc83e$export$NATIVE_DRAG_TYPES.has(type)) {
|
|
207
|
-
// Only one item of a given type can be set on a data transfer.
|
|
208
|
-
// Join all of the items together separated by newlines.
|
|
209
|
-
let data = items.join('\n');
|
|
210
|
-
dataTransfer.items.add(data, type);
|
|
211
|
-
} else {
|
|
212
|
-
// Set data to the first item so we have access to the list of types.
|
|
213
|
-
dataTransfer.items.add(items[0], type);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (needsCustomData) {
|
|
218
|
-
let data = JSON.stringify(customData);
|
|
219
|
-
dataTransfer.items.add(data, $b29ea0269b2ea2bf4827b4fa19ddc83e$export$CUSTOM_DRAG_TYPE);
|
|
220
|
-
}
|
|
96
|
+
function $4620ae0dc40f0031$export$1fb2158d224b542c() {
|
|
97
|
+
return $4620ae0dc40f0031$var$mapModality($4vY0V$reactariainteractions.getInteractionModality());
|
|
221
98
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
99
|
+
function $4620ae0dc40f0031$export$f9c1490890ddd063(dataTransfer, items) {
|
|
100
|
+
// The data transfer API doesn't support more than one item of a given type at once.
|
|
101
|
+
// In addition, only a small set of types are supported natively for transfer between applications.
|
|
102
|
+
// We allow for both multiple items, as well as multiple representations of a single item.
|
|
103
|
+
// In order to make our API work with the native API, we serialize all items to JSON and
|
|
104
|
+
// store as a single native item. We only need to do this if there is more than one item
|
|
105
|
+
// of the same type, or if an item has more than one representation. Otherwise the native
|
|
106
|
+
// API is sufficient.
|
|
107
|
+
//
|
|
108
|
+
// The DataTransferItemList API also theoretically supports adding files, which would enable
|
|
109
|
+
// dragging binary data out of the browser onto the user's desktop for example. Unfortunately,
|
|
110
|
+
// this does not currently work in any browser, so it is not currently supported by our API.
|
|
111
|
+
// See e.g. https://bugs.chromium.org/p/chromium/issues/detail?id=438479.
|
|
112
|
+
let groupedByType = new Map();
|
|
113
|
+
let needsCustomData = false;
|
|
114
|
+
let customData = [];
|
|
115
|
+
for (let item of items){
|
|
116
|
+
let types = Object.keys(item);
|
|
117
|
+
if (types.length > 1) needsCustomData = true;
|
|
118
|
+
let dataByType = {
|
|
119
|
+
};
|
|
120
|
+
for (let type of types){
|
|
121
|
+
let typeItems = groupedByType.get(type);
|
|
122
|
+
if (!typeItems) {
|
|
123
|
+
typeItems = [];
|
|
124
|
+
groupedByType.set(type, typeItems);
|
|
125
|
+
} else needsCustomData = true;
|
|
126
|
+
let data = item[type];
|
|
127
|
+
dataByType[type] = data;
|
|
128
|
+
typeItems.push(data);
|
|
234
129
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
130
|
+
customData.push(dataByType);
|
|
131
|
+
}
|
|
132
|
+
for (let [type, items1] of groupedByType)if ($76b1e110a27b1ccd$export$4a7729b856e9a690.has(type)) {
|
|
133
|
+
// Only one item of a given type can be set on a data transfer.
|
|
134
|
+
// Join all of the items together separated by newlines.
|
|
135
|
+
let data = items1.join('\n');
|
|
136
|
+
dataTransfer.items.add(data, type);
|
|
137
|
+
} else // Set data to the first item so we have access to the list of types.
|
|
138
|
+
dataTransfer.items.add(items1[0], type);
|
|
139
|
+
if (needsCustomData) {
|
|
140
|
+
let data = JSON.stringify(customData);
|
|
141
|
+
dataTransfer.items.add(data, $76b1e110a27b1ccd$export$fd9f9fc120c5402d);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
class $4620ae0dc40f0031$export$7f04ce188c91447c {
|
|
145
|
+
has(type) {
|
|
146
|
+
if (this.includesUnknownTypes) return true;
|
|
147
|
+
return this.types.has(type);
|
|
148
|
+
}
|
|
149
|
+
constructor(dataTransfer){
|
|
150
|
+
this.types = new Set();
|
|
151
|
+
let hasFiles = false;
|
|
152
|
+
for (let item of dataTransfer.items)if (item.type !== $76b1e110a27b1ccd$export$fd9f9fc120c5402d) {
|
|
153
|
+
if (item.kind === 'file') hasFiles = true;
|
|
154
|
+
if (item.type) this.types.add(item.type);
|
|
155
|
+
else // Files with unknown types or extensions that don't map to a known mime type
|
|
156
|
+
// are sometimes exposed as an empty string by the browser. Map to a generic
|
|
157
|
+
// mime type instead. Note that this could also be a directory as there's no
|
|
158
|
+
// way to determine if something is a file or directory until drop.
|
|
159
|
+
this.types.add($76b1e110a27b1ccd$export$f8fc6581787339b3);
|
|
244
160
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes('Files');
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
has(type) {
|
|
255
|
-
if (this.includesUnknownTypes) {
|
|
256
|
-
return true;
|
|
161
|
+
// In Safari, when dragging files, the dataTransfer.items list is empty, but dataTransfer.types contains "Files".
|
|
162
|
+
// Unfortunately, this doesn't tell us what types of files the user is dragging, so we need to assume that any
|
|
163
|
+
// type the user checks for is included. See https://bugs.webkit.org/show_bug.cgi?id=223517.
|
|
164
|
+
this.includesUnknownTypes = !hasFiles && dataTransfer.types.includes('Files');
|
|
257
165
|
}
|
|
258
|
-
|
|
259
|
-
return this.types.has(type);
|
|
260
|
-
}
|
|
261
|
-
|
|
262
166
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
for (let item of parsed) {
|
|
277
|
-
items.push({
|
|
278
|
-
kind: 'text',
|
|
279
|
-
types: new Set(Object.keys(item)),
|
|
280
|
-
getText: type => Promise.resolve(item[type])
|
|
167
|
+
function $4620ae0dc40f0031$export$d9e760437831f8b3(dataTransfer) {
|
|
168
|
+
let items = [];
|
|
169
|
+
// If our custom drag type is available, use that. This is a JSON serialized
|
|
170
|
+
// representation of all items in the drag, set when there are multiple items
|
|
171
|
+
// of the same type, or an individual item has multiple representations.
|
|
172
|
+
let hasCustomType = false;
|
|
173
|
+
if (dataTransfer.types.includes($76b1e110a27b1ccd$export$fd9f9fc120c5402d)) try {
|
|
174
|
+
let data = dataTransfer.getData($76b1e110a27b1ccd$export$fd9f9fc120c5402d);
|
|
175
|
+
let parsed = JSON.parse(data);
|
|
176
|
+
for (let item of parsed)items.push({
|
|
177
|
+
kind: 'text',
|
|
178
|
+
types: new Set(Object.keys(item)),
|
|
179
|
+
getText: (type)=>Promise.resolve(item[type])
|
|
281
180
|
});
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
if (!entry) {
|
|
307
|
-
// For some reason, Chrome and Firefox include an item with type image/png when copy
|
|
308
|
-
// and pasting any file or directory (no matter the type), but return `null` for both
|
|
309
|
-
// item.getAsFile() and item.webkitGetAsEntry(). Safari works as expected. Ignore this
|
|
310
|
-
// item if this happens.
|
|
311
|
-
continue;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
if (entry.isFile) {
|
|
315
|
-
items.push($bc29619458500c186021634c18dc$var$createFileItem(item.getAsFile()));
|
|
316
|
-
} else if (entry.isDirectory) {
|
|
317
|
-
items.push($bc29619458500c186021634c18dc$var$createDirectoryItem(entry));
|
|
318
|
-
}
|
|
319
|
-
} else {
|
|
320
|
-
// Assume it's a file.
|
|
321
|
-
items.push($bc29619458500c186021634c18dc$var$createFileItem(item.getAsFile()));
|
|
181
|
+
hasCustomType = true;
|
|
182
|
+
} catch (e) {
|
|
183
|
+
// ignore
|
|
184
|
+
}
|
|
185
|
+
// Otherwise, map native drag items to items of a single representation.
|
|
186
|
+
if (!hasCustomType) {
|
|
187
|
+
let stringItems = new Map();
|
|
188
|
+
for (let item of dataTransfer.items){
|
|
189
|
+
if (item.kind === 'string') // The data for all formats must be read here because the data transfer gets
|
|
190
|
+
// cleared out after the event handler finishes. If the item has an empty string
|
|
191
|
+
// as a type, the mime type is unknown. Map to a generic mime type instead.
|
|
192
|
+
stringItems.set(item.type || $76b1e110a27b1ccd$export$f8fc6581787339b3, dataTransfer.getData(item.type));
|
|
193
|
+
else if (item.kind === 'file') {
|
|
194
|
+
// Despite the name, webkitGetAsEntry is also implemented in Firefox and Edge.
|
|
195
|
+
// In the future, we may use getAsFileSystemHandle instead, but that's currently
|
|
196
|
+
// only implemented in Chrome.
|
|
197
|
+
if (typeof item.webkitGetAsEntry === 'function') {
|
|
198
|
+
let entry = item.webkitGetAsEntry();
|
|
199
|
+
if (!entry) continue;
|
|
200
|
+
if (entry.isFile) items.push($4620ae0dc40f0031$var$createFileItem(item.getAsFile()));
|
|
201
|
+
else if (entry.isDirectory) items.push($4620ae0dc40f0031$var$createDirectoryItem(entry));
|
|
202
|
+
} else // Assume it's a file.
|
|
203
|
+
items.push($4620ae0dc40f0031$var$createFileItem(item.getAsFile()));
|
|
204
|
+
}
|
|
322
205
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
kind: 'text',
|
|
331
|
-
types: new Set(stringItems.keys()),
|
|
332
|
-
getText: type => Promise.resolve(stringItems.get(type))
|
|
333
|
-
});
|
|
206
|
+
// All string items are different representations of the same item. There's no way to have
|
|
207
|
+
// multiple string items at once in the current DataTransfer API.
|
|
208
|
+
if (stringItems.size > 0) items.push({
|
|
209
|
+
kind: 'text',
|
|
210
|
+
types: new Set(stringItems.keys()),
|
|
211
|
+
getText: (type)=>Promise.resolve(stringItems.get(type))
|
|
212
|
+
});
|
|
334
213
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return items;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
function $bc29619458500c186021634c18dc$var$blobToString(blob) {
|
|
341
|
-
if (typeof blob.text === 'function') {
|
|
342
|
-
return blob.text();
|
|
343
|
-
} // Safari doesn't have the Blob#text() method yet...
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return new Promise((resolve, reject) => {
|
|
347
|
-
let reader = new FileReader();
|
|
348
|
-
|
|
349
|
-
reader.onload = () => {
|
|
350
|
-
resolve(reader.result);
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
reader.onerror = reject;
|
|
354
|
-
reader.readAsText(blob);
|
|
355
|
-
});
|
|
214
|
+
return items;
|
|
356
215
|
}
|
|
357
|
-
|
|
358
|
-
function
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
216
|
+
function $4620ae0dc40f0031$var$blobToString(blob) {
|
|
217
|
+
if (typeof blob.text === 'function') return blob.text();
|
|
218
|
+
// Safari doesn't have the Blob#text() method yet...
|
|
219
|
+
return new Promise((resolve, reject)=>{
|
|
220
|
+
let reader = new FileReader;
|
|
221
|
+
reader.onload = ()=>{
|
|
222
|
+
resolve(reader.result);
|
|
223
|
+
};
|
|
224
|
+
reader.onerror = reject;
|
|
225
|
+
reader.readAsText(blob);
|
|
226
|
+
});
|
|
366
227
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
228
|
+
function $4620ae0dc40f0031$var$createFileItem(file) {
|
|
229
|
+
return {
|
|
230
|
+
kind: 'file',
|
|
231
|
+
type: file.type || $76b1e110a27b1ccd$export$f8fc6581787339b3,
|
|
232
|
+
name: file.name,
|
|
233
|
+
getText: ()=>$4620ae0dc40f0031$var$blobToString(file)
|
|
234
|
+
,
|
|
235
|
+
getFile: ()=>Promise.resolve(file)
|
|
236
|
+
};
|
|
374
237
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
238
|
+
function $4620ae0dc40f0031$var$createDirectoryItem(entry) {
|
|
239
|
+
return {
|
|
240
|
+
kind: 'directory',
|
|
241
|
+
name: entry.name,
|
|
242
|
+
getEntries: ()=>$4620ae0dc40f0031$var$getEntries(entry)
|
|
243
|
+
};
|
|
378
244
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
let reader = item.createReader(); // We must call readEntries repeatedly because there may be a limit to the
|
|
245
|
+
async function* $4620ae0dc40f0031$var$getEntries(item) {
|
|
246
|
+
let reader = item.createReader();
|
|
247
|
+
// We must call readEntries repeatedly because there may be a limit to the
|
|
383
248
|
// number of entries that are returned at once.
|
|
384
|
-
|
|
385
249
|
let entries;
|
|
386
|
-
|
|
387
250
|
do {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
} else if (entry.isDirectory) {
|
|
397
|
-
yield $bc29619458500c186021634c18dc$var$createDirectoryItem(entry);
|
|
251
|
+
entries = await new Promise((resolve, reject)=>{
|
|
252
|
+
reader.readEntries(resolve, reject);
|
|
253
|
+
});
|
|
254
|
+
for (let entry of entries){
|
|
255
|
+
if (entry.isFile) {
|
|
256
|
+
let file = await $4620ae0dc40f0031$var$getEntryFile(entry);
|
|
257
|
+
yield $4620ae0dc40f0031$var$createFileItem(file);
|
|
258
|
+
} else if (entry.isDirectory) yield $4620ae0dc40f0031$var$createDirectoryItem(entry);
|
|
398
259
|
}
|
|
399
|
-
|
|
400
|
-
} while (entries.length > 0);
|
|
401
|
-
});
|
|
402
|
-
return $bc29619458500c186021634c18dc$var$_getEntries.apply(this, arguments);
|
|
260
|
+
}while (entries.length > 0)
|
|
403
261
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
262
|
+
function $4620ae0dc40f0031$var$getEntryFile(entry) {
|
|
263
|
+
return new Promise((resolve, reject)=>entry.file(resolve, reject)
|
|
264
|
+
);
|
|
407
265
|
}
|
|
408
266
|
|
|
409
|
-
let $a75d092e5c30878812fba78e$var$dropTargets = new Map();
|
|
410
|
-
let $a75d092e5c30878812fba78e$var$dropItems = new Map();
|
|
411
|
-
let $a75d092e5c30878812fba78e$var$dragSession = null;
|
|
412
|
-
let $a75d092e5c30878812fba78e$var$subscriptions = new Set();
|
|
413
267
|
|
|
414
|
-
function $a75d092e5c30878812fba78e$export$registerDropTarget(target) {
|
|
415
|
-
var _dragSession;
|
|
416
268
|
|
|
417
|
-
$a75d092e5c30878812fba78e$var$dropTargets.set(target.element, target);
|
|
418
|
-
(_dragSession = $a75d092e5c30878812fba78e$var$dragSession) == null ? void 0 : _dragSession.updateValidDropTargets();
|
|
419
|
-
return () => {
|
|
420
|
-
var _dragSession2;
|
|
421
269
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
270
|
+
let $28e10663603f5ea1$var$dropTargets = new Map();
|
|
271
|
+
let $28e10663603f5ea1$var$dropItems = new Map();
|
|
272
|
+
let $28e10663603f5ea1$var$dragSession = null;
|
|
273
|
+
let $28e10663603f5ea1$var$subscriptions = new Set();
|
|
274
|
+
function $28e10663603f5ea1$export$c28d9fb4a54e471a(target) {
|
|
275
|
+
$28e10663603f5ea1$var$dropTargets.set(target.element, target);
|
|
276
|
+
$28e10663603f5ea1$var$dragSession === null || $28e10663603f5ea1$var$dragSession === void 0 ? void 0 : $28e10663603f5ea1$var$dragSession.updateValidDropTargets();
|
|
277
|
+
return ()=>{
|
|
278
|
+
$28e10663603f5ea1$var$dropTargets.delete(target.element);
|
|
279
|
+
$28e10663603f5ea1$var$dragSession === null || $28e10663603f5ea1$var$dragSession === void 0 ? void 0 : $28e10663603f5ea1$var$dragSession.updateValidDropTargets();
|
|
280
|
+
};
|
|
425
281
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
};
|
|
282
|
+
function $28e10663603f5ea1$export$aef80212ac99c003(item) {
|
|
283
|
+
$28e10663603f5ea1$var$dropItems.set(item.element, item);
|
|
284
|
+
return ()=>{
|
|
285
|
+
$28e10663603f5ea1$var$dropItems.delete(item.element);
|
|
286
|
+
};
|
|
432
287
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
$a75d092e5c30878812fba78e$var$dragSession.setup();
|
|
442
|
-
|
|
443
|
-
if ($bc29619458500c186021634c18dc$export$getDragModality() === 'keyboard') {
|
|
444
|
-
$a75d092e5c30878812fba78e$var$dragSession.next();
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
for (let cb of $a75d092e5c30878812fba78e$var$subscriptions) {
|
|
449
|
-
cb();
|
|
450
|
-
}
|
|
288
|
+
function $28e10663603f5ea1$export$549dbcf8649bf3b2(target, stringFormatter) {
|
|
289
|
+
if ($28e10663603f5ea1$var$dragSession) throw new Error('Cannot begin dragging while already dragging');
|
|
290
|
+
$28e10663603f5ea1$var$dragSession = new $28e10663603f5ea1$var$DragSession(target, stringFormatter);
|
|
291
|
+
requestAnimationFrame(()=>{
|
|
292
|
+
$28e10663603f5ea1$var$dragSession.setup();
|
|
293
|
+
if ($4620ae0dc40f0031$export$1fb2158d224b542c() === 'keyboard' || $4620ae0dc40f0031$export$1fb2158d224b542c() === 'touch' && $4vY0V$reactariainteractions.getInteractionModality() === 'virtual') $28e10663603f5ea1$var$dragSession.next();
|
|
294
|
+
});
|
|
295
|
+
for (let cb of $28e10663603f5ea1$var$subscriptions)cb();
|
|
451
296
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
};
|
|
462
|
-
|
|
463
|
-
return session;
|
|
297
|
+
function $28e10663603f5ea1$export$418e185dd3f1b968() {
|
|
298
|
+
let [session, setSession] = $4vY0V$react.useState($28e10663603f5ea1$var$dragSession);
|
|
299
|
+
$4vY0V$react.useEffect(()=>{
|
|
300
|
+
let cb = ()=>setSession($28e10663603f5ea1$var$dragSession)
|
|
301
|
+
;
|
|
302
|
+
$28e10663603f5ea1$var$subscriptions.add(cb);
|
|
303
|
+
return ()=>{
|
|
304
|
+
$28e10663603f5ea1$var$subscriptions.delete(cb);
|
|
305
|
+
};
|
|
306
|
+
}, []);
|
|
307
|
+
return session;
|
|
464
308
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
for (let cb of $a75d092e5c30878812fba78e$var$subscriptions) {
|
|
470
|
-
cb();
|
|
471
|
-
}
|
|
309
|
+
function $28e10663603f5ea1$var$endDragging() {
|
|
310
|
+
$28e10663603f5ea1$var$dragSession = null;
|
|
311
|
+
for (let cb of $28e10663603f5ea1$var$subscriptions)cb();
|
|
472
312
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
const $a75d092e5c30878812fba78e$var$MESSAGES = {
|
|
477
|
-
keyboard: 'dragStartedKeyboard',
|
|
478
|
-
touch: 'dragStartedTouch',
|
|
479
|
-
virtual: 'dragStartedVirtual'
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
class $a75d092e5c30878812fba78e$var$DragSession {
|
|
483
|
-
constructor(target, formatMessage) {
|
|
484
|
-
this.dragTarget = void 0;
|
|
485
|
-
this.validDropTargets = void 0;
|
|
486
|
-
this.currentDropTarget = void 0;
|
|
487
|
-
this.currentDropItem = void 0;
|
|
488
|
-
this.dropOperation = void 0;
|
|
489
|
-
this.mutationObserver = void 0;
|
|
490
|
-
this.mutationImmediate = void 0;
|
|
491
|
-
this.restoreAriaHidden = void 0;
|
|
492
|
-
this.formatMessage = void 0;
|
|
493
|
-
this.dragTarget = target;
|
|
494
|
-
this.formatMessage = formatMessage;
|
|
495
|
-
this.onKeyDown = this.onKeyDown.bind(this);
|
|
496
|
-
this.onFocus = this.onFocus.bind(this);
|
|
497
|
-
this.onBlur = this.onBlur.bind(this);
|
|
498
|
-
this.onClick = this.onClick.bind(this);
|
|
499
|
-
this.cancelEvent = this.cancelEvent.bind(this);
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
setup() {
|
|
503
|
-
document.addEventListener('keydown', this.onKeyDown, true);
|
|
504
|
-
window.addEventListener('focus', this.onFocus, true);
|
|
505
|
-
window.addEventListener('blur', this.onBlur, true);
|
|
506
|
-
document.addEventListener('click', this.onClick, true);
|
|
507
|
-
|
|
508
|
-
for (let event of $a75d092e5c30878812fba78e$var$CANCELED_EVENTS) {
|
|
509
|
-
document.addEventListener(event, this.cancelEvent, true);
|
|
313
|
+
function $28e10663603f5ea1$export$7454aff2e161f241(element) {
|
|
314
|
+
for (let target of $28e10663603f5ea1$var$dropTargets.keys()){
|
|
315
|
+
if (target.contains(element)) return true;
|
|
510
316
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
const $28e10663603f5ea1$var$CANCELED_EVENTS = [
|
|
320
|
+
'pointerdown',
|
|
321
|
+
'pointermove',
|
|
322
|
+
'pointerenter',
|
|
323
|
+
'pointerleave',
|
|
324
|
+
'pointerover',
|
|
325
|
+
'pointerout',
|
|
326
|
+
'pointerup',
|
|
327
|
+
'mousedown',
|
|
328
|
+
'mousemove',
|
|
329
|
+
'mouseenter',
|
|
330
|
+
'mouseleave',
|
|
331
|
+
'mouseover',
|
|
332
|
+
'mouseout',
|
|
333
|
+
'mouseup',
|
|
334
|
+
'touchstart',
|
|
335
|
+
'touchmove',
|
|
336
|
+
'touchend',
|
|
337
|
+
'keyup',
|
|
338
|
+
'focusin',
|
|
339
|
+
'focusout'
|
|
340
|
+
];
|
|
341
|
+
const $28e10663603f5ea1$var$CLICK_EVENTS = [
|
|
342
|
+
'pointerup',
|
|
343
|
+
'mouseup',
|
|
344
|
+
'touchend'
|
|
345
|
+
];
|
|
346
|
+
const $28e10663603f5ea1$var$MESSAGES = {
|
|
347
|
+
keyboard: 'dragStartedKeyboard',
|
|
348
|
+
touch: 'dragStartedTouch',
|
|
349
|
+
virtual: 'dragStartedVirtual'
|
|
350
|
+
};
|
|
351
|
+
class $28e10663603f5ea1$var$DragSession {
|
|
352
|
+
setup() {
|
|
353
|
+
document.addEventListener('keydown', this.onKeyDown, true);
|
|
354
|
+
window.addEventListener('focus', this.onFocus, true);
|
|
355
|
+
window.addEventListener('blur', this.onBlur, true);
|
|
356
|
+
document.addEventListener('click', this.onClick, true);
|
|
357
|
+
document.addEventListener('pointerdown', this.onPointerDown, true);
|
|
358
|
+
for (let event of $28e10663603f5ea1$var$CANCELED_EVENTS)document.addEventListener(event, this.cancelEvent, true);
|
|
359
|
+
this.mutationObserver = new MutationObserver(()=>this.updateValidDropTargets()
|
|
360
|
+
);
|
|
520
361
|
this.updateValidDropTargets();
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
this.
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
this.currentDropTarget.onKeyDown(e, this.dragTarget);
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
onFocus(e) {
|
|
579
|
-
// Prevent focus events, except to the original drag target.
|
|
580
|
-
if (e.target !== this.dragTarget.element) {
|
|
581
|
-
this.cancelEvent(e);
|
|
582
|
-
} // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target));
|
|
590
|
-
|
|
591
|
-
if (!dropTarget) {
|
|
592
|
-
if (this.currentDropTarget) {
|
|
593
|
-
this.currentDropTarget.element.focus();
|
|
594
|
-
} else {
|
|
595
|
-
this.dragTarget.element.focus();
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
return;
|
|
362
|
+
$4vY0V$reactarialiveannouncer.announce(this.stringFormatter.format($28e10663603f5ea1$var$MESSAGES[$4620ae0dc40f0031$export$1fb2158d224b542c()]));
|
|
363
|
+
}
|
|
364
|
+
teardown() {
|
|
365
|
+
document.removeEventListener('keydown', this.onKeyDown, true);
|
|
366
|
+
window.removeEventListener('focus', this.onFocus, true);
|
|
367
|
+
window.removeEventListener('blur', this.onBlur, true);
|
|
368
|
+
document.removeEventListener('click', this.onClick, true);
|
|
369
|
+
document.removeEventListener('pointerdown', this.onPointerDown, true);
|
|
370
|
+
for (let event of $28e10663603f5ea1$var$CANCELED_EVENTS)document.removeEventListener(event, this.cancelEvent, true);
|
|
371
|
+
this.mutationObserver.disconnect();
|
|
372
|
+
this.restoreAriaHidden();
|
|
373
|
+
}
|
|
374
|
+
onKeyDown(e) {
|
|
375
|
+
var ref;
|
|
376
|
+
this.cancelEvent(e);
|
|
377
|
+
if (e.key === 'Escape') {
|
|
378
|
+
this.cancel();
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
if (e.key === 'Enter') {
|
|
382
|
+
if (e.altKey) this.activate();
|
|
383
|
+
else this.drop();
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {
|
|
387
|
+
if (e.shiftKey) this.previous();
|
|
388
|
+
else this.next();
|
|
389
|
+
}
|
|
390
|
+
if (typeof ((ref = this.currentDropTarget) === null || ref === void 0 ? void 0 : ref.onKeyDown) === 'function') this.currentDropTarget.onKeyDown(e, this.dragTarget);
|
|
391
|
+
}
|
|
392
|
+
onFocus(e) {
|
|
393
|
+
// Prevent focus events, except to the original drag target.
|
|
394
|
+
if (e.target !== this.dragTarget.element) this.cancelEvent(e);
|
|
395
|
+
// Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.
|
|
396
|
+
if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) return;
|
|
397
|
+
let dropTarget = this.validDropTargets.find((target)=>target.element.contains(e.target)
|
|
398
|
+
);
|
|
399
|
+
if (!dropTarget) {
|
|
400
|
+
if (this.currentDropTarget) this.currentDropTarget.element.focus();
|
|
401
|
+
else this.dragTarget.element.focus();
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
let item = $28e10663603f5ea1$var$dropItems.get(e.target);
|
|
405
|
+
this.setCurrentDropTarget(dropTarget, item);
|
|
406
|
+
}
|
|
407
|
+
onBlur(e) {
|
|
408
|
+
if (e.target !== this.dragTarget.element) this.cancelEvent(e);
|
|
409
|
+
// If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),
|
|
410
|
+
// restore focus back to the current drop target if any, or the original drag target.
|
|
411
|
+
if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {
|
|
412
|
+
if (this.currentDropTarget) this.currentDropTarget.element.focus();
|
|
413
|
+
else this.dragTarget.element.focus();
|
|
414
|
+
}
|
|
599
415
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
} else {
|
|
616
|
-
this.dragTarget.element.focus();
|
|
617
|
-
}
|
|
416
|
+
onClick(e) {
|
|
417
|
+
this.cancelEvent(e);
|
|
418
|
+
if (e.detail === 0 || this.isVirtualClick) {
|
|
419
|
+
if (e.target === this.dragTarget.element) {
|
|
420
|
+
this.cancel();
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
let dropTarget = this.validDropTargets.find((target)=>target.element.contains(e.target)
|
|
424
|
+
);
|
|
425
|
+
if (dropTarget) {
|
|
426
|
+
let item = $28e10663603f5ea1$var$dropItems.get(e.target);
|
|
427
|
+
this.setCurrentDropTarget(dropTarget, item);
|
|
428
|
+
this.drop(item);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
618
431
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
432
|
+
onPointerDown(e) {
|
|
433
|
+
// Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires
|
|
434
|
+
// so we can properly perform cancel and drop operations.
|
|
435
|
+
this.cancelEvent(e);
|
|
436
|
+
this.isVirtualClick = $28e10663603f5ea1$var$isVirtualPointerEvent(e);
|
|
437
|
+
}
|
|
438
|
+
cancelEvent(e) {
|
|
439
|
+
var ref;
|
|
440
|
+
// Allow focusin and focusout on the drag target so focus ring works properly.
|
|
441
|
+
if ((e.type === 'focusin' || e.type === 'focusout') && e.target === ((ref = this.dragTarget) === null || ref === void 0 ? void 0 : ref.element)) return;
|
|
442
|
+
// Allow default for events that might cancel a click event
|
|
443
|
+
if (!$28e10663603f5ea1$var$CLICK_EVENTS.includes(e.type)) e.preventDefault();
|
|
444
|
+
e.stopPropagation();
|
|
445
|
+
e.stopImmediatePropagation();
|
|
446
|
+
}
|
|
447
|
+
updateValidDropTargets() {
|
|
448
|
+
if (!this.mutationObserver) return;
|
|
449
|
+
this.mutationObserver.disconnect();
|
|
450
|
+
if (this.restoreAriaHidden) this.restoreAriaHidden();
|
|
451
|
+
this.validDropTargets = $28e10663603f5ea1$var$findValidDropTargets(this.dragTarget);
|
|
452
|
+
if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
453
|
+
// Find valid drop items within collections
|
|
454
|
+
let types = $4620ae0dc40f0031$export$e1d41611756c6326(this.dragTarget.items);
|
|
455
|
+
let validDropItems = [
|
|
456
|
+
...$28e10663603f5ea1$var$dropItems.values()
|
|
457
|
+
].filter((item)=>{
|
|
458
|
+
if (typeof item.getDropOperation === 'function') return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';
|
|
459
|
+
return true;
|
|
460
|
+
});
|
|
461
|
+
// Filter out drop targets that contain valid items. We don't want to stop hiding elements
|
|
462
|
+
// other than the drop items that exist inside the collection.
|
|
463
|
+
let visibleDropTargets = this.validDropTargets.filter((target)=>!validDropItems.some((item)=>target.element.contains(item.element)
|
|
464
|
+
)
|
|
465
|
+
);
|
|
466
|
+
this.restoreAriaHidden = $4vY0V$reactariaoverlays.ariaHideOutside([
|
|
467
|
+
this.dragTarget.element,
|
|
468
|
+
...validDropItems.map((item)=>item.element
|
|
469
|
+
),
|
|
470
|
+
...visibleDropTargets.map((target)=>target.element
|
|
471
|
+
)
|
|
472
|
+
]);
|
|
473
|
+
this.mutationObserver.observe(document.body, {
|
|
474
|
+
subtree: true,
|
|
475
|
+
attributes: true,
|
|
476
|
+
attributeFilter: [
|
|
477
|
+
'aria-hidden'
|
|
478
|
+
]
|
|
479
|
+
});
|
|
626
480
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
481
|
+
next() {
|
|
482
|
+
if (!this.currentDropTarget) {
|
|
483
|
+
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
let index = this.validDropTargets.indexOf(this.currentDropTarget);
|
|
487
|
+
if (index < 0) {
|
|
488
|
+
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
// If we've reached the end of the valid drop targets, cycle back to the original drag target.
|
|
492
|
+
// This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
|
|
493
|
+
if (index === this.validDropTargets.length - 1) {
|
|
494
|
+
if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
|
|
495
|
+
this.setCurrentDropTarget(null);
|
|
496
|
+
this.dragTarget.element.focus();
|
|
497
|
+
} else this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
498
|
+
} else this.setCurrentDropTarget(this.validDropTargets[index + 1]);
|
|
499
|
+
}
|
|
500
|
+
previous() {
|
|
501
|
+
if (!this.currentDropTarget) {
|
|
502
|
+
this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
let index = this.validDropTargets.indexOf(this.currentDropTarget);
|
|
506
|
+
if (index < 0) {
|
|
507
|
+
this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
// If we've reached the start of the valid drop targets, cycle back to the original drag target.
|
|
511
|
+
// This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
|
|
512
|
+
if (index === 0) {
|
|
513
|
+
if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
|
|
514
|
+
this.setCurrentDropTarget(null);
|
|
515
|
+
this.dragTarget.element.focus();
|
|
516
|
+
} else this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);
|
|
517
|
+
} else this.setCurrentDropTarget(this.validDropTargets[index - 1]);
|
|
518
|
+
}
|
|
519
|
+
setCurrentDropTarget(dropTarget, item) {
|
|
520
|
+
if (dropTarget !== this.currentDropTarget) {
|
|
521
|
+
if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {
|
|
522
|
+
let rect = this.currentDropTarget.element.getBoundingClientRect();
|
|
523
|
+
this.currentDropTarget.onDropExit({
|
|
524
|
+
type: 'dropexit',
|
|
525
|
+
x: rect.left + rect.width / 2,
|
|
526
|
+
y: rect.top + rect.height / 2
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
this.currentDropTarget = dropTarget;
|
|
530
|
+
if (dropTarget) {
|
|
531
|
+
if (typeof dropTarget.onDropEnter === 'function') {
|
|
532
|
+
let rect = dropTarget.element.getBoundingClientRect();
|
|
533
|
+
dropTarget.onDropEnter({
|
|
534
|
+
type: 'dropenter',
|
|
535
|
+
x: rect.left + rect.width / 2,
|
|
536
|
+
y: rect.top + rect.height / 2
|
|
537
|
+
}, this.dragTarget);
|
|
538
|
+
}
|
|
539
|
+
if (!item) dropTarget === null || dropTarget === void 0 ? void 0 : dropTarget.element.focus();
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
if (item !== this.currentDropItem) {
|
|
543
|
+
if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') this.currentDropTarget.onDropTargetEnter(item === null || item === void 0 ? void 0 : item.target);
|
|
544
|
+
item === null || item === void 0 ? void 0 : item.element.focus();
|
|
545
|
+
this.currentDropItem = item;
|
|
546
|
+
// Annouce first drop target after drag start announcement finishes.
|
|
547
|
+
// Otherwise, it will never get announced because drag start announcement is assertive.
|
|
548
|
+
if (!this.initialFocused) {
|
|
549
|
+
$4vY0V$reactarialiveannouncer.announce(item === null || item === void 0 ? void 0 : item.element.getAttribute('aria-label'), 'polite');
|
|
550
|
+
this.initialFocused = true;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
631
553
|
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
554
|
+
end() {
|
|
555
|
+
this.teardown();
|
|
556
|
+
if (typeof this.dragTarget.onDragEnd === 'function') {
|
|
557
|
+
let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;
|
|
558
|
+
let rect = target.element.getBoundingClientRect();
|
|
559
|
+
this.dragTarget.onDragEnd({
|
|
560
|
+
type: 'dragend',
|
|
561
|
+
x: rect.x + rect.width / 2,
|
|
562
|
+
y: rect.y + rect.height / 2,
|
|
563
|
+
dropOperation: this.dropOperation
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
// Blur and re-focus the drop target so that the focus ring appears.
|
|
567
|
+
if (this.currentDropTarget) {
|
|
568
|
+
this.currentDropTarget.element.blur();
|
|
569
|
+
this.currentDropTarget.element.focus();
|
|
570
|
+
}
|
|
571
|
+
this.setCurrentDropTarget(null);
|
|
572
|
+
$28e10663603f5ea1$var$endDragging();
|
|
639
573
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
if (!$a75d092e5c30878812fba78e$var$CLICK_EVENTS.includes(e.type)) {
|
|
645
|
-
e.preventDefault();
|
|
574
|
+
cancel() {
|
|
575
|
+
this.end();
|
|
576
|
+
if (!this.dragTarget.element.closest('[aria-hidden="true"]')) this.dragTarget.element.focus();
|
|
577
|
+
$4vY0V$reactarialiveannouncer.announce(this.stringFormatter.format('dropCanceled'));
|
|
646
578
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
579
|
+
drop(item1) {
|
|
580
|
+
if (!this.currentDropTarget) {
|
|
581
|
+
this.cancel();
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
584
|
+
if (typeof (item1 === null || item1 === void 0 ? void 0 : item1.getDropOperation) === 'function') {
|
|
585
|
+
let types = $4620ae0dc40f0031$export$e1d41611756c6326(this.dragTarget.items);
|
|
586
|
+
this.dropOperation = item1.getDropOperation(types, this.dragTarget.allowedDropOperations);
|
|
587
|
+
} else if (typeof this.currentDropTarget.getDropOperation === 'function') {
|
|
588
|
+
let types = $4620ae0dc40f0031$export$e1d41611756c6326(this.dragTarget.items);
|
|
589
|
+
this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);
|
|
590
|
+
} else // TODO: show menu ??
|
|
591
|
+
this.dropOperation = this.dragTarget.allowedDropOperations[0];
|
|
592
|
+
if (typeof this.currentDropTarget.onDrop === 'function') {
|
|
593
|
+
let items = this.dragTarget.items.map((item)=>({
|
|
594
|
+
kind: 'text',
|
|
595
|
+
types: new Set(Object.keys(item)),
|
|
596
|
+
getText: (type)=>Promise.resolve(item[type])
|
|
597
|
+
})
|
|
598
|
+
);
|
|
599
|
+
let rect = this.currentDropTarget.element.getBoundingClientRect();
|
|
600
|
+
this.currentDropTarget.onDrop({
|
|
601
|
+
type: 'drop',
|
|
602
|
+
x: rect.left + rect.width / 2,
|
|
603
|
+
y: rect.top + rect.height / 2,
|
|
604
|
+
items: items,
|
|
605
|
+
dropOperation: this.dropOperation
|
|
606
|
+
}, item1 === null || item1 === void 0 ? void 0 : item1.target);
|
|
607
|
+
}
|
|
608
|
+
this.end();
|
|
609
|
+
$4vY0V$reactarialiveannouncer.announce(this.stringFormatter.format('dropComplete'));
|
|
610
|
+
}
|
|
611
|
+
activate() {
|
|
612
|
+
if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {
|
|
613
|
+
let rect = this.currentDropTarget.element.getBoundingClientRect();
|
|
614
|
+
this.currentDropTarget.onDropActivate({
|
|
615
|
+
type: 'dropactivate',
|
|
616
|
+
x: rect.left + rect.width / 2,
|
|
617
|
+
y: rect.top + rect.height / 2
|
|
618
|
+
});
|
|
619
|
+
}
|
|
655
620
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
621
|
+
constructor(target, stringFormatter){
|
|
622
|
+
this.dragTarget = target;
|
|
623
|
+
this.stringFormatter = stringFormatter;
|
|
624
|
+
this.onKeyDown = this.onKeyDown.bind(this);
|
|
625
|
+
this.onFocus = this.onFocus.bind(this);
|
|
626
|
+
this.onBlur = this.onBlur.bind(this);
|
|
627
|
+
this.onClick = this.onClick.bind(this);
|
|
628
|
+
this.onPointerDown = this.onPointerDown.bind(this);
|
|
629
|
+
this.cancelEvent = this.cancelEvent.bind(this);
|
|
630
|
+
this.initialFocused = false;
|
|
661
631
|
}
|
|
632
|
+
}
|
|
633
|
+
function $28e10663603f5ea1$var$findValidDropTargets(options) {
|
|
634
|
+
let types = $4620ae0dc40f0031$export$e1d41611756c6326(options.items);
|
|
635
|
+
return [
|
|
636
|
+
...$28e10663603f5ea1$var$dropTargets.values()
|
|
637
|
+
].filter((target)=>{
|
|
638
|
+
if (target.element.closest('[aria-hidden="true"]')) return false;
|
|
639
|
+
if (typeof target.getDropOperation === 'function') return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';
|
|
640
|
+
return true;
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
function $28e10663603f5ea1$var$isVirtualPointerEvent(event) {
|
|
644
|
+
// If the pointer size is zero, then we assume it's from a screen reader.
|
|
645
|
+
// Android TalkBack double tap will sometimes return a event with width and height of 1
|
|
646
|
+
// and pointerType === 'mouse' so we need to check for a specific combination of event attributes.
|
|
647
|
+
// Cannot use "event.pressure === 0" as the sole check due to Safari pointer events always returning pressure === 0
|
|
648
|
+
// instead of .5, see https://bugs.webkit.org/show_bug.cgi?id=206216
|
|
649
|
+
return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0;
|
|
650
|
+
}
|
|
662
651
|
|
|
663
|
-
this.validDropTargets = $a75d092e5c30878812fba78e$var$findValidDropTargets(this.dragTarget);
|
|
664
|
-
|
|
665
|
-
if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {
|
|
666
|
-
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
667
|
-
} // Find valid drop items within collections
|
|
668
652
|
|
|
669
653
|
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
654
|
+
var $d624b4da796f302a$exports = {};
|
|
655
|
+
var $12ee6b0bfb4232ad$exports = {};
|
|
656
|
+
$12ee6b0bfb4232ad$exports = {
|
|
657
|
+
"dragDescriptionKeyboard": `اضغط Enter لبدء السحب.`,
|
|
658
|
+
"dragDescriptionTouch": `اضغط مرتين لبدء السحب.`,
|
|
659
|
+
"dragDescriptionVirtual": `انقر لبدء السحب.`,
|
|
660
|
+
"dragItem": (args)=>`اسحب ${args.itemText}`
|
|
661
|
+
,
|
|
662
|
+
"dragSelectedItems": (args, formatter)=>`اسحب ${formatter.plural(args.count, {
|
|
663
|
+
one: ()=>`${formatter.number(args.count)} عنصر محدد`
|
|
664
|
+
,
|
|
665
|
+
other: ()=>`${formatter.number(args.count)} عناصر محددة`
|
|
666
|
+
})}`
|
|
667
|
+
,
|
|
668
|
+
"dragStartedKeyboard": `بدأ السحب. اضغط Tab للانتقال إلى موضع الإفلات، ثم اضغط Enter للإفلات، أو اضغط Escape للإلغاء.`,
|
|
669
|
+
"dragStartedTouch": `بدأ السحب. انتقل إلى موضع الإفلات، ثم اضغط مرتين للإفلات.`,
|
|
670
|
+
"dragStartedVirtual": `بدأ السحب. انتقل إلى مكان الإفلات، ثم انقر أو اضغط Enter للإفلات.`,
|
|
671
|
+
"dropCanceled": `تم إلغاء الإفلات.`,
|
|
672
|
+
"dropComplete": `اكتمل الإفلات.`,
|
|
673
|
+
"dropDescriptionKeyboard": `اضغط Enter للإفلات. اضغط Escape لإلغاء السحب.`,
|
|
674
|
+
"dropDescriptionTouch": `اضغط مرتين للإفلات.`,
|
|
675
|
+
"dropDescriptionVirtual": `انقر للإفلات.`,
|
|
676
|
+
"dropIndicator": `مؤشر الإفلات`,
|
|
677
|
+
"dropOnItem": (args)=>`إفلات ${args.itemText}`
|
|
678
|
+
,
|
|
679
|
+
"dropOnRoot": `الإفلات`,
|
|
680
|
+
"endDragKeyboard": `السحب. اضغط Enter لإلغاء السحب.`,
|
|
681
|
+
"endDragTouch": `السحب. اضغط مرتين لإلغاء السحب.`,
|
|
682
|
+
"endDragVirtual": `السحب. انقر لإلغاء السحب.`,
|
|
683
|
+
"insertAfter": (args)=>`أدخل بعد ${args.itemText}`
|
|
684
|
+
,
|
|
685
|
+
"insertBefore": (args)=>`أدخل قبل ${args.itemText}`
|
|
686
|
+
,
|
|
687
|
+
"insertBetween": (args)=>`أدخل بين ${args.beforeItemText} و ${args.afterItemText}`
|
|
688
|
+
};
|
|
675
689
|
|
|
676
|
-
return true;
|
|
677
|
-
}); // Filter out drop targets that contain valid items. We don't want to stop hiding elements
|
|
678
|
-
// other than the drop items that exist inside the collection.
|
|
679
690
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
691
|
+
var $e21ef7c55796c5e1$exports = {};
|
|
692
|
+
$e21ef7c55796c5e1$exports = {
|
|
693
|
+
"dragDescriptionKeyboard": `Натиснете „Enter“, за да започнете да плъзгате.`,
|
|
694
|
+
"dragDescriptionTouch": `Натиснете двукратно, за да започнете да плъзгате.`,
|
|
695
|
+
"dragDescriptionVirtual": `Щракнете, за да започнете да плъзгате.`,
|
|
696
|
+
"dragItem": (args)=>`Плъзни ${args.itemText}`
|
|
697
|
+
,
|
|
698
|
+
"dragSelectedItems": (args, formatter)=>`Плъзни ${formatter.plural(args.count, {
|
|
699
|
+
one: ()=>`${formatter.number(args.count)} избран елемент`
|
|
700
|
+
,
|
|
701
|
+
other: ()=>`${formatter.number(args.count)} избрани елемента`
|
|
702
|
+
})}`
|
|
703
|
+
,
|
|
704
|
+
"dragStartedKeyboard": `Започна плъзгане. Натиснете „Tab“, за да се придвижите до целта, след което натиснете „Enter“ за пускане или натиснете „Escape“ за отмяна.`,
|
|
705
|
+
"dragStartedTouch": `Започна плъзгане. Придвижете се до целта, след което натиснете двукратно, за да пуснете.`,
|
|
706
|
+
"dragStartedVirtual": `Започна плъзгане. Придвижете се до целта, след което щракнете или натиснете „Enter“ за пускане.`,
|
|
707
|
+
"dropCanceled": `Пускането е отменено.`,
|
|
708
|
+
"dropComplete": `Пускането е завършено.`,
|
|
709
|
+
"dropDescriptionKeyboard": `Натиснете „Enter“ за пускане. Натиснете „Escape“ за отмяна на плъзгането.`,
|
|
710
|
+
"dropDescriptionTouch": `Натиснете двукратно за пускане.`,
|
|
711
|
+
"dropDescriptionVirtual": `Щракнете за пускане.`,
|
|
712
|
+
"dropIndicator": `индикатор за пускане`,
|
|
713
|
+
"dropOnItem": (args)=>`Пусни върху ${args.itemText}`
|
|
714
|
+
,
|
|
715
|
+
"dropOnRoot": `Пусни върху`,
|
|
716
|
+
"endDragKeyboard": `Плъзгане. Натиснете „Enter“ за отмяна на плъзгането.`,
|
|
717
|
+
"endDragTouch": `Плъзгане. Натиснете двукратно за отмяна на плъзгането.`,
|
|
718
|
+
"endDragVirtual": `Плъзгане. Щракнете за отмяна.`,
|
|
719
|
+
"insertAfter": (args)=>`Вмъкни след ${args.itemText}`
|
|
720
|
+
,
|
|
721
|
+
"insertBefore": (args)=>`Вмъкни преди ${args.itemText}`
|
|
722
|
+
,
|
|
723
|
+
"insertBetween": (args)=>`Вмъкни между ${args.beforeItemText} и ${args.afterItemText}`
|
|
724
|
+
};
|
|
688
725
|
|
|
689
|
-
next() {
|
|
690
|
-
if (!this.currentDropTarget) {
|
|
691
|
-
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
692
|
-
return;
|
|
693
|
-
}
|
|
694
726
|
|
|
695
|
-
|
|
727
|
+
var $dfa9cd1c2317d9aa$exports = {};
|
|
728
|
+
$dfa9cd1c2317d9aa$exports = {
|
|
729
|
+
"dragDescriptionKeyboard": `Stisknutím klávesy Enter začnete s přetahováním.`,
|
|
730
|
+
"dragDescriptionTouch": `Poklepáním začnete s přetahováním.`,
|
|
731
|
+
"dragDescriptionVirtual": `Kliknutím začnete s přetahováním.`,
|
|
732
|
+
"dragItem": (args)=>`Přetáhnout ${args.itemText}`
|
|
733
|
+
,
|
|
734
|
+
"dragSelectedItems": (args, formatter)=>`Přetáhnout ${formatter.plural(args.count, {
|
|
735
|
+
one: ()=>`${formatter.number(args.count)} vybranou položku`
|
|
736
|
+
,
|
|
737
|
+
few: ()=>`${formatter.number(args.count)} vybrané položky`
|
|
738
|
+
,
|
|
739
|
+
other: ()=>`${formatter.number(args.count)} vybraných položek`
|
|
740
|
+
})}`
|
|
741
|
+
,
|
|
742
|
+
"dragStartedKeyboard": `Začněte s přetahováním. Po stisknutí klávesy Tab najděte požadovaný cíl a stisknutím klávesy Enter přetažení dokončete nebo stisknutím klávesy Esc akci zrušte.`,
|
|
743
|
+
"dragStartedTouch": `Začněte s přetahováním. Najděte požadovaný cíl a poklepáním přetažení dokončete.`,
|
|
744
|
+
"dragStartedVirtual": `Začněte s přetahováním. Najděte požadovaný cíl a kliknutím nebo stisknutím klávesy Enter přetažení dokončete.`,
|
|
745
|
+
"dropCanceled": `Přetažení bylo zrušeno.`,
|
|
746
|
+
"dropComplete": `Přetažení bylo dokončeno.`,
|
|
747
|
+
"dropDescriptionKeyboard": `Stisknutím klávesy Enter přetažení dokončete nebo stisknutím klávesy Esc akci zrušte.`,
|
|
748
|
+
"dropDescriptionTouch": `Poklepáním přetažení dokončete.`,
|
|
749
|
+
"dropDescriptionVirtual": `Kliknutím objekt přetáhněte.`,
|
|
750
|
+
"dropIndicator": `indikátor přetažení`,
|
|
751
|
+
"dropOnItem": (args)=>`Přetáhnout na ${args.itemText}`
|
|
752
|
+
,
|
|
753
|
+
"dropOnRoot": `Přetáhnout na`,
|
|
754
|
+
"endDragKeyboard": `Probíhá přetahování. Stisknutím klávesy Enter přetažení zrušíte.`,
|
|
755
|
+
"endDragTouch": `Probíhá přetahování. Poklepáním přetažení zrušíte.`,
|
|
756
|
+
"endDragVirtual": `Probíhá přetahování. Kliknutím přetažení zrušíte.`,
|
|
757
|
+
"insertAfter": (args)=>`Vložit za ${args.itemText}`
|
|
758
|
+
,
|
|
759
|
+
"insertBefore": (args)=>`Vložit před ${args.itemText}`
|
|
760
|
+
,
|
|
761
|
+
"insertBetween": (args)=>`Vložit mezi ${args.beforeItemText} a ${args.afterItemText}`
|
|
762
|
+
};
|
|
696
763
|
|
|
697
|
-
if (index < 0) {
|
|
698
|
-
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
699
|
-
return;
|
|
700
|
-
} // If we've reached the end of the valid drop targets, cycle back to the original drag target.
|
|
701
|
-
// This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).
|
|
702
764
|
|
|
765
|
+
var $65fff3bbacfa8956$exports = {};
|
|
766
|
+
$65fff3bbacfa8956$exports = {
|
|
767
|
+
"dragDescriptionKeyboard": `Tryk på Enter for at starte med at trække.`,
|
|
768
|
+
"dragDescriptionTouch": `Dobbelttryk for at starte med at trække.`,
|
|
769
|
+
"dragDescriptionVirtual": `Klik for at starte med at trække.`,
|
|
770
|
+
"dragItem": (args)=>`Træk ${args.itemText}`
|
|
771
|
+
,
|
|
772
|
+
"dragSelectedItems": (args, formatter)=>`Træk ${formatter.plural(args.count, {
|
|
773
|
+
one: ()=>`${formatter.number(args.count)} valgt element`
|
|
774
|
+
,
|
|
775
|
+
other: ()=>`${formatter.number(args.count)} valgte elementer`
|
|
776
|
+
})}`
|
|
777
|
+
,
|
|
778
|
+
"dragStartedKeyboard": `Startet med at trække. Tryk på Tab for at gå til et slip-mål, tryk derefter på Enter for at slippe, eller tryk på Escape for at annullere.`,
|
|
779
|
+
"dragStartedTouch": `Startet med at trække. Gå til et slip-mål, og dobbelttryk derefter for at slippe.`,
|
|
780
|
+
"dragStartedVirtual": `Startet med at trække. Gå til et slip-mål, og klik eller tryk derefter på enter for at slippe.`,
|
|
781
|
+
"dropCanceled": `Slip annulleret.`,
|
|
782
|
+
"dropComplete": `Slip fuldført.`,
|
|
783
|
+
"dropDescriptionKeyboard": `Tryk på Enter for at slippe. Tryk på Escape for at annullere trækning.`,
|
|
784
|
+
"dropDescriptionTouch": `Dobbelttryk for at slippe.`,
|
|
785
|
+
"dropDescriptionVirtual": `Klik for at slippe.`,
|
|
786
|
+
"dropIndicator": `slip-indikator`,
|
|
787
|
+
"dropOnItem": (args)=>`Slip på ${args.itemText}`
|
|
788
|
+
,
|
|
789
|
+
"dropOnRoot": `Slip på`,
|
|
790
|
+
"endDragKeyboard": `Trækning. Tryk på enter for at annullere træk.`,
|
|
791
|
+
"endDragTouch": `Trækning. Dobbelttryk for at annullere træk.`,
|
|
792
|
+
"endDragVirtual": `Trækning. Klik for at annullere trækning.`,
|
|
793
|
+
"insertAfter": (args)=>`Indsæt efter ${args.itemText}`
|
|
794
|
+
,
|
|
795
|
+
"insertBefore": (args)=>`Indsæt før ${args.itemText}`
|
|
796
|
+
,
|
|
797
|
+
"insertBetween": (args)=>`Indsæt mellem ${args.beforeItemText} og ${args.afterItemText}`
|
|
798
|
+
};
|
|
703
799
|
|
|
704
|
-
if (index === this.validDropTargets.length - 1) {
|
|
705
|
-
if (!this.dragTarget.element.closest('[aria-hidden="true"]')) {
|
|
706
|
-
this.setCurrentDropTarget(null);
|
|
707
|
-
this.dragTarget.element.focus();
|
|
708
|
-
} else {
|
|
709
|
-
this.setCurrentDropTarget(this.validDropTargets[0]);
|
|
710
|
-
}
|
|
711
|
-
} else {
|
|
712
|
-
this.setCurrentDropTarget(this.validDropTargets[index + 1]);
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
800
|
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
801
|
+
var $10b7dfe45cd41c2d$exports = {};
|
|
802
|
+
$10b7dfe45cd41c2d$exports = {
|
|
803
|
+
"dragDescriptionKeyboard": `Drücken Sie die Eingabetaste, um den Ziehvorgang zu starten.`,
|
|
804
|
+
"dragDescriptionTouch": `Tippen Sie doppelt, um den Ziehvorgang zu starten.`,
|
|
805
|
+
"dragDescriptionVirtual": `Zum Starten des Ziehvorgangs klicken.`,
|
|
806
|
+
"dragItem": (args)=>`${args.itemText} ziehen`
|
|
807
|
+
,
|
|
808
|
+
"dragSelectedItems": (args, formatter)=>`${formatter.plural(args.count, {
|
|
809
|
+
one: ()=>`${formatter.number(args.count)} ausgewähltes Objekt`
|
|
810
|
+
,
|
|
811
|
+
other: ()=>`${formatter.number(args.count)} ausgewählte Objekte`
|
|
812
|
+
})} ziehen`
|
|
813
|
+
,
|
|
814
|
+
"dragStartedKeyboard": `Ziehvorgang gestartet. Drücken Sie die Tabulatortaste, um zu einem Ablegeziel zu navigieren und drücken Sie dann die Eingabetaste, um das Objekt abzulegen, oder Escape, um den Vorgang abzubrechen.`,
|
|
815
|
+
"dragStartedTouch": `Ziehvorgang gestartet. Navigieren Sie zu einem Ablegeziel und tippen Sie doppelt, um das Objekt abzulegen.`,
|
|
816
|
+
"dragStartedVirtual": `Ziehvorgang gestartet. Navigieren Sie zu einem Ablegeziel und klicken Sie oder drücken Sie die Eingabetaste, um das Objekt abzulegen.`,
|
|
817
|
+
"dropCanceled": `Ablegen abgebrochen.`,
|
|
818
|
+
"dropComplete": `Ablegen abgeschlossen.`,
|
|
819
|
+
"dropDescriptionKeyboard": `Drücken Sie die Eingabetaste, um das Objekt abzulegen. Drücken Sie Escape, um den Vorgang abzubrechen.`,
|
|
820
|
+
"dropDescriptionTouch": `Tippen Sie doppelt, um das Objekt abzulegen.`,
|
|
821
|
+
"dropDescriptionVirtual": `Zum Ablegen klicken.`,
|
|
822
|
+
"dropIndicator": `Ablegeanzeiger`,
|
|
823
|
+
"dropOnItem": (args)=>`Auf ${args.itemText} ablegen`
|
|
824
|
+
,
|
|
825
|
+
"dropOnRoot": `Ablegen auf`,
|
|
826
|
+
"endDragKeyboard": `Ziehvorgang läuft. Drücken Sie die Eingabetaste, um den Vorgang abzubrechen.`,
|
|
827
|
+
"endDragTouch": `Ziehvorgang läuft. Tippen Sie doppelt, um den Vorgang abzubrechen.`,
|
|
828
|
+
"endDragVirtual": `Ziehvorgang läuft. Klicken Sie, um den Vorgang abzubrechen.`,
|
|
829
|
+
"insertAfter": (args)=>`Nach ${args.itemText} einfügen`
|
|
830
|
+
,
|
|
831
|
+
"insertBefore": (args)=>`Vor ${args.itemText} einfügen`
|
|
832
|
+
,
|
|
833
|
+
"insertBetween": (args)=>`Zwischen ${args.beforeItemText} und ${args.afterItemText} einfügen`
|
|
834
|
+
};
|
|
721
835
|
|
|
722
|
-
let index = this.validDropTargets.indexOf(this.currentDropTarget);
|
|
723
836
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
837
|
+
var $0cadcffb7abc96b8$exports = {};
|
|
838
|
+
$0cadcffb7abc96b8$exports = {
|
|
839
|
+
"dragDescriptionKeyboard": `Πατήστε Enter για έναρξη της μεταφοράς.`,
|
|
840
|
+
"dragDescriptionTouch": `Πατήστε δύο φορές για έναρξη της μεταφοράς.`,
|
|
841
|
+
"dragDescriptionVirtual": `Κάντε κλικ για να ξεκινήσετε τη μεταφορά.`,
|
|
842
|
+
"dragItem": (args)=>`Μεταφορά ${args.itemText}`
|
|
843
|
+
,
|
|
844
|
+
"dragSelectedItems": (args, formatter)=>`Μεταφορά σε ${formatter.plural(args.count, {
|
|
845
|
+
one: ()=>`${formatter.number(args.count)} επιλεγμένο στοιχείο`
|
|
846
|
+
,
|
|
847
|
+
other: ()=>`${formatter.number(args.count)} επιλεγμένα στοιχεία`
|
|
848
|
+
})}`
|
|
849
|
+
,
|
|
850
|
+
"dragStartedKeyboard": `Η μεταφορά ξεκίνησε. Πατήστε το πλήκτρο Tab για να μεταβείτε σε έναν προορισμό απόθεσης και, στη συνέχεια, πατήστε Enter για απόθεση ή πατήστε Escape για ακύρωση.`,
|
|
851
|
+
"dragStartedTouch": `Η μεταφορά ξεκίνησε. Μεταβείτε σε έναν προορισμό απόθεσης και, στη συνέχεια, πατήστε δύο φορές για απόθεση.`,
|
|
852
|
+
"dragStartedVirtual": `Η μεταφορά ξεκίνησε. Μεταβείτε σε έναν προορισμό απόθεσης και, στη συνέχεια, κάντε κλικ ή πατήστε Enter για απόθεση.`,
|
|
853
|
+
"dropCanceled": `Η απόθεση ακυρώθηκε.`,
|
|
854
|
+
"dropComplete": `Η απόθεση ολοκληρώθηκε.`,
|
|
855
|
+
"dropDescriptionKeyboard": `Πατήστε Enter για απόθεση. Πατήστε Escape για ακύρωση της μεταφοράς.`,
|
|
856
|
+
"dropDescriptionTouch": `Πατήστε δύο φορές για απόθεση.`,
|
|
857
|
+
"dropDescriptionVirtual": `Κάντε κλικ για απόθεση.`,
|
|
858
|
+
"dropIndicator": `δείκτης απόθεσης`,
|
|
859
|
+
"dropOnItem": (args)=>`Απόθεση σε ${args.itemText}`
|
|
860
|
+
,
|
|
861
|
+
"dropOnRoot": `Απόθεση σε`,
|
|
862
|
+
"endDragKeyboard": `Μεταφορά σε εξέλιξη. Πατήστε Enter για ακύρωση της μεταφοράς.`,
|
|
863
|
+
"endDragTouch": `Μεταφορά σε εξέλιξη. Πατήστε δύο φορές για ακύρωση της μεταφοράς.`,
|
|
864
|
+
"endDragVirtual": `Μεταφορά σε εξέλιξη. Κάντε κλικ για ακύρωση της μεταφοράς.`,
|
|
865
|
+
"insertAfter": (args)=>`Εισαγωγή μετά από ${args.itemText}`
|
|
866
|
+
,
|
|
867
|
+
"insertBefore": (args)=>`Εισαγωγή πριν από ${args.itemText}`
|
|
868
|
+
,
|
|
869
|
+
"insertBetween": (args)=>`Εισαγωγή μεταξύ ${args.beforeItemText} και ${args.afterItemText}`
|
|
870
|
+
};
|
|
729
871
|
|
|
730
872
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
873
|
+
var $7e3982b34ddf1bdf$exports = {};
|
|
874
|
+
$7e3982b34ddf1bdf$exports = {
|
|
875
|
+
"dragItem": (args)=>`Drag ${args.itemText}`
|
|
876
|
+
,
|
|
877
|
+
"dragSelectedItems": (args, formatter)=>`Drag ${formatter.plural(args.count, {
|
|
878
|
+
one: ()=>`${formatter.number(args.count)} selected item`
|
|
879
|
+
,
|
|
880
|
+
other: ()=>`${formatter.number(args.count)} selected items`
|
|
881
|
+
})}`
|
|
882
|
+
,
|
|
883
|
+
"dragDescriptionKeyboard": `Press Enter to start dragging.`,
|
|
884
|
+
"dragDescriptionTouch": `Double tap to start dragging.`,
|
|
885
|
+
"dragDescriptionVirtual": `Click to start dragging.`,
|
|
886
|
+
"dragStartedKeyboard": `Started dragging. Press Tab to navigate to a drop target, then press Enter to drop, or press Escape to cancel.`,
|
|
887
|
+
"dragStartedTouch": `Started dragging. Navigate to a drop target, then double tap to drop.`,
|
|
888
|
+
"dragStartedVirtual": `Started dragging. Navigate to a drop target, then click or press Enter to drop.`,
|
|
889
|
+
"endDragKeyboard": `Dragging. Press Enter to cancel drag.`,
|
|
890
|
+
"endDragTouch": `Dragging. Double tap to cancel drag.`,
|
|
891
|
+
"endDragVirtual": `Dragging. Click to cancel drag.`,
|
|
892
|
+
"dropDescriptionKeyboard": `Press Enter to drop. Press Escape to cancel drag.`,
|
|
893
|
+
"dropDescriptionTouch": `Double tap to drop.`,
|
|
894
|
+
"dropDescriptionVirtual": `Click to drop.`,
|
|
895
|
+
"dropCanceled": `Drop canceled.`,
|
|
896
|
+
"dropComplete": `Drop complete.`,
|
|
897
|
+
"dropIndicator": `drop indicator`,
|
|
898
|
+
"dropOnRoot": `Drop on`,
|
|
899
|
+
"dropOnItem": (args)=>`Drop on ${args.itemText}`
|
|
900
|
+
,
|
|
901
|
+
"insertBefore": (args)=>`Insert before ${args.itemText}`
|
|
902
|
+
,
|
|
903
|
+
"insertBetween": (args)=>`Insert between ${args.beforeItemText} and ${args.afterItemText}`
|
|
904
|
+
,
|
|
905
|
+
"insertAfter": (args)=>`Insert after ${args.itemText}`
|
|
906
|
+
};
|
|
765
907
|
|
|
766
|
-
if (!item) {
|
|
767
|
-
dropTarget == null ? void 0 : dropTarget.element.focus();
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
908
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
909
|
+
var $cb29ce0b655c4023$exports = {};
|
|
910
|
+
$cb29ce0b655c4023$exports = {
|
|
911
|
+
"dragDescriptionKeyboard": `Pulse Intro para empezar a arrastrar.`,
|
|
912
|
+
"dragDescriptionTouch": `Pulse dos veces para iniciar el arrastre.`,
|
|
913
|
+
"dragDescriptionVirtual": `Haga clic para iniciar el arrastre.`,
|
|
914
|
+
"dragItem": (args)=>`Arrastrar ${args.itemText}`
|
|
915
|
+
,
|
|
916
|
+
"dragSelectedItems": (args, formatter)=>`Arrastrar ${formatter.plural(args.count, {
|
|
917
|
+
one: ()=>`${formatter.number(args.count)} elemento seleccionado`
|
|
918
|
+
,
|
|
919
|
+
other: ()=>`${formatter.number(args.count)} elementos seleccionados`
|
|
920
|
+
})}`
|
|
921
|
+
,
|
|
922
|
+
"dragStartedKeyboard": `Se ha empezado a arrastrar. Pulse el tabulador para ir al destino de colocación y, a continuación, pulse Intro para soltar, o pulse Escape para cancelar.`,
|
|
923
|
+
"dragStartedTouch": `Se ha empezado a arrastrar. Vaya al destino de colocación y, a continuación, pulse dos veces para soltar.`,
|
|
924
|
+
"dragStartedVirtual": `Se ha empezado a arrastrar. Vaya al destino de colocación y, a continuación, haga clic o pulse Intro para soltar.`,
|
|
925
|
+
"dropCanceled": `Se ha cancelado la colocación.`,
|
|
926
|
+
"dropComplete": `Colocación finalizada.`,
|
|
927
|
+
"dropDescriptionKeyboard": `Pulse Intro para soltar. Pulse Escape para cancelar el arrastre.`,
|
|
928
|
+
"dropDescriptionTouch": `Pulse dos veces para soltar.`,
|
|
929
|
+
"dropDescriptionVirtual": `Haga clic para soltar.`,
|
|
930
|
+
"dropIndicator": `indicador de colocación`,
|
|
931
|
+
"dropOnItem": (args)=>`Soltar en ${args.itemText}`
|
|
932
|
+
,
|
|
933
|
+
"dropOnRoot": `Soltar en`,
|
|
934
|
+
"endDragKeyboard": `Arrastrando. Pulse Intro para cancelar el arrastre.`,
|
|
935
|
+
"endDragTouch": `Arrastrando. Pulse dos veces para cancelar el arrastre.`,
|
|
936
|
+
"endDragVirtual": `Arrastrando. Haga clic para cancelar el arrastre.`,
|
|
937
|
+
"insertAfter": (args)=>`Insertar después de ${args.itemText}`
|
|
938
|
+
,
|
|
939
|
+
"insertBefore": (args)=>`Insertar antes de ${args.itemText}`
|
|
940
|
+
,
|
|
941
|
+
"insertBetween": (args)=>`Insertar entre ${args.beforeItemText} y ${args.afterItemText}`
|
|
942
|
+
};
|
|
776
943
|
|
|
777
|
-
item == null ? void 0 : item.element.focus();
|
|
778
|
-
this.currentDropItem = item;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
end() {
|
|
783
|
-
this.teardown();
|
|
784
|
-
|
|
785
|
-
if (typeof this.dragTarget.onDragEnd === 'function') {
|
|
786
|
-
let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;
|
|
787
|
-
let rect = target.element.getBoundingClientRect();
|
|
788
|
-
this.dragTarget.onDragEnd({
|
|
789
|
-
type: 'dragend',
|
|
790
|
-
x: rect.x + rect.width / 2,
|
|
791
|
-
y: rect.y + rect.height / 2,
|
|
792
|
-
dropOperation: this.dropOperation
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
944
|
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
945
|
+
var $067d46bab80bcf4b$exports = {};
|
|
946
|
+
$067d46bab80bcf4b$exports = {
|
|
947
|
+
"dragDescriptionKeyboard": `Lohistamise alustamiseks vajutage klahvi Enter.`,
|
|
948
|
+
"dragDescriptionTouch": `Topeltpuudutage lohistamise alustamiseks.`,
|
|
949
|
+
"dragDescriptionVirtual": `Klõpsake lohistamise alustamiseks.`,
|
|
950
|
+
"dragItem": (args)=>`Lohista ${args.itemText}`
|
|
951
|
+
,
|
|
952
|
+
"dragSelectedItems": (args, formatter)=>`Lohista ${formatter.plural(args.count, {
|
|
953
|
+
one: ()=>`${formatter.number(args.count)} valitud üksust`
|
|
954
|
+
,
|
|
955
|
+
other: ()=>`${formatter.number(args.count)} valitud üksust`
|
|
956
|
+
})}`
|
|
957
|
+
,
|
|
958
|
+
"dragStartedKeyboard": `Alustati lohistamist. Kukutamise sihtmärgi juurde navigeerimiseks vajutage klahvi Tab, seejärel vajutage kukutamiseks klahvi Enter või loobumiseks klahvi Escape.`,
|
|
959
|
+
"dragStartedTouch": `Alustati lohistamist. Navigeerige kukutamise sihtmärgi juurde ja topeltpuudutage kukutamiseks.`,
|
|
960
|
+
"dragStartedVirtual": `Alustati lohistamist. Navigeerige kukutamise sihtmärgi juurde ja kukutamiseks klõpsake või vajutage klahvi Enter.`,
|
|
961
|
+
"dropCanceled": `Lohistamisest loobuti.`,
|
|
962
|
+
"dropComplete": `Lohistamine on tehtud.`,
|
|
963
|
+
"dropDescriptionKeyboard": `Kukutamiseks vajutage klahvi Enter. Lohistamisest loobumiseks vajutage klahvi Escape.`,
|
|
964
|
+
"dropDescriptionTouch": `Kukutamiseks topeltpuudutage.`,
|
|
965
|
+
"dropDescriptionVirtual": `Kukutamiseks klõpsake.`,
|
|
966
|
+
"dropIndicator": `lohistamise indikaator`,
|
|
967
|
+
"dropOnItem": (args)=>`Kukuta asukohta ${args.itemText}`
|
|
968
|
+
,
|
|
969
|
+
"dropOnRoot": `Kukuta asukohta`,
|
|
970
|
+
"endDragKeyboard": `Lohistamine. Lohistamisest loobumiseks vajutage klahvi Enter.`,
|
|
971
|
+
"endDragTouch": `Lohistamine. Lohistamisest loobumiseks topeltpuudutage.`,
|
|
972
|
+
"endDragVirtual": `Lohistamine. Lohistamisest loobumiseks klõpsake.`,
|
|
973
|
+
"insertAfter": (args)=>`Sisesta ${args.itemText} järele`
|
|
974
|
+
,
|
|
975
|
+
"insertBefore": (args)=>`Sisesta ${args.itemText} ette`
|
|
976
|
+
,
|
|
977
|
+
"insertBetween": (args)=>`Sisesta ${args.beforeItemText} ja ${args.afterItemText} vahele`
|
|
978
|
+
};
|
|
799
979
|
|
|
800
|
-
cancel() {
|
|
801
|
-
this.end();
|
|
802
980
|
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
981
|
+
var $8aa1b9a1f9d783d3$exports = {};
|
|
982
|
+
$8aa1b9a1f9d783d3$exports = {
|
|
983
|
+
"dragDescriptionKeyboard": `Aloita vetäminen painamalla Enter-näppäintä.`,
|
|
984
|
+
"dragDescriptionTouch": `Aloita vetäminen kaksoisnapauttamalla.`,
|
|
985
|
+
"dragDescriptionVirtual": `Aloita vetäminen napsauttamalla.`,
|
|
986
|
+
"dragItem": (args)=>`Vedä kohdetta ${args.itemText}`
|
|
987
|
+
,
|
|
988
|
+
"dragSelectedItems": (args, formatter)=>`Vedä ${formatter.plural(args.count, {
|
|
989
|
+
one: ()=>`${formatter.number(args.count)} valittua kohdetta`
|
|
990
|
+
,
|
|
991
|
+
other: ()=>`${formatter.number(args.count)} valittua kohdetta`
|
|
992
|
+
})}`
|
|
993
|
+
,
|
|
994
|
+
"dragStartedKeyboard": `Vetäminen aloitettu. Siirry pudotuskohteeseen painamalla sarkainnäppäintä ja sitten pudota painamalla Enter-näppäintä tai peruuta painamalla Escape-näppäintä.`,
|
|
995
|
+
"dragStartedTouch": `Vetäminen aloitettu. Siirry pudotuskohteeseen ja pudota kaksoisnapauttamalla.`,
|
|
996
|
+
"dragStartedVirtual": `Vetäminen aloitettu. Siirry pudotuskohteeseen ja pudota napsauttamalla tai painamalla Enter-näppäintä.`,
|
|
997
|
+
"dropCanceled": `Pudotus peruutettu.`,
|
|
998
|
+
"dropComplete": `Pudotus suoritettu.`,
|
|
999
|
+
"dropDescriptionKeyboard": `Pudota painamalla Enter-näppäintä. Peruuta vetäminen painamalla Escape-näppäintä.`,
|
|
1000
|
+
"dropDescriptionTouch": `Pudota kaksoisnapauttamalla.`,
|
|
1001
|
+
"dropDescriptionVirtual": `Pudota napsauttamalla.`,
|
|
1002
|
+
"dropIndicator": `pudotuksen ilmaisin`,
|
|
1003
|
+
"dropOnItem": (args)=>`Pudota kohteeseen ${args.itemText}`
|
|
1004
|
+
,
|
|
1005
|
+
"dropOnRoot": `Pudota kohteeseen`,
|
|
1006
|
+
"endDragKeyboard": `Vedetään. Peruuta vetäminen painamalla Enter-näppäintä.`,
|
|
1007
|
+
"endDragTouch": `Vedetään. Peruuta vetäminen kaksoisnapauttamalla.`,
|
|
1008
|
+
"endDragVirtual": `Vedetään. Peruuta vetäminen napsauttamalla.`,
|
|
1009
|
+
"insertAfter": (args)=>`Lisää kohteen ${args.itemText} jälkeen`
|
|
1010
|
+
,
|
|
1011
|
+
"insertBefore": (args)=>`Lisää ennen kohdetta ${args.itemText}`
|
|
1012
|
+
,
|
|
1013
|
+
"insertBetween": (args)=>`Lisää kohteiden ${args.beforeItemText} ja ${args.afterItemText} väliin`
|
|
1014
|
+
};
|
|
806
1015
|
|
|
807
|
-
announce(this.formatMessage('dropCanceled'));
|
|
808
|
-
}
|
|
809
1016
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
1017
|
+
var $9e248ec27f7dc55f$exports = {};
|
|
1018
|
+
$9e248ec27f7dc55f$exports = {
|
|
1019
|
+
"dragDescriptionKeyboard": `Appuyez sur Entrée pour commencer le déplacement.`,
|
|
1020
|
+
"dragDescriptionTouch": `Touchez deux fois pour commencer le déplacement.`,
|
|
1021
|
+
"dragDescriptionVirtual": `Cliquez pour commencer le déplacement.`,
|
|
1022
|
+
"dragItem": (args)=>`Déplacer ${args.itemText}`
|
|
1023
|
+
,
|
|
1024
|
+
"dragSelectedItems": (args, formatter)=>`Déplacer ${formatter.plural(args.count, {
|
|
1025
|
+
one: ()=>`${formatter.number(args.count)} élément sélectionné`
|
|
1026
|
+
,
|
|
1027
|
+
other: ()=>`${formatter.number(args.count)} éléments sélectionnés`
|
|
1028
|
+
})}`
|
|
1029
|
+
,
|
|
1030
|
+
"dragStartedKeyboard": `Déplacement commencé. Appuyez sur Tabulation pour accéder à une cible de dépôt, puis appuyez sur Entrée pour déposer, ou appuyez sur Échap pour annuler.`,
|
|
1031
|
+
"dragStartedTouch": `Déplacement commencé. Accédez à une cible de dépôt, puis touchez deux fois pour déposer.`,
|
|
1032
|
+
"dragStartedVirtual": `Déplacement commencé. Accédez à une cible de dépôt, puis cliquez ou appuyez sur Entrée pour déposer.`,
|
|
1033
|
+
"dropCanceled": `Dépôt annulé.`,
|
|
1034
|
+
"dropComplete": `Dépôt terminé.`,
|
|
1035
|
+
"dropDescriptionKeyboard": `Appuyez sur Entrée pour déposer. Appuyez sur Échap pour annuler le déplacement.`,
|
|
1036
|
+
"dropDescriptionTouch": `Touchez deux fois pour déposer.`,
|
|
1037
|
+
"dropDescriptionVirtual": `Cliquez pour déposer.`,
|
|
1038
|
+
"dropIndicator": `indicateur de dépôt`,
|
|
1039
|
+
"dropOnItem": (args)=>`Déposer sur ${args.itemText}`
|
|
1040
|
+
,
|
|
1041
|
+
"dropOnRoot": `Déposer sur`,
|
|
1042
|
+
"endDragKeyboard": `Déplacement. Appuyez sur Entrée pour annuler le déplacement.`,
|
|
1043
|
+
"endDragTouch": `Déplacement. Touchez deux fois pour annuler le déplacement.`,
|
|
1044
|
+
"endDragVirtual": `Déplacement. Cliquez pour annuler le déplacement.`,
|
|
1045
|
+
"insertAfter": (args)=>`Insérer après ${args.itemText}`
|
|
1046
|
+
,
|
|
1047
|
+
"insertBefore": (args)=>`Insérer avant ${args.itemText}`
|
|
1048
|
+
,
|
|
1049
|
+
"insertBetween": (args)=>`Insérer entre ${args.beforeItemText} et ${args.afterItemText}`
|
|
1050
|
+
};
|
|
815
1051
|
|
|
816
|
-
if (typeof (item == null ? void 0 : item.getDropOperation) === 'function') {
|
|
817
|
-
let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
|
|
818
|
-
this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);
|
|
819
|
-
} else if (typeof this.currentDropTarget.getDropOperation === 'function') {
|
|
820
|
-
let types = $bc29619458500c186021634c18dc$export$getTypes(this.dragTarget.items);
|
|
821
|
-
this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);
|
|
822
|
-
} else {
|
|
823
|
-
// TODO: show menu ??
|
|
824
|
-
this.dropOperation = this.dragTarget.allowedDropOperations[0];
|
|
825
|
-
}
|
|
826
1052
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
1053
|
+
var $6387f7228f0de45e$exports = {};
|
|
1054
|
+
$6387f7228f0de45e$exports = {
|
|
1055
|
+
"dragDescriptionKeyboard": `הקש על Enter כדי להתחיל לגרור.`,
|
|
1056
|
+
"dragDescriptionTouch": `הקש פעמיים כדי להתחיל בגרירה.`,
|
|
1057
|
+
"dragDescriptionVirtual": `לחץ כדי להתחיל לגרור.`,
|
|
1058
|
+
"dragItem": (args)=>`גרור את ${args.itemText}`
|
|
1059
|
+
,
|
|
1060
|
+
"dragSelectedItems": (args, formatter)=>`גרור ${formatter.plural(args.count, {
|
|
1061
|
+
one: ()=>`פריט נבחר ${formatter.number(args.count)}`
|
|
1062
|
+
,
|
|
1063
|
+
other: ()=>`${formatter.number(args.count)} פריטים שנבחרו`
|
|
1064
|
+
})}`
|
|
1065
|
+
,
|
|
1066
|
+
"dragStartedKeyboard": `התחלת לגרור. הקש על Tab כדי לנווט לנקודת הגרירה ולאחר מכן הקש על Enter כדי לשחרר או על Escape כדי לבטל.`,
|
|
1067
|
+
"dragStartedTouch": `התחלת לגרור. נווט לנקודת השחרור ולאחר מכן הקש פעמיים כדי לשחרר.`,
|
|
1068
|
+
"dragStartedVirtual": `התחלת לגרור. נווט לנקודת השחרור ולאחר מכן לחץ או הקש על Enter כדי לשחרר.`,
|
|
1069
|
+
"dropCanceled": `השחרור בוטל.`,
|
|
1070
|
+
"dropComplete": `השחרור הושלם.`,
|
|
1071
|
+
"dropDescriptionKeyboard": `הקש על Enter כדי לשחרר. הקש על Escape כדי לבטל את הגרירה.`,
|
|
1072
|
+
"dropDescriptionTouch": `הקש פעמיים כדי לשחרר.`,
|
|
1073
|
+
"dropDescriptionVirtual": `לחץ כדי לשחרר.`,
|
|
1074
|
+
"dropIndicator": `מחוון שחרור`,
|
|
1075
|
+
"dropOnItem": (args)=>`שחרר על ${args.itemText}`
|
|
1076
|
+
,
|
|
1077
|
+
"dropOnRoot": `שחרר על`,
|
|
1078
|
+
"endDragKeyboard": `גורר. הקש על Enter כדי לבטל את הגרירה.`,
|
|
1079
|
+
"endDragTouch": `גורר. הקש פעמיים כדי לבטל את הגרירה.`,
|
|
1080
|
+
"endDragVirtual": `גורר. לחץ כדי לבטל את הגרירה.`,
|
|
1081
|
+
"insertAfter": (args)=>`הוסף אחרי ${args.itemText}`
|
|
1082
|
+
,
|
|
1083
|
+
"insertBefore": (args)=>`הוסף לפני ${args.itemText}`
|
|
1084
|
+
,
|
|
1085
|
+
"insertBetween": (args)=>`הוסף בין ${args.beforeItemText} לבין ${args.afterItemText}`
|
|
1086
|
+
};
|
|
842
1087
|
|
|
843
|
-
this.end();
|
|
844
|
-
announce(this.formatMessage('dropComplete'));
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
activate() {
|
|
848
|
-
if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {
|
|
849
|
-
let rect = this.currentDropTarget.element.getBoundingClientRect();
|
|
850
|
-
this.currentDropTarget.onDropActivate({
|
|
851
|
-
type: 'dropactivate',
|
|
852
|
-
x: rect.left + rect.width / 2,
|
|
853
|
-
y: rect.top + rect.height / 2
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
1088
|
|
|
858
|
-
}
|
|
1089
|
+
var $34a283567735f754$exports = {};
|
|
1090
|
+
$34a283567735f754$exports = {
|
|
1091
|
+
"dragDescriptionKeyboard": `Pritisnite Enter da biste počeli povlačiti.`,
|
|
1092
|
+
"dragDescriptionTouch": `Dvaput dodirnite da biste počeli povlačiti.`,
|
|
1093
|
+
"dragDescriptionVirtual": `Kliknite da biste počeli povlačiti.`,
|
|
1094
|
+
"dragItem": (args)=>`Povucite stavku ${args.itemText}`
|
|
1095
|
+
,
|
|
1096
|
+
"dragSelectedItems": (args, formatter)=>`Povucite ${formatter.plural(args.count, {
|
|
1097
|
+
one: ()=>`${formatter.number(args.count)} odabranu stavku`
|
|
1098
|
+
,
|
|
1099
|
+
other: ()=>`ovoliko odabranih stavki: ${formatter.number(args.count)}`
|
|
1100
|
+
})}`
|
|
1101
|
+
,
|
|
1102
|
+
"dragStartedKeyboard": `Počeli ste povlačiti. Pritisnite tipku tabulatora da biste došli do cilja ispuštanja, a zatim Enter da biste ispustili stavku ili Escape da biste prekinuli povlačenje.`,
|
|
1103
|
+
"dragStartedTouch": `Počeli ste povlačiti. Dođite do cilja ispuštanja, a zatim dvaput dodirnite da biste ispustili stavku.`,
|
|
1104
|
+
"dragStartedVirtual": `Počeli ste povlačiti. Dođite do cilja ispuštanja, a zatim kliknite ili pritisnite Enter da biste ispustili stavku.`,
|
|
1105
|
+
"dropCanceled": `Povlačenje je prekinuto.`,
|
|
1106
|
+
"dropComplete": `Ispuštanje je dovršeno.`,
|
|
1107
|
+
"dropDescriptionKeyboard": `Pritisnite Enter da biste ispustili stavku. Pritisnite Escape da biste prekinuli povlačenje.`,
|
|
1108
|
+
"dropDescriptionTouch": `Dvaput dodirnite da biste ispustili stavku.`,
|
|
1109
|
+
"dropDescriptionVirtual": `Kliknite da biste ispustili stavku.`,
|
|
1110
|
+
"dropIndicator": `pokazatelj ispuštanja`,
|
|
1111
|
+
"dropOnItem": (args)=>`Ispustite na stavku ${args.itemText}`
|
|
1112
|
+
,
|
|
1113
|
+
"dropOnRoot": `Ispustite na`,
|
|
1114
|
+
"endDragKeyboard": `Povlačenje. Pritisnite Enter da biste prekinuli povlačenje.`,
|
|
1115
|
+
"endDragTouch": `Povlačenje. Dvaput dodirnite da biste prekinuli povlačenje.`,
|
|
1116
|
+
"endDragVirtual": `Povlačenje. Kliknite da biste prekinuli povlačenje.`,
|
|
1117
|
+
"insertAfter": (args)=>`Umetnite iza stavke ${args.itemText}`
|
|
1118
|
+
,
|
|
1119
|
+
"insertBefore": (args)=>`Ispustite ispred stavke ${args.itemText}`
|
|
1120
|
+
,
|
|
1121
|
+
"insertBetween": (args)=>`Umetnite između stavki ${args.beforeItemText} i ${args.afterItemText}`
|
|
1122
|
+
};
|
|
859
1123
|
|
|
860
|
-
function $a75d092e5c30878812fba78e$var$findValidDropTargets(options) {
|
|
861
|
-
let types = $bc29619458500c186021634c18dc$export$getTypes(options.items);
|
|
862
|
-
return [...$a75d092e5c30878812fba78e$var$dropTargets.values()].filter(target => {
|
|
863
|
-
if (target.element.closest('[aria-hidden="true"]')) {
|
|
864
|
-
return false;
|
|
865
|
-
}
|
|
866
1124
|
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
1125
|
+
var $466590c56bee4342$exports = {};
|
|
1126
|
+
$466590c56bee4342$exports = {
|
|
1127
|
+
"dragDescriptionKeyboard": `Nyomja le az Enter billentyűt a húzás megkezdéséhez.`,
|
|
1128
|
+
"dragDescriptionTouch": `Koppintson duplán a húzás megkezdéséhez.`,
|
|
1129
|
+
"dragDescriptionVirtual": `Kattintson a húzás megkezdéséhez.`,
|
|
1130
|
+
"dragItem": (args)=>`${args.itemText} húzása`
|
|
1131
|
+
,
|
|
1132
|
+
"dragSelectedItems": (args, formatter)=>`${formatter.plural(args.count, {
|
|
1133
|
+
one: ()=>`${formatter.number(args.count)} kijelölt elem`
|
|
1134
|
+
,
|
|
1135
|
+
other: ()=>`${formatter.number(args.count)} kijelölt elem`
|
|
1136
|
+
})} húzása`
|
|
1137
|
+
,
|
|
1138
|
+
"dragStartedKeyboard": `Húzás megkezdve. Nyomja le a Tab billentyűt az elengedési célhoz navigálásához, majd nyomja le az Enter billentyűt az elengedéshez, vagy nyomja le az Escape billentyűt a megszakításhoz.`,
|
|
1139
|
+
"dragStartedTouch": `Húzás megkezdve. Navigáljon egy elengedési célhoz, majd koppintson duplán az elengedéshez.`,
|
|
1140
|
+
"dragStartedVirtual": `Húzás megkezdve. Navigáljon egy elengedési célhoz, majd kattintson vagy nyomja le az Enter billentyűt az elengedéshez.`,
|
|
1141
|
+
"dropCanceled": `Elengedés megszakítva.`,
|
|
1142
|
+
"dropComplete": `Elengedés teljesítve.`,
|
|
1143
|
+
"dropDescriptionKeyboard": `Nyomja le az Enter billentyűt az elengedéshez. Nyomja le az Escape billentyűt a húzás megszakításához.`,
|
|
1144
|
+
"dropDescriptionTouch": `Koppintson duplán az elengedéshez.`,
|
|
1145
|
+
"dropDescriptionVirtual": `Kattintson az elengedéshez.`,
|
|
1146
|
+
"dropIndicator": `elengedésjelző`,
|
|
1147
|
+
"dropOnItem": (args)=>`Elengedés erre: ${args.itemText}`
|
|
1148
|
+
,
|
|
1149
|
+
"dropOnRoot": `Elengedés erre:`,
|
|
1150
|
+
"endDragKeyboard": `Húzás folyamatban. Nyomja le az Enter billentyűt a húzás megszakításához.`,
|
|
1151
|
+
"endDragTouch": `Húzás folyamatban. Koppintson duplán a húzás megszakításához.`,
|
|
1152
|
+
"endDragVirtual": `Húzás folyamatban. Kattintson a húzás megszakításához.`,
|
|
1153
|
+
"insertAfter": (args)=>`Beszúrás ${args.itemText} után`
|
|
1154
|
+
,
|
|
1155
|
+
"insertBefore": (args)=>`Beszúrás ${args.itemText} elé`
|
|
1156
|
+
,
|
|
1157
|
+
"insertBetween": (args)=>`Beszúrás ${args.beforeItemText} és ${args.afterItemText} közé`
|
|
1158
|
+
};
|
|
870
1159
|
|
|
871
|
-
return true;
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
1160
|
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
1161
|
+
var $e013896dcb6a6884$exports = {};
|
|
1162
|
+
$e013896dcb6a6884$exports = {
|
|
1163
|
+
"dragDescriptionKeyboard": `Premi Invio per iniziare a trascinare.`,
|
|
1164
|
+
"dragDescriptionTouch": `Tocca due volte per iniziare a trascinare.`,
|
|
1165
|
+
"dragDescriptionVirtual": `Fai clic per iniziare a trascinare.`,
|
|
1166
|
+
"dragItem": (args)=>`Trascina ${args.itemText}`
|
|
1167
|
+
,
|
|
1168
|
+
"dragSelectedItems": (args, formatter)=>`Trascina ${formatter.plural(args.count, {
|
|
1169
|
+
one: ()=>`${formatter.number(args.count)} altro elemento selezionato`
|
|
1170
|
+
,
|
|
1171
|
+
other: ()=>`${formatter.number(args.count)} altri elementi selezionati`
|
|
1172
|
+
})}`
|
|
1173
|
+
,
|
|
1174
|
+
"dragStartedKeyboard": `Hai iniziato a trascinare. Premi Tab per arrivare sull’area di destinazione, quindi premi Invio per rilasciare o Esc per annullare.`,
|
|
1175
|
+
"dragStartedTouch": `Hai iniziato a trascinare. Arriva sull’area di destinazione, quindi tocca due volte per rilasciare.`,
|
|
1176
|
+
"dragStartedVirtual": `Hai iniziato a trascinare. Arriva sull’area di destinazione, quindi fai clic o premi Invio per rilasciare.`,
|
|
1177
|
+
"dropCanceled": `Rilascio annullato.`,
|
|
1178
|
+
"dropComplete": `Rilascio completato.`,
|
|
1179
|
+
"dropDescriptionKeyboard": `Premi Invio per rilasciare. Premi Esc per annullare.`,
|
|
1180
|
+
"dropDescriptionTouch": `Tocca due volte per rilasciare.`,
|
|
1181
|
+
"dropDescriptionVirtual": `Fai clic per rilasciare.`,
|
|
1182
|
+
"dropIndicator": `indicatore di rilascio`,
|
|
1183
|
+
"dropOnItem": (args)=>`Rilascia su ${args.itemText}`
|
|
1184
|
+
,
|
|
1185
|
+
"dropOnRoot": `Rilascia su`,
|
|
1186
|
+
"endDragKeyboard": `Trascinamento. Premi Invio per annullare.`,
|
|
1187
|
+
"endDragTouch": `Trascinamento. Tocca due volte per annullare.`,
|
|
1188
|
+
"endDragVirtual": `Trascinamento. Fai clic per annullare.`,
|
|
1189
|
+
"insertAfter": (args)=>`Inserisci dopo ${args.itemText}`
|
|
1190
|
+
,
|
|
1191
|
+
"insertBefore": (args)=>`Inserisci prima di ${args.itemText}`
|
|
1192
|
+
,
|
|
1193
|
+
"insertBetween": (args)=>`Inserisci tra ${args.beforeItemText} e ${args.afterItemText}`
|
|
895
1194
|
};
|
|
896
1195
|
|
|
897
|
-
function useDrag(options) {
|
|
898
|
-
let formatMessage = useMessageFormatter($faa3fd9c929dcb7fde0b75ef821032d3$var$intlMessages);
|
|
899
|
-
let state = useRef({
|
|
900
|
-
options,
|
|
901
|
-
x: 0,
|
|
902
|
-
y: 0
|
|
903
|
-
}).current;
|
|
904
|
-
state.options = options;
|
|
905
|
-
let [isDragging, setDragging] = useState(false);
|
|
906
|
-
|
|
907
|
-
let onDragStart = e => {
|
|
908
|
-
let items = options.getItems();
|
|
909
|
-
$bc29619458500c186021634c18dc$export$writeToDataTransfer(e.dataTransfer, items);
|
|
910
|
-
|
|
911
|
-
if (typeof options.getAllowedDropOperations === 'function') {
|
|
912
|
-
let allowedOperations = options.getAllowedDropOperations();
|
|
913
|
-
let allowed = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.none;
|
|
914
|
-
|
|
915
|
-
for (let operation of allowedOperations) {
|
|
916
|
-
allowed |= $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION[operation] || $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.none;
|
|
917
|
-
}
|
|
918
|
-
|
|
919
|
-
e.dataTransfer.effectAllowed = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$EFFECT_ALLOWED[allowed] || 'none';
|
|
920
|
-
} // If there is a renderPreview function, use it to render a custom preview image that will
|
|
921
|
-
// appear under the pointer while dragging. If not, the element itself is dragged by the browser.
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
if (typeof options.renderPreview === 'function') {
|
|
925
|
-
let preview = options.renderPreview(items);
|
|
926
|
-
|
|
927
|
-
if (preview) {
|
|
928
|
-
// Create an off-screen div to render the preview into.
|
|
929
|
-
let node = document.createElement('div');
|
|
930
|
-
node.style.zIndex = '-100';
|
|
931
|
-
node.style.position = 'absolute';
|
|
932
|
-
node.style.top = '0';
|
|
933
|
-
node.style.left = '-100000px';
|
|
934
|
-
document.body.appendChild(node); // Call renderPreview to get a JSX element, and render it into the div with React DOM.
|
|
935
|
-
|
|
936
|
-
_reactDom.render(preview, node); // Compute the offset that the preview will appear under the mouse.
|
|
937
|
-
// If possible, this is based on the point the user clicked on the target.
|
|
938
|
-
// If the preview is much smaller, then just use the center point of the preview.
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
let size = node.getBoundingClientRect();
|
|
942
|
-
let rect = e.currentTarget.getBoundingClientRect();
|
|
943
|
-
let x = e.clientX - rect.x;
|
|
944
|
-
let y = e.clientY - rect.y;
|
|
945
|
-
|
|
946
|
-
if (x > size.width || y > size.height) {
|
|
947
|
-
x = size.width / 2;
|
|
948
|
-
y = size.height / 2;
|
|
949
|
-
}
|
|
950
1196
|
|
|
951
|
-
|
|
1197
|
+
var $d6121e4246c6e502$exports = {};
|
|
1198
|
+
$d6121e4246c6e502$exports = {
|
|
1199
|
+
"dragDescriptionKeyboard": `Enter キーを押してドラッグを開始してください。`,
|
|
1200
|
+
"dragDescriptionTouch": `ダブルタップしてドラッグを開始します。`,
|
|
1201
|
+
"dragDescriptionVirtual": `クリックしてドラッグを開始します。`,
|
|
1202
|
+
"dragItem": (args)=>`${args.itemText} をドラッグ`
|
|
1203
|
+
,
|
|
1204
|
+
"dragSelectedItems": (args, formatter)=>`${formatter.plural(args.count, {
|
|
1205
|
+
one: ()=>`${formatter.number(args.count)} 個の選択項目`
|
|
1206
|
+
,
|
|
1207
|
+
other: ()=>`${formatter.number(args.count)} 個の選択項目`
|
|
1208
|
+
})} をドラッグ`
|
|
1209
|
+
,
|
|
1210
|
+
"dragStartedKeyboard": `ドラッグを開始します。Tab キーを押してドロップターゲットにいどうし、Enter キーを押してドロップするか、Esc キーを押してキャンセルします。`,
|
|
1211
|
+
"dragStartedTouch": `ドラッグを開始しました。ドロップのターゲットに移動し、ダブルタップしてドロップします。`,
|
|
1212
|
+
"dragStartedVirtual": `ドラッグを開始しました。ドロップのターゲットに移動し、クリックまたは Enter キーを押してドロップします。`,
|
|
1213
|
+
"dropCanceled": `ドロップがキャンセルされました。`,
|
|
1214
|
+
"dropComplete": `ドロップが完了しました。`,
|
|
1215
|
+
"dropDescriptionKeyboard": `Enter キーを押してドロップします。Esc キーを押してドラッグをキャンセルします。`,
|
|
1216
|
+
"dropDescriptionTouch": `ダブルタップしてドロップします。`,
|
|
1217
|
+
"dropDescriptionVirtual": `クリックしてドロップします。`,
|
|
1218
|
+
"dropIndicator": `ドロップインジケーター`,
|
|
1219
|
+
"dropOnItem": (args)=>`${args.itemText} にドロップ`
|
|
1220
|
+
,
|
|
1221
|
+
"dropOnRoot": `ドロップ場所`,
|
|
1222
|
+
"endDragKeyboard": `ドラッグしています。Enter キーを押してドラッグをキャンセルします。`,
|
|
1223
|
+
"endDragTouch": `ドラッグしています。ダブルタップしてドラッグをキャンセルします。`,
|
|
1224
|
+
"endDragVirtual": `ドラッグしています。クリックしてドラッグをキャンセルします。`,
|
|
1225
|
+
"insertAfter": (args)=>`${args.itemText} の後に挿入`
|
|
1226
|
+
,
|
|
1227
|
+
"insertBefore": (args)=>`${args.itemText} の前に挿入`
|
|
1228
|
+
,
|
|
1229
|
+
"insertBetween": (args)=>`${args.beforeItemText} と ${args.afterItemText} の間に挿入`
|
|
1230
|
+
};
|
|
952
1231
|
|
|
953
|
-
requestAnimationFrame(() => {
|
|
954
|
-
document.body.removeChild(node);
|
|
955
|
-
});
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
1232
|
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
1233
|
+
var $cf48a963c482dcba$exports = {};
|
|
1234
|
+
$cf48a963c482dcba$exports = {
|
|
1235
|
+
"dragDescriptionKeyboard": `드래그를 시작하려면 Enter를 누르세요.`,
|
|
1236
|
+
"dragDescriptionTouch": `드래그를 시작하려면 더블 탭하세요.`,
|
|
1237
|
+
"dragDescriptionVirtual": `드래그를 시작하려면 클릭하세요.`,
|
|
1238
|
+
"dragItem": (args)=>`${args.itemText} 드래그`
|
|
1239
|
+
,
|
|
1240
|
+
"dragSelectedItems": (args, formatter)=>`${formatter.plural(args.count, {
|
|
1241
|
+
one: ()=>`${formatter.number(args.count)}개 선택 항목`
|
|
1242
|
+
,
|
|
1243
|
+
other: ()=>`${formatter.number(args.count)}개 선택 항목`
|
|
1244
|
+
})} 드래그`
|
|
1245
|
+
,
|
|
1246
|
+
"dragStartedKeyboard": `드래그가 시작되었습니다. Tab을 눌러 드롭 대상으로 이동한 다음 Enter를 눌러 드롭하거나 Esc를 눌러 취소하세요.`,
|
|
1247
|
+
"dragStartedTouch": `드래그가 시작되었습니다. 드롭 대상으로 이동한 다음 더블 탭하여 드롭하세요.`,
|
|
1248
|
+
"dragStartedVirtual": `드래그가 시작되었습니다. 드롭 대상으로 이동한 다음 클릭하거나 Enter를 눌러 드롭하세요.`,
|
|
1249
|
+
"dropCanceled": `드롭이 취소되었습니다.`,
|
|
1250
|
+
"dropComplete": `드롭이 완료되었습니다.`,
|
|
1251
|
+
"dropDescriptionKeyboard": `드롭하려면 Enter를 누르세요. 드래그를 취소하려면 Esc를 누르세요.`,
|
|
1252
|
+
"dropDescriptionTouch": `더블 탭하여 드롭하세요.`,
|
|
1253
|
+
"dropDescriptionVirtual": `드롭하려면 클릭하세요.`,
|
|
1254
|
+
"dropIndicator": `드롭 표시기`,
|
|
1255
|
+
"dropOnItem": (args)=>`${args.itemText}에 드롭`
|
|
1256
|
+
,
|
|
1257
|
+
"dropOnRoot": `드롭 대상`,
|
|
1258
|
+
"endDragKeyboard": `드래그 중입니다. 드래그를 취소하려면 Enter를 누르세요.`,
|
|
1259
|
+
"endDragTouch": `드래그 중입니다. 드래그를 취소하려면 더블 탭하세요.`,
|
|
1260
|
+
"endDragVirtual": `드래그 중입니다. 드래그를 취소하려면 클릭하세요.`,
|
|
1261
|
+
"insertAfter": (args)=>`${args.itemText} 이후에 삽입`
|
|
1262
|
+
,
|
|
1263
|
+
"insertBefore": (args)=>`${args.itemText} 이전에 삽입`
|
|
1264
|
+
,
|
|
1265
|
+
"insertBetween": (args)=>`${args.beforeItemText} 및 ${args.afterItemText} 사이에 삽입`
|
|
1266
|
+
};
|
|
966
1267
|
|
|
967
|
-
state.x = e.clientX;
|
|
968
|
-
state.y = e.clientY; // Wait a frame before we set dragging to true so that the browser has time to
|
|
969
|
-
// render the preview image before we update the element that has been dragged.
|
|
970
1268
|
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1269
|
+
var $b156071f04f1c899$exports = {};
|
|
1270
|
+
$b156071f04f1c899$exports = {
|
|
1271
|
+
"dragDescriptionKeyboard": `Paspauskite „Enter“, kad pradėtumėte vilkti.`,
|
|
1272
|
+
"dragDescriptionTouch": `Palieskite dukart, kad pradėtumėte vilkti.`,
|
|
1273
|
+
"dragDescriptionVirtual": `Spustelėkite, kad pradėtumėte vilkti.`,
|
|
1274
|
+
"dragItem": (args)=>`Vilkti ${args.itemText}`
|
|
1275
|
+
,
|
|
1276
|
+
"dragSelectedItems": (args, formatter)=>`Vilkti ${formatter.plural(args.count, {
|
|
1277
|
+
one: ()=>`${formatter.number(args.count)} pasirinktą elementą`
|
|
1278
|
+
,
|
|
1279
|
+
other: ()=>`${formatter.number(args.count)} pasirinktus elementus`
|
|
1280
|
+
})}`
|
|
1281
|
+
,
|
|
1282
|
+
"dragStartedKeyboard": `Pradėta vilkti. Paspauskite „Tab“, kad pereitumėte į tiesioginę paskirties vietą, tada paspauskite „Enter“, kad numestumėte, arba „Escape“, kad atšauktumėte.`,
|
|
1283
|
+
"dragStartedTouch": `Pradėta vilkti. Eikite į tiesioginę paskirties vietą, tada palieskite dukart, kad numestumėte.`,
|
|
1284
|
+
"dragStartedVirtual": `Pradėta vilkti. Eikite į tiesioginę paskirties vietą ir spustelėkite arba paspauskite „Enter“, kad numestumėte.`,
|
|
1285
|
+
"dropCanceled": `Numetimas atšauktas.`,
|
|
1286
|
+
"dropComplete": `Numesta.`,
|
|
1287
|
+
"dropDescriptionKeyboard": `Paspauskite „Enter“, kad numestumėte. Paspauskite „Escape“, kad atšauktumėte vilkimą.`,
|
|
1288
|
+
"dropDescriptionTouch": `Palieskite dukart, kad numestumėte.`,
|
|
1289
|
+
"dropDescriptionVirtual": `Spustelėkite, kad numestumėte.`,
|
|
1290
|
+
"dropIndicator": `numetimo indikatorius`,
|
|
1291
|
+
"dropOnItem": (args)=>`Numesti ant ${args.itemText}`
|
|
1292
|
+
,
|
|
1293
|
+
"dropOnRoot": `Numesti ant`,
|
|
1294
|
+
"endDragKeyboard": `Velkama. Paspauskite „Enter“, kad atšauktumėte vilkimą.`,
|
|
1295
|
+
"endDragTouch": `Velkama. Spustelėkite dukart, kad atšauktumėte vilkimą.`,
|
|
1296
|
+
"endDragVirtual": `Velkama. Spustelėkite, kad atšauktumėte vilkimą.`,
|
|
1297
|
+
"insertAfter": (args)=>`Įterpti po ${args.itemText}`
|
|
1298
|
+
,
|
|
1299
|
+
"insertBefore": (args)=>`Įterpti prieš ${args.itemText}`
|
|
1300
|
+
,
|
|
1301
|
+
"insertBetween": (args)=>`Įterpti tarp ${args.beforeItemText} ir ${args.afterItemText}`
|
|
1302
|
+
};
|
|
975
1303
|
|
|
976
|
-
let onDrag = e => {
|
|
977
|
-
if (e.clientX === state.x && e.clientY === state.y) {
|
|
978
|
-
return;
|
|
979
|
-
}
|
|
980
1304
|
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1305
|
+
var $5300be8ef98d39fa$exports = {};
|
|
1306
|
+
$5300be8ef98d39fa$exports = {
|
|
1307
|
+
"dragDescriptionKeyboard": `Nospiediet Enter, lai sāktu vilkšanu.`,
|
|
1308
|
+
"dragDescriptionTouch": `Veiciet dubultskārienu, lai sāktu vilkšanu.`,
|
|
1309
|
+
"dragDescriptionVirtual": `Noklikšķiniet, lai sāktu vilkšanu.`,
|
|
1310
|
+
"dragItem": (args)=>`Velciet ${args.itemText}`
|
|
1311
|
+
,
|
|
1312
|
+
"dragSelectedItems": (args, formatter)=>`Velciet ${formatter.plural(args.count, {
|
|
1313
|
+
one: ()=>`${formatter.number(args.count)} atlasīto vienumu`
|
|
1314
|
+
,
|
|
1315
|
+
other: ()=>`${formatter.number(args.count)} atlasītos vienumus`
|
|
1316
|
+
})}`
|
|
1317
|
+
,
|
|
1318
|
+
"dragStartedKeyboard": `Uzsākta vilkšana. Nospiediet taustiņu Tab, lai pārietu uz nomešanas mērķi, pēc tam nospiediet Enter, lai nomestu, vai nospiediet Escape, lai atceltu.`,
|
|
1319
|
+
"dragStartedTouch": `Uzsākta vilkšana. Pārejiet uz nomešanas mērķi, pēc tam veiciet dubultskārienu, lai nomestu.`,
|
|
1320
|
+
"dragStartedVirtual": `Uzsākta vilkšana. Pārejiet uz nomešanas mērķi, pēc tam nospiediet Enter, lai nomestu.`,
|
|
1321
|
+
"dropCanceled": `Nomešana atcelta.`,
|
|
1322
|
+
"dropComplete": `Nomešana pabeigta.`,
|
|
1323
|
+
"dropDescriptionKeyboard": `Nospiediet Enter, lai nomestu. Nospiediet Escape, lai atceltu vilkšanu.`,
|
|
1324
|
+
"dropDescriptionTouch": `Veiciet dubultskārienu, lai nomestu.`,
|
|
1325
|
+
"dropDescriptionVirtual": `Noklikšķiniet, lai nomestu.`,
|
|
1326
|
+
"dropIndicator": `nomešanas indikators`,
|
|
1327
|
+
"dropOnItem": (args)=>`Nometiet uz ${args.itemText}`
|
|
1328
|
+
,
|
|
1329
|
+
"dropOnRoot": `Nometiet uz`,
|
|
1330
|
+
"endDragKeyboard": `Notiek vilkšana. Nospiediet Enter, lai atceltu vilkšanu.`,
|
|
1331
|
+
"endDragTouch": `Notiek vilkšana. Veiciet dubultskārienu, lai atceltu vilkšanu.`,
|
|
1332
|
+
"endDragVirtual": `Notiek vilkšana. Noklikšķiniet, lai atceltu vilkšanu.`,
|
|
1333
|
+
"insertAfter": (args)=>`Ievietojiet pēc ${args.itemText}`
|
|
1334
|
+
,
|
|
1335
|
+
"insertBefore": (args)=>`Ievietojiet pirms ${args.itemText}`
|
|
1336
|
+
,
|
|
1337
|
+
"insertBetween": (args)=>`Ievietojiet starp ${args.beforeItemText} un ${args.afterItemText}`
|
|
1338
|
+
};
|
|
988
1339
|
|
|
989
|
-
state.x = e.clientX;
|
|
990
|
-
state.y = e.clientY;
|
|
991
|
-
};
|
|
992
|
-
|
|
993
|
-
let onDragEnd = e => {
|
|
994
|
-
if (typeof options.onDragEnd === 'function') {
|
|
995
|
-
options.onDragEnd({
|
|
996
|
-
type: 'dragend',
|
|
997
|
-
x: e.clientX,
|
|
998
|
-
y: e.clientY,
|
|
999
|
-
dropOperation: $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION[e.dataTransfer.dropEffect]
|
|
1000
|
-
});
|
|
1001
|
-
}
|
|
1002
1340
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1341
|
+
var $7484477aad199932$exports = {};
|
|
1342
|
+
$7484477aad199932$exports = {
|
|
1343
|
+
"dragDescriptionKeyboard": `Trykk på Enter for å begynne å dra.`,
|
|
1344
|
+
"dragDescriptionTouch": `Dobbelttrykk for å begynne å dra.`,
|
|
1345
|
+
"dragDescriptionVirtual": `Klikk for å begynne å dra.`,
|
|
1346
|
+
"dragItem": (args)=>`Dra ${args.itemText}`
|
|
1347
|
+
,
|
|
1348
|
+
"dragSelectedItems": (args, formatter)=>`Dra ${formatter.plural(args.count, {
|
|
1349
|
+
one: ()=>`${formatter.number(args.count)} merket element`
|
|
1350
|
+
,
|
|
1351
|
+
other: ()=>`${formatter.number(args.count)} merkede elementer`
|
|
1352
|
+
})}`
|
|
1353
|
+
,
|
|
1354
|
+
"dragStartedKeyboard": `Begynte å dra. Trykk på Tab for å navigere til et mål, og trykk deretter på Enter for å slippe eller på Esc for å avbryte.`,
|
|
1355
|
+
"dragStartedTouch": `Begynte å dra. Naviger til et mål, og dobbelttrykk for å slippe.`,
|
|
1356
|
+
"dragStartedVirtual": `Begynte å dra. Naviger til et mål, og klikk eller trykk på Enter for å slippe.`,
|
|
1357
|
+
"dropCanceled": `Avbrøt slipping.`,
|
|
1358
|
+
"dropComplete": `Slippingen er fullført.`,
|
|
1359
|
+
"dropDescriptionKeyboard": `Trykk på Enter for å slippe. Trykk på Esc hvis du vil avbryte draingen.`,
|
|
1360
|
+
"dropDescriptionTouch": `Dobbelttrykk for å slippe.`,
|
|
1361
|
+
"dropDescriptionVirtual": `Klikk for å slippe.`,
|
|
1362
|
+
"dropIndicator": `slippeindikator`,
|
|
1363
|
+
"dropOnItem": (args)=>`Slipp på ${args.itemText}`
|
|
1364
|
+
,
|
|
1365
|
+
"dropOnRoot": `Slipp på`,
|
|
1366
|
+
"endDragKeyboard": `Drar. Trykk på Enter hvis du vil avbryte.`,
|
|
1367
|
+
"endDragTouch": `Drar. Dobbelttrykk hvis du vil avbryte.`,
|
|
1368
|
+
"endDragVirtual": `Drar. Klikk hvis du vil avbryte.`,
|
|
1369
|
+
"insertAfter": (args)=>`Sett inn etter ${args.itemText}`
|
|
1370
|
+
,
|
|
1371
|
+
"insertBefore": (args)=>`Sett inn før ${args.itemText}`
|
|
1372
|
+
,
|
|
1373
|
+
"insertBetween": (args)=>`Sett inn mellom ${args.beforeItemText} og ${args.afterItemText}`
|
|
1374
|
+
};
|
|
1005
1375
|
|
|
1006
|
-
let onPress = e => {
|
|
1007
|
-
if (e.pointerType !== 'keyboard' && e.pointerType !== 'virtual') {
|
|
1008
|
-
return;
|
|
1009
|
-
}
|
|
1010
1376
|
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1377
|
+
var $968e09cb41d6cd76$exports = {};
|
|
1378
|
+
$968e09cb41d6cd76$exports = {
|
|
1379
|
+
"dragDescriptionKeyboard": `Druk op Enter om te slepen.`,
|
|
1380
|
+
"dragDescriptionTouch": `Dubbeltik om te slepen.`,
|
|
1381
|
+
"dragDescriptionVirtual": `Klik om met slepen te starten.`,
|
|
1382
|
+
"dragItem": (args)=>`${args.itemText} slepen`
|
|
1383
|
+
,
|
|
1384
|
+
"dragSelectedItems": (args, formatter)=>`${formatter.plural(args.count, {
|
|
1385
|
+
one: ()=>`${formatter.number(args.count)} geselecteerd item`
|
|
1386
|
+
,
|
|
1387
|
+
other: ()=>`${formatter.number(args.count)} geselecteerde items`
|
|
1388
|
+
})} slepen`
|
|
1389
|
+
,
|
|
1390
|
+
"dragStartedKeyboard": `Begonnen met slepen. Druk op Tab om naar een locatie te gaan. Druk dan op Enter om neer te zetten, of op Esc om te annuleren.`,
|
|
1391
|
+
"dragStartedTouch": `Begonnen met slepen. Ga naar de gewenste locatie en dubbeltik om neer te zetten.`,
|
|
1392
|
+
"dragStartedVirtual": `Begonnen met slepen. Ga naar de gewenste locatie en klik of druk op Enter om neer te zetten.`,
|
|
1393
|
+
"dropCanceled": `Neerzetten geannuleerd.`,
|
|
1394
|
+
"dropComplete": `Neerzetten voltooid.`,
|
|
1395
|
+
"dropDescriptionKeyboard": `Druk op Enter om neer te zetten. Druk op Esc om het slepen te annuleren.`,
|
|
1396
|
+
"dropDescriptionTouch": `Dubbeltik om neer te zetten.`,
|
|
1397
|
+
"dropDescriptionVirtual": `Klik om neer te zetten.`,
|
|
1398
|
+
"dropIndicator": `aanwijzer voor neerzetten`,
|
|
1399
|
+
"dropOnItem": (args)=>`Neerzetten op ${args.itemText}`
|
|
1400
|
+
,
|
|
1401
|
+
"dropOnRoot": `Neerzetten op`,
|
|
1402
|
+
"endDragKeyboard": `Bezig met slepen. Druk op Enter om te annuleren.`,
|
|
1403
|
+
"endDragTouch": `Bezig met slepen. Dubbeltik om te annuleren.`,
|
|
1404
|
+
"endDragVirtual": `Bezig met slepen. Klik om te annuleren.`,
|
|
1405
|
+
"insertAfter": (args)=>`Plaatsen na ${args.itemText}`
|
|
1406
|
+
,
|
|
1407
|
+
"insertBefore": (args)=>`Plaatsen vóór ${args.itemText}`
|
|
1408
|
+
,
|
|
1409
|
+
"insertBetween": (args)=>`Plaatsen tussen ${args.beforeItemText} en ${args.afterItemText}`
|
|
1410
|
+
};
|
|
1019
1411
|
|
|
1020
|
-
$a75d092e5c30878812fba78e$export$beginDragging({
|
|
1021
|
-
element: e.target,
|
|
1022
|
-
items: state.options.getItems(),
|
|
1023
|
-
allowedDropOperations: typeof state.options.getAllowedDropOperations === 'function' ? state.options.getAllowedDropOperations() : ['move', 'copy', 'link'],
|
|
1024
1412
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1413
|
+
var $0c2c6c954dd638d7$exports = {};
|
|
1414
|
+
$0c2c6c954dd638d7$exports = {
|
|
1415
|
+
"dragDescriptionKeyboard": `Naciśnij Enter, aby rozpocząć przeciąganie.`,
|
|
1416
|
+
"dragDescriptionTouch": `Dotknij dwukrotnie, aby rozpocząć przeciąganie.`,
|
|
1417
|
+
"dragDescriptionVirtual": `Kliknij, aby rozpocząć przeciąganie.`,
|
|
1418
|
+
"dragItem": (args)=>`Przeciągnij ${args.itemText}`
|
|
1419
|
+
,
|
|
1420
|
+
"dragSelectedItems": (args, formatter)=>`Przeciągnij ${formatter.plural(args.count, {
|
|
1421
|
+
one: ()=>`${formatter.number(args.count)} wybrany element`
|
|
1422
|
+
,
|
|
1423
|
+
other: ()=>`${formatter.number(args.count)} wybranych elementów`
|
|
1424
|
+
})}`
|
|
1425
|
+
,
|
|
1426
|
+
"dragStartedKeyboard": `Rozpoczęto przeciąganie. Naciśnij Tab, aby wybrać miejsce docelowe, a następnie naciśnij Enter, aby upuścić, lub Escape, aby anulować.`,
|
|
1427
|
+
"dragStartedTouch": `Rozpoczęto przeciąganie. Wybierz miejsce, w którym chcesz upuścić element, a następnie dotknij dwukrotnie, aby upuścić.F`,
|
|
1428
|
+
"dragStartedVirtual": `Rozpoczęto przeciąganie. Wybierz miejsce, w którym chcesz upuścić element, a następnie kliknij lub naciśnij Enter, aby upuścić.`,
|
|
1429
|
+
"dropCanceled": `Anulowano upuszczenie.`,
|
|
1430
|
+
"dropComplete": `Zakończono upuszczanie.`,
|
|
1431
|
+
"dropDescriptionKeyboard": `Naciśnij Enter, aby upuścić. Naciśnij Escape, aby anulować przeciągnięcie.`,
|
|
1432
|
+
"dropDescriptionTouch": `Dotknij dwukrotnie, aby upuścić.`,
|
|
1433
|
+
"dropDescriptionVirtual": `Kliknij, aby upuścić.`,
|
|
1434
|
+
"dropIndicator": `wskaźnik upuszczenia`,
|
|
1435
|
+
"dropOnItem": (args)=>`Upuść na ${args.itemText}`
|
|
1436
|
+
,
|
|
1437
|
+
"dropOnRoot": `Upuść`,
|
|
1438
|
+
"endDragKeyboard": `Przeciąganie. Naciśnij Enter, aby anulować przeciągnięcie.`,
|
|
1439
|
+
"endDragTouch": `Przeciąganie. Kliknij dwukrotnie, aby anulować przeciągnięcie.`,
|
|
1440
|
+
"endDragVirtual": `Przeciąganie. Kliknij, aby anulować przeciąganie.`,
|
|
1441
|
+
"insertAfter": (args)=>`Umieść za ${args.itemText}`
|
|
1442
|
+
,
|
|
1443
|
+
"insertBefore": (args)=>`Umieść przed ${args.itemText}`
|
|
1444
|
+
,
|
|
1445
|
+
"insertBetween": (args)=>`Umieść między ${args.beforeItemText} i ${args.afterItemText}`
|
|
1446
|
+
};
|
|
1027
1447
|
|
|
1028
|
-
if (typeof state.options.onDragEnd === 'function') {
|
|
1029
|
-
state.options.onDragEnd(e);
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
}, formatMessage);
|
|
1034
|
-
setDragging(true);
|
|
1035
|
-
};
|
|
1036
|
-
|
|
1037
|
-
let modality = $bc29619458500c186021634c18dc$export$useDragModality();
|
|
1038
|
-
let descriptionProps = useDescription(formatMessage(!isDragging ? $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES[modality].start : $faa3fd9c929dcb7fde0b75ef821032d3$var$MESSAGES[modality].end));
|
|
1039
|
-
return {
|
|
1040
|
-
dragProps: {
|
|
1041
|
-
draggable: 'true',
|
|
1042
|
-
onDragStart,
|
|
1043
|
-
onDrag,
|
|
1044
|
-
onDragEnd
|
|
1045
|
-
},
|
|
1046
|
-
dragButtonProps: _babelRuntimeHelpersExtends({}, descriptionProps, {
|
|
1047
|
-
onPress
|
|
1048
|
-
}),
|
|
1049
|
-
isDragging
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
1448
|
|
|
1053
|
-
exports
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1449
|
+
var $db510f249c1f2e00$exports = {};
|
|
1450
|
+
$db510f249c1f2e00$exports = {
|
|
1451
|
+
"dragDescriptionKeyboard": `Pressione Enter para começar a arrastar.`,
|
|
1452
|
+
"dragDescriptionTouch": `Toque duas vezes para começar a arrastar.`,
|
|
1453
|
+
"dragDescriptionVirtual": `Clique para começar a arrastar.`,
|
|
1454
|
+
"dragItem": (args)=>`Arrastar ${args.itemText}`
|
|
1455
|
+
,
|
|
1456
|
+
"dragSelectedItems": (args, formatter)=>`Arrastar ${formatter.plural(args.count, {
|
|
1457
|
+
one: ()=>`${formatter.number(args.count)} item selecionado`
|
|
1458
|
+
,
|
|
1459
|
+
other: ()=>`${formatter.number(args.count)} itens selecionados`
|
|
1460
|
+
})}`
|
|
1461
|
+
,
|
|
1462
|
+
"dragStartedKeyboard": `Comece a arrastar. Pressione Tab para navegar até um alvo e, em seguida, pressione Enter para soltar ou pressione Escape para cancelar.`,
|
|
1463
|
+
"dragStartedTouch": `Comece a arrastar. Navegue até um alvo e toque duas vezes para soltar.`,
|
|
1464
|
+
"dragStartedVirtual": `Comece a arrastar. Navegue até um alvo e clique ou pressione Enter para soltar.`,
|
|
1465
|
+
"dropCanceled": `Liberação cancelada.`,
|
|
1466
|
+
"dropComplete": `Liberação concluída.`,
|
|
1467
|
+
"dropDescriptionKeyboard": `Pressione Enter para soltar. Pressione Escape para cancelar.`,
|
|
1468
|
+
"dropDescriptionTouch": `Toque duas vezes para soltar.`,
|
|
1469
|
+
"dropDescriptionVirtual": `Clique para soltar.`,
|
|
1470
|
+
"dropIndicator": `indicador de liberação`,
|
|
1471
|
+
"dropOnItem": (args)=>`Soltar em ${args.itemText}`
|
|
1472
|
+
,
|
|
1473
|
+
"dropOnRoot": `Soltar`,
|
|
1474
|
+
"endDragKeyboard": `Arrastando. Pressione Enter para cancelar.`,
|
|
1475
|
+
"endDragTouch": `Arrastando. Toque duas vezes para cancelar.`,
|
|
1476
|
+
"endDragVirtual": `Arrastando. Clique para cancelar.`,
|
|
1477
|
+
"insertAfter": (args)=>`Inserir após ${args.itemText}`
|
|
1478
|
+
,
|
|
1479
|
+
"insertBefore": (args)=>`Inserir antes de ${args.itemText}`
|
|
1480
|
+
,
|
|
1481
|
+
"insertBetween": (args)=>`Inserir entre ${args.beforeItemText} e ${args.afterItemText}`
|
|
1062
1482
|
};
|
|
1063
1483
|
|
|
1064
|
-
function $ca75888e192994dbb11ae05e54$export$useVirtualDrop() {
|
|
1065
|
-
let formatMessage = useMessageFormatter($ca75888e192994dbb11ae05e54$var$intlMessages);
|
|
1066
|
-
let modality = $bc29619458500c186021634c18dc$export$useDragModality();
|
|
1067
|
-
let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
|
|
1068
|
-
let descriptionProps = useDescription(dragSession ? formatMessage($ca75888e192994dbb11ae05e54$var$MESSAGES[modality]) : '');
|
|
1069
|
-
return {
|
|
1070
|
-
dropProps: _babelRuntimeHelpersExtends({}, descriptionProps, {
|
|
1071
|
-
// Mobile Safari does not properly bubble click events on elements except links or inputs
|
|
1072
|
-
// unless there is an onclick handler bound directly to the element itself. By adding this
|
|
1073
|
-
// handler, React will take care of adding that for us, and we are able to handle document
|
|
1074
|
-
// level click events in the DragManager.
|
|
1075
|
-
// See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
|
|
1076
|
-
onClick: () => {}
|
|
1077
|
-
})
|
|
1078
|
-
};
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
const $db0591c71140b157a950096251935c$var$DROP_ACTIVATE_TIMEOUT = 800;
|
|
1082
1484
|
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1485
|
+
var $d734686296d37387$exports = {};
|
|
1486
|
+
$d734686296d37387$exports = {
|
|
1487
|
+
"dragDescriptionKeyboard": `Prima Enter para iniciar o arrasto.`,
|
|
1488
|
+
"dragDescriptionTouch": `Faça duplo toque para começar a arrastar.`,
|
|
1489
|
+
"dragDescriptionVirtual": `Clique para iniciar o arrasto.`,
|
|
1490
|
+
"dragItem": (args)=>`Arrastar ${args.itemText}`
|
|
1491
|
+
,
|
|
1492
|
+
"dragSelectedItems": (args, formatter)=>`Arrastar ${formatter.plural(args.count, {
|
|
1493
|
+
one: ()=>`${formatter.number(args.count)} item selecionado`
|
|
1494
|
+
,
|
|
1495
|
+
other: ()=>`${formatter.number(args.count)} itens selecionados`
|
|
1496
|
+
})}`
|
|
1497
|
+
,
|
|
1498
|
+
"dragStartedKeyboard": `Arrasto iniciado. Prima a tecla de tabulação para navegar para um destino para largar, e em seguida prima Enter para largar ou prima Escape para cancelar.`,
|
|
1499
|
+
"dragStartedTouch": `Arrasto iniciado. Navegue para um destino para largar, e em seguida faça duplo toque para largar.`,
|
|
1500
|
+
"dragStartedVirtual": `Arrasto iniciado. Navegue para um destino para largar, e em seguida clique ou prima Enter para largar.`,
|
|
1501
|
+
"dropCanceled": `Largar cancelado.`,
|
|
1502
|
+
"dropComplete": `Largar completo.`,
|
|
1503
|
+
"dropDescriptionKeyboard": `Prima Enter para largar. Prima Escape para cancelar o arrasto.`,
|
|
1504
|
+
"dropDescriptionTouch": `Faça duplo toque para largar.`,
|
|
1505
|
+
"dropDescriptionVirtual": `Clique para largar.`,
|
|
1506
|
+
"dropIndicator": `Indicador de largar`,
|
|
1507
|
+
"dropOnItem": (args)=>`Largar em ${args.itemText}`
|
|
1508
|
+
,
|
|
1509
|
+
"dropOnRoot": `Largar em`,
|
|
1510
|
+
"endDragKeyboard": `A arrastar. Prima Enter para cancelar o arrasto.`,
|
|
1511
|
+
"endDragTouch": `A arrastar. Faça duplo toque para cancelar o arrasto.`,
|
|
1512
|
+
"endDragVirtual": `A arrastar. Clique para cancelar o arrasto.`,
|
|
1513
|
+
"insertAfter": (args)=>`Inserir depois de ${args.itemText}`
|
|
1514
|
+
,
|
|
1515
|
+
"insertBefore": (args)=>`Inserir antes de ${args.itemText}`
|
|
1516
|
+
,
|
|
1517
|
+
"insertBetween": (args)=>`Inserir entre ${args.beforeItemText} e ${args.afterItemText}`
|
|
1518
|
+
};
|
|
1092
1519
|
|
|
1093
|
-
let onDragOver = e => {
|
|
1094
|
-
e.preventDefault();
|
|
1095
1520
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1521
|
+
var $d239d4998a584a23$exports = {};
|
|
1522
|
+
$d239d4998a584a23$exports = {
|
|
1523
|
+
"dragDescriptionKeyboard": `Apăsați pe Enter pentru a începe glisarea.`,
|
|
1524
|
+
"dragDescriptionTouch": `Atingeți de două ori pentru a începe să glisați.`,
|
|
1525
|
+
"dragDescriptionVirtual": `Faceți clic pentru a începe glisarea.`,
|
|
1526
|
+
"dragItem": (args)=>`Glisați ${args.itemText}`
|
|
1527
|
+
,
|
|
1528
|
+
"dragSelectedItems": (args, formatter)=>`Glisați ${formatter.plural(args.count, {
|
|
1529
|
+
one: ()=>`${formatter.number(args.count)} element selectat`
|
|
1530
|
+
,
|
|
1531
|
+
other: ()=>`${formatter.number(args.count)} elemente selectate`
|
|
1532
|
+
})}`
|
|
1533
|
+
,
|
|
1534
|
+
"dragStartedKeyboard": `A început glisarea. Apăsați pe Tab pentru a naviga la o țintă de fixare, apoi apăsați pe Enter pentru a fixa sau apăsați pe Escape pentru a anula glisarea.`,
|
|
1535
|
+
"dragStartedTouch": `A început glisarea. Navigați la o țintă de fixare, apoi atingeți de două ori pentru a fixa.`,
|
|
1536
|
+
"dragStartedVirtual": `A început glisarea. Navigați la o țintă de fixare, apoi faceți clic sau apăsați pe Enter pentru a fixa.`,
|
|
1537
|
+
"dropCanceled": `Fixare anulată.`,
|
|
1538
|
+
"dropComplete": `Fixare finalizată.`,
|
|
1539
|
+
"dropDescriptionKeyboard": `Apăsați pe Enter pentru a fixa. Apăsați pe Escape pentru a anula glisarea.`,
|
|
1540
|
+
"dropDescriptionTouch": `Atingeți de două ori pentru a fixa.`,
|
|
1541
|
+
"dropDescriptionVirtual": `Faceți clic pentru a fixa.`,
|
|
1542
|
+
"dropIndicator": `indicator de fixare`,
|
|
1543
|
+
"dropOnItem": (args)=>`Fixați pe ${args.itemText}`
|
|
1544
|
+
,
|
|
1545
|
+
"dropOnRoot": `Fixare pe`,
|
|
1546
|
+
"endDragKeyboard": `Se glisează. Apăsați pe Enter pentru a anula glisarea.`,
|
|
1547
|
+
"endDragTouch": `Se glisează. Atingeți de două ori pentru a anula glisarea.`,
|
|
1548
|
+
"endDragVirtual": `Se glisează. Faceți clic pentru a anula glisarea.`,
|
|
1549
|
+
"insertAfter": (args)=>`Inserați după ${args.itemText}`
|
|
1550
|
+
,
|
|
1551
|
+
"insertBefore": (args)=>`Inserați înainte de ${args.itemText}`
|
|
1552
|
+
,
|
|
1553
|
+
"insertBetween": (args)=>`Inserați între ${args.beforeItemText} și ${args.afterItemText}`
|
|
1554
|
+
};
|
|
1100
1555
|
|
|
1101
|
-
state.x = e.clientX;
|
|
1102
|
-
state.y = e.clientY;
|
|
1103
1556
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1557
|
+
var $a06126b47eabe64f$exports = {};
|
|
1558
|
+
$a06126b47eabe64f$exports = {
|
|
1559
|
+
"dragDescriptionKeyboard": `Нажмите клавишу Enter для начала перетаскивания.`,
|
|
1560
|
+
"dragDescriptionTouch": `Дважды нажмите для начала перетаскивания.`,
|
|
1561
|
+
"dragDescriptionVirtual": `Щелкните для начала перетаскивания.`,
|
|
1562
|
+
"dragItem": (args)=>`Перетащить ${args.itemText}`
|
|
1563
|
+
,
|
|
1564
|
+
"dragSelectedItems": (args, formatter)=>`Перетащить ${formatter.plural(args.count, {
|
|
1565
|
+
one: ()=>`${formatter.number(args.count)} выбранный элемент`
|
|
1566
|
+
,
|
|
1567
|
+
other: ()=>`${formatter.number(args.count)} выбранных элем`
|
|
1568
|
+
})}`
|
|
1569
|
+
,
|
|
1570
|
+
"dragStartedKeyboard": `Начато перетаскивание. Нажмите клавишу Tab для выбора цели, затем нажмите клавишу Enter, чтобы применить перетаскивание, или клавишу Escape для отмены действия.`,
|
|
1571
|
+
"dragStartedTouch": `Начато перетаскивание. Выберите цель, затем дважды нажмите, чтобы применить перетаскивание.`,
|
|
1572
|
+
"dragStartedVirtual": `Начато перетаскивание. Нажмите клавишу Tab для выбора цели, затем нажмите клавишу Enter, чтобы применить перетаскивание.`,
|
|
1573
|
+
"dropCanceled": `Перетаскивание отменено.`,
|
|
1574
|
+
"dropComplete": `Перетаскивание завершено.`,
|
|
1575
|
+
"dropDescriptionKeyboard": `Нажмите клавишу Enter, чтобы применить перетаскивание. Нажмите клавишу Escape для отмены.`,
|
|
1576
|
+
"dropDescriptionTouch": `Дважды нажмите, чтобы применить перетаскивание.`,
|
|
1577
|
+
"dropDescriptionVirtual": `Щелкните, чтобы применить перетаскивание.`,
|
|
1578
|
+
"dropIndicator": `индикатор перетаскивания`,
|
|
1579
|
+
"dropOnItem": (args)=>`Перетащить на ${args.itemText}`
|
|
1580
|
+
,
|
|
1581
|
+
"dropOnRoot": `Перетащить на`,
|
|
1582
|
+
"endDragKeyboard": `Перетаскивание. Нажмите клавишу Enter для отмены.`,
|
|
1583
|
+
"endDragTouch": `Перетаскивание. Дважды нажмите для отмены.`,
|
|
1584
|
+
"endDragVirtual": `Перетаскивание. Щелкните для отмены.`,
|
|
1585
|
+
"insertAfter": (args)=>`Вставить после ${args.itemText}`
|
|
1586
|
+
,
|
|
1587
|
+
"insertBefore": (args)=>`Вставить перед ${args.itemText}`
|
|
1588
|
+
,
|
|
1589
|
+
"insertBetween": (args)=>`Вставить между ${args.beforeItemText} и ${args.afterItemText}`
|
|
1590
|
+
};
|
|
1111
1591
|
|
|
1112
|
-
e.dataTransfer.dropEffect = state.dropEffect;
|
|
1113
1592
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1593
|
+
var $0983413fc05d96fb$exports = {};
|
|
1594
|
+
$0983413fc05d96fb$exports = {
|
|
1595
|
+
"dragDescriptionKeyboard": `Stlačením klávesu Enter začnete presúvanie.`,
|
|
1596
|
+
"dragDescriptionTouch": `Dvojitým kliknutím začnete presúvanie.`,
|
|
1597
|
+
"dragDescriptionVirtual": `Kliknutím začnete presúvanie.`,
|
|
1598
|
+
"dragItem": (args)=>`Presunúť položku ${args.itemText}`
|
|
1599
|
+
,
|
|
1600
|
+
"dragSelectedItems": (args, formatter)=>`Presunúť ${formatter.plural(args.count, {
|
|
1601
|
+
one: ()=>`${formatter.number(args.count)} vybratú položku`
|
|
1602
|
+
,
|
|
1603
|
+
other: ()=>`${formatter.number(args.count)} vybraté položky`
|
|
1604
|
+
})}`
|
|
1605
|
+
,
|
|
1606
|
+
"dragStartedKeyboard": `Presúvanie sa začalo. Do cieľového umiestnenia prejdete stlačením klávesu Tab. Ak chcete položku umiestniť, stlačte kláves Enter alebo stlačte kláves Esc, ak chcete presúvanie zrušiť.`,
|
|
1607
|
+
"dragStartedTouch": `Presúvanie sa začalo. Prejdite na cieľové umiestnenie a dvojitým kliknutím umiestnite položku.`,
|
|
1608
|
+
"dragStartedVirtual": `Presúvanie sa začalo. Prejdite na cieľové umiestnenie a kliknutím alebo stlačením klávesu Enter umiestnite položku.`,
|
|
1609
|
+
"dropCanceled": `Umiestnenie zrušené.`,
|
|
1610
|
+
"dropComplete": `Umiestnenie dokončené.`,
|
|
1611
|
+
"dropDescriptionKeyboard": `Stlačením klávesu Enter umiestnite položku. Stlačením klávesu Esc zrušíte presúvanie.`,
|
|
1612
|
+
"dropDescriptionTouch": `Dvojitým kliknutím umiestnite položku.`,
|
|
1613
|
+
"dropDescriptionVirtual": `Kliknutím umiestnite položku.`,
|
|
1614
|
+
"dropIndicator": `indikátor umiestnenia`,
|
|
1615
|
+
"dropOnItem": (args)=>`Umiestniť na položku ${args.itemText}`
|
|
1616
|
+
,
|
|
1617
|
+
"dropOnRoot": `Umiestniť na`,
|
|
1618
|
+
"endDragKeyboard": `Prebieha presúvanie. Ak ho chcete zrušiť, stlačte kláves Enter.`,
|
|
1619
|
+
"endDragTouch": `Prebieha presúvanie. Dvojitým kliknutím ho môžete zrušiť.`,
|
|
1620
|
+
"endDragVirtual": `Prebieha presúvanie.`,
|
|
1621
|
+
"insertAfter": (args)=>`Vložiť za položku ${args.itemText}`
|
|
1622
|
+
,
|
|
1623
|
+
"insertBefore": (args)=>`Vložiť pred položku ${args.itemText}`
|
|
1624
|
+
,
|
|
1625
|
+
"insertBetween": (args)=>`Vložiť medzi položky ${args.beforeItemText} a ${args.afterItemText}`
|
|
1626
|
+
};
|
|
1122
1627
|
|
|
1123
|
-
clearTimeout(state.dropActivateTimer);
|
|
1124
1628
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1629
|
+
var $c66896a0464692f1$exports = {};
|
|
1630
|
+
$c66896a0464692f1$exports = {
|
|
1631
|
+
"dragDescriptionKeyboard": `Pritisnite tipko Enter za začetek vlečenja.`,
|
|
1632
|
+
"dragDescriptionTouch": `Dvotapnite za začetek vlečenja.`,
|
|
1633
|
+
"dragDescriptionVirtual": `Kliknite za začetek vlečenja.`,
|
|
1634
|
+
"dragItem": (args)=>`Povleci ${args.itemText}`
|
|
1635
|
+
,
|
|
1636
|
+
"dragSelectedItems": (args, formatter)=>`Povlecite ${formatter.plural(args.count, {
|
|
1637
|
+
one: ()=>`${formatter.number(args.count)} izbran element`
|
|
1638
|
+
,
|
|
1639
|
+
other: ()=>`izbrane elemente (${formatter.number(args.count)})`
|
|
1640
|
+
})}`
|
|
1641
|
+
,
|
|
1642
|
+
"dragStartedKeyboard": `Vlečenje se je začelo. Pritisnite tipko Tab za pomik na mesto, kamor želite spustiti elemente, in pritisnite tipko Enter, da jih spustite, ali tipko Escape, da prekličete postopek.`,
|
|
1643
|
+
"dragStartedTouch": `Vlečenje se je začelo. Pomaknite se na mesto, kamor želite spustiti elemente, in dvotapnite, da jih spustite.`,
|
|
1644
|
+
"dragStartedVirtual": `Vlečenje se je začelo. Pomaknite se na mesto, kamor želite spustiti elemente, in kliknite ali pritisnite tipko Enter, da jih spustite.`,
|
|
1645
|
+
"dropCanceled": `Spust je preklican.`,
|
|
1646
|
+
"dropComplete": `Spust je končan.`,
|
|
1647
|
+
"dropDescriptionKeyboard": `Pritisnite tipko Enter, da spustite. Pritisnite tipko Escape, da prekličete vlečenje.`,
|
|
1648
|
+
"dropDescriptionTouch": `Dvotapnite, da spustite.`,
|
|
1649
|
+
"dropDescriptionVirtual": `Kliknite, da spustite.`,
|
|
1650
|
+
"dropIndicator": `indikator spusta`,
|
|
1651
|
+
"dropOnItem": (args)=>`Spusti na mesto ${args.itemText}`
|
|
1652
|
+
,
|
|
1653
|
+
"dropOnRoot": `Spusti na mesto`,
|
|
1654
|
+
"endDragKeyboard": `Vlečenje. Pritisnite tipko Enter za preklic vlečenja.`,
|
|
1655
|
+
"endDragTouch": `Vlečenje. Dvotapnite za preklic vlečenja.`,
|
|
1656
|
+
"endDragVirtual": `Vlečenje. Kliknite, da prekličete vlečenje.`,
|
|
1657
|
+
"insertAfter": (args)=>`Vstavi za ${args.itemText}`
|
|
1658
|
+
,
|
|
1659
|
+
"insertBefore": (args)=>`Vstavi pred ${args.itemText}`
|
|
1660
|
+
,
|
|
1661
|
+
"insertBetween": (args)=>`Vstavi med ${args.beforeItemText} in ${args.afterItemText}`
|
|
1662
|
+
};
|
|
1136
1663
|
|
|
1137
|
-
let onDragEnter = e => {
|
|
1138
|
-
state.dragEnterCount++;
|
|
1139
1664
|
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
}
|
|
1665
|
+
var $f0d9abe43a1bcdf6$exports = {};
|
|
1666
|
+
$f0d9abe43a1bcdf6$exports = {
|
|
1667
|
+
"dragItem": (args)=>`Prevucite ${args.itemText}`
|
|
1668
|
+
,
|
|
1669
|
+
"dragSelectedItems": (args, formatter)=>`Prevucite ${formatter.plural(args.count, {
|
|
1670
|
+
one: ()=>`${formatter.number(args.count)} izabranu stavku`
|
|
1671
|
+
,
|
|
1672
|
+
other: ()=>`${formatter.number(args.count)} izabrane stavke`
|
|
1673
|
+
})}`
|
|
1674
|
+
,
|
|
1675
|
+
"dragDescriptionKeyboard": `Pritisnite Enter da biste započeli prevlačenje..`,
|
|
1676
|
+
"dragDescriptionTouch": `Dvaput dodirnite za otpuštanje.`,
|
|
1677
|
+
"dragDescriptionVirtual": `Kliknite da biste započeli prevlačenje.`,
|
|
1678
|
+
"dragStartedKeyboard": `Prevlačenje je započeto. Pritisnite Tab da biste otišli do cilja za otpuštanje, zatim pritisnite Enter za ispuštanje ili pritisnite Escape za otkazivanje.`,
|
|
1679
|
+
"dragStartedTouch": `Prevlačenje je započeto. Idite do cilja za otpuštanje, a zatim dvaput dodirnite za otpuštanje.`,
|
|
1680
|
+
"dragStartedVirtual": `Prevlačenje je započeto. Idite do cilja za otpuštanje, a zatim kliknite ili pritinite Enter za otpuštanje.`,
|
|
1681
|
+
"endDragKeyboard": `Prevlačenje u toku. Pritisnite Enter da biste otkazali prevlačenje.`,
|
|
1682
|
+
"endDragTouch": `Prevlačenje u toku. Dvaput dodirnite da biste otkazali prevlačenje.`,
|
|
1683
|
+
"endDragVirtual": `Prevlačenje u toku. Kliknite da biste otkazali prevlačenje.`,
|
|
1684
|
+
"dropDescriptionKeyboard": `Pritisnite Enter da biste otpustili. Pritisnite Escape da biste otkazali prevlačenje.`,
|
|
1685
|
+
"dropDescriptionTouch": `Dvaput dodirnite za otpuštanje.`,
|
|
1686
|
+
"dropDescriptionVirtual": `Kliknite za otpuštanje.`,
|
|
1687
|
+
"dropCanceled": `Otpuštanje je otkazano.`,
|
|
1688
|
+
"dropComplete": `Prevlačenje je završeno.`,
|
|
1689
|
+
"dropIndicator": `Indikator otpuštanja`,
|
|
1690
|
+
"dropOnRoot": `Otpusti na`,
|
|
1691
|
+
"dropOnItem": (args)=>`Otpusti na ${args.itemText}`
|
|
1692
|
+
,
|
|
1693
|
+
"insertBefore": (args)=>`Umetnite ispred ${args.itemText}`
|
|
1694
|
+
,
|
|
1695
|
+
"insertBetween": (args)=>`Umetnite između ${args.beforeItemText} i ${args.afterItemText}`
|
|
1696
|
+
,
|
|
1697
|
+
"insertAfter": (args)=>`Umetnite posle ${args.itemText}`
|
|
1698
|
+
};
|
|
1143
1699
|
|
|
1144
|
-
let allowedOperations = $db0591c71140b157a950096251935c$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
|
|
1145
|
-
let dropOperation = allowedOperations[0];
|
|
1146
1700
|
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1701
|
+
var $f3e2ce4b6d6cc4ac$exports = {};
|
|
1702
|
+
$f3e2ce4b6d6cc4ac$exports = {
|
|
1703
|
+
"dragDescriptionKeyboard": `Tryck på enter för att börja dra.`,
|
|
1704
|
+
"dragDescriptionTouch": `Dubbeltryck för att börja dra.`,
|
|
1705
|
+
"dragDescriptionVirtual": `Klicka för att börja dra.`,
|
|
1706
|
+
"dragItem": (args)=>`Dra ${args.itemText}`
|
|
1707
|
+
,
|
|
1708
|
+
"dragSelectedItems": (args, formatter)=>`Dra ${formatter.plural(args.count, {
|
|
1709
|
+
one: ()=>`${formatter.number(args.count)} valt objekt`
|
|
1710
|
+
,
|
|
1711
|
+
other: ()=>`${formatter.number(args.count)} valda objekt`
|
|
1712
|
+
})}`
|
|
1713
|
+
,
|
|
1714
|
+
"dragStartedKeyboard": `Börja dra. Tryck på tabb för att navigera till målet, tryck på enter för att släppa eller på escape för att avbryta.`,
|
|
1715
|
+
"dragStartedTouch": `Börja dra. Navigera till ett mål och dubbeltryck för att släppa.`,
|
|
1716
|
+
"dragStartedVirtual": `Börja dra. Navigera till ett mål och klicka eller tryck på enter för att släppa.`,
|
|
1717
|
+
"dropCanceled": `Släppåtgärd avbröts.`,
|
|
1718
|
+
"dropComplete": `Släppåtgärd klar.`,
|
|
1719
|
+
"dropDescriptionKeyboard": `Tryck på enter för att släppa. Tryck på escape för att avbryta dragåtgärd.`,
|
|
1720
|
+
"dropDescriptionTouch": `Dubbeltryck för att släppa.`,
|
|
1721
|
+
"dropDescriptionVirtual": `Klicka för att släppa.`,
|
|
1722
|
+
"dropIndicator": `släppindikator`,
|
|
1723
|
+
"dropOnItem": (args)=>`Släpp på ${args.itemText}`
|
|
1724
|
+
,
|
|
1725
|
+
"dropOnRoot": `Släpp på`,
|
|
1726
|
+
"endDragKeyboard": `Drar. Tryck på enter för att avbryta dragåtgärd.`,
|
|
1727
|
+
"endDragTouch": `Drar. Dubbeltryck för att avbryta dragåtgärd.`,
|
|
1728
|
+
"endDragVirtual": `Drar. Klicka för att avbryta dragåtgärd.`,
|
|
1729
|
+
"insertAfter": (args)=>`Infoga efter ${args.itemText}`
|
|
1730
|
+
,
|
|
1731
|
+
"insertBefore": (args)=>`Infoga före ${args.itemText}`
|
|
1732
|
+
,
|
|
1733
|
+
"insertBetween": (args)=>`Infoga mellan ${args.beforeItemText} och ${args.afterItemText}`
|
|
1734
|
+
};
|
|
1151
1735
|
|
|
1152
|
-
if (dropOperation !== 'cancel') {
|
|
1153
|
-
setDropTarget(true);
|
|
1154
|
-
}
|
|
1155
1736
|
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1737
|
+
var $da91b0d12d273475$exports = {};
|
|
1738
|
+
$da91b0d12d273475$exports = {
|
|
1739
|
+
"dragDescriptionKeyboard": `Sürüklemeyi başlatmak için Enter'a basın.`,
|
|
1740
|
+
"dragDescriptionTouch": `Sürüklemeyi başlatmak için çift tıklayın.`,
|
|
1741
|
+
"dragDescriptionVirtual": `Sürüklemeyi başlatmak için tıklayın.`,
|
|
1742
|
+
"dragItem": (args)=>`${args.itemText}’i sürükle`
|
|
1743
|
+
,
|
|
1744
|
+
"dragSelectedItems": (args, formatter)=>`Sürükle ${formatter.plural(args.count, {
|
|
1745
|
+
one: ()=>`${formatter.number(args.count)} seçili öge`
|
|
1746
|
+
,
|
|
1747
|
+
other: ()=>`${formatter.number(args.count)} seçili öge`
|
|
1748
|
+
})}`
|
|
1749
|
+
,
|
|
1750
|
+
"dragStartedKeyboard": `Sürükleme başlatıldı. Bir bırakma hedefine gitmek için Tab’a basın, ardından bırakmak için Enter’a basın veya iptal etmek için Escape’e basın.`,
|
|
1751
|
+
"dragStartedTouch": `Sürükleme başlatıldı. Bir bırakma hedefine gidin, ardından bırakmak için çift tıklayın.`,
|
|
1752
|
+
"dragStartedVirtual": `Sürükleme başlatıldı. Bir bırakma hedefine gidin, ardından bırakmak için Enter’a tıklayın veya basın.`,
|
|
1753
|
+
"dropCanceled": `Bırakma iptal edildi.`,
|
|
1754
|
+
"dropComplete": `Bırakma tamamlandı.`,
|
|
1755
|
+
"dropDescriptionKeyboard": `Bırakmak için Enter'a basın. Sürüklemeyi iptal etmek için Escape'e basın.`,
|
|
1756
|
+
"dropDescriptionTouch": `Bırakmak için çift tıklayın.`,
|
|
1757
|
+
"dropDescriptionVirtual": `Bırakmak için tıklayın.`,
|
|
1758
|
+
"dropIndicator": `bırakma göstergesi`,
|
|
1759
|
+
"dropOnItem": (args)=>`${args.itemText} üzerine bırak`
|
|
1760
|
+
,
|
|
1761
|
+
"dropOnRoot": `Bırakın`,
|
|
1762
|
+
"endDragKeyboard": `Sürükleme. Sürüklemeyi iptal etmek için Enter'a basın.`,
|
|
1763
|
+
"endDragTouch": `Sürükleme. Sürüklemeyi iptal etmek için çift tıklayın.`,
|
|
1764
|
+
"endDragVirtual": `Sürükleme. Sürüklemeyi iptal etmek için tıklayın.`,
|
|
1765
|
+
"insertAfter": (args)=>`${args.itemText}’den sonra gir`
|
|
1766
|
+
,
|
|
1767
|
+
"insertBefore": (args)=>`${args.itemText}’den önce gir`
|
|
1768
|
+
,
|
|
1769
|
+
"insertBetween": (args)=>`${args.beforeItemText} ve ${args.afterItemText} arasına gir`
|
|
1770
|
+
};
|
|
1161
1771
|
|
|
1162
|
-
state.dropEffect = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION_TO_DROP_EFFECT[dropOperation] || 'none';
|
|
1163
|
-
e.dataTransfer.dropEffect = state.dropEffect;
|
|
1164
1772
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1773
|
+
var $d6f72e28f0f4871c$exports = {};
|
|
1774
|
+
$d6f72e28f0f4871c$exports = {
|
|
1775
|
+
"dragDescriptionKeyboard": `Натисніть Enter, щоб почати перетягування.`,
|
|
1776
|
+
"dragDescriptionTouch": `Натисніть двічі, щоб почати перетягування.`,
|
|
1777
|
+
"dragDescriptionVirtual": `Натисніть, щоб почати перетягування.`,
|
|
1778
|
+
"dragItem": (args)=>`Перетягнути ${args.itemText}`
|
|
1779
|
+
,
|
|
1780
|
+
"dragSelectedItems": (args, formatter)=>`Перетягніть ${formatter.plural(args.count, {
|
|
1781
|
+
one: ()=>`${formatter.number(args.count)} вибраний елемент`
|
|
1782
|
+
,
|
|
1783
|
+
other: ()=>`${formatter.number(args.count)} вибраних елем`
|
|
1784
|
+
})}`
|
|
1785
|
+
,
|
|
1786
|
+
"dragStartedKeyboard": `Перетягування почалося. Натисніть Tab, щоб перейти до цілі перетягування, потім натисніть Enter, щоб перетягнути, або Escape, щоб скасувати.`,
|
|
1787
|
+
"dragStartedTouch": `Перетягування почалося. Перейдіть до цілі перетягування, потім натисніть двічі, щоб перетягнути.`,
|
|
1788
|
+
"dragStartedVirtual": `Перетягування почалося. Перейдіть до цілі перетягування, потім натисніть Enter, щоб перетягнути.`,
|
|
1789
|
+
"dropCanceled": `Перетягування скасовано.`,
|
|
1790
|
+
"dropComplete": `Перетягування завершено.`,
|
|
1791
|
+
"dropDescriptionKeyboard": `Натисніть Enter, щоб перетягнути. Натисніть Escape, щоб скасувати перетягування.`,
|
|
1792
|
+
"dropDescriptionTouch": `Натисніть двічі, щоб перетягнути.`,
|
|
1793
|
+
"dropDescriptionVirtual": `Натисніть, щоб перетягнути.`,
|
|
1794
|
+
"dropIndicator": `індикатор перетягування`,
|
|
1795
|
+
"dropOnItem": (args)=>`Перетягнути на ${args.itemText}`
|
|
1796
|
+
,
|
|
1797
|
+
"dropOnRoot": `Перетягнути на`,
|
|
1798
|
+
"endDragKeyboard": `Триває перетягування. Натисніть Enter, щоб скасувати перетягування.`,
|
|
1799
|
+
"endDragTouch": `Триває перетягування. Натисніть двічі, щоб скасувати перетягування.`,
|
|
1800
|
+
"endDragVirtual": `Триває перетягування. Натисніть, щоб скасувати перетягування.`,
|
|
1801
|
+
"insertAfter": (args)=>`Вставити після ${args.itemText}`
|
|
1802
|
+
,
|
|
1803
|
+
"insertBefore": (args)=>`Вставити перед ${args.itemText}`
|
|
1804
|
+
,
|
|
1805
|
+
"insertBetween": (args)=>`Вставити між ${args.beforeItemText} і ${args.afterItemText}`
|
|
1806
|
+
};
|
|
1173
1807
|
|
|
1174
|
-
state.x = e.clientX;
|
|
1175
|
-
state.y = e.clientY;
|
|
1176
|
-
};
|
|
1177
1808
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1809
|
+
var $187738fbdc896f75$exports = {};
|
|
1810
|
+
$187738fbdc896f75$exports = {
|
|
1811
|
+
"dragDescriptionKeyboard": `按 Enter 开始拖动。`,
|
|
1812
|
+
"dragDescriptionTouch": `双击开始拖动。`,
|
|
1813
|
+
"dragDescriptionVirtual": `单击开始拖动。`,
|
|
1814
|
+
"dragItem": (args)=>`拖动 ${args.itemText}`
|
|
1815
|
+
,
|
|
1816
|
+
"dragSelectedItems": (args, formatter)=>`拖动 ${formatter.plural(args.count, {
|
|
1817
|
+
one: ()=>`${formatter.number(args.count)} 选中项目`
|
|
1818
|
+
,
|
|
1819
|
+
other: ()=>`${formatter.number(args.count)} 选中项目`
|
|
1820
|
+
})}`
|
|
1821
|
+
,
|
|
1822
|
+
"dragStartedKeyboard": `已开始拖动。按 Tab 导航到放置目标,然后按 Enter 放置或按 Escape 取消。`,
|
|
1823
|
+
"dragStartedTouch": `已开始拖动。导航到放置目标,然后双击放置。`,
|
|
1824
|
+
"dragStartedVirtual": `已开始拖动。导航到放置目标,然后单击或按 Enter 放置。`,
|
|
1825
|
+
"dropCanceled": `放置已取消。`,
|
|
1826
|
+
"dropComplete": `放置已完成。`,
|
|
1827
|
+
"dropDescriptionKeyboard": `按 Enter 放置。按 Escape 取消拖动。`,
|
|
1828
|
+
"dropDescriptionTouch": `双击放置。`,
|
|
1829
|
+
"dropDescriptionVirtual": `单击放置。`,
|
|
1830
|
+
"dropIndicator": `放置标记`,
|
|
1831
|
+
"dropOnItem": (args)=>`放置于 ${args.itemText}`
|
|
1832
|
+
,
|
|
1833
|
+
"dropOnRoot": `放置于`,
|
|
1834
|
+
"endDragKeyboard": `正在拖动。按 Enter 取消拖动。`,
|
|
1835
|
+
"endDragTouch": `正在拖动。双击取消拖动。`,
|
|
1836
|
+
"endDragVirtual": `正在拖动。单击取消拖动。`,
|
|
1837
|
+
"insertAfter": (args)=>`插入到 ${args.itemText} 之后`
|
|
1838
|
+
,
|
|
1839
|
+
"insertBefore": (args)=>`插入到 ${args.itemText} 之前`
|
|
1840
|
+
,
|
|
1841
|
+
"insertBetween": (args)=>`插入到 ${args.beforeItemText} 和 ${args.afterItemText} 之间`
|
|
1842
|
+
};
|
|
1180
1843
|
|
|
1181
|
-
if (state.dragEnterCount > 0) {
|
|
1182
|
-
return;
|
|
1183
|
-
}
|
|
1184
1844
|
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1845
|
+
var $80cfc1f1f7d356d3$exports = {};
|
|
1846
|
+
$80cfc1f1f7d356d3$exports = {
|
|
1847
|
+
"dragDescriptionKeyboard": `按 Enter 鍵以開始拖曳。`,
|
|
1848
|
+
"dragDescriptionTouch": `輕點兩下以開始拖曳。`,
|
|
1849
|
+
"dragDescriptionVirtual": `按一下滑鼠以開始拖曳。`,
|
|
1850
|
+
"dragItem": (args)=>`拖曳「${args.itemText}」`
|
|
1851
|
+
,
|
|
1852
|
+
"dragSelectedItems": (args, formatter)=>`拖曳 ${formatter.plural(args.count, {
|
|
1853
|
+
one: ()=>`${formatter.number(args.count)} 個選定項目`
|
|
1854
|
+
,
|
|
1855
|
+
other: ()=>`${formatter.number(args.count)} 個選定項目`
|
|
1856
|
+
})}`
|
|
1857
|
+
,
|
|
1858
|
+
"dragStartedKeyboard": `已開始拖曳。按 Tab 鍵以瀏覽至放置目標,然後按 Enter 鍵以放置,或按 Escape 鍵以取消。`,
|
|
1859
|
+
"dragStartedTouch": `已開始拖曳。瀏覽至放置目標,然後輕點兩下以放置。`,
|
|
1860
|
+
"dragStartedVirtual": `已開始拖曳。瀏覽至放置目標,然後按一下滑鼠或按 Enter 鍵以放置。`,
|
|
1861
|
+
"dropCanceled": `放置已取消。`,
|
|
1862
|
+
"dropComplete": `放置已完成。`,
|
|
1863
|
+
"dropDescriptionKeyboard": `按 Enter 鍵以放置。按 Escape 鍵以取消拖曳。`,
|
|
1864
|
+
"dropDescriptionTouch": `輕點兩下以放置。`,
|
|
1865
|
+
"dropDescriptionVirtual": `按一下滑鼠以放置。`,
|
|
1866
|
+
"dropIndicator": `放置指示器`,
|
|
1867
|
+
"dropOnItem": (args)=>`放置在「${args.itemText}」上`
|
|
1868
|
+
,
|
|
1869
|
+
"dropOnRoot": `放置在`,
|
|
1870
|
+
"endDragKeyboard": `拖曳中。按 Enter 鍵以取消拖曳。`,
|
|
1871
|
+
"endDragTouch": `拖曳中。輕點兩下以取消拖曳。`,
|
|
1872
|
+
"endDragVirtual": `拖曳中。按一下滑鼠以取消拖曳。`,
|
|
1873
|
+
"insertAfter": (args)=>`插入至「${args.itemText}」之後`
|
|
1874
|
+
,
|
|
1875
|
+
"insertBefore": (args)=>`插入至「${args.itemText}」之前`
|
|
1876
|
+
,
|
|
1877
|
+
"insertBetween": (args)=>`插入至「${args.beforeItemText}」和「${args.afterItemText}」之間`
|
|
1878
|
+
};
|
|
1193
1879
|
|
|
1194
|
-
setDropTarget(false);
|
|
1195
|
-
clearTimeout(state.dropActivateTimer);
|
|
1196
|
-
};
|
|
1197
|
-
|
|
1198
|
-
let onDrop = e => {
|
|
1199
|
-
e.preventDefault();
|
|
1200
|
-
|
|
1201
|
-
if (typeof options.onDrop === 'function') {
|
|
1202
|
-
let dropOperation = $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_EFFECT_TO_DROP_OPERATION[state.dropEffect];
|
|
1203
|
-
let items = $bc29619458500c186021634c18dc$export$readFromDataTransfer(e.dataTransfer);
|
|
1204
|
-
let rect = e.currentTarget.getBoundingClientRect();
|
|
1205
|
-
let event = {
|
|
1206
|
-
type: 'drop',
|
|
1207
|
-
x: e.clientX - rect.x,
|
|
1208
|
-
y: e.clientY - rect.y,
|
|
1209
|
-
items,
|
|
1210
|
-
dropOperation
|
|
1211
|
-
}; // Wait a frame to dispatch the drop event so that we ensure the dragend event fires first.
|
|
1212
|
-
// Otherwise, if onDrop removes the original dragged element from the DOM, dragend will never be fired.
|
|
1213
|
-
// This behavior is consistent across browsers, but see this issue for details:
|
|
1214
|
-
// https://bugzilla.mozilla.org/show_bug.cgi?id=460801
|
|
1215
|
-
|
|
1216
|
-
setTimeout(() => {
|
|
1217
|
-
options.onDrop(event);
|
|
1218
|
-
}, 0);
|
|
1219
|
-
}
|
|
1220
1880
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1881
|
+
$d624b4da796f302a$exports = {
|
|
1882
|
+
"ar-AE": $12ee6b0bfb4232ad$exports,
|
|
1883
|
+
"bg-BG": $e21ef7c55796c5e1$exports,
|
|
1884
|
+
"cs-CZ": $dfa9cd1c2317d9aa$exports,
|
|
1885
|
+
"da-DK": $65fff3bbacfa8956$exports,
|
|
1886
|
+
"de-DE": $10b7dfe45cd41c2d$exports,
|
|
1887
|
+
"el-GR": $0cadcffb7abc96b8$exports,
|
|
1888
|
+
"en-US": $7e3982b34ddf1bdf$exports,
|
|
1889
|
+
"es-ES": $cb29ce0b655c4023$exports,
|
|
1890
|
+
"et-EE": $067d46bab80bcf4b$exports,
|
|
1891
|
+
"fi-FI": $8aa1b9a1f9d783d3$exports,
|
|
1892
|
+
"fr-FR": $9e248ec27f7dc55f$exports,
|
|
1893
|
+
"he-IL": $6387f7228f0de45e$exports,
|
|
1894
|
+
"hr-HR": $34a283567735f754$exports,
|
|
1895
|
+
"hu-HU": $466590c56bee4342$exports,
|
|
1896
|
+
"it-IT": $e013896dcb6a6884$exports,
|
|
1897
|
+
"ja-JP": $d6121e4246c6e502$exports,
|
|
1898
|
+
"ko-KR": $cf48a963c482dcba$exports,
|
|
1899
|
+
"lt-LT": $b156071f04f1c899$exports,
|
|
1900
|
+
"lv-LV": $5300be8ef98d39fa$exports,
|
|
1901
|
+
"nb-NO": $7484477aad199932$exports,
|
|
1902
|
+
"nl-NL": $968e09cb41d6cd76$exports,
|
|
1903
|
+
"pl-PL": $0c2c6c954dd638d7$exports,
|
|
1904
|
+
"pt-BR": $db510f249c1f2e00$exports,
|
|
1905
|
+
"pt-PT": $d734686296d37387$exports,
|
|
1906
|
+
"ro-RO": $d239d4998a584a23$exports,
|
|
1907
|
+
"ru-RU": $a06126b47eabe64f$exports,
|
|
1908
|
+
"sk-SK": $0983413fc05d96fb$exports,
|
|
1909
|
+
"sl-SI": $c66896a0464692f1$exports,
|
|
1910
|
+
"sr-SP": $f0d9abe43a1bcdf6$exports,
|
|
1911
|
+
"sv-SE": $f3e2ce4b6d6cc4ac$exports,
|
|
1912
|
+
"tr-TR": $da91b0d12d273475$exports,
|
|
1913
|
+
"uk-UA": $d6f72e28f0f4871c$exports,
|
|
1914
|
+
"zh-CN": $187738fbdc896f75$exports,
|
|
1915
|
+
"zh-TW": $80cfc1f1f7d356d3$exports
|
|
1916
|
+
};
|
|
1229
1917
|
|
|
1230
|
-
state.dragEnterCount = 0;
|
|
1231
|
-
setDropTarget(false);
|
|
1232
|
-
clearTimeout(state.dropActivateTimer);
|
|
1233
|
-
};
|
|
1234
1918
|
|
|
1235
|
-
let optionsRef = useRef(options);
|
|
1236
|
-
optionsRef.current = options;
|
|
1237
|
-
useLayoutEffect(() => $a75d092e5c30878812fba78e$export$registerDropTarget({
|
|
1238
|
-
element: optionsRef.current.ref.current,
|
|
1239
|
-
getDropOperation: optionsRef.current.getDropOperation,
|
|
1240
1919
|
|
|
1241
|
-
onDropEnter(e) {
|
|
1242
|
-
setDropTarget(true);
|
|
1243
1920
|
|
|
1244
|
-
if (typeof optionsRef.current.onDropEnter === 'function') {
|
|
1245
|
-
optionsRef.current.onDropEnter(e);
|
|
1246
|
-
}
|
|
1247
|
-
},
|
|
1248
1921
|
|
|
1249
|
-
onDropExit(e) {
|
|
1250
|
-
setDropTarget(false);
|
|
1251
1922
|
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1923
|
+
const $dc204e8ec58447a6$var$MESSAGES = {
|
|
1924
|
+
keyboard: {
|
|
1925
|
+
start: 'dragDescriptionKeyboard',
|
|
1926
|
+
end: 'endDragKeyboard'
|
|
1255
1927
|
},
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
optionsRef.current.onDrop(e);
|
|
1260
|
-
}
|
|
1928
|
+
touch: {
|
|
1929
|
+
start: 'dragDescriptionTouch',
|
|
1930
|
+
end: 'endDragTouch'
|
|
1261
1931
|
},
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
optionsRef.current.onDropActivate(e);
|
|
1266
|
-
}
|
|
1932
|
+
virtual: {
|
|
1933
|
+
start: 'dragDescriptionVirtual',
|
|
1934
|
+
end: 'endDragVirtual'
|
|
1267
1935
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.copy) {
|
|
1295
|
-
allowedOperations.push('copy');
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
if (allowedOperationsBits & $b29ea0269b2ea2bf4827b4fa19ddc83e$export$DROP_OPERATION.link) {
|
|
1299
|
-
allowedOperations.push('link');
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
return allowedOperations;
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
const $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE = 20;
|
|
1306
|
-
|
|
1307
|
-
function $cf2100581419e36b2fe8caccc6dbd4b$export$useAutoScroll(ref) {
|
|
1308
|
-
let scrollableRef = useRef(null);
|
|
1309
|
-
useEffect(() => {
|
|
1310
|
-
if (ref.current) {
|
|
1311
|
-
scrollableRef.current = getScrollParent(ref.current);
|
|
1312
|
-
}
|
|
1313
|
-
}, [ref]);
|
|
1314
|
-
let state = useRef({
|
|
1315
|
-
timer: null,
|
|
1316
|
-
dx: 0,
|
|
1317
|
-
dy: 0
|
|
1318
|
-
}).current;
|
|
1319
|
-
let scroll = useCallback(() => {
|
|
1320
|
-
scrollableRef.current.scrollLeft += state.dx;
|
|
1321
|
-
scrollableRef.current.scrollTop += state.dy;
|
|
1322
|
-
|
|
1323
|
-
if (state.timer) {
|
|
1324
|
-
state.timer = requestAnimationFrame(scroll);
|
|
1325
|
-
}
|
|
1326
|
-
}, [scrollableRef, state]);
|
|
1327
|
-
return {
|
|
1328
|
-
move(x, y) {
|
|
1329
|
-
// Most browsers auto scroll natively, but WebKit on macOS does not (iOS does 🤷♂️).
|
|
1330
|
-
// https://bugs.webkit.org/show_bug.cgi?id=222636
|
|
1331
|
-
if (!isWebKit() || isIOS() || !scrollableRef.current) {
|
|
1332
|
-
return;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
let box = scrollableRef.current.getBoundingClientRect();
|
|
1336
|
-
let left = $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
|
|
1337
|
-
let top = $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
|
|
1338
|
-
let bottom = box.height - $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
|
|
1339
|
-
let right = box.width - $cf2100581419e36b2fe8caccc6dbd4b$var$AUTOSCROLL_AREA_SIZE;
|
|
1340
|
-
|
|
1341
|
-
if (x < left || x > right || y < top || y > bottom) {
|
|
1342
|
-
if (x < left) {
|
|
1343
|
-
state.dx = x - left;
|
|
1344
|
-
} else if (x > right) {
|
|
1345
|
-
state.dx = x - right;
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
if (y < top) {
|
|
1349
|
-
state.dy = y - top;
|
|
1350
|
-
} else if (y > bottom) {
|
|
1351
|
-
state.dy = y - bottom;
|
|
1936
|
+
};
|
|
1937
|
+
function $dc204e8ec58447a6$export$7941f8aafa4b6021(options) {
|
|
1938
|
+
let stringFormatter = $4vY0V$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
|
|
1939
|
+
let state = $4vY0V$react.useRef({
|
|
1940
|
+
options: options,
|
|
1941
|
+
x: 0,
|
|
1942
|
+
y: 0
|
|
1943
|
+
}).current;
|
|
1944
|
+
state.options = options;
|
|
1945
|
+
let [isDragging, setDragging] = $4vY0V$react.useState(false);
|
|
1946
|
+
let { addGlobalListener: addGlobalListener , removeAllGlobalListeners: removeAllGlobalListeners } = $4vY0V$reactariautils.useGlobalListeners();
|
|
1947
|
+
let onDragStart = (e1)=>{
|
|
1948
|
+
var ref;
|
|
1949
|
+
if (e1.defaultPrevented) return;
|
|
1950
|
+
if (typeof options.onDragStart === 'function') options.onDragStart({
|
|
1951
|
+
type: 'dragstart',
|
|
1952
|
+
x: e1.clientX,
|
|
1953
|
+
y: e1.clientY
|
|
1954
|
+
});
|
|
1955
|
+
let items = options.getItems();
|
|
1956
|
+
$4620ae0dc40f0031$export$f9c1490890ddd063(e1.dataTransfer, items);
|
|
1957
|
+
if (typeof options.getAllowedDropOperations === 'function') {
|
|
1958
|
+
let allowedOperations = options.getAllowedDropOperations();
|
|
1959
|
+
let allowed = $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.none;
|
|
1960
|
+
for (let operation of allowedOperations)allowed |= $76b1e110a27b1ccd$export$60b7b4bcf3903d8e[operation] || $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.none;
|
|
1961
|
+
e1.dataTransfer.effectAllowed = $76b1e110a27b1ccd$export$dd0165308d8bff45[allowed] || 'none';
|
|
1352
1962
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1963
|
+
// If there is a preview option, use it to render a custom preview image that will
|
|
1964
|
+
// appear under the pointer while dragging. If not, the element itself is dragged by the browser.
|
|
1965
|
+
if (typeof ((ref = options.preview) === null || ref === void 0 ? void 0 : ref.current) === 'function') options.preview.current(items, (node)=>{
|
|
1966
|
+
// Compute the offset that the preview will appear under the mouse.
|
|
1967
|
+
// If possible, this is based on the point the user clicked on the target.
|
|
1968
|
+
// If the preview is much smaller, then just use the center point of the preview.
|
|
1969
|
+
let size = node.getBoundingClientRect();
|
|
1970
|
+
let rect = e1.currentTarget.getBoundingClientRect();
|
|
1971
|
+
let x = e1.clientX - rect.x;
|
|
1972
|
+
let y = e1.clientY - rect.y;
|
|
1973
|
+
if (x > size.width || y > size.height) {
|
|
1974
|
+
x = size.width / 2;
|
|
1975
|
+
y = size.height / 2;
|
|
1976
|
+
}
|
|
1977
|
+
// Rounding height to an even number prevents blurry preview seen on some screens
|
|
1978
|
+
let height = 2 * Math.round(rect.height / 2);
|
|
1979
|
+
node.style.height = `${height}px`;
|
|
1980
|
+
e1.dataTransfer.setDragImage(node, x, y);
|
|
1981
|
+
});
|
|
1982
|
+
// Enforce that drops are handled by useDrop.
|
|
1983
|
+
addGlobalListener(window, 'drop', (e)=>{
|
|
1984
|
+
if (!$28e10663603f5ea1$export$7454aff2e161f241(e.target)) {
|
|
1985
|
+
e.preventDefault();
|
|
1986
|
+
e.stopPropagation();
|
|
1987
|
+
throw new Error('Drags initiated from the React Aria useDrag hook may only be dropped on a target created with useDrop. This ensures that a keyboard and screen reader accessible alternative is available.');
|
|
1988
|
+
}
|
|
1989
|
+
}, {
|
|
1990
|
+
capture: true,
|
|
1991
|
+
once: true
|
|
1992
|
+
});
|
|
1993
|
+
state.x = e1.clientX;
|
|
1994
|
+
state.y = e1.clientY;
|
|
1995
|
+
// Wait a frame before we set dragging to true so that the browser has time to
|
|
1996
|
+
// render the preview image before we update the element that has been dragged.
|
|
1997
|
+
requestAnimationFrame(()=>{
|
|
1998
|
+
setDragging(true);
|
|
1999
|
+
});
|
|
2000
|
+
};
|
|
2001
|
+
let onDrag = (e)=>{
|
|
2002
|
+
if (e.clientX === state.x && e.clientY === state.y) return;
|
|
2003
|
+
if (typeof options.onDragMove === 'function') options.onDragMove({
|
|
2004
|
+
type: 'dragmove',
|
|
2005
|
+
x: e.clientX,
|
|
2006
|
+
y: e.clientY
|
|
2007
|
+
});
|
|
2008
|
+
state.x = e.clientX;
|
|
2009
|
+
state.y = e.clientY;
|
|
2010
|
+
};
|
|
2011
|
+
let onDragEnd = (e)=>{
|
|
2012
|
+
if (typeof options.onDragEnd === 'function') options.onDragEnd({
|
|
2013
|
+
type: 'dragend',
|
|
2014
|
+
x: e.clientX,
|
|
2015
|
+
y: e.clientY,
|
|
2016
|
+
dropOperation: $76b1e110a27b1ccd$export$608ecc6f1b23c35d[e.dataTransfer.dropEffect]
|
|
2017
|
+
});
|
|
2018
|
+
setDragging(false);
|
|
2019
|
+
removeAllGlobalListeners();
|
|
2020
|
+
};
|
|
2021
|
+
let onPress = (e2)=>{
|
|
2022
|
+
if (e2.pointerType !== 'keyboard' && e2.pointerType !== 'virtual') return;
|
|
2023
|
+
if (typeof state.options.onDragStart === 'function') {
|
|
2024
|
+
let rect = e2.target.getBoundingClientRect();
|
|
2025
|
+
state.options.onDragStart({
|
|
2026
|
+
type: 'dragstart',
|
|
2027
|
+
x: rect.x + rect.width / 2,
|
|
2028
|
+
y: rect.y + rect.height / 2
|
|
2029
|
+
});
|
|
1356
2030
|
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
2031
|
+
$28e10663603f5ea1$export$549dbcf8649bf3b2({
|
|
2032
|
+
element: e2.target,
|
|
2033
|
+
items: state.options.getItems(),
|
|
2034
|
+
allowedDropOperations: typeof state.options.getAllowedDropOperations === 'function' ? state.options.getAllowedDropOperations() : [
|
|
2035
|
+
'move',
|
|
2036
|
+
'copy',
|
|
2037
|
+
'link'
|
|
2038
|
+
],
|
|
2039
|
+
onDragEnd (e) {
|
|
2040
|
+
setDragging(false);
|
|
2041
|
+
if (typeof state.options.onDragEnd === 'function') state.options.onDragEnd(e);
|
|
2042
|
+
}
|
|
2043
|
+
}, stringFormatter);
|
|
2044
|
+
setDragging(true);
|
|
2045
|
+
};
|
|
2046
|
+
let modality = $4620ae0dc40f0031$export$49bac5d6d4b352ea();
|
|
2047
|
+
let descriptionProps = $4vY0V$reactariautils.useDescription(stringFormatter.format(!isDragging ? $dc204e8ec58447a6$var$MESSAGES[modality].start : $dc204e8ec58447a6$var$MESSAGES[modality].end));
|
|
2048
|
+
return {
|
|
2049
|
+
dragProps: {
|
|
2050
|
+
draggable: 'true',
|
|
2051
|
+
onDragStart: onDragStart,
|
|
2052
|
+
onDrag: onDrag,
|
|
2053
|
+
onDragEnd: onDragEnd
|
|
2054
|
+
},
|
|
2055
|
+
dragButtonProps: {
|
|
2056
|
+
...descriptionProps,
|
|
2057
|
+
onPress: onPress
|
|
2058
|
+
},
|
|
2059
|
+
isDragging: isDragging
|
|
2060
|
+
};
|
|
1370
2061
|
}
|
|
1371
2062
|
|
|
1372
|
-
const $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS = ['before', 'on', 'after'];
|
|
1373
|
-
|
|
1374
|
-
function useDroppableCollection(props, state, ref) {
|
|
1375
|
-
let localState = useRef({
|
|
1376
|
-
props,
|
|
1377
|
-
state,
|
|
1378
|
-
nextTarget: null,
|
|
1379
|
-
dropOperation: null
|
|
1380
|
-
}).current;
|
|
1381
|
-
localState.props = props;
|
|
1382
|
-
localState.state = state;
|
|
1383
|
-
let autoScroll = $cf2100581419e36b2fe8caccc6dbd4b$export$useAutoScroll(ref);
|
|
1384
|
-
let {
|
|
1385
|
-
dropProps
|
|
1386
|
-
} = useDrop({
|
|
1387
|
-
ref,
|
|
1388
|
-
|
|
1389
|
-
onDropEnter(e) {
|
|
1390
|
-
let target = props.getDropTargetFromPoint(e.x, e.y);
|
|
1391
|
-
state.setTarget(target);
|
|
1392
|
-
},
|
|
1393
2063
|
|
|
1394
|
-
onDropMove(e) {
|
|
1395
|
-
state.setTarget(localState.nextTarget);
|
|
1396
|
-
autoScroll.move(e.x, e.y);
|
|
1397
|
-
},
|
|
1398
2064
|
|
|
1399
|
-
getDropOperationForPoint(types, allowedOperations, x, y) {
|
|
1400
|
-
let target = props.getDropTargetFromPoint(x, y);
|
|
1401
2065
|
|
|
1402
|
-
if (!target) {
|
|
1403
|
-
localState.dropOperation = 'cancel';
|
|
1404
|
-
localState.nextTarget = null;
|
|
1405
|
-
return 'cancel';
|
|
1406
|
-
}
|
|
1407
2066
|
|
|
1408
|
-
if (state.isDropTarget(target)) {
|
|
1409
|
-
localState.nextTarget = target;
|
|
1410
|
-
return localState.dropOperation;
|
|
1411
|
-
}
|
|
1412
2067
|
|
|
1413
|
-
localState.dropOperation = state.getDropOperation(target, types, allowedOperations); // If the target doesn't accept the drop, see if the root accepts it instead.
|
|
1414
2068
|
|
|
1415
|
-
if (localState.dropOperation === 'cancel') {
|
|
1416
|
-
let rootTarget = {
|
|
1417
|
-
type: 'root'
|
|
1418
|
-
};
|
|
1419
|
-
let dropOperation = state.getDropOperation(rootTarget, types, allowedOperations);
|
|
1420
2069
|
|
|
1421
|
-
if (dropOperation !== 'cancel') {
|
|
1422
|
-
target = rootTarget;
|
|
1423
|
-
localState.dropOperation = dropOperation;
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
2070
|
|
|
1427
|
-
localState.nextTarget = localState.dropOperation === 'cancel' ? null : target;
|
|
1428
|
-
return localState.dropOperation;
|
|
1429
|
-
},
|
|
1430
2071
|
|
|
1431
|
-
onDropExit() {
|
|
1432
|
-
state.setTarget(null);
|
|
1433
|
-
autoScroll.stop();
|
|
1434
|
-
},
|
|
1435
2072
|
|
|
1436
|
-
onDropActivate(e) {
|
|
1437
|
-
var _state$target, _state$target2;
|
|
1438
2073
|
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
}
|
|
2074
|
+
const $419982e205c8e8dc$var$MESSAGES = {
|
|
2075
|
+
keyboard: 'dropDescriptionKeyboard',
|
|
2076
|
+
touch: 'dropDescriptionTouch',
|
|
2077
|
+
virtual: 'dropDescriptionVirtual'
|
|
2078
|
+
};
|
|
2079
|
+
function $419982e205c8e8dc$export$62447ad3d2ec7da6() {
|
|
2080
|
+
let stringFormatter = $4vY0V$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
|
|
2081
|
+
let modality = $4620ae0dc40f0031$export$49bac5d6d4b352ea();
|
|
2082
|
+
let dragSession = $28e10663603f5ea1$export$418e185dd3f1b968();
|
|
2083
|
+
let descriptionProps = $4vY0V$reactariautils.useDescription(dragSession ? stringFormatter.format($419982e205c8e8dc$var$MESSAGES[modality]) : '');
|
|
2084
|
+
return {
|
|
2085
|
+
dropProps: {
|
|
2086
|
+
...descriptionProps,
|
|
2087
|
+
// Mobile Safari does not properly bubble click events on elements except links or inputs
|
|
2088
|
+
// unless there is an onclick handler bound directly to the element itself. By adding this
|
|
2089
|
+
// handler, React will take care of adding that for us, and we are able to handle document
|
|
2090
|
+
// level click events in the DragManager.
|
|
2091
|
+
// See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
|
|
2092
|
+
onClick: ()=>{
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
1463
2097
|
|
|
1464
|
-
});
|
|
1465
|
-
useEffect(() => {
|
|
1466
|
-
let getNextTarget = function getNextTarget(target, wrap) {
|
|
1467
|
-
if (wrap === void 0) {
|
|
1468
|
-
wrap = true;
|
|
1469
|
-
}
|
|
1470
2098
|
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
return {
|
|
1488
|
-
type: 'item',
|
|
1489
|
-
key: target.key,
|
|
1490
|
-
dropPosition: nextDropPosition
|
|
1491
|
-
};
|
|
2099
|
+
const $1ca228bc9257ca16$var$DROP_ACTIVATE_TIMEOUT = 800;
|
|
2100
|
+
function $1ca228bc9257ca16$export$ccdee5eaf73cf661(options) {
|
|
2101
|
+
let [isDropTarget, setDropTarget] = $4vY0V$react.useState(false);
|
|
2102
|
+
let state = $4vY0V$react.useRef({
|
|
2103
|
+
x: 0,
|
|
2104
|
+
y: 0,
|
|
2105
|
+
dragEnterCount: 0,
|
|
2106
|
+
dropEffect: 'none',
|
|
2107
|
+
dropActivateTimer: null
|
|
2108
|
+
}).current;
|
|
2109
|
+
let onDragOver = (e)=>{
|
|
2110
|
+
e.preventDefault();
|
|
2111
|
+
e.stopPropagation();
|
|
2112
|
+
if (e.clientX === state.x && e.clientY === state.y) {
|
|
2113
|
+
e.dataTransfer.dropEffect = state.dropEffect;
|
|
2114
|
+
return;
|
|
1492
2115
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
2116
|
+
state.x = e.clientX;
|
|
2117
|
+
state.y = e.clientY;
|
|
2118
|
+
if (typeof options.getDropOperationForPoint === 'function') {
|
|
2119
|
+
let allowedOperations = $1ca228bc9257ca16$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
|
|
2120
|
+
let types = new $4620ae0dc40f0031$export$7f04ce188c91447c(e.dataTransfer);
|
|
2121
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2122
|
+
let dropOperation = options.getDropOperationForPoint(types, allowedOperations, state.x - rect.x, state.y - rect.y);
|
|
2123
|
+
state.dropEffect = $76b1e110a27b1ccd$export$5eacb0769d26d3b2[dropOperation] || 'none';
|
|
2124
|
+
}
|
|
2125
|
+
e.dataTransfer.dropEffect = state.dropEffect;
|
|
2126
|
+
if (typeof options.onDropMove === 'function') {
|
|
2127
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2128
|
+
options.onDropMove({
|
|
2129
|
+
type: 'dropmove',
|
|
2130
|
+
x: state.x - rect.x,
|
|
2131
|
+
y: state.y - rect.y
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
clearTimeout(state.dropActivateTimer);
|
|
2135
|
+
if (typeof options.onDropActivate === 'function' && state.dropEffect !== 'none') {
|
|
2136
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2137
|
+
state.dropActivateTimer = setTimeout(()=>{
|
|
2138
|
+
options.onDropActivate({
|
|
2139
|
+
type: 'dropactivate',
|
|
2140
|
+
x: state.x - rect.x,
|
|
2141
|
+
y: state.y - rect.y
|
|
2142
|
+
});
|
|
2143
|
+
}, $1ca228bc9257ca16$var$DROP_ACTIVATE_TIMEOUT);
|
|
1500
2144
|
}
|
|
1501
|
-
|
|
1502
|
-
return null;
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
return {
|
|
1506
|
-
type: 'item',
|
|
1507
|
-
key: nextKey,
|
|
1508
|
-
dropPosition: $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS[0]
|
|
1509
|
-
};
|
|
1510
2145
|
};
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
let nextKey = (target == null ? void 0 : target.type) === 'item' ? keyboardDelegate.getKeyAbove(target.key) : keyboardDelegate.getLastKey();
|
|
1521
|
-
|
|
1522
|
-
if ((target == null ? void 0 : target.type) === 'item') {
|
|
1523
|
-
let positionIndex = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS.indexOf(target.dropPosition);
|
|
1524
|
-
let nextDropPosition = $ab6d833b5804400cb02efc69c9302a$var$DROP_POSITIONS[positionIndex - 1];
|
|
1525
|
-
|
|
1526
|
-
if (positionIndex > 0 && nextDropPosition !== 'after') {
|
|
1527
|
-
return {
|
|
1528
|
-
type: 'item',
|
|
1529
|
-
key: target.key,
|
|
1530
|
-
dropPosition: nextDropPosition
|
|
1531
|
-
};
|
|
2146
|
+
let onDragEnter = (e)=>{
|
|
2147
|
+
e.stopPropagation();
|
|
2148
|
+
state.dragEnterCount++;
|
|
2149
|
+
if (state.dragEnterCount > 1) return;
|
|
2150
|
+
let allowedOperations = $1ca228bc9257ca16$var$effectAllowedToOperations(e.dataTransfer.effectAllowed);
|
|
2151
|
+
let dropOperation = allowedOperations[0];
|
|
2152
|
+
if (typeof options.getDropOperation === 'function') {
|
|
2153
|
+
let types = new $4620ae0dc40f0031$export$7f04ce188c91447c(e.dataTransfer);
|
|
2154
|
+
dropOperation = options.getDropOperation(types, allowedOperations);
|
|
1532
2155
|
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
type: 'root'
|
|
1539
|
-
};
|
|
2156
|
+
if (dropOperation !== 'cancel') setDropTarget(true);
|
|
2157
|
+
if (typeof options.getDropOperationForPoint === 'function') {
|
|
2158
|
+
let types = new $4620ae0dc40f0031$export$7f04ce188c91447c(e.dataTransfer);
|
|
2159
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2160
|
+
dropOperation = options.getDropOperationForPoint(types, allowedOperations, e.clientX - rect.x, e.clientY - rect.y);
|
|
1540
2161
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
2162
|
+
state.dropEffect = $76b1e110a27b1ccd$export$5eacb0769d26d3b2[dropOperation] || 'none';
|
|
2163
|
+
e.dataTransfer.dropEffect = state.dropEffect;
|
|
2164
|
+
if (typeof options.onDropEnter === 'function' && dropOperation !== 'cancel') {
|
|
2165
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2166
|
+
options.onDropEnter({
|
|
2167
|
+
type: 'dropenter',
|
|
2168
|
+
x: e.clientX - rect.x,
|
|
2169
|
+
y: e.clientY - rect.y
|
|
2170
|
+
});
|
|
2171
|
+
}
|
|
2172
|
+
state.x = e.clientX;
|
|
2173
|
+
state.y = e.clientY;
|
|
1550
2174
|
};
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
2175
|
+
let onDragLeave = (e)=>{
|
|
2176
|
+
e.stopPropagation();
|
|
2177
|
+
state.dragEnterCount--;
|
|
2178
|
+
if (state.dragEnterCount > 0) return;
|
|
2179
|
+
if (typeof options.onDropExit === 'function' && state.dropEffect !== 'none') {
|
|
2180
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2181
|
+
options.onDropExit({
|
|
2182
|
+
type: 'dropexit',
|
|
2183
|
+
x: e.clientX - rect.x,
|
|
2184
|
+
y: e.clientY - rect.y
|
|
2185
|
+
});
|
|
2186
|
+
}
|
|
2187
|
+
setDropTarget(false);
|
|
2188
|
+
clearTimeout(state.dropActivateTimer);
|
|
2189
|
+
};
|
|
2190
|
+
let onDrop = (e)=>{
|
|
2191
|
+
e.preventDefault();
|
|
2192
|
+
e.stopPropagation();
|
|
2193
|
+
if (typeof options.onDrop === 'function') {
|
|
2194
|
+
let dropOperation = $76b1e110a27b1ccd$export$608ecc6f1b23c35d[state.dropEffect];
|
|
2195
|
+
let items = $4620ae0dc40f0031$export$d9e760437831f8b3(e.dataTransfer);
|
|
2196
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2197
|
+
let event = {
|
|
2198
|
+
type: 'drop',
|
|
2199
|
+
x: e.clientX - rect.x,
|
|
2200
|
+
y: e.clientY - rect.y,
|
|
2201
|
+
items: items,
|
|
2202
|
+
dropOperation: dropOperation
|
|
2203
|
+
};
|
|
2204
|
+
// Wait a frame to dispatch the drop event so that we ensure the dragend event fires first.
|
|
2205
|
+
// Otherwise, if onDrop removes the original dragged element from the DOM, dragend will never be fired.
|
|
2206
|
+
// This behavior is consistent across browsers, but see this issue for details:
|
|
2207
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=460801
|
|
2208
|
+
setTimeout(()=>{
|
|
2209
|
+
options.onDrop(event);
|
|
2210
|
+
}, 0);
|
|
2211
|
+
}
|
|
2212
|
+
if (typeof options.onDropExit === 'function') {
|
|
2213
|
+
let rect = e.currentTarget.getBoundingClientRect();
|
|
2214
|
+
options.onDropExit({
|
|
2215
|
+
type: 'dropexit',
|
|
2216
|
+
x: e.clientX - rect.x,
|
|
2217
|
+
y: e.clientY - rect.y
|
|
2218
|
+
});
|
|
1565
2219
|
}
|
|
2220
|
+
state.dragEnterCount = 0;
|
|
2221
|
+
setDropTarget(false);
|
|
2222
|
+
clearTimeout(state.dropActivateTimer);
|
|
2223
|
+
};
|
|
2224
|
+
let optionsRef = $4vY0V$react.useRef(options);
|
|
2225
|
+
optionsRef.current = options;
|
|
2226
|
+
$4vY0V$reactariautils.useLayoutEffect(()=>$28e10663603f5ea1$export$c28d9fb4a54e471a({
|
|
2227
|
+
element: optionsRef.current.ref.current,
|
|
2228
|
+
getDropOperation: optionsRef.current.getDropOperation,
|
|
2229
|
+
onDropEnter (e) {
|
|
2230
|
+
setDropTarget(true);
|
|
2231
|
+
if (typeof optionsRef.current.onDropEnter === 'function') optionsRef.current.onDropEnter(e);
|
|
2232
|
+
},
|
|
2233
|
+
onDropExit (e) {
|
|
2234
|
+
setDropTarget(false);
|
|
2235
|
+
if (typeof optionsRef.current.onDropExit === 'function') optionsRef.current.onDropExit(e);
|
|
2236
|
+
},
|
|
2237
|
+
onDrop (e) {
|
|
2238
|
+
if (typeof optionsRef.current.onDrop === 'function') optionsRef.current.onDrop(e);
|
|
2239
|
+
},
|
|
2240
|
+
onDropActivate (e) {
|
|
2241
|
+
if (typeof optionsRef.current.onDropActivate === 'function') optionsRef.current.onDropActivate(e);
|
|
2242
|
+
}
|
|
2243
|
+
})
|
|
2244
|
+
, [
|
|
2245
|
+
optionsRef
|
|
2246
|
+
]);
|
|
2247
|
+
let { dropProps: dropProps } = $419982e205c8e8dc$export$62447ad3d2ec7da6();
|
|
2248
|
+
return {
|
|
2249
|
+
dropProps: {
|
|
2250
|
+
...dropProps,
|
|
2251
|
+
onDragEnter: onDragEnter,
|
|
2252
|
+
onDragOver: onDragOver,
|
|
2253
|
+
onDragLeave: onDragLeave,
|
|
2254
|
+
onDrop: onDrop
|
|
2255
|
+
},
|
|
2256
|
+
isDropTarget: isDropTarget
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
function $1ca228bc9257ca16$var$effectAllowedToOperations(effectAllowed) {
|
|
2260
|
+
let allowedOperationsBits = $76b1e110a27b1ccd$export$9bbdfc78cf083e16[effectAllowed];
|
|
2261
|
+
let allowedOperations = [];
|
|
2262
|
+
if (allowedOperationsBits & $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.move) allowedOperations.push('move');
|
|
2263
|
+
if (allowedOperationsBits & $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.copy) allowedOperations.push('copy');
|
|
2264
|
+
if (allowedOperationsBits & $76b1e110a27b1ccd$export$60b7b4bcf3903d8e.link) allowedOperations.push('link');
|
|
2265
|
+
return allowedOperations;
|
|
2266
|
+
}
|
|
1566
2267
|
|
|
1567
|
-
target = nextTarget;
|
|
1568
|
-
operation = localState.state.getDropOperation(nextTarget, types, allowedDropOperations);
|
|
1569
2268
|
|
|
1570
|
-
if (target.type === 'root') {
|
|
1571
|
-
seenRoot++;
|
|
1572
|
-
}
|
|
1573
|
-
} while (target && operation === 'cancel' && !localState.state.isDropTarget(target) && seenRoot < 2);
|
|
1574
2269
|
|
|
1575
|
-
if (operation === 'cancel') {
|
|
1576
|
-
return null;
|
|
1577
|
-
}
|
|
1578
2270
|
|
|
1579
|
-
return target;
|
|
1580
|
-
};
|
|
1581
2271
|
|
|
1582
|
-
return $a75d092e5c30878812fba78e$export$registerDropTarget({
|
|
1583
|
-
element: ref.current,
|
|
1584
2272
|
|
|
1585
|
-
getDropOperation(types, allowedOperations) {
|
|
1586
|
-
if (localState.state.target) {
|
|
1587
|
-
return localState.state.getDropOperation(localState.state.target, types, allowedOperations);
|
|
1588
|
-
} // Check if any of the targets accept the drop.
|
|
1589
|
-
// TODO: should we have a faster way of doing this or e.g. for pagination?
|
|
1590
2273
|
|
|
1591
2274
|
|
|
1592
|
-
let target = nextValidTarget(null, types, allowedOperations, getNextTarget);
|
|
1593
|
-
return target ? 'move' : 'cancel';
|
|
1594
|
-
},
|
|
1595
2275
|
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
2276
|
+
const $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE = 20;
|
|
2277
|
+
function $12cc069a1c69155b$export$6323452ca4533ed8(ref) {
|
|
2278
|
+
let scrollableRef = $4vY0V$react.useRef(null);
|
|
2279
|
+
$4vY0V$react.useEffect(()=>{
|
|
2280
|
+
if (ref.current) scrollableRef.current = $4vY0V$reactariautils.getScrollParent(ref.current);
|
|
2281
|
+
}, [
|
|
2282
|
+
ref
|
|
2283
|
+
]);
|
|
2284
|
+
let state = $4vY0V$react.useRef({
|
|
2285
|
+
timer: null,
|
|
2286
|
+
dx: 0,
|
|
2287
|
+
dy: 0
|
|
2288
|
+
}).current;
|
|
2289
|
+
let scroll = $4vY0V$react.useCallback(()=>{
|
|
2290
|
+
scrollableRef.current.scrollLeft += state.dx;
|
|
2291
|
+
scrollableRef.current.scrollTop += state.dy;
|
|
2292
|
+
if (state.timer) state.timer = requestAnimationFrame(scroll);
|
|
2293
|
+
}, [
|
|
2294
|
+
scrollableRef,
|
|
2295
|
+
state
|
|
2296
|
+
]);
|
|
2297
|
+
return {
|
|
2298
|
+
move (x, y) {
|
|
2299
|
+
// Most browsers auto scroll natively, but WebKit on macOS does not (iOS does 🤷♂️).
|
|
2300
|
+
// https://bugs.webkit.org/show_bug.cgi?id=222636
|
|
2301
|
+
if (!$4vY0V$reactariautils.isWebKit() || $4vY0V$reactariautils.isIOS() || !scrollableRef.current) return;
|
|
2302
|
+
let box = scrollableRef.current.getBoundingClientRect();
|
|
2303
|
+
let left = $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
|
|
2304
|
+
let top = $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
|
|
2305
|
+
let bottom = box.height - $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
|
|
2306
|
+
let right = box.width - $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE;
|
|
2307
|
+
if (x < left || x > right || y < top || y > bottom) {
|
|
2308
|
+
if (x < left) state.dx = x - left;
|
|
2309
|
+
else if (x > right) state.dx = x - right;
|
|
2310
|
+
if (y < top) state.dy = y - top;
|
|
2311
|
+
else if (y > bottom) state.dy = y - bottom;
|
|
2312
|
+
if (!state.timer) state.timer = requestAnimationFrame(scroll);
|
|
2313
|
+
} else this.stop();
|
|
2314
|
+
},
|
|
2315
|
+
stop () {
|
|
2316
|
+
if (state.timer) {
|
|
2317
|
+
cancelAnimationFrame(state.timer);
|
|
2318
|
+
state.timer = null;
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
1601
2323
|
|
|
1602
|
-
onDropExit() {
|
|
1603
|
-
localState.state.setTarget(null);
|
|
1604
|
-
},
|
|
1605
2324
|
|
|
1606
|
-
onDropTargetEnter(target) {
|
|
1607
|
-
localState.state.setTarget(target);
|
|
1608
|
-
},
|
|
1609
2325
|
|
|
1610
|
-
onDropActivate(e) {
|
|
1611
|
-
var _localState$state$tar, _localState$state$tar2;
|
|
1612
2326
|
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
2327
|
+
const $7f93a158ac20b90a$var$DROP_POSITIONS = [
|
|
2328
|
+
'before',
|
|
2329
|
+
'on',
|
|
2330
|
+
'after'
|
|
2331
|
+
];
|
|
2332
|
+
function $7f93a158ac20b90a$export$f4e2f423c21f7b04(props, state1, ref2) {
|
|
2333
|
+
let localState = $4vY0V$react.useRef({
|
|
2334
|
+
props: props,
|
|
2335
|
+
state: state1,
|
|
2336
|
+
nextTarget: null,
|
|
2337
|
+
dropOperation: null
|
|
2338
|
+
}).current;
|
|
2339
|
+
localState.props = props;
|
|
2340
|
+
localState.state = state1;
|
|
2341
|
+
let autoScroll = $12cc069a1c69155b$export$6323452ca4533ed8(ref2);
|
|
2342
|
+
let { dropProps: dropProps } = $1ca228bc9257ca16$export$ccdee5eaf73cf661({
|
|
2343
|
+
ref: ref2,
|
|
2344
|
+
onDropEnter (e) {
|
|
2345
|
+
let target = props.getDropTargetFromPoint(e.x, e.y);
|
|
2346
|
+
state1.setTarget(target);
|
|
2347
|
+
},
|
|
2348
|
+
onDropMove (e) {
|
|
2349
|
+
state1.setTarget(localState.nextTarget);
|
|
2350
|
+
autoScroll.move(e.x, e.y);
|
|
2351
|
+
},
|
|
2352
|
+
getDropOperationForPoint (types, allowedOperations, x, y) {
|
|
2353
|
+
let target = props.getDropTargetFromPoint(x, y);
|
|
2354
|
+
if (!target) {
|
|
2355
|
+
localState.dropOperation = 'cancel';
|
|
2356
|
+
localState.nextTarget = null;
|
|
2357
|
+
return 'cancel';
|
|
2358
|
+
}
|
|
2359
|
+
localState.dropOperation = state1.getDropOperation(target, types, allowedOperations);
|
|
2360
|
+
// If the target doesn't accept the drop, see if the root accepts it instead.
|
|
2361
|
+
if (localState.dropOperation === 'cancel') {
|
|
2362
|
+
let rootTarget = {
|
|
2363
|
+
type: 'root'
|
|
2364
|
+
};
|
|
2365
|
+
let dropOperation = state1.getDropOperation(rootTarget, types, allowedOperations);
|
|
2366
|
+
if (dropOperation !== 'cancel') {
|
|
2367
|
+
target = rootTarget;
|
|
2368
|
+
localState.dropOperation = dropOperation;
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
localState.nextTarget = localState.dropOperation === 'cancel' ? null : target;
|
|
2372
|
+
return localState.dropOperation;
|
|
2373
|
+
},
|
|
2374
|
+
onDropExit () {
|
|
2375
|
+
state1.setTarget(null);
|
|
2376
|
+
autoScroll.stop();
|
|
2377
|
+
},
|
|
2378
|
+
onDropActivate (e) {
|
|
2379
|
+
var ref, ref1;
|
|
2380
|
+
if (((ref = state1.target) === null || ref === void 0 ? void 0 : ref.type) === 'item' && ((ref1 = state1.target) === null || ref1 === void 0 ? void 0 : ref1.dropPosition) === 'on' && typeof props.onDropActivate === 'function') props.onDropActivate({
|
|
2381
|
+
type: 'dropactivate',
|
|
2382
|
+
x: e.x,
|
|
2383
|
+
y: e.y,
|
|
2384
|
+
target: state1.target
|
|
2385
|
+
});
|
|
2386
|
+
},
|
|
2387
|
+
onDrop (e) {
|
|
2388
|
+
if (state1.target && typeof props.onDrop === 'function') onDrop(e, state1.target);
|
|
1621
2389
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
2390
|
+
});
|
|
2391
|
+
let droppingState = $4vY0V$react.useRef(null);
|
|
2392
|
+
let onDrop = $4vY0V$react.useCallback((e, target)=>{
|
|
2393
|
+
let { state: state2 } = localState;
|
|
2394
|
+
// Focus the collection.
|
|
2395
|
+
state2.selectionManager.setFocused(true);
|
|
2396
|
+
// Save some state of the collection/selection before the drop occurs so we can compare later.
|
|
2397
|
+
let focusedKey = state2.selectionManager.focusedKey;
|
|
2398
|
+
droppingState.current = {
|
|
2399
|
+
timeout: null,
|
|
2400
|
+
focusedKey: focusedKey,
|
|
2401
|
+
collection: state2.collection,
|
|
2402
|
+
selectedKeys: state2.selectionManager.selectedKeys
|
|
2403
|
+
};
|
|
2404
|
+
localState.props.onDrop({
|
|
1627
2405
|
type: 'drop',
|
|
1628
2406
|
x: e.x,
|
|
1629
|
-
// todo
|
|
1630
2407
|
y: e.y,
|
|
1631
|
-
target: target
|
|
2408
|
+
target: target,
|
|
1632
2409
|
items: e.items,
|
|
1633
2410
|
dropOperation: e.dropOperation
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
break;
|
|
2411
|
+
});
|
|
2412
|
+
// Wait for a short time period after the onDrop is called to allow the data to be read asynchronously
|
|
2413
|
+
// and for React to re-render. If an insert occurs during this time, it will be selected/focused below.
|
|
2414
|
+
// If items are not "immediately" inserted by the onDrop handler, the application will need to handle
|
|
2415
|
+
// selecting and focusing those items themselves.
|
|
2416
|
+
droppingState.current.timeout = setTimeout(()=>{
|
|
2417
|
+
// If focus didn't move already (e.g. due to an insert), and the user dropped on an item,
|
|
2418
|
+
// focus that item and show the focus ring to give the user feedback that the drop occurred.
|
|
2419
|
+
// Also show the focus ring if the focused key is not selected, e.g. in case of a reorder.
|
|
2420
|
+
let { state: state } = localState;
|
|
2421
|
+
if (state.selectionManager.focusedKey === focusedKey) {
|
|
2422
|
+
if (target.type === 'item' && target.dropPosition === 'on' && state.collection.getItem(target.key) != null) {
|
|
2423
|
+
state.selectionManager.setFocusedKey(target.key);
|
|
2424
|
+
state.selectionManager.setFocused(true);
|
|
2425
|
+
$4vY0V$reactariainteractions.setInteractionModality('keyboard');
|
|
2426
|
+
} else if (!state.selectionManager.isSelected(focusedKey)) $4vY0V$reactariainteractions.setInteractionModality('keyboard');
|
|
1653
2427
|
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
2428
|
+
droppingState.current = null;
|
|
2429
|
+
}, 50);
|
|
2430
|
+
}, [
|
|
2431
|
+
localState
|
|
2432
|
+
]);
|
|
2433
|
+
// eslint-disable-next-line arrow-body-style
|
|
2434
|
+
$4vY0V$react.useEffect(()=>{
|
|
2435
|
+
return ()=>{
|
|
2436
|
+
if (droppingState.current) clearTimeout(droppingState.current.timeout);
|
|
2437
|
+
};
|
|
2438
|
+
}, []);
|
|
2439
|
+
$4vY0V$reactariautils.useLayoutEffect(()=>{
|
|
2440
|
+
// If an insert occurs during a drop, we want to immediately select these items to give
|
|
2441
|
+
// feedback to the user that a drop occurred. Only do this if the selection didn't change
|
|
2442
|
+
// since the drop started so we don't override if the user or application did something.
|
|
2443
|
+
if (droppingState.current && state1.selectionManager.isFocused && state1.collection.size > droppingState.current.collection.size && state1.selectionManager.isSelectionEqual(droppingState.current.selectedKeys)) {
|
|
2444
|
+
let newKeys = new Set();
|
|
2445
|
+
for (let key of state1.collection.getKeys())if (!droppingState.current.collection.getItem(key)) newKeys.add(key);
|
|
2446
|
+
state1.selectionManager.setSelectedKeys(newKeys);
|
|
2447
|
+
// If the focused item didn't change since the drop occurred, also focus the first
|
|
2448
|
+
// inserted item. If selection is disabled, then also show the focus ring so there
|
|
2449
|
+
// is some indication that items were added.
|
|
2450
|
+
if (state1.selectionManager.focusedKey === droppingState.current.focusedKey) {
|
|
2451
|
+
let first = newKeys.keys().next().value;
|
|
2452
|
+
state1.selectionManager.setFocusedKey(first);
|
|
2453
|
+
if (state1.selectionManager.selectionMode === 'none') $4vY0V$reactariainteractions.setInteractionModality('keyboard');
|
|
1663
2454
|
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
2455
|
+
droppingState.current = null;
|
|
2456
|
+
}
|
|
2457
|
+
});
|
|
2458
|
+
$4vY0V$react.useEffect(()=>{
|
|
2459
|
+
let getNextTarget1 = (target, wrap = true)=>{
|
|
2460
|
+
if (!target) return {
|
|
2461
|
+
type: 'root'
|
|
2462
|
+
};
|
|
2463
|
+
let { keyboardDelegate: keyboardDelegate } = localState.props;
|
|
2464
|
+
let nextKey = target.type === 'item' ? keyboardDelegate.getKeyBelow(target.key) : keyboardDelegate.getFirstKey();
|
|
2465
|
+
let dropPosition = 'before';
|
|
2466
|
+
if (target.type === 'item') {
|
|
2467
|
+
let positionIndex = $7f93a158ac20b90a$var$DROP_POSITIONS.indexOf(target.dropPosition);
|
|
2468
|
+
let nextDropPosition = $7f93a158ac20b90a$var$DROP_POSITIONS[positionIndex + 1];
|
|
2469
|
+
if (positionIndex < $7f93a158ac20b90a$var$DROP_POSITIONS.length - 1 && !(nextDropPosition === 'after' && nextKey != null)) return {
|
|
2470
|
+
type: 'item',
|
|
2471
|
+
key: target.key,
|
|
2472
|
+
dropPosition: nextDropPosition
|
|
2473
|
+
};
|
|
2474
|
+
// If the last drop position was 'after', then 'before' on the next key is equivalent.
|
|
2475
|
+
// Switch to 'on' instead.
|
|
2476
|
+
if (target.dropPosition === 'after') dropPosition = 'on';
|
|
1673
2477
|
}
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
localState.state.setTarget(target);
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
break;
|
|
2478
|
+
if (nextKey == null) {
|
|
2479
|
+
if (wrap) return {
|
|
2480
|
+
type: 'root'
|
|
2481
|
+
};
|
|
2482
|
+
return null;
|
|
1683
2483
|
}
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
if (nextKey == null || target.type === 'item' && target.key === keyboardDelegate.getLastKey()) {
|
|
1700
|
-
nextKey = keyboardDelegate.getLastKey();
|
|
1701
|
-
dropPosition = 'after';
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
target = {
|
|
2484
|
+
return {
|
|
2485
|
+
type: 'item',
|
|
2486
|
+
key: nextKey,
|
|
2487
|
+
dropPosition: dropPosition
|
|
2488
|
+
};
|
|
2489
|
+
};
|
|
2490
|
+
let getPreviousTarget = (target, wrap = true)=>{
|
|
2491
|
+
let { keyboardDelegate: keyboardDelegate } = localState.props;
|
|
2492
|
+
let nextKey = (target === null || target === void 0 ? void 0 : target.type) === 'item' ? keyboardDelegate.getKeyAbove(target.key) : keyboardDelegate.getLastKey();
|
|
2493
|
+
let dropPosition = !target || target.type === 'root' ? 'after' : 'on';
|
|
2494
|
+
if ((target === null || target === void 0 ? void 0 : target.type) === 'item') {
|
|
2495
|
+
let positionIndex = $7f93a158ac20b90a$var$DROP_POSITIONS.indexOf(target.dropPosition);
|
|
2496
|
+
let nextDropPosition = $7f93a158ac20b90a$var$DROP_POSITIONS[positionIndex - 1];
|
|
2497
|
+
if (positionIndex > 0 && nextDropPosition !== 'after') return {
|
|
1705
2498
|
type: 'item',
|
|
1706
|
-
key:
|
|
1707
|
-
dropPosition
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
if (operation === 'cancel') {
|
|
1714
|
-
var _nextValidTarget;
|
|
1715
|
-
|
|
1716
|
-
target = (_nextValidTarget = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget, false)) != null ? _nextValidTarget : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
localState.state.setTarget((_target = target) != null ? _target : localState.state.target);
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
break;
|
|
2499
|
+
key: target.key,
|
|
2500
|
+
dropPosition: nextDropPosition
|
|
2501
|
+
};
|
|
2502
|
+
// If the last drop position was 'before', then 'after' on the previous key is equivalent.
|
|
2503
|
+
// Switch to 'on' instead.
|
|
2504
|
+
if (target.dropPosition === 'before') dropPosition = 'on';
|
|
1724
2505
|
}
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
{
|
|
1728
|
-
var _target2;
|
|
1729
|
-
|
|
1730
|
-
if (!keyboardDelegate.getKeyPageAbove) {
|
|
1731
|
-
break;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
let target = localState.state.target;
|
|
1735
|
-
|
|
1736
|
-
if (!target) {
|
|
1737
|
-
target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
|
|
1738
|
-
} else if (target.type === 'item') {
|
|
1739
|
-
// If at the top already, switch to the root. Otherwise navigate a page up.
|
|
1740
|
-
if (target.key === keyboardDelegate.getFirstKey()) {
|
|
1741
|
-
target = {
|
|
2506
|
+
if (nextKey == null) {
|
|
2507
|
+
if (wrap) return {
|
|
1742
2508
|
type: 'root'
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
2509
|
+
};
|
|
2510
|
+
return null;
|
|
2511
|
+
}
|
|
2512
|
+
return {
|
|
2513
|
+
type: 'item',
|
|
2514
|
+
key: nextKey,
|
|
2515
|
+
dropPosition: dropPosition
|
|
2516
|
+
};
|
|
2517
|
+
};
|
|
2518
|
+
let nextValidTarget = (target, types, allowedDropOperations, getNextTarget, wrap = true)=>{
|
|
2519
|
+
let seenRoot = 0;
|
|
2520
|
+
let operation;
|
|
2521
|
+
do {
|
|
2522
|
+
let nextTarget = getNextTarget(target, wrap);
|
|
2523
|
+
if (!nextTarget) return null;
|
|
2524
|
+
target = nextTarget;
|
|
2525
|
+
operation = localState.state.getDropOperation(nextTarget, types, allowedDropOperations);
|
|
2526
|
+
if (target.type === 'root') seenRoot++;
|
|
2527
|
+
}while (operation === 'cancel' && !localState.state.isDropTarget(target) && seenRoot < 2)
|
|
2528
|
+
if (operation === 'cancel') return null;
|
|
2529
|
+
return target;
|
|
2530
|
+
};
|
|
2531
|
+
return $28e10663603f5ea1$export$c28d9fb4a54e471a({
|
|
2532
|
+
element: ref2.current,
|
|
2533
|
+
getDropOperation (types, allowedOperations) {
|
|
2534
|
+
if (localState.state.target) return localState.state.getDropOperation(localState.state.target, types, allowedOperations);
|
|
2535
|
+
// Check if any of the targets accept the drop.
|
|
2536
|
+
// TODO: should we have a faster way of doing this or e.g. for pagination?
|
|
2537
|
+
let target = nextValidTarget(null, types, allowedOperations, getNextTarget1);
|
|
2538
|
+
return target ? 'move' : 'cancel';
|
|
2539
|
+
},
|
|
2540
|
+
onDropEnter (e, drag) {
|
|
2541
|
+
let types = $4620ae0dc40f0031$export$e1d41611756c6326(drag.items);
|
|
2542
|
+
let selectionManager = localState.state.selectionManager;
|
|
2543
|
+
let target;
|
|
2544
|
+
// When entering the droppable collection for the first time, the default drop target
|
|
2545
|
+
// is after the focused key.
|
|
2546
|
+
let key = selectionManager.focusedKey;
|
|
2547
|
+
let dropPosition = 'after';
|
|
2548
|
+
// If the focused key is a cell, get the parent item instead.
|
|
2549
|
+
// For now, we assume that individual cells cannot be dropped on.
|
|
2550
|
+
let item = localState.state.collection.getItem(key);
|
|
2551
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === 'cell') key = item.parentKey;
|
|
2552
|
+
// If the focused item is also selected, the default drop target is after the last selected item.
|
|
2553
|
+
// But if the focused key is the first selected item, then default to before the first selected item.
|
|
2554
|
+
// This is to make reordering lists slightly easier. If you select top down, we assume you want to
|
|
2555
|
+
// move the items down. If you select bottom up, we assume you want to move the items up.
|
|
2556
|
+
if (selectionManager.isSelected(key)) {
|
|
2557
|
+
if (selectionManager.selectedKeys.size > 1 && selectionManager.firstSelectedKey === key) dropPosition = 'before';
|
|
2558
|
+
else key = selectionManager.lastSelectedKey;
|
|
2559
|
+
}
|
|
2560
|
+
if (key != null) {
|
|
2561
|
+
target = {
|
|
2562
|
+
type: 'item',
|
|
2563
|
+
key: key,
|
|
2564
|
+
dropPosition: dropPosition
|
|
2565
|
+
};
|
|
2566
|
+
var ref;
|
|
2567
|
+
// If the default target is not valid, find the next one that is.
|
|
2568
|
+
if (localState.state.getDropOperation(target, types, drag.allowedDropOperations) === 'cancel') target = (ref = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false)) !== null && ref !== void 0 ? ref : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
|
|
2569
|
+
}
|
|
2570
|
+
// If no focused key, then start from the root.
|
|
2571
|
+
if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
|
|
2572
|
+
localState.state.setTarget(target);
|
|
2573
|
+
},
|
|
2574
|
+
onDropExit () {
|
|
2575
|
+
localState.state.setTarget(null);
|
|
2576
|
+
},
|
|
2577
|
+
onDropTargetEnter (target) {
|
|
2578
|
+
localState.state.setTarget(target);
|
|
2579
|
+
},
|
|
2580
|
+
onDropActivate (e) {
|
|
2581
|
+
var ref, ref3;
|
|
2582
|
+
if (((ref = localState.state.target) === null || ref === void 0 ? void 0 : ref.type) === 'item' && ((ref3 = localState.state.target) === null || ref3 === void 0 ? void 0 : ref3.dropPosition) === 'on' && typeof localState.props.onDropActivate === 'function') localState.props.onDropActivate({
|
|
2583
|
+
type: 'dropactivate',
|
|
2584
|
+
x: e.x,
|
|
2585
|
+
y: e.y,
|
|
2586
|
+
target: localState.state.target
|
|
2587
|
+
});
|
|
2588
|
+
},
|
|
2589
|
+
onDrop (e, target) {
|
|
2590
|
+
if (localState.state.target && typeof localState.props.onDrop === 'function') onDrop(e, target || localState.state.target);
|
|
2591
|
+
},
|
|
2592
|
+
onKeyDown (e, drag) {
|
|
2593
|
+
let { keyboardDelegate: keyboardDelegate } = localState.props;
|
|
2594
|
+
let types = $4620ae0dc40f0031$export$e1d41611756c6326(drag.items);
|
|
2595
|
+
switch(e.key){
|
|
2596
|
+
case 'ArrowDown':
|
|
2597
|
+
if (keyboardDelegate.getKeyBelow) {
|
|
2598
|
+
let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getNextTarget1);
|
|
2599
|
+
localState.state.setTarget(target);
|
|
2600
|
+
}
|
|
2601
|
+
break;
|
|
2602
|
+
case 'ArrowUp':
|
|
2603
|
+
if (keyboardDelegate.getKeyAbove) {
|
|
2604
|
+
let target = nextValidTarget(localState.state.target, types, drag.allowedDropOperations, getPreviousTarget);
|
|
2605
|
+
localState.state.setTarget(target);
|
|
2606
|
+
}
|
|
2607
|
+
break;
|
|
2608
|
+
case 'Home':
|
|
2609
|
+
if (keyboardDelegate.getFirstKey) {
|
|
2610
|
+
let target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
|
|
2611
|
+
localState.state.setTarget(target);
|
|
2612
|
+
}
|
|
2613
|
+
break;
|
|
2614
|
+
case 'End':
|
|
2615
|
+
if (keyboardDelegate.getLastKey) {
|
|
2616
|
+
let target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
|
|
2617
|
+
localState.state.setTarget(target);
|
|
2618
|
+
}
|
|
2619
|
+
break;
|
|
2620
|
+
case 'PageDown':
|
|
2621
|
+
if (keyboardDelegate.getKeyPageBelow) {
|
|
2622
|
+
let target = localState.state.target;
|
|
2623
|
+
if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getNextTarget1);
|
|
2624
|
+
else {
|
|
2625
|
+
// If on the root, go to the item a page below the top. Otherwise a page below the current item.
|
|
2626
|
+
let nextKey = keyboardDelegate.getKeyPageBelow(target.type === 'item' ? target.key : keyboardDelegate.getFirstKey());
|
|
2627
|
+
let dropPosition = target.type === 'item' ? target.dropPosition : 'after';
|
|
2628
|
+
// If there is no next key, or we are starting on the last key, jump to the last possible position.
|
|
2629
|
+
if (nextKey == null || target.type === 'item' && target.key === keyboardDelegate.getLastKey()) {
|
|
2630
|
+
nextKey = keyboardDelegate.getLastKey();
|
|
2631
|
+
dropPosition = 'after';
|
|
2632
|
+
}
|
|
2633
|
+
target = {
|
|
2634
|
+
type: 'item',
|
|
2635
|
+
key: nextKey,
|
|
2636
|
+
dropPosition: dropPosition
|
|
2637
|
+
};
|
|
2638
|
+
// If the target does not accept the drop, find the next valid target.
|
|
2639
|
+
// If no next valid target, find the previous valid target.
|
|
2640
|
+
let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
|
|
2641
|
+
var ref;
|
|
2642
|
+
if (operation === 'cancel') target = (ref = nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false)) !== null && ref !== void 0 ? ref : nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false);
|
|
2643
|
+
}
|
|
2644
|
+
localState.state.setTarget(target !== null && target !== void 0 ? target : localState.state.target);
|
|
2645
|
+
}
|
|
2646
|
+
break;
|
|
2647
|
+
case 'PageUp':
|
|
2648
|
+
{
|
|
2649
|
+
if (!keyboardDelegate.getKeyPageAbove) break;
|
|
2650
|
+
let target = localState.state.target;
|
|
2651
|
+
if (!target) target = nextValidTarget(null, types, drag.allowedDropOperations, getPreviousTarget);
|
|
2652
|
+
else if (target.type === 'item') {
|
|
2653
|
+
// If at the top already, switch to the root. Otherwise navigate a page up.
|
|
2654
|
+
if (target.key === keyboardDelegate.getFirstKey()) target = {
|
|
2655
|
+
type: 'root'
|
|
2656
|
+
};
|
|
2657
|
+
else {
|
|
2658
|
+
let nextKey = keyboardDelegate.getKeyPageAbove(target.key);
|
|
2659
|
+
let dropPosition = target.dropPosition;
|
|
2660
|
+
if (nextKey == null) {
|
|
2661
|
+
nextKey = keyboardDelegate.getFirstKey();
|
|
2662
|
+
dropPosition = 'before';
|
|
2663
|
+
}
|
|
2664
|
+
target = {
|
|
2665
|
+
type: 'item',
|
|
2666
|
+
key: nextKey,
|
|
2667
|
+
dropPosition: dropPosition
|
|
2668
|
+
};
|
|
2669
|
+
}
|
|
2670
|
+
// If the target does not accept the drop, find the previous valid target.
|
|
2671
|
+
// If no next valid target, find the next valid target.
|
|
2672
|
+
let operation = localState.state.getDropOperation(target, types, drag.allowedDropOperations);
|
|
2673
|
+
var ref4;
|
|
2674
|
+
if (operation === 'cancel') target = (ref4 = nextValidTarget(target, types, drag.allowedDropOperations, getPreviousTarget, false)) !== null && ref4 !== void 0 ? ref4 : nextValidTarget(target, types, drag.allowedDropOperations, getNextTarget1, false);
|
|
2675
|
+
}
|
|
2676
|
+
localState.state.setTarget(target !== null && target !== void 0 ? target : localState.state.target);
|
|
2677
|
+
break;
|
|
2678
|
+
}
|
|
1768
2679
|
}
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
localState.state.setTarget((_target2 = target) != null ? _target2 : localState.state.target);
|
|
1772
|
-
break;
|
|
1773
2680
|
}
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
2681
|
+
});
|
|
2682
|
+
}, [
|
|
2683
|
+
localState,
|
|
2684
|
+
ref2,
|
|
2685
|
+
onDrop
|
|
2686
|
+
]);
|
|
2687
|
+
let id = $4620ae0dc40f0031$export$b1601eb39394a581(state1);
|
|
2688
|
+
return {
|
|
2689
|
+
collectionProps: $4vY0V$reactariautils.mergeProps(dropProps, {
|
|
2690
|
+
id: id,
|
|
2691
|
+
// Remove description from collection element. If dropping on the entire collection,
|
|
2692
|
+
// there should be a drop indicator that has this description, so no need to double announce.
|
|
2693
|
+
'aria-describedby': null
|
|
2694
|
+
})
|
|
2695
|
+
};
|
|
1788
2696
|
}
|
|
1789
2697
|
|
|
1790
|
-
exports.useDroppableCollection = useDroppableCollection;
|
|
1791
2698
|
|
|
1792
|
-
function useDroppableItem(options, state, ref) {
|
|
1793
|
-
let {
|
|
1794
|
-
dropProps
|
|
1795
|
-
} = $ca75888e192994dbb11ae05e54$export$useVirtualDrop();
|
|
1796
|
-
useEffect(() => {
|
|
1797
|
-
if (ref.current) {
|
|
1798
|
-
return $a75d092e5c30878812fba78e$export$registerDropItem({
|
|
1799
|
-
element: ref.current,
|
|
1800
|
-
target: options.target,
|
|
1801
2699
|
|
|
1802
|
-
getDropOperation(types, allowedOperations) {
|
|
1803
|
-
return state.getDropOperation(options.target, types, allowedOperations);
|
|
1804
|
-
}
|
|
1805
2700
|
|
|
1806
|
-
});
|
|
1807
|
-
}
|
|
1808
|
-
}, [ref, options.target, state]);
|
|
1809
|
-
let dragSession = $a75d092e5c30878812fba78e$export$useDragSession();
|
|
1810
|
-
let isValidDropTarget = dragSession && state.getDropOperation(options.target, $bc29619458500c186021634c18dc$export$getTypes(dragSession.dragTarget.items), dragSession.dragTarget.allowedDropOperations) !== 'cancel';
|
|
1811
|
-
let isDropTarget = state.isDropTarget(options.target);
|
|
1812
|
-
useEffect(() => {
|
|
1813
|
-
if (dragSession && isDropTarget && ref.current) {
|
|
1814
|
-
ref.current.focus();
|
|
1815
|
-
}
|
|
1816
|
-
}, [isDropTarget, dragSession, ref]);
|
|
1817
|
-
return {
|
|
1818
|
-
dropProps: _babelRuntimeHelpersExtends({}, dropProps, {
|
|
1819
|
-
'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
|
|
1820
|
-
})
|
|
1821
|
-
};
|
|
1822
|
-
}
|
|
1823
2701
|
|
|
1824
|
-
exports.useDroppableItem = useDroppableItem;
|
|
1825
|
-
// @ts-ignore
|
|
1826
|
-
const $e2ffcaef12f0c83baf595a484787300$var$intlMessages = {
|
|
1827
|
-
"en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
|
|
1828
|
-
};
|
|
1829
2702
|
|
|
1830
|
-
function
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
let before = target.dropPosition === 'before' ? collection.getKeyBefore(target.key) : target.key;
|
|
1862
|
-
let after = target.dropPosition === 'after' ? collection.getKeyAfter(target.key) : target.key;
|
|
1863
|
-
|
|
1864
|
-
if (before && after) {
|
|
1865
|
-
label = formatMessage('insertBetween', {
|
|
1866
|
-
beforeItemText: getText(before),
|
|
1867
|
-
afterItemText: getText(after)
|
|
1868
|
-
});
|
|
1869
|
-
} else if (before) {
|
|
1870
|
-
label = formatMessage('insertAfter', {
|
|
1871
|
-
itemText: getText(before)
|
|
1872
|
-
});
|
|
1873
|
-
} else if (after) {
|
|
1874
|
-
label = formatMessage('insertBefore', {
|
|
1875
|
-
itemText: getText(after)
|
|
1876
|
-
});
|
|
1877
|
-
}
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
return {
|
|
1881
|
-
dropIndicatorProps: _babelRuntimeHelpersExtends({}, dropProps, {
|
|
1882
|
-
id,
|
|
1883
|
-
'aria-roledescription': formatMessage('dropIndicator'),
|
|
1884
|
-
'aria-label': label,
|
|
1885
|
-
'aria-labelledby': labelledBy,
|
|
1886
|
-
'aria-hidden': !dragSession ? 'true' : dropProps['aria-hidden'],
|
|
1887
|
-
tabIndex: -1
|
|
1888
|
-
})
|
|
1889
|
-
};
|
|
2703
|
+
function $fc1876157e07bcec$export$f7b0c5d28b66b6a5(options, state, ref) {
|
|
2704
|
+
let { dropProps: dropProps } = $419982e205c8e8dc$export$62447ad3d2ec7da6();
|
|
2705
|
+
$4vY0V$react.useEffect(()=>{
|
|
2706
|
+
if (ref.current) return $28e10663603f5ea1$export$aef80212ac99c003({
|
|
2707
|
+
element: ref.current,
|
|
2708
|
+
target: options.target,
|
|
2709
|
+
getDropOperation (types, allowedOperations) {
|
|
2710
|
+
return state.getDropOperation(options.target, types, allowedOperations);
|
|
2711
|
+
}
|
|
2712
|
+
});
|
|
2713
|
+
}, [
|
|
2714
|
+
ref,
|
|
2715
|
+
options.target,
|
|
2716
|
+
state
|
|
2717
|
+
]);
|
|
2718
|
+
let dragSession = $28e10663603f5ea1$export$418e185dd3f1b968();
|
|
2719
|
+
let isValidDropTarget = dragSession && state.getDropOperation(options.target, $4620ae0dc40f0031$export$e1d41611756c6326(dragSession.dragTarget.items), dragSession.dragTarget.allowedDropOperations) !== 'cancel';
|
|
2720
|
+
let isDropTarget = state.isDropTarget(options.target);
|
|
2721
|
+
$4vY0V$react.useEffect(()=>{
|
|
2722
|
+
if (dragSession && isDropTarget && ref.current) ref.current.focus();
|
|
2723
|
+
}, [
|
|
2724
|
+
isDropTarget,
|
|
2725
|
+
dragSession,
|
|
2726
|
+
ref
|
|
2727
|
+
]);
|
|
2728
|
+
return {
|
|
2729
|
+
dropProps: {
|
|
2730
|
+
...dropProps,
|
|
2731
|
+
'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
|
|
2732
|
+
}
|
|
2733
|
+
};
|
|
1890
2734
|
}
|
|
1891
2735
|
|
|
1892
|
-
exports.useDropIndicator = useDropIndicator;
|
|
1893
|
-
// @ts-ignore
|
|
1894
|
-
const $a1d519dfa8f428d414c97a867b60c6f$var$intlMessages = {
|
|
1895
|
-
"en-US": _babelRuntimeHelpersInteropRequireDefault($ece80d58838919a4624d1c28b393f77$exports).default
|
|
1896
|
-
};
|
|
1897
2736
|
|
|
1898
|
-
function useDraggableItem(props, state) {
|
|
1899
|
-
let formatMessage = useMessageFormatter($a1d519dfa8f428d414c97a867b60c6f$var$intlMessages);
|
|
1900
|
-
let {
|
|
1901
|
-
dragProps,
|
|
1902
|
-
dragButtonProps
|
|
1903
|
-
} = useDrag({
|
|
1904
|
-
getItems() {
|
|
1905
|
-
return state.getItems(props.key);
|
|
1906
|
-
},
|
|
1907
2737
|
|
|
1908
|
-
renderPreview() {
|
|
1909
|
-
return state.renderPreview(props.key);
|
|
1910
|
-
},
|
|
1911
2738
|
|
|
1912
|
-
onDragStart(e) {
|
|
1913
|
-
state.startDrag(props.key, e);
|
|
1914
|
-
},
|
|
1915
2739
|
|
|
1916
|
-
onDragMove(e) {
|
|
1917
|
-
state.moveDrag(e);
|
|
1918
|
-
},
|
|
1919
2740
|
|
|
1920
|
-
onDragEnd(e) {
|
|
1921
|
-
state.endDrag(e);
|
|
1922
|
-
}
|
|
1923
2741
|
|
|
1924
|
-
});
|
|
1925
|
-
let item = state.collection.getItem(props.key);
|
|
1926
|
-
let numSelectedKeys = state.selectionManager.selectedKeys.size;
|
|
1927
|
-
let isSelected = state.selectionManager.isSelected(props.key);
|
|
1928
|
-
let message;
|
|
1929
2742
|
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
2743
|
+
function $c5557edbed563ebf$export$8d0e41d2815afac5(props, state, ref1) {
|
|
2744
|
+
let { target: target } = props;
|
|
2745
|
+
let { collection: collection } = state;
|
|
2746
|
+
let stringFormatter = $4vY0V$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
|
|
2747
|
+
let dragSession = $28e10663603f5ea1$export$418e185dd3f1b968();
|
|
2748
|
+
let { dropProps: dropProps } = $fc1876157e07bcec$export$f7b0c5d28b66b6a5(props, state, ref1);
|
|
2749
|
+
let id = $4vY0V$reactariautils.useId();
|
|
2750
|
+
let getText = (key)=>{
|
|
2751
|
+
var ref;
|
|
2752
|
+
return (ref = collection.getItem(key)) === null || ref === void 0 ? void 0 : ref.textValue;
|
|
2753
|
+
};
|
|
2754
|
+
let label = '';
|
|
2755
|
+
let labelledBy;
|
|
2756
|
+
if (target.type === 'root') {
|
|
2757
|
+
label = stringFormatter.format('dropOnRoot');
|
|
2758
|
+
labelledBy = `${id} ${$4620ae0dc40f0031$export$3093291712f09a77(state)}`;
|
|
2759
|
+
} else if (target.dropPosition === 'on') label = stringFormatter.format('dropOnItem', {
|
|
2760
|
+
itemText: getText(target.key)
|
|
1939
2761
|
});
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
2762
|
+
else {
|
|
2763
|
+
let before = target.dropPosition === 'before' ? collection.getKeyBefore(target.key) : target.key;
|
|
2764
|
+
let after = target.dropPosition === 'after' ? collection.getKeyAfter(target.key) : target.key;
|
|
2765
|
+
if (before && after) label = stringFormatter.format('insertBetween', {
|
|
2766
|
+
beforeItemText: getText(before),
|
|
2767
|
+
afterItemText: getText(after)
|
|
2768
|
+
});
|
|
2769
|
+
else if (before) label = stringFormatter.format('insertAfter', {
|
|
2770
|
+
itemText: getText(before)
|
|
2771
|
+
});
|
|
2772
|
+
else if (after) label = stringFormatter.format('insertBefore', {
|
|
2773
|
+
itemText: getText(after)
|
|
2774
|
+
});
|
|
2775
|
+
}
|
|
2776
|
+
return {
|
|
2777
|
+
dropIndicatorProps: {
|
|
2778
|
+
...dropProps,
|
|
2779
|
+
id: id,
|
|
2780
|
+
'aria-roledescription': stringFormatter.format('dropIndicator'),
|
|
2781
|
+
'aria-label': label,
|
|
2782
|
+
'aria-labelledby': labelledBy,
|
|
2783
|
+
'aria-hidden': !dragSession ? 'true' : dropProps['aria-hidden'],
|
|
2784
|
+
tabIndex: -1
|
|
2785
|
+
}
|
|
2786
|
+
};
|
|
1948
2787
|
}
|
|
1949
2788
|
|
|
1950
|
-
exports.useDraggableItem = useDraggableItem;
|
|
1951
|
-
const $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents = new Map();
|
|
1952
2789
|
|
|
1953
|
-
function $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener(event, fn) {
|
|
1954
|
-
let eventData = $c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.get(event);
|
|
1955
2790
|
|
|
1956
|
-
if (!eventData) {
|
|
1957
|
-
let handlers = new Set();
|
|
1958
2791
|
|
|
1959
|
-
let listener = e => {
|
|
1960
|
-
for (let handler of handlers) {
|
|
1961
|
-
handler(e);
|
|
1962
|
-
}
|
|
1963
|
-
};
|
|
1964
2792
|
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
2793
|
+
function $0cbbd00cda972c67$export$b35afafff42da2d9(props, state) {
|
|
2794
|
+
let stringFormatter = $4vY0V$reactariai18n.useLocalizedStringFormatter((/*@__PURE__*/$parcel$interopDefault($d624b4da796f302a$exports)));
|
|
2795
|
+
let { dragProps: dragProps , dragButtonProps: dragButtonProps } = $dc204e8ec58447a6$export$7941f8aafa4b6021({
|
|
2796
|
+
getItems () {
|
|
2797
|
+
return state.getItems(props.key);
|
|
2798
|
+
},
|
|
2799
|
+
preview: state.preview,
|
|
2800
|
+
onDragStart (e) {
|
|
2801
|
+
state.startDrag(props.key, e);
|
|
2802
|
+
},
|
|
2803
|
+
onDragMove (e) {
|
|
2804
|
+
state.moveDrag(e);
|
|
2805
|
+
},
|
|
2806
|
+
onDragEnd (e) {
|
|
2807
|
+
state.endDrag(e);
|
|
2808
|
+
}
|
|
2809
|
+
});
|
|
2810
|
+
let item = state.collection.getItem(props.key);
|
|
2811
|
+
let numKeysForDrag = state.getKeysForDrag(props.key).size;
|
|
2812
|
+
let isSelected = state.selectionManager.isSelected(props.key);
|
|
2813
|
+
let message;
|
|
2814
|
+
var ref;
|
|
2815
|
+
if (isSelected && numKeysForDrag > 1) message = stringFormatter.format('dragSelectedItems', {
|
|
2816
|
+
count: numKeysForDrag
|
|
2817
|
+
});
|
|
2818
|
+
else message = stringFormatter.format('dragItem', {
|
|
2819
|
+
itemText: (ref = item === null || item === void 0 ? void 0 : item.textValue) !== null && ref !== void 0 ? ref : ''
|
|
2820
|
+
});
|
|
2821
|
+
return {
|
|
2822
|
+
dragProps: dragProps,
|
|
2823
|
+
dragButtonProps: {
|
|
2824
|
+
...dragButtonProps,
|
|
2825
|
+
'aria-label': message
|
|
2826
|
+
}
|
|
1968
2827
|
};
|
|
1969
|
-
$c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.set(event, eventData);
|
|
1970
|
-
document.addEventListener(event, listener);
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
eventData.handlers.add(fn);
|
|
1974
|
-
return () => {
|
|
1975
|
-
eventData.handlers.delete(fn);
|
|
1976
|
-
|
|
1977
|
-
if (eventData.handlers.size === 0) {
|
|
1978
|
-
document.removeEventListener(event, eventData.listener);
|
|
1979
|
-
$c1be8e43b63c7fad889cec0e3e2f47d5$var$globalEvents.delete(event);
|
|
1980
|
-
}
|
|
1981
|
-
};
|
|
1982
2828
|
}
|
|
1983
2829
|
|
|
1984
|
-
function useClipboard(options) {
|
|
1985
|
-
let ref = useRef(options);
|
|
1986
|
-
ref.current = options;
|
|
1987
|
-
let isFocusedRef = useRef(false);
|
|
1988
|
-
let {
|
|
1989
|
-
focusProps
|
|
1990
|
-
} = useFocus({
|
|
1991
|
-
onFocusChange: isFocused => {
|
|
1992
|
-
isFocusedRef.current = isFocused;
|
|
1993
|
-
}
|
|
1994
|
-
});
|
|
1995
|
-
useEffect(() => {
|
|
1996
|
-
let onBeforeCopy = e => {
|
|
1997
|
-
// Enable the "Copy" menu item in Safari if this element is focused and copying is supported.
|
|
1998
|
-
let options = ref.current;
|
|
1999
|
-
|
|
2000
|
-
if (isFocusedRef.current && options.getItems) {
|
|
2001
|
-
e.preventDefault();
|
|
2002
|
-
}
|
|
2003
|
-
};
|
|
2004
2830
|
|
|
2005
|
-
let onCopy = e => {
|
|
2006
|
-
let options = ref.current;
|
|
2007
2831
|
|
|
2008
|
-
if (!isFocusedRef.current || !options.getItems) {
|
|
2009
|
-
return;
|
|
2010
|
-
}
|
|
2011
2832
|
|
|
2012
|
-
e.preventDefault();
|
|
2013
|
-
$bc29619458500c186021634c18dc$export$writeToDataTransfer(e.clipboardData, options.getItems());
|
|
2014
|
-
options.onCopy == null ? void 0 : options.onCopy();
|
|
2015
|
-
};
|
|
2016
2833
|
|
|
2017
|
-
let onBeforeCut = e => {
|
|
2018
|
-
let options = ref.current;
|
|
2019
2834
|
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2835
|
+
const $74f3dedaa4d234b4$var$globalEvents = new Map();
|
|
2836
|
+
function $74f3dedaa4d234b4$var$addGlobalEventListener(event, fn) {
|
|
2837
|
+
let eventData = $74f3dedaa4d234b4$var$globalEvents.get(event);
|
|
2838
|
+
if (!eventData) {
|
|
2839
|
+
let handlers = new Set();
|
|
2840
|
+
let listener = (e)=>{
|
|
2841
|
+
for (let handler of handlers)handler(e);
|
|
2842
|
+
};
|
|
2843
|
+
eventData = {
|
|
2844
|
+
listener: listener,
|
|
2845
|
+
handlers: handlers
|
|
2846
|
+
};
|
|
2847
|
+
$74f3dedaa4d234b4$var$globalEvents.set(event, eventData);
|
|
2848
|
+
document.addEventListener(event, listener);
|
|
2849
|
+
}
|
|
2850
|
+
eventData.handlers.add(fn);
|
|
2851
|
+
return ()=>{
|
|
2852
|
+
eventData.handlers.delete(fn);
|
|
2853
|
+
if (eventData.handlers.size === 0) {
|
|
2854
|
+
document.removeEventListener(event, eventData.listener);
|
|
2855
|
+
$74f3dedaa4d234b4$var$globalEvents.delete(event);
|
|
2856
|
+
}
|
|
2023
2857
|
};
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2858
|
+
}
|
|
2859
|
+
function $74f3dedaa4d234b4$export$2314ca2a3e892862(options1) {
|
|
2860
|
+
let ref = $4vY0V$react.useRef(options1);
|
|
2861
|
+
ref.current = options1;
|
|
2862
|
+
let isFocusedRef = $4vY0V$react.useRef(false);
|
|
2863
|
+
let { focusProps: focusProps } = $4vY0V$reactariainteractions.useFocus({
|
|
2864
|
+
onFocusChange: (isFocused)=>{
|
|
2865
|
+
isFocusedRef.current = isFocused;
|
|
2866
|
+
}
|
|
2867
|
+
});
|
|
2868
|
+
$4vY0V$react.useEffect(()=>{
|
|
2869
|
+
let onBeforeCopy = (e)=>{
|
|
2870
|
+
// Enable the "Copy" menu item in Safari if this element is focused and copying is supported.
|
|
2871
|
+
let options = ref.current;
|
|
2872
|
+
if (isFocusedRef.current && options.getItems) e.preventDefault();
|
|
2873
|
+
};
|
|
2874
|
+
let onCopy = (e)=>{
|
|
2875
|
+
var ref1;
|
|
2876
|
+
let options = ref.current;
|
|
2877
|
+
if (!isFocusedRef.current || !options.getItems) return;
|
|
2878
|
+
e.preventDefault();
|
|
2879
|
+
$4620ae0dc40f0031$export$f9c1490890ddd063(e.clipboardData, options.getItems());
|
|
2880
|
+
(ref1 = options.onCopy) === null || ref1 === void 0 ? void 0 : ref1.call(options);
|
|
2881
|
+
};
|
|
2882
|
+
let onBeforeCut = (e)=>{
|
|
2883
|
+
let options = ref.current;
|
|
2884
|
+
if (isFocusedRef.current && options.onCut && options.getItems) e.preventDefault();
|
|
2885
|
+
};
|
|
2886
|
+
let onCut = (e)=>{
|
|
2887
|
+
let options = ref.current;
|
|
2888
|
+
if (!isFocusedRef.current || !options.onCut || !options.getItems) return;
|
|
2889
|
+
e.preventDefault();
|
|
2890
|
+
$4620ae0dc40f0031$export$f9c1490890ddd063(e.clipboardData, options.getItems());
|
|
2891
|
+
options.onCut();
|
|
2892
|
+
};
|
|
2893
|
+
let onBeforePaste = (e)=>{
|
|
2894
|
+
let options = ref.current;
|
|
2895
|
+
// Unfortunately, e.clipboardData.types is not available in this event so we always
|
|
2896
|
+
// have to enable the Paste menu item even if the type of data is unsupported.
|
|
2897
|
+
if (isFocusedRef.current && options.onPaste) e.preventDefault();
|
|
2898
|
+
};
|
|
2899
|
+
let onPaste = (e)=>{
|
|
2900
|
+
let options = ref.current;
|
|
2901
|
+
if (!isFocusedRef.current || !options.onPaste) return;
|
|
2902
|
+
e.preventDefault();
|
|
2903
|
+
let items = $4620ae0dc40f0031$export$d9e760437831f8b3(e.clipboardData);
|
|
2904
|
+
options.onPaste(items);
|
|
2905
|
+
};
|
|
2906
|
+
return $4vY0V$reactariautils.chain($74f3dedaa4d234b4$var$addGlobalEventListener('beforecopy', onBeforeCopy), $74f3dedaa4d234b4$var$addGlobalEventListener('copy', onCopy), $74f3dedaa4d234b4$var$addGlobalEventListener('beforecut', onBeforeCut), $74f3dedaa4d234b4$var$addGlobalEventListener('cut', onCut), $74f3dedaa4d234b4$var$addGlobalEventListener('beforepaste', onBeforePaste), $74f3dedaa4d234b4$var$addGlobalEventListener('paste', onPaste));
|
|
2907
|
+
}, []);
|
|
2908
|
+
return {
|
|
2909
|
+
clipboardProps: focusProps
|
|
2035
2910
|
};
|
|
2911
|
+
}
|
|
2036
2912
|
|
|
2037
|
-
let onBeforePaste = e => {
|
|
2038
|
-
let options = ref.current; // Unfortunately, e.clipboardData.types is not available in this event so we always
|
|
2039
|
-
// have to enable the Paste menu item even if the type of data is unsupported.
|
|
2040
2913
|
|
|
2041
|
-
if (isFocusedRef.current && options.onPaste) {
|
|
2042
|
-
e.preventDefault();
|
|
2043
|
-
}
|
|
2044
|
-
};
|
|
2045
2914
|
|
|
2046
|
-
let onPaste = e => {
|
|
2047
|
-
let options = ref.current;
|
|
2048
2915
|
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2916
|
+
function $2dccaca1f4baa446$var$DragPreview(props, ref) {
|
|
2917
|
+
let render = props.children;
|
|
2918
|
+
let [children, setChildren] = $4vY0V$react.useState(null);
|
|
2919
|
+
let domRef = $4vY0V$react.useRef(null);
|
|
2920
|
+
$4vY0V$react.useImperativeHandle(ref, ()=>(items, callback)=>{
|
|
2921
|
+
// This will be called during the onDragStart event by useDrag. We need to render the
|
|
2922
|
+
// preview synchronously before this event returns so we can call event.dataTransfer.setDragImage.
|
|
2923
|
+
$4vY0V$reactdom.flushSync(()=>{
|
|
2924
|
+
setChildren(render(items));
|
|
2925
|
+
});
|
|
2926
|
+
// Yield back to useDrag to set the drag image.
|
|
2927
|
+
callback(domRef.current);
|
|
2928
|
+
// Remove the preview from the DOM after a frame so the browser has time to paint.
|
|
2929
|
+
requestAnimationFrame(()=>{
|
|
2930
|
+
setChildren(null);
|
|
2931
|
+
});
|
|
2932
|
+
}
|
|
2933
|
+
, [
|
|
2934
|
+
render
|
|
2935
|
+
]);
|
|
2936
|
+
if (!children) return null;
|
|
2937
|
+
return(/*#__PURE__*/ ($parcel$interopDefault($4vY0V$react)).createElement("div", {
|
|
2938
|
+
style: {
|
|
2939
|
+
zIndex: -100,
|
|
2940
|
+
position: 'absolute',
|
|
2941
|
+
top: 0,
|
|
2942
|
+
left: -100000
|
|
2943
|
+
},
|
|
2944
|
+
ref: domRef
|
|
2945
|
+
}, children));
|
|
2946
|
+
}
|
|
2947
|
+
let $2dccaca1f4baa446$export$905ab40ac2179daa = /*#__PURE__*/ ($parcel$interopDefault($4vY0V$react)).forwardRef($2dccaca1f4baa446$var$DragPreview);
|
|
2948
|
+
|
|
2052
2949
|
|
|
2053
|
-
e.preventDefault();
|
|
2054
|
-
let items = $bc29619458500c186021634c18dc$export$readFromDataTransfer(e.clipboardData);
|
|
2055
|
-
options.onPaste(items);
|
|
2056
|
-
};
|
|
2057
2950
|
|
|
2058
|
-
return chain($c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('beforecopy', onBeforeCopy), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('copy', onCopy), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('beforecut', onBeforeCut), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('cut', onCut), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('beforepaste', onBeforePaste), $c1be8e43b63c7fad889cec0e3e2f47d5$var$addGlobalEventListener('paste', onPaste));
|
|
2059
|
-
}, []);
|
|
2060
|
-
return {
|
|
2061
|
-
clipboardProps: focusProps
|
|
2062
|
-
};
|
|
2063
|
-
}
|
|
2064
2951
|
|
|
2065
|
-
exports.useClipboard = useClipboard;
|
|
2066
2952
|
//# sourceMappingURL=main.js.map
|