easy-file-system 2.1.13 → 2.1.15
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/example.js +100 -87
- package/lib/constants.js +1 -9
- package/lib/explorer.js +16 -7
- package/lib/item/entry/drag.js +42 -22
- package/lib/list/entries.js +13 -17
- package/lib/span/name.js +4 -8
- package/package.json +1 -1
- package/src/constants.js +0 -2
- package/src/explorer.js +16 -10
- package/src/item/entry/drag.js +44 -25
- package/src/list/entries.js +13 -16
- package/src/span/name.js +4 -11
package/src/list/entries.js
CHANGED
|
@@ -104,7 +104,7 @@ class EntriesList extends Element {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
addFilePath(filePath
|
|
107
|
+
addFilePath(filePath) {
|
|
108
108
|
let fileNameDragEntryItem;
|
|
109
109
|
|
|
110
110
|
const topmostDirectoryName = topmostDirectoryNameFromPath(filePath);
|
|
@@ -115,7 +115,7 @@ class EntriesList extends Element {
|
|
|
115
115
|
fileNameDragEntryItem = this.findFileNameDragEntryItem(fileName);
|
|
116
116
|
|
|
117
117
|
if (fileNameDragEntryItem === null) {
|
|
118
|
-
fileNameDragEntryItem = this.createFileNameDragEntryItem(fileName
|
|
118
|
+
fileNameDragEntryItem = this.createFileNameDragEntryItem(fileName);
|
|
119
119
|
|
|
120
120
|
this.addEntryItem(fileNameDragEntryItem);
|
|
121
121
|
}
|
|
@@ -123,10 +123,9 @@ class EntriesList extends Element {
|
|
|
123
123
|
let topmostDirectoryNameDragEntryItem = this.findDirectoryNameDragEntryItem(topmostDirectoryName);
|
|
124
124
|
|
|
125
125
|
if (topmostDirectoryNameDragEntryItem === null) {
|
|
126
|
-
const
|
|
127
|
-
collapsed = true;
|
|
126
|
+
const collapsed = true;
|
|
128
127
|
|
|
129
|
-
topmostDirectoryNameDragEntryItem = this.createDirectoryNameDragEntryItem(topmostDirectoryName, collapsed
|
|
128
|
+
topmostDirectoryNameDragEntryItem = this.createDirectoryNameDragEntryItem(topmostDirectoryName, collapsed);
|
|
130
129
|
|
|
131
130
|
this.addEntryItem(topmostDirectoryNameDragEntryItem);
|
|
132
131
|
}
|
|
@@ -135,7 +134,7 @@ class EntriesList extends Element {
|
|
|
135
134
|
|
|
136
135
|
filePath = filePathWithoutTopmostDirectoryName; ///
|
|
137
136
|
|
|
138
|
-
fileNameDragEntryItem = topmostDirectoryNameDragEntryItem.addFilePath(filePath
|
|
137
|
+
fileNameDragEntryItem = topmostDirectoryNameDragEntryItem.addFilePath(filePath);
|
|
139
138
|
}
|
|
140
139
|
|
|
141
140
|
return fileNameDragEntryItem;
|
|
@@ -184,7 +183,7 @@ class EntriesList extends Element {
|
|
|
184
183
|
});
|
|
185
184
|
}
|
|
186
185
|
|
|
187
|
-
addDirectoryPath(directoryPath, collapsed = true
|
|
186
|
+
addDirectoryPath(directoryPath, collapsed = true) {
|
|
188
187
|
let directoryNameDragEntryItem;
|
|
189
188
|
|
|
190
189
|
const topmostDirectoryName = topmostDirectoryNameFromPath(directoryPath);
|
|
@@ -195,7 +194,7 @@ class EntriesList extends Element {
|
|
|
195
194
|
directoryNameDragEntryItem = this.findDirectoryNameDragEntryItem(directoryName);
|
|
196
195
|
|
|
197
196
|
if (directoryNameDragEntryItem === null) {
|
|
198
|
-
directoryNameDragEntryItem = this.createDirectoryNameDragEntryItem(directoryName, collapsed
|
|
197
|
+
directoryNameDragEntryItem = this.createDirectoryNameDragEntryItem(directoryName, collapsed);
|
|
199
198
|
|
|
200
199
|
this.addEntryItem(directoryNameDragEntryItem);
|
|
201
200
|
} else {
|
|
@@ -207,9 +206,7 @@ class EntriesList extends Element {
|
|
|
207
206
|
let topmostDirectoryNameDragEntryItem = this.findDirectoryNameDragEntryItem(topmostDirectoryName);
|
|
208
207
|
|
|
209
208
|
if (topmostDirectoryNameDragEntryItem === null) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
topmostDirectoryNameDragEntryItem = this.createDirectoryNameDragEntryItem(topmostDirectoryName, collapsed, created);
|
|
209
|
+
topmostDirectoryNameDragEntryItem = this.createDirectoryNameDragEntryItem(topmostDirectoryName, collapsed);
|
|
213
210
|
|
|
214
211
|
this.addEntryItem(topmostDirectoryNameDragEntryItem);
|
|
215
212
|
}
|
|
@@ -218,7 +215,7 @@ class EntriesList extends Element {
|
|
|
218
215
|
|
|
219
216
|
directoryPath = directoryPathWithoutTopmostDirectoryName; ///
|
|
220
217
|
|
|
221
|
-
directoryNameDragEntryItem = topmostDirectoryNameDragEntryItem.addDirectoryPath(directoryPath, collapsed
|
|
218
|
+
directoryNameDragEntryItem = topmostDirectoryNameDragEntryItem.addDirectoryPath(directoryPath, collapsed);
|
|
222
219
|
}
|
|
223
220
|
|
|
224
221
|
return directoryNameDragEntryItem;
|
|
@@ -369,26 +366,26 @@ class EntriesList extends Element {
|
|
|
369
366
|
});
|
|
370
367
|
}
|
|
371
368
|
|
|
372
|
-
createFileNameDragEntryItem(fileName
|
|
369
|
+
createFileNameDragEntryItem(fileName) {
|
|
373
370
|
const name = fileName, ///
|
|
374
371
|
explorer = this.getExplorer(),
|
|
375
372
|
FileNameDragEntryItem = explorer.getFileNameDragEntryItem(),
|
|
376
373
|
fileNameDragEntryItem =
|
|
377
374
|
|
|
378
|
-
<FileNameDragEntryItem name={name} explorer={explorer}
|
|
375
|
+
<FileNameDragEntryItem name={name} explorer={explorer} />
|
|
379
376
|
|
|
380
377
|
;
|
|
381
378
|
|
|
382
379
|
return fileNameDragEntryItem;
|
|
383
380
|
}
|
|
384
381
|
|
|
385
|
-
createDirectoryNameDragEntryItem(directoryName, collapsed
|
|
382
|
+
createDirectoryNameDragEntryItem(directoryName, collapsed) {
|
|
386
383
|
const name = directoryName, ///
|
|
387
384
|
explorer = this.getExplorer(),
|
|
388
385
|
DirectoryNameDragEntryItem = explorer.getDirectoryNameDragEntryItem(),
|
|
389
386
|
directoryNameDragEntryItem =
|
|
390
387
|
|
|
391
|
-
<DirectoryNameDragEntryItem name={name} explorer={explorer} collapsed={collapsed}
|
|
388
|
+
<DirectoryNameDragEntryItem name={name} explorer={explorer} collapsed={collapsed} />
|
|
392
389
|
|
|
393
390
|
;
|
|
394
391
|
|
package/src/span/name.js
CHANGED
|
@@ -6,9 +6,9 @@ import { arrayUtilities } from "necessary";
|
|
|
6
6
|
|
|
7
7
|
import nameSpanMixins from "../mixins/nameSpan";
|
|
8
8
|
|
|
9
|
+
import { TRUE, CONTENT_EDITABLE } from "../constants";
|
|
9
10
|
import { Element, window, document } from "easy";
|
|
10
11
|
import { ENTER_KEY_CODE, ESCAPE_KEY_CODE } from "../keyCodes";
|
|
11
|
-
import { ROLE, TRUE, TEXTBOX, CONTENT_EDITABLE } from "../constants";
|
|
12
12
|
|
|
13
13
|
const { first } = arrayUtilities;
|
|
14
14
|
|
|
@@ -30,7 +30,8 @@ class NameSpan extends Element {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
isEditable() {
|
|
33
|
-
const
|
|
33
|
+
const contentEditable = this.hasAttribute(CONTENT_EDITABLE),
|
|
34
|
+
editable = contentEditable; ///
|
|
34
35
|
|
|
35
36
|
return editable;
|
|
36
37
|
}
|
|
@@ -54,10 +55,6 @@ class NameSpan extends Element {
|
|
|
54
55
|
edit() {
|
|
55
56
|
this.focus();
|
|
56
57
|
|
|
57
|
-
this.addClass("editable");
|
|
58
|
-
|
|
59
|
-
this.addAttribute(ROLE, TEXTBOX);
|
|
60
|
-
|
|
61
58
|
this.addAttribute(CONTENT_EDITABLE, TRUE);
|
|
62
59
|
|
|
63
60
|
const html = this.html(),
|
|
@@ -83,10 +80,6 @@ class NameSpan extends Element {
|
|
|
83
80
|
cancel() {
|
|
84
81
|
this.offKeyDown(this.keyDownHandler);
|
|
85
82
|
|
|
86
|
-
this.removeClass("editable");
|
|
87
|
-
|
|
88
|
-
this.removeAttribute(ROLE, TEXTBOX);
|
|
89
|
-
|
|
90
83
|
this.removeAttribute(CONTENT_EDITABLE, TRUE);
|
|
91
84
|
}
|
|
92
85
|
|
|
@@ -133,7 +126,7 @@ export default withStyle(NameSpan)`
|
|
|
133
126
|
font-weight: inherit;
|
|
134
127
|
font-family: inherit;
|
|
135
128
|
|
|
136
|
-
|
|
129
|
+
[contentEditable] {
|
|
137
130
|
border: 1px solid black;
|
|
138
131
|
padding: 4px;
|
|
139
132
|
}
|