@exmg/exm-upload 1.0.14 → 1.0.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.
@@ -1,2 +1 @@
1
1
  export declare const style: import("lit").CSSResult;
2
- export default style;
@@ -1,4 +1,124 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{display:flex;align-items:center;height:65px;border-bottom:1px solid var(--md-sys-color-outline-variant);padding-bottom:6px;margin-bottom:6px}.item{display:grid;height:65px;width:100%;grid-template-columns:2rem 1fr 6rem;grid-auto-flow:column;align-items:center}.vertical-center{display:flex;align-items:center}.loader{width:18px;height:18px;border:3px solid var(--md-sys-color-primary);border-bottom-color:rgba(0,0,0,0);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}.name-container{margin-left:16px;display:flex;flex-direction:column;gap:4px;width:100%}.file-name{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-error{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.file-details{display:flex;flex-direction:row;justify-content:space-between}.file-error{font-size:.7rem;background-color:var(--md-sys-color-error-container, #b00020);color:var(--md-sys-color-on-error-container, white);padding:2px 4px;border-radius:6px}.actions{display:flex;justify-content:flex-end;justify-self:flex-end;width:60px}.error-icon,.error-icon svg{fill:#b00020;font-weight:bold;width:32px;height:32px}.success-icon{--md-icon-color: green;--md-icon-size: 32px;--md-icon-weight: 400}.badge{display:flex;align-items:center;background-color:var(--md-ref-palette-primary-primary50);margin-right:4px;border-radius:4px;color:var(--md-ref-palette-primary-primary80);padding:6px;font-size:.6rem;height:.4rem;font-weight:bold;line-height:1.75;letter-spacing:.5px}.status{display:flex;justify-content:center}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}`;
3
- export default style;
2
+ export const style = css `
3
+ :host {
4
+ display: flex;
5
+ align-items: center;
6
+ height: 65px;
7
+ border-bottom: 1px solid var(--md-sys-color-outline-variant);
8
+ padding-bottom: 6px;
9
+ margin-bottom: 6px;
10
+ }
11
+
12
+ .item {
13
+ display: grid;
14
+ height: 65px;
15
+ width: 100%;
16
+ grid-template-columns: 2rem 1fr 6rem;
17
+ grid-auto-flow: column;
18
+ align-items: center;
19
+ }
20
+
21
+ .vertical-center {
22
+ display: flex;
23
+ align-items: center;
24
+ }
25
+
26
+ .loader {
27
+ width: 18px;
28
+ height: 18px;
29
+ border: 3px solid var(--md-sys-color-primary);
30
+ border-bottom-color: rgba(0, 0, 0, 0);
31
+ border-radius: 50%;
32
+ display: inline-block;
33
+ box-sizing: border-box;
34
+ animation: rotation 1s linear infinite;
35
+ }
36
+
37
+ .name-container {
38
+ margin-left: 16px;
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 4px;
42
+ width: 100%;
43
+ }
44
+
45
+ .file-name {
46
+ width: 100%;
47
+ white-space: nowrap;
48
+ overflow: hidden;
49
+ text-overflow: ellipsis;
50
+ }
51
+
52
+ .file-error {
53
+ width: 100%;
54
+ white-space: nowrap;
55
+ overflow: hidden;
56
+ text-overflow: ellipsis;
57
+ }
58
+
59
+ .file-details {
60
+ display: flex;
61
+ flex-direction: row;
62
+ justify-content: space-between;
63
+ }
64
+
65
+ .file-error {
66
+ font-size: 0.7rem;
67
+ background-color: var(--md-sys-color-error-container, #b00020);
68
+ color: var(--md-sys-color-on-error-container, white);
69
+ padding: 2px 4px;
70
+ border-radius: 6px;
71
+ }
72
+
73
+ .actions {
74
+ display: flex;
75
+ justify-content: flex-end;
76
+ justify-self: flex-end;
77
+ width: 60px;
78
+ }
79
+
80
+ .error-icon,
81
+ .error-icon svg {
82
+ fill: #b00020;
83
+ font-weight: bold;
84
+ width: 32px;
85
+ height: 32px;
86
+ }
87
+
88
+ .success-icon {
89
+ --md-icon-color: green;
90
+ --md-icon-size: 32px;
91
+ --md-icon-weight: 400;
92
+ }
93
+
94
+ .badge {
95
+ display: flex;
96
+ align-items: center;
97
+ background-color: var(--md-ref-palette-primary-primary50);
98
+ margin-right: 4px;
99
+ border-radius: 4px;
100
+ color: var(--md-ref-palette-primary-primary80);
101
+ padding: 6px;
102
+ font-size: 0.6rem;
103
+ height: 0.4rem;
104
+ font-weight: bold;
105
+ line-height: 1.75;
106
+ letter-spacing: 0.5px;
107
+ }
108
+
109
+ .status {
110
+ display: flex;
111
+ justify-content: center;
112
+ }
113
+
114
+ @keyframes rotation {
115
+ 0% {
116
+ transform: rotate(0deg);
117
+ }
118
+
119
+ 100% {
120
+ transform: rotate(360deg);
121
+ }
122
+ }
123
+ `;
4
124
  //# sourceMappingURL=exm-upload-item-styles-css.js.map
@@ -1,2 +1 @@
1
1
  export declare const style: import("lit").CSSResult;
2
- export default style;
@@ -1,4 +1,150 @@
1
1
  import { css } from 'lit';
2
- export const style = css `:host{display:flex;color:var(--exm-upload-text-color, #000);color:var(--_supporting-text-color);font:var(--_supporting-text-type);flex-direction:column;justify-content:center;align-items:center;gap:.5rem;padding:8px 0 8px 0;--_supporting-text-color: var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var( --md-dialog-supporting-text-type, 400 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto) )}.image-upload-wrapper{display:flex;width:100%;flex-direction:row}#preview{max-width:80px;max-height:80px}.preview-wrapper{margin:1rem}.info-wrapper{display:flex;margin-left:1.5rem;flex-direction:column;padding:1rem;gap:12px}.info{display:flex;flex-direction:column;gap:8px}.description{color:var(--exm-upload-description-text-color, #a7a7a7);font-size:.9rem;margin-bottom:1rem}.browse{width:50%}exm-button{display:flex;align-items:center}.click-label{position:absolute;width:100%;height:100%;box-sizing:border-box;display:flex;align-items:center;justify-content:center;cursor:pointer}img{z-index:99999;display:block;max-width:100%}.image-container{width:200px;height:200px}.error-message{display:flex;align-items:center;gap:1rem;background-color:#dedede;width:450px;padding:8px;color:#f02d2d;border-radius:4px;margin-bottom:1rem;box-sizing:border-box}.item{width:100%}.item-container{width:100%}.item:first-child{margin-top:1rem}.item:last-child{border-bottom:none}.actions{display:flex;flex-direction:row;justify-content:space-between;margin-bottom:2rem;align-items:center}.actions .icon-buttons{display:flex;flex-direction:row;gap:8px}.disabled{opacity:.5;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-o-user-select:none;user-select:none}exm-upload-drop-area a{color:var(--md-sys-color-primary);text-decoration:none}exm-upload-drop-area md-icon{fill:#0071dc;--md-icon-color: var(--md-sys-color-primary);--md-icon-size: 48px;--md-icon-weight: 600}`;
3
- export default style;
2
+ export const style = css `
3
+ :host {
4
+ display: flex;
5
+ color: var(--exm-upload-text-color, #000);
6
+ color: var(--_supporting-text-color);
7
+ font: var(--_supporting-text-type);
8
+ flex-direction: column;
9
+ justify-content: center;
10
+ align-items: center;
11
+ gap: 0.5rem;
12
+ padding: 8px 0 8px 0;
13
+ --_supporting-text-color: var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));
14
+ --_supporting-text-type: var(
15
+ --md-dialog-supporting-text-type,
16
+ 400 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)
17
+ );
18
+ }
19
+
20
+ .image-upload-wrapper {
21
+ display: flex;
22
+ width: 100%;
23
+ flex-direction: row;
24
+ }
25
+
26
+ #preview {
27
+ max-width: 80px;
28
+ max-height: 80px;
29
+ }
30
+
31
+ .preview-wrapper {
32
+ margin: 1rem;
33
+ }
34
+
35
+ .info-wrapper {
36
+ display: flex;
37
+ margin-left: 1.5rem;
38
+ flex-direction: column;
39
+ padding: 1rem;
40
+ gap: 12px;
41
+ }
42
+
43
+ .info {
44
+ display: flex;
45
+ flex-direction: column;
46
+ gap: 8px;
47
+ }
48
+
49
+ .description {
50
+ color: var(--exm-upload-description-text-color, #a7a7a7);
51
+ font-size: 0.9rem;
52
+ margin-bottom: 1rem;
53
+ }
54
+
55
+ .browse {
56
+ width: 50%;
57
+ }
58
+
59
+ exm-button {
60
+ display: flex;
61
+ align-items: center;
62
+ }
63
+
64
+ .click-label {
65
+ position: absolute;
66
+ width: 100%;
67
+ height: 100%;
68
+ box-sizing: border-box;
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ cursor: pointer;
73
+ }
74
+
75
+ img {
76
+ z-index: 99999;
77
+ display: block;
78
+ max-width: 100%;
79
+ }
80
+
81
+ .image-container {
82
+ width: 200px;
83
+ height: 200px;
84
+ }
85
+
86
+ .error-message {
87
+ display: flex;
88
+ align-items: center;
89
+ gap: 1rem;
90
+ background-color: #dedede;
91
+ width: 450px;
92
+ padding: 8px;
93
+ color: #f02d2d;
94
+ border-radius: 4px;
95
+ margin-bottom: 1rem;
96
+ box-sizing: border-box;
97
+ }
98
+
99
+ .item {
100
+ width: 100%;
101
+ }
102
+
103
+ .item-container {
104
+ width: 100%;
105
+ }
106
+
107
+ .item:first-child {
108
+ margin-top: 1rem;
109
+ }
110
+
111
+ .item:last-child {
112
+ border-bottom: none;
113
+ }
114
+
115
+ .actions {
116
+ display: flex;
117
+ flex-direction: row;
118
+ justify-content: space-between;
119
+ margin-bottom: 2rem;
120
+ align-items: center;
121
+ }
122
+
123
+ .actions .icon-buttons {
124
+ display: flex;
125
+ flex-direction: row;
126
+ gap: 8px;
127
+ }
128
+
129
+ .disabled {
130
+ opacity: 0.5;
131
+ -webkit-user-select: none;
132
+ -khtml-user-select: none;
133
+ -moz-user-select: none;
134
+ -o-user-select: none;
135
+ user-select: none;
136
+ }
137
+
138
+ exm-upload-drop-area a {
139
+ color: var(--md-sys-color-primary);
140
+ text-decoration: none;
141
+ }
142
+
143
+ exm-upload-drop-area md-icon {
144
+ fill: #0071dc;
145
+ --md-icon-color: var(--md-sys-color-primary);
146
+ --md-icon-size: 48px;
147
+ --md-icon-weight: 600;
148
+ }
149
+ `;
4
150
  //# sourceMappingURL=exm-upload-styles-css.js.map
package/src/utils.js CHANGED
@@ -18,7 +18,7 @@ export const isTypeValidExtension = (file, accept) => {
18
18
  const name = file.name;
19
19
  const type = file.type;
20
20
  const hasFileExtension = fileExtensionRegExp.test(name);
21
- const [fileExtension] = !hasFileExtension ? [undefined] : (_a = fileExtensionRegExp.exec(name)) !== null && _a !== void 0 ? _a : [];
21
+ const [fileExtension] = !hasFileExtension ? [undefined] : ((_a = fileExtensionRegExp.exec(name)) !== null && _a !== void 0 ? _a : []);
22
22
  return acceptedTypes.has(type) || (fileExtension && acceptedTypes.has(fileExtension));
23
23
  };
24
24
  /**
@@ -1,22 +0,0 @@
1
- @use '@material/web/dialog/internal/dialog-styles';
2
-
3
- [slot='headline'] {
4
- display: flex;
5
- flex-direction: row-reverse;
6
- align-items: center;
7
- }
8
-
9
- [showing-fullscreen] [slot='headline'] {
10
- flex-direction: row;
11
- }
12
-
13
- .headline {
14
- flex: 1;
15
- display: block;
16
- text-align: left;
17
- }
18
-
19
- exm-upload,
20
- ::slotted(exm-upload) {
21
- width: 460px;
22
- }
@@ -1,323 +0,0 @@
1
- #image {
2
- z-index: 99999;
3
- display: flex;
4
-
5
- /* This rule is very important, please don't ignore this */
6
- max-width: 100%;
7
- }
8
- .image-container {
9
- max-width: 300px;
10
- max-height: 300px;
11
- }
12
- .actions {
13
- margin-top: 8px;
14
- display: flex;
15
- justify-content: flex-end;
16
- }
17
-
18
- /*!
19
- * Cropper.js v1.5.13
20
- * https://fengyuanchen.github.io/cropperjs
21
- *
22
- * Copyright 2015-present Chen Fengyuan
23
- * Released under the MIT license
24
- *
25
- * Date: 2022-11-20T05:30:43.444Z
26
- */
27
-
28
- .cropper-container {
29
- direction: ltr;
30
- font-size: 0;
31
- line-height: 0;
32
- position: relative;
33
- -ms-touch-action: none;
34
- touch-action: none;
35
- -webkit-user-select: none;
36
- -moz-user-select: none;
37
- -ms-user-select: none;
38
- user-select: none;
39
- }
40
-
41
- .cropper-container img {
42
- -webkit-backface-visibility: hidden;
43
- backface-visibility: hidden;
44
- display: block;
45
- height: 100%;
46
- image-orientation: 0deg;
47
- max-height: none !important;
48
- max-width: none !important;
49
- min-height: 0 !important;
50
- min-width: 0 !important;
51
- width: 100%;
52
- }
53
-
54
- .cropper-wrap-box,
55
- .cropper-canvas,
56
- .cropper-drag-box,
57
- .cropper-crop-box,
58
- .cropper-modal {
59
- bottom: 0;
60
- left: 0;
61
- position: absolute;
62
- right: 0;
63
- top: 0;
64
- }
65
-
66
- .cropper-wrap-box,
67
- .cropper-canvas {
68
- overflow: hidden;
69
- }
70
-
71
- .cropper-drag-box {
72
- background-color: #fff;
73
- opacity: 0;
74
- }
75
-
76
- .cropper-modal {
77
- background-color: #000;
78
- opacity: 0.5;
79
- }
80
-
81
- .cropper-view-box {
82
- display: block;
83
- height: 100%;
84
- outline: 1px solid #39f;
85
- outline-color: rgba(51, 153, 255, 75%);
86
- overflow: hidden;
87
- width: 100%;
88
- }
89
-
90
- .cropper-dashed {
91
- border: 0 dashed #eee;
92
- display: block;
93
- opacity: 0.5;
94
- position: absolute;
95
- }
96
-
97
- .cropper-dashed.dashed-h {
98
- border-bottom-width: 1px;
99
- border-top-width: 1px;
100
- height: calc(100% / 3);
101
- left: 0;
102
- top: calc(100% / 3);
103
- width: 100%;
104
- }
105
-
106
- .cropper-dashed.dashed-v {
107
- border-left-width: 1px;
108
- border-right-width: 1px;
109
- height: 100%;
110
- left: calc(100% / 3);
111
- top: 0;
112
- width: calc(100% / 3);
113
- }
114
-
115
- .cropper-center {
116
- display: block;
117
- height: 0;
118
- left: 50%;
119
- opacity: 0.75;
120
- position: absolute;
121
- top: 50%;
122
- width: 0;
123
- }
124
-
125
- .cropper-center::before,
126
- .cropper-center::after {
127
- background-color: #eee;
128
- content: " ";
129
- display: block;
130
- position: absolute;
131
- }
132
-
133
- .cropper-center::before {
134
- height: 1px;
135
- left: -3px;
136
- top: 0;
137
- width: 7px;
138
- }
139
-
140
- .cropper-center::after {
141
- height: 7px;
142
- left: 0;
143
- top: -3px;
144
- width: 1px;
145
- }
146
-
147
- .cropper-face,
148
- .cropper-line,
149
- .cropper-point {
150
- display: block;
151
- height: 100%;
152
- opacity: 0.1;
153
- position: absolute;
154
- width: 100%;
155
- }
156
-
157
- .cropper-face {
158
- background-color: #fff;
159
- left: 0;
160
- top: 0;
161
- }
162
-
163
- .cropper-line {
164
- background-color: #39f;
165
- }
166
-
167
- .cropper-line.line-e {
168
- cursor: ew-resize;
169
- right: -3px;
170
- top: 0;
171
- width: 5px;
172
- }
173
-
174
- .cropper-line.line-n {
175
- cursor: ns-resize;
176
- height: 5px;
177
- left: 0;
178
- top: -3px;
179
- }
180
-
181
- .cropper-line.line-w {
182
- cursor: ew-resize;
183
- left: -3px;
184
- top: 0;
185
- width: 5px;
186
- }
187
-
188
- .cropper-line.line-s {
189
- bottom: -3px;
190
- cursor: ns-resize;
191
- height: 5px;
192
- left: 0;
193
- }
194
-
195
- .cropper-point {
196
- background-color: #39f;
197
- height: 5px;
198
- opacity: 0.75;
199
- width: 5px;
200
- }
201
-
202
- .cropper-point.point-e {
203
- cursor: ew-resize;
204
- margin-top: -3px;
205
- right: -3px;
206
- top: 50%;
207
- }
208
-
209
- .cropper-point.point-n {
210
- cursor: ns-resize;
211
- left: 50%;
212
- margin-left: -3px;
213
- top: -3px;
214
- }
215
-
216
- .cropper-point.point-w {
217
- cursor: ew-resize;
218
- left: -3px;
219
- margin-top: -3px;
220
- top: 50%;
221
- }
222
-
223
- .cropper-point.point-s {
224
- bottom: -3px;
225
- cursor: s-resize;
226
- left: 50%;
227
- margin-left: -3px;
228
- }
229
-
230
- .cropper-point.point-ne {
231
- cursor: nesw-resize;
232
- right: -3px;
233
- top: -3px;
234
- }
235
-
236
- .cropper-point.point-nw {
237
- cursor: nwse-resize;
238
- left: -3px;
239
- top: -3px;
240
- }
241
-
242
- .cropper-point.point-sw {
243
- bottom: -3px;
244
- cursor: nesw-resize;
245
- left: -3px;
246
- }
247
-
248
- .cropper-point.point-se {
249
- bottom: -3px;
250
- cursor: nwse-resize;
251
- height: 20px;
252
- opacity: 1;
253
- right: -3px;
254
- width: 20px;
255
- }
256
-
257
- @media (min-width: 768px) {
258
- .cropper-point.point-se {
259
- height: 15px;
260
- width: 15px;
261
- }
262
- }
263
-
264
- @media (min-width: 992px) {
265
- .cropper-point.point-se {
266
- height: 10px;
267
- width: 10px;
268
- }
269
- }
270
-
271
- @media (min-width: 1200px) {
272
- .cropper-point.point-se {
273
- height: 5px;
274
- opacity: 0.75;
275
- width: 5px;
276
- }
277
- }
278
-
279
- .cropper-point.point-se::before {
280
- background-color: #39f;
281
- bottom: -50%;
282
- content: " ";
283
- display: block;
284
- height: 200%;
285
- opacity: 0;
286
- position: absolute;
287
- right: -50%;
288
- width: 200%;
289
- }
290
-
291
- .cropper-invisible {
292
- opacity: 0;
293
- }
294
-
295
- .cropper-bg {
296
- background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC");
297
- }
298
-
299
- .cropper-hide {
300
- display: block;
301
- height: 0;
302
- position: absolute;
303
- width: 0;
304
- }
305
-
306
- .cropper-hidden {
307
- display: none !important;
308
- }
309
-
310
- .cropper-move {
311
- cursor: move;
312
- }
313
-
314
- .cropper-crop {
315
- cursor: crosshair;
316
- }
317
-
318
- .cropper-disabled .cropper-drag-box,
319
- .cropper-disabled .cropper-face,
320
- .cropper-disabled .cropper-line,
321
- .cropper-disabled .cropper-point {
322
- cursor: not-allowed;
323
- }
@@ -1,48 +0,0 @@
1
- :host {
2
- display: flex;
3
- width: 100%;
4
- }
5
-
6
- .description {
7
- font-size: 0.675rem;
8
- text-transform: uppercase;
9
- opacity: 0.3;
10
- margin-top: 8px;
11
- }
12
-
13
- .drop {
14
- display: flex;
15
- width: 100%;
16
- position: relative;
17
- min-height: 160px;
18
- background-color: var(--md-sys-color-surface-variant);
19
- color: var(--md-sys-color-on-surface);
20
- border: 1px dashed var(--md-sys-color-outline);
21
- border-radius: 10px;
22
- box-sizing: border-box;
23
- }
24
-
25
- .drop-container {
26
- flex: 1;
27
- display: flex;
28
- padding: 1rem;
29
- justify-content: center;
30
- align-items: center;
31
- flex-direction: column;
32
- }
33
-
34
- .drop-text {
35
- font-size: 1rem;
36
- margin-top: 8px;
37
- width: 85%;
38
- overflow: hidden;
39
- text-overflow: ellipsis;
40
- text-align: center;
41
- a {
42
- color: var(--md-sys-color-primary);
43
- }
44
- }
45
-
46
- .drop.dropHover {
47
- background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='10' ry='10' stroke='%230071dc' stroke-width='4' stroke-dasharray='6%2c 10' stroke-dashoffset='6' stroke-linecap='square'/%3e%3c/svg%3e");
48
- }
@@ -1,18 +0,0 @@
1
- :host {
2
- display: inline-flex;
3
- }
4
-
5
- .input-wrapper {
6
- display: flex;
7
- flex-direction: column;
8
- }
9
-
10
- .icon {
11
- margin-left: var(--exm-upload-input-icon-margin-left, 8px);
12
- }
13
-
14
- .icon svg {
15
- width: var(--exm-upload-input-icon-size, 24px);
16
- height: var(--exm-upload-input-icon-size, 24px);
17
- fill: var(--exm-upload-input-icon-fill, #0071dc);
18
- }