@instructure/ui-file-drop 8.10.1 → 8.10.2-snapshot.22
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/LICENSE.md +27 -0
- package/es/FileDrop/index.js +7 -1
- package/lib/FileDrop/index.js +7 -1
- package/package.json +17 -16
- package/src/FileDrop/index.tsx +7 -0
- package/types/FileDrop/index.d.ts +2 -0
- package/types/FileDrop/index.d.ts.map +1 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: The MIT License (MIT)
|
|
3
|
+
category: Getting Started
|
|
4
|
+
order: 9
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# The MIT License (MIT)
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
+
|
|
11
|
+
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions.**
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
package/es/FileDrop/index.js
CHANGED
|
@@ -89,6 +89,11 @@ let FileDrop = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
89
89
|
this.enterCounter = 0;
|
|
90
90
|
this.fileInputEl = null;
|
|
91
91
|
this.defaultId = null;
|
|
92
|
+
this.ref = null;
|
|
93
|
+
|
|
94
|
+
this.handleElementRef = el => {
|
|
95
|
+
this.ref = el;
|
|
96
|
+
};
|
|
92
97
|
|
|
93
98
|
this.handleDragEnter = e => {
|
|
94
99
|
e.preventDefault(); // Count the dropzone and any children that are entered.
|
|
@@ -341,7 +346,8 @@ let FileDrop = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
|
|
|
341
346
|
minWidth: minWidth,
|
|
342
347
|
maxWidth: maxWidth,
|
|
343
348
|
margin: margin,
|
|
344
|
-
height: height
|
|
349
|
+
height: height,
|
|
350
|
+
elementRef: this.handleElementRef
|
|
345
351
|
}, jsx("label", {
|
|
346
352
|
css: this.props.styles.fileDropLabel,
|
|
347
353
|
htmlFor: id,
|
package/lib/FileDrop/index.js
CHANGED
|
@@ -92,6 +92,11 @@ let FileDrop = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
92
92
|
this.enterCounter = 0;
|
|
93
93
|
this.fileInputEl = null;
|
|
94
94
|
this.defaultId = null;
|
|
95
|
+
this.ref = null;
|
|
96
|
+
|
|
97
|
+
this.handleElementRef = el => {
|
|
98
|
+
this.ref = el;
|
|
99
|
+
};
|
|
95
100
|
|
|
96
101
|
this.handleDragEnter = e => {
|
|
97
102
|
e.preventDefault(); // Count the dropzone and any children that are entered.
|
|
@@ -343,7 +348,8 @@ let FileDrop = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
|
|
|
343
348
|
minWidth: minWidth,
|
|
344
349
|
maxWidth: maxWidth,
|
|
345
350
|
margin: margin,
|
|
346
|
-
height: height
|
|
351
|
+
height: height,
|
|
352
|
+
elementRef: this.handleElementRef
|
|
347
353
|
}, (0, _emotion.jsx)("label", {
|
|
348
354
|
css: this.props.styles.fileDropLabel,
|
|
349
355
|
htmlFor: id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-file-drop",
|
|
3
|
-
"version": "8.10.
|
|
3
|
+
"version": "8.10.2-snapshot.22+b84160eff",
|
|
4
4
|
"description": "A flexible facade for an HTML file input",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,24 +25,24 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/console": "8.10.
|
|
29
|
-
"@instructure/emotion": "8.10.
|
|
30
|
-
"@instructure/shared-types": "8.10.
|
|
31
|
-
"@instructure/ui-color-utils": "8.10.
|
|
32
|
-
"@instructure/ui-form-field": "8.10.
|
|
33
|
-
"@instructure/ui-react-utils": "8.10.
|
|
34
|
-
"@instructure/ui-testable": "8.10.
|
|
35
|
-
"@instructure/ui-utils": "8.10.
|
|
36
|
-
"@instructure/ui-view": "8.10.
|
|
37
|
-
"@instructure/uid": "8.10.
|
|
28
|
+
"@instructure/console": "8.10.2-snapshot.22+b84160eff",
|
|
29
|
+
"@instructure/emotion": "8.10.2-snapshot.22+b84160eff",
|
|
30
|
+
"@instructure/shared-types": "8.10.2-snapshot.22+b84160eff",
|
|
31
|
+
"@instructure/ui-color-utils": "8.10.2-snapshot.22+b84160eff",
|
|
32
|
+
"@instructure/ui-form-field": "8.10.2-snapshot.22+b84160eff",
|
|
33
|
+
"@instructure/ui-react-utils": "8.10.2-snapshot.22+b84160eff",
|
|
34
|
+
"@instructure/ui-testable": "8.10.2-snapshot.22+b84160eff",
|
|
35
|
+
"@instructure/ui-utils": "8.10.2-snapshot.22+b84160eff",
|
|
36
|
+
"@instructure/ui-view": "8.10.2-snapshot.22+b84160eff",
|
|
37
|
+
"@instructure/uid": "8.10.2-snapshot.22+b84160eff",
|
|
38
38
|
"keycode": "^2",
|
|
39
39
|
"prop-types": "^15"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@instructure/ui-babel-preset": "8.10.
|
|
43
|
-
"@instructure/ui-test-locator": "8.10.
|
|
44
|
-
"@instructure/ui-test-utils": "8.10.
|
|
45
|
-
"@instructure/ui-themes": "8.10.
|
|
42
|
+
"@instructure/ui-babel-preset": "8.10.2-snapshot.22+b84160eff",
|
|
43
|
+
"@instructure/ui-test-locator": "8.10.2-snapshot.22+b84160eff",
|
|
44
|
+
"@instructure/ui-test-utils": "8.10.2-snapshot.22+b84160eff",
|
|
45
|
+
"@instructure/ui-themes": "8.10.2-snapshot.22+b84160eff"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=17"
|
|
@@ -50,5 +50,6 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"sideEffects": false
|
|
53
|
+
"sideEffects": false,
|
|
54
|
+
"gitHead": "b84160effefb01aeb94b754f0b7a64f8dad1b7f2"
|
|
54
55
|
}
|
package/src/FileDrop/index.tsx
CHANGED
|
@@ -134,6 +134,12 @@ class FileDrop extends Component<FileDropProps, FileDropState> {
|
|
|
134
134
|
fileInputEl = null
|
|
135
135
|
defaultId = null
|
|
136
136
|
|
|
137
|
+
ref: Element | null = null
|
|
138
|
+
|
|
139
|
+
handleElementRef = (el: Element | null) => {
|
|
140
|
+
this.ref = el
|
|
141
|
+
}
|
|
142
|
+
|
|
137
143
|
get functionallyDisabled() {
|
|
138
144
|
return this.interaction === 'disabled' || this.interaction === 'readonly'
|
|
139
145
|
}
|
|
@@ -372,6 +378,7 @@ class FileDrop extends Component<FileDropProps, FileDropState> {
|
|
|
372
378
|
maxWidth={maxWidth}
|
|
373
379
|
margin={margin}
|
|
374
380
|
height={height}
|
|
381
|
+
elementRef={this.handleElementRef}
|
|
375
382
|
>
|
|
376
383
|
<label
|
|
377
384
|
css={(this.props as any).styles.fileDropLabel}
|
|
@@ -83,6 +83,8 @@ declare class FileDrop extends Component<FileDropProps, FileDropState> {
|
|
|
83
83
|
enterCounter: number;
|
|
84
84
|
fileInputEl: null;
|
|
85
85
|
defaultId: null;
|
|
86
|
+
ref: Element | null;
|
|
87
|
+
handleElementRef: (el: Element | null) => void;
|
|
86
88
|
get functionallyDisabled(): boolean;
|
|
87
89
|
get hasMessages(): any;
|
|
88
90
|
get interaction(): import("@instructure/ui-react-utils").InteractionType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FileDrop/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAiBjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAkB/E;;;;GAIG;AACH,cAEM,QAAS,SAAQ,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,WAAW,cAAa;IAExC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;qBAEK,GAAG;2BAEG,GAAG,YAAY,GAAG,KAAK,GAAG;mCAElB,GAAG,KAAK,GAAG;mCAEX,GAAG,KAAK,GAAG;yBAErB,GAAG;wBAEJ,GAAG;yBAEF,GAAG;;;;;;;;MAS9B;gBAEW,KAAK,EAAE,aAAa;IAOhC,iBAAiB;IAIjB,kB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