@fluid-topics/ft-file-drop 0.3.12 → 0.3.14
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/build/ft-file-drop.css.d.ts +13 -0
- package/build/ft-file-drop.css.js +95 -0
- package/build/ft-file-drop.d.ts +1 -17
- package/build/ft-file-drop.js +5 -94
- package/build/ft-file-drop.light.js +320 -326
- package/build/ft-file-drop.min.js +323 -323
- package/build/ft-file-drop.properties.d.ts +7 -0
- package/build/ft-file-drop.properties.js +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const FtFileDropCssVariables: {
|
|
2
|
+
zIndex: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
3
|
+
hintBackgroundColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
4
|
+
hintColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
5
|
+
errorColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
6
|
+
borderRadius: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
7
|
+
borderWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
8
|
+
borderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
9
|
+
visibleBorderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
10
|
+
activeBorderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
11
|
+
};
|
|
12
|
+
export declare const styles: import("lit").CSSResult;
|
|
13
|
+
//# sourceMappingURL=ft-file-drop.css.d.ts.map
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtChipCssVariables } from "@fluid-topics/ft-chip/build/ft-chip.css";
|
|
4
|
+
export const FtFileDropCssVariables = {
|
|
5
|
+
zIndex: FtCssVariableFactory.create("--ft-file-drop-z-index", "NUMBER", "10"),
|
|
6
|
+
hintBackgroundColor: FtCssVariableFactory.extend("--ft-file-drop-hint-background-color", designSystemVariables.colorSurface),
|
|
7
|
+
hintColor: FtCssVariableFactory.extend("--ft-file-drop-hint-color", designSystemVariables.colorPrimary),
|
|
8
|
+
errorColor: FtCssVariableFactory.extend("--ft-file-drop-error-color", designSystemVariables.colorError),
|
|
9
|
+
borderRadius: FtCssVariableFactory.extend("--ft-file-drop-border-radius", designSystemVariables.borderRadiusL),
|
|
10
|
+
borderWidth: FtCssVariableFactory.create("--ft-file-drop-border-width", "SIZE", "4px"),
|
|
11
|
+
borderColor: FtCssVariableFactory.create("--ft-file-drop-border-color", "COLOR", "transparent"),
|
|
12
|
+
visibleBorderColor: FtCssVariableFactory.extend("--ft-file-drop-visible-border-color", designSystemVariables.colorOutline),
|
|
13
|
+
activeBorderColor: FtCssVariableFactory.extend("--ft-file-drop-active-border-color", designSystemVariables.colorPrimary),
|
|
14
|
+
};
|
|
15
|
+
// language=CSS
|
|
16
|
+
export const styles = css `
|
|
17
|
+
:host {
|
|
18
|
+
display: block;
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#container {
|
|
23
|
+
position: absolute;
|
|
24
|
+
inset: 0;
|
|
25
|
+
border: dashed ${FtFileDropCssVariables.borderWidth} ${FtFileDropCssVariables.borderColor};
|
|
26
|
+
border-radius: ${FtFileDropCssVariables.borderRadius};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#container.visible {
|
|
30
|
+
border-color: ${FtFileDropCssVariables.visibleBorderColor}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#container.dragging {
|
|
34
|
+
border-color: ${FtFileDropCssVariables.activeBorderColor}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
slot {
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
display: block;
|
|
41
|
+
overflow: auto;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#overlay {
|
|
45
|
+
display: none;
|
|
46
|
+
position: absolute;
|
|
47
|
+
inset: 0;
|
|
48
|
+
z-index: ${FtFileDropCssVariables.zIndex};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#container.dragging #overlay {
|
|
52
|
+
display: block;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#overlay-background {
|
|
56
|
+
z-index: 1;
|
|
57
|
+
position: absolute;
|
|
58
|
+
inset: 0;
|
|
59
|
+
background-color: ${FtFileDropCssVariables.activeBorderColor};
|
|
60
|
+
opacity: 0.20;
|
|
61
|
+
border-radius: ${FtFileDropCssVariables.borderRadius};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
#overlay-drop {
|
|
65
|
+
z-index: 2;
|
|
66
|
+
position: absolute;
|
|
67
|
+
inset: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#overlay-content {
|
|
71
|
+
z-index: 1;
|
|
72
|
+
position: absolute;
|
|
73
|
+
inset: 0;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: flex-end;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#overlay-content ft-chip {
|
|
80
|
+
margin-bottom: 10%;
|
|
81
|
+
${setVariable(FtChipCssVariables.color, FtFileDropCssVariables.hintColor)};
|
|
82
|
+
${setVariable(FtChipCssVariables.iconSize, "32px")};
|
|
83
|
+
${setVariable(FtChipCssVariables.colorOutline, "transparent")};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#overlay-content xft-chip[icon=error] {
|
|
87
|
+
${setVariable(FtChipCssVariables.color, FtFileDropCssVariables.errorColor)};
|
|
88
|
+
${setVariable(FtChipCssVariables.backgroundColor, FtFileDropCssVariables.hintBackgroundColor)};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[hidden] {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
//# sourceMappingURL=ft-file-drop.css.js.map
|
package/build/ft-file-drop.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
-
|
|
3
|
-
dropHint: string;
|
|
4
|
-
accept: string;
|
|
5
|
-
fileTypeError: string;
|
|
6
|
-
visible: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const FtFileDropCssVariables: {
|
|
9
|
-
zIndex: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
10
|
-
hintBackgroundColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
11
|
-
hintColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
12
|
-
errorColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
13
|
-
borderRadius: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
14
|
-
borderWidth: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
15
|
-
borderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
16
|
-
visibleBorderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
17
|
-
activeBorderColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
18
|
-
};
|
|
2
|
+
import { FtFileDropProperties } from "./ft-file-drop.properties";
|
|
19
3
|
export declare class FileDropEvent extends CustomEvent<{
|
|
20
4
|
file: File;
|
|
21
5
|
}> {
|
package/build/ft-file-drop.js
CHANGED
|
@@ -4,23 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html } from "lit";
|
|
8
8
|
import { property, state } from "lit/decorators.js";
|
|
9
|
-
import {
|
|
9
|
+
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
10
10
|
import { classMap } from "lit/directives/class-map.js";
|
|
11
11
|
import { matchAccept } from "./match-accept";
|
|
12
|
-
import { FtChip
|
|
13
|
-
|
|
14
|
-
zIndex: FtCssVariableFactory.create("--ft-file-drop-z-index", "NUMBER", "10"),
|
|
15
|
-
hintBackgroundColor: FtCssVariableFactory.extend("--ft-file-drop-hint-background-color", designSystemVariables.colorSurface),
|
|
16
|
-
hintColor: FtCssVariableFactory.extend("--ft-file-drop-hint-color", designSystemVariables.colorPrimary),
|
|
17
|
-
errorColor: FtCssVariableFactory.extend("--ft-file-drop-error-color", designSystemVariables.colorError),
|
|
18
|
-
borderRadius: FtCssVariableFactory.extend("--ft-file-drop-border-radius", designSystemVariables.borderRadiusL),
|
|
19
|
-
borderWidth: FtCssVariableFactory.create("--ft-file-drop-border-width", "SIZE", "4px"),
|
|
20
|
-
borderColor: FtCssVariableFactory.create("--ft-file-drop-border-color", "COLOR", "transparent"),
|
|
21
|
-
visibleBorderColor: FtCssVariableFactory.extend("--ft-file-drop-visible-border-color", designSystemVariables.colorOutline),
|
|
22
|
-
activeBorderColor: FtCssVariableFactory.extend("--ft-file-drop-active-border-color", designSystemVariables.colorPrimary),
|
|
23
|
-
};
|
|
12
|
+
import { FtChip } from "@fluid-topics/ft-chip";
|
|
13
|
+
import { styles } from "./ft-file-drop.css";
|
|
24
14
|
export class FileDropEvent extends CustomEvent {
|
|
25
15
|
constructor(file) {
|
|
26
16
|
super("file-drop", { detail: { file } });
|
|
@@ -93,86 +83,7 @@ export class FtFileDrop extends FtLitElement {
|
|
|
93
83
|
FtFileDrop.elementDefinitions = {
|
|
94
84
|
"ft-chip": FtChip,
|
|
95
85
|
};
|
|
96
|
-
|
|
97
|
-
FtFileDrop.styles = css `
|
|
98
|
-
:host {
|
|
99
|
-
display: block;
|
|
100
|
-
position: relative;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
#container {
|
|
104
|
-
position: absolute;
|
|
105
|
-
inset: 0;
|
|
106
|
-
border: dashed ${FtFileDropCssVariables.borderWidth} ${FtFileDropCssVariables.borderColor};
|
|
107
|
-
border-radius: ${FtFileDropCssVariables.borderRadius};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
#container.visible {
|
|
111
|
-
border-color: ${FtFileDropCssVariables.visibleBorderColor}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
#container.dragging {
|
|
115
|
-
border-color: ${FtFileDropCssVariables.activeBorderColor}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
slot {
|
|
119
|
-
position: absolute;
|
|
120
|
-
inset: 0;
|
|
121
|
-
display: block;
|
|
122
|
-
overflow: auto;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
#overlay {
|
|
126
|
-
display: none;
|
|
127
|
-
position: absolute;
|
|
128
|
-
inset: 0;
|
|
129
|
-
z-index: ${FtFileDropCssVariables.zIndex};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
#container.dragging #overlay {
|
|
133
|
-
display: block;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
#overlay-background {
|
|
137
|
-
z-index: 1;
|
|
138
|
-
position: absolute;
|
|
139
|
-
inset: 0;
|
|
140
|
-
background-color: ${FtFileDropCssVariables.activeBorderColor};
|
|
141
|
-
opacity: 0.20;
|
|
142
|
-
border-radius: ${FtFileDropCssVariables.borderRadius};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
#overlay-drop {
|
|
146
|
-
z-index: 2;
|
|
147
|
-
position: absolute;
|
|
148
|
-
inset: 0;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
#overlay-content {
|
|
152
|
-
z-index: 1;
|
|
153
|
-
position: absolute;
|
|
154
|
-
inset: 0;
|
|
155
|
-
display: flex;
|
|
156
|
-
align-items: flex-end;
|
|
157
|
-
justify-content: center;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
#overlay-content ft-chip {
|
|
161
|
-
margin-bottom: 10%;
|
|
162
|
-
${setVariable(FtChipCssVariables.color, FtFileDropCssVariables.hintColor)};
|
|
163
|
-
${setVariable(FtChipCssVariables.iconSize, "32px")};
|
|
164
|
-
${setVariable(FtChipCssVariables.colorOutline, "transparent")};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
#overlay-content xft-chip[icon=error] {
|
|
168
|
-
${setVariable(FtChipCssVariables.color, FtFileDropCssVariables.errorColor)};
|
|
169
|
-
${setVariable(FtChipCssVariables.backgroundColor, FtFileDropCssVariables.hintBackgroundColor)};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
[hidden] {
|
|
173
|
-
display: none;
|
|
174
|
-
}
|
|
175
|
-
`;
|
|
86
|
+
FtFileDrop.styles = styles;
|
|
176
87
|
__decorate([
|
|
177
88
|
property()
|
|
178
89
|
], FtFileDrop.prototype, "dropHint", void 0);
|