@exmg/exm-upload 1.0.0
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/README.md +20 -0
- package/index.d.ts +18 -0
- package/index.js +17 -0
- package/package.json +53 -0
- package/src/exm-dialog-upload-base.d.ts +90 -0
- package/src/exm-dialog-upload-base.js +226 -0
- package/src/exm-dialog-upload.d.ts +11 -0
- package/src/exm-dialog-upload.js +15 -0
- package/src/exm-upload-base.d.ts +148 -0
- package/src/exm-upload-base.js +373 -0
- package/src/exm-upload-crop-base.d.ts +16 -0
- package/src/exm-upload-crop-base.js +76 -0
- package/src/exm-upload-crop.d.ts +9 -0
- package/src/exm-upload-crop.js +12 -0
- package/src/exm-upload-drop-area-base.d.ts +8 -0
- package/src/exm-upload-drop-area-base.js +34 -0
- package/src/exm-upload-drop-area.d.ts +9 -0
- package/src/exm-upload-drop-area.js +12 -0
- package/src/exm-upload-input.d.ts +15 -0
- package/src/exm-upload-input.js +84 -0
- package/src/exm-upload-item-base.d.ts +45 -0
- package/src/exm-upload-item-base.js +177 -0
- package/src/exm-upload-item.d.ts +9 -0
- package/src/exm-upload-item.js +12 -0
- package/src/exm-upload.d.ts +19 -0
- package/src/exm-upload.js +22 -0
- package/src/mixins/exm-upload-drag-drop-mixin.d.ts +10 -0
- package/src/mixins/exm-upload-drag-drop-mixin.js +28 -0
- package/src/styles/exm-dialog-upload-css.d.ts +2 -0
- package/src/styles/exm-dialog-upload-css.js +4 -0
- package/src/styles/exm-dialog-upload.scss +22 -0
- package/src/styles/exm-upload-crop-styles-css.d.ts +2 -0
- package/src/styles/exm-upload-crop-styles-css.js +12 -0
- package/src/styles/exm-upload-crop-styles.scss +323 -0
- package/src/styles/exm-upload-drop-area-styles-css.d.ts +2 -0
- package/src/styles/exm-upload-drop-area-styles-css.js +4 -0
- package/src/styles/exm-upload-drop-area-styles.scss +45 -0
- package/src/styles/exm-upload-input-css.d.ts +2 -0
- package/src/styles/exm-upload-input-css.js +4 -0
- package/src/styles/exm-upload-input.scss +18 -0
- package/src/styles/exm-upload-item-styles-css.d.ts +2 -0
- package/src/styles/exm-upload-item-styles-css.js +4 -0
- package/src/styles/exm-upload-item-styles.scss +119 -0
- package/src/styles/exm-upload-styles-css.d.ts +2 -0
- package/src/styles/exm-upload-styles-css.js +4 -0
- package/src/styles/exm-upload-styles.scss +147 -0
- package/src/types.d.ts +33 -0
- package/src/types.js +10 -0
- package/src/upload/adapters/local-adapter.d.ts +6 -0
- package/src/upload/adapters/local-adapter.js +23 -0
- package/src/upload/adapters/xhr-adapter.d.ts +9 -0
- package/src/upload/adapters/xhr-adapter.js +49 -0
- package/src/upload/index.d.ts +1 -0
- package/src/upload/index.js +2 -0
- package/src/upload/service.d.ts +9 -0
- package/src/upload/service.js +42 -0
- package/src/upload/types.d.ts +12 -0
- package/src/upload/types.js +2 -0
- package/src/utils.d.ts +33 -0
- package/src/utils.js +89 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import '@material/web/iconbutton/icon-button.js';
|
|
3
|
+
import '@material/web/progress/linear-progress.js';
|
|
4
|
+
import { FileData } from './types.js';
|
|
5
|
+
import { UploadService } from './upload/index.js';
|
|
6
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
7
|
+
export declare class ExmgUploadItemBase extends ExmgElement {
|
|
8
|
+
/**
|
|
9
|
+
* Optional property. If not set it will look for the window.emconfig.backendHost
|
|
10
|
+
*/
|
|
11
|
+
uploadUrl?: string;
|
|
12
|
+
customAdapterPath?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The upload response type
|
|
15
|
+
*/
|
|
16
|
+
serverType: 'xhr' | 'local' | 'custom';
|
|
17
|
+
/**
|
|
18
|
+
* The upload response type
|
|
19
|
+
*/
|
|
20
|
+
responseType?: '' | 'json' | 'text' | 'blob' | 'arraybuffer';
|
|
21
|
+
uploadService?: UploadService;
|
|
22
|
+
item?: FileData;
|
|
23
|
+
allowCropping?: boolean;
|
|
24
|
+
aspectRatio?: number;
|
|
25
|
+
firstUpdated(): Promise<void>;
|
|
26
|
+
private _handleEditClick;
|
|
27
|
+
private _handleRemoveClick;
|
|
28
|
+
/**
|
|
29
|
+
* Error handling helper function used for all validation
|
|
30
|
+
* @param message
|
|
31
|
+
* @param item
|
|
32
|
+
*/
|
|
33
|
+
handleError(message: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Handle upload from added files
|
|
36
|
+
*/
|
|
37
|
+
handleFileUpload(): Promise<void>;
|
|
38
|
+
private renderStatus;
|
|
39
|
+
private renderActions;
|
|
40
|
+
private _renderWarning;
|
|
41
|
+
private renderUploading;
|
|
42
|
+
private renderUploaded;
|
|
43
|
+
private renderInvalid;
|
|
44
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
|
+
import { property } from 'lit/decorators.js';
|
|
4
|
+
import '@material/web/icon/icon.js';
|
|
5
|
+
import '@material/web/iconbutton/icon-button.js';
|
|
6
|
+
import '@material/web/progress/linear-progress.js';
|
|
7
|
+
import { formatBytes, isImage } from './utils.js';
|
|
8
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
|
+
import { UploadService } from './upload/index.js';
|
|
10
|
+
import { ExmgElement } from '@exmg/lit-base';
|
|
11
|
+
export class ExmgUploadItemBase extends ExmgElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/**
|
|
15
|
+
* The upload response type
|
|
16
|
+
*/
|
|
17
|
+
this.serverType = 'xhr';
|
|
18
|
+
}
|
|
19
|
+
async firstUpdated() {
|
|
20
|
+
var _a;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
const uploadUrl = this.uploadUrl;
|
|
23
|
+
const headers = window.uploadDefaults ? window.uploadDefaults.headers || {} : {};
|
|
24
|
+
const payload = {
|
|
25
|
+
uploadUrl: uploadUrl || ((_a = window.uploadDefaults) === null || _a === void 0 ? void 0 : _a.uploadUrl) || undefined,
|
|
26
|
+
headers,
|
|
27
|
+
responseType: this.responseType,
|
|
28
|
+
};
|
|
29
|
+
if (this.customAdapterPath) {
|
|
30
|
+
payload.customAdapterPath = this.customAdapterPath || window.uploadDefaults.customAdapterPath;
|
|
31
|
+
}
|
|
32
|
+
this.uploadService = await UploadService.create(this.serverType, payload);
|
|
33
|
+
this.handleFileUpload();
|
|
34
|
+
}
|
|
35
|
+
_handleEditClick() {
|
|
36
|
+
this.fire('edit-image', this.item, true);
|
|
37
|
+
}
|
|
38
|
+
_handleRemoveClick() {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
(_a = this.uploadService) === null || _a === void 0 ? void 0 : _a.abort();
|
|
41
|
+
this.fire('remove-item', (_b = this.item) === null || _b === void 0 ? void 0 : _b.id, true);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Error handling helper function used for all validation
|
|
45
|
+
* @param message
|
|
46
|
+
* @param item
|
|
47
|
+
*/
|
|
48
|
+
handleError(message) {
|
|
49
|
+
this.item.invalid = true;
|
|
50
|
+
this.item.status = 'INVALID';
|
|
51
|
+
this.item.error = message;
|
|
52
|
+
this.requestUpdate('item');
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Handle upload from added files
|
|
56
|
+
*/
|
|
57
|
+
async handleFileUpload() {
|
|
58
|
+
var _a;
|
|
59
|
+
if (!this.item) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// Check if file is valid before attempting the upload
|
|
63
|
+
if (!this.item.invalid) {
|
|
64
|
+
try {
|
|
65
|
+
const url = await ((_a = this.uploadService) === null || _a === void 0 ? void 0 : _a.upload(this.item.file, (progress) => {
|
|
66
|
+
this.item.progress = progress;
|
|
67
|
+
this.requestUpdate('item');
|
|
68
|
+
}));
|
|
69
|
+
this.item.url = url;
|
|
70
|
+
this.item.status = 'UPLOADED';
|
|
71
|
+
this.requestUpdate('item');
|
|
72
|
+
this.fire('upload-success', this.item, true);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
this.handleError(error);
|
|
76
|
+
throw new Error(error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
renderStatus() {
|
|
81
|
+
const { status } = this.item;
|
|
82
|
+
switch (status) {
|
|
83
|
+
case 'UPLOADING':
|
|
84
|
+
return this.renderUploading();
|
|
85
|
+
case 'UPLOADED':
|
|
86
|
+
return this.renderUploaded();
|
|
87
|
+
case 'INVALID':
|
|
88
|
+
return this.renderInvalid();
|
|
89
|
+
case 'WARNING':
|
|
90
|
+
return this._renderWarning();
|
|
91
|
+
default:
|
|
92
|
+
return nothing;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
renderActions() {
|
|
96
|
+
const { item, allowCropping } = this;
|
|
97
|
+
const { status } = item;
|
|
98
|
+
return html `${status === 'UPLOADED' && isImage(item.file) && allowCropping
|
|
99
|
+
? html `<md-icon-button @click=${this._handleEditClick}>
|
|
100
|
+
<md-icon>edit</md-icon>
|
|
101
|
+
</md-icon-button>`
|
|
102
|
+
: nothing}
|
|
103
|
+
<md-icon-button @click=${this._handleRemoveClick}>
|
|
104
|
+
<md-icon>delete</md-icon>
|
|
105
|
+
</md-icon-button>`;
|
|
106
|
+
}
|
|
107
|
+
_renderWarning() {
|
|
108
|
+
return html `<md-icon class="warning-icon">warning</md-icon>`;
|
|
109
|
+
}
|
|
110
|
+
renderUploading() {
|
|
111
|
+
return html `<span class="loader"></span> `;
|
|
112
|
+
}
|
|
113
|
+
renderUploaded() {
|
|
114
|
+
return html `<md-icon class="success-icon">check</md-icon>`;
|
|
115
|
+
}
|
|
116
|
+
renderInvalid() {
|
|
117
|
+
return html `<md-icon class="error-icon">error</md-icon>`;
|
|
118
|
+
}
|
|
119
|
+
render() {
|
|
120
|
+
var _a, _b, _c;
|
|
121
|
+
const file = (_a = this.item) === null || _a === void 0 ? void 0 : _a.file;
|
|
122
|
+
const { progress, status } = this.item;
|
|
123
|
+
const originalName = file === null || file === void 0 ? void 0 : file.name;
|
|
124
|
+
const fileName = originalName.substring(0, originalName.lastIndexOf('.'));
|
|
125
|
+
const fileType = originalName.substring(originalName.lastIndexOf('.') + 1, originalName.length);
|
|
126
|
+
return html `
|
|
127
|
+
<div class="item">
|
|
128
|
+
<div class="status vertical-center">${this.renderStatus()}</div>
|
|
129
|
+
<div class="name-container">
|
|
130
|
+
<span class="file-name">${fileName}</span>
|
|
131
|
+
${status !== 'INVALID' && status !== 'WARNING'
|
|
132
|
+
? html ` <md-linear-progress
|
|
133
|
+
max="100"
|
|
134
|
+
class="progress"
|
|
135
|
+
value="${ifDefined(progress || 0)}"
|
|
136
|
+
></md-linear-progress>`
|
|
137
|
+
: nothing}
|
|
138
|
+
${((_b = this.item) === null || _b === void 0 ? void 0 : _b.error)
|
|
139
|
+
? html ` <span class="file-error">${(_c = this.item) === null || _c === void 0 ? void 0 : _c.error}</span> `
|
|
140
|
+
: html ` <div class="file-details vertical-center">
|
|
141
|
+
<div class="vertical-center">
|
|
142
|
+
<span class="file-size badge">${fileType.toUpperCase()}</span>
|
|
143
|
+
<span class="file-type badge">${formatBytes(file === null || file === void 0 ? void 0 : file.size)}</span>
|
|
144
|
+
</div>
|
|
145
|
+
<span class="progress">${Math.round((progress || 0) * 10) / 10}%</span>
|
|
146
|
+
</div>`}
|
|
147
|
+
</div>
|
|
148
|
+
<div class="actions vertical-center">${this.renderActions()}</div>
|
|
149
|
+
</div>
|
|
150
|
+
`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
__decorate([
|
|
154
|
+
property({ type: String })
|
|
155
|
+
], ExmgUploadItemBase.prototype, "uploadUrl", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
property({ type: String })
|
|
158
|
+
], ExmgUploadItemBase.prototype, "customAdapterPath", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
property({ type: String })
|
|
161
|
+
], ExmgUploadItemBase.prototype, "serverType", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
property({ type: String })
|
|
164
|
+
], ExmgUploadItemBase.prototype, "responseType", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
property({ type: Object })
|
|
167
|
+
], ExmgUploadItemBase.prototype, "uploadService", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
property({ type: Object })
|
|
170
|
+
], ExmgUploadItemBase.prototype, "item", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
property({ type: Boolean })
|
|
173
|
+
], ExmgUploadItemBase.prototype, "allowCropping", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
property({ type: Number })
|
|
176
|
+
], ExmgUploadItemBase.prototype, "aspectRatio", void 0);
|
|
177
|
+
//# sourceMappingURL=exm-upload-item-base.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExmgUploadItemBase } from './exm-upload-item-base.js';
|
|
2
|
+
export declare class ExmgUploadItem extends ExmgUploadItemBase {
|
|
3
|
+
static styles: import("lit").CSSResult;
|
|
4
|
+
}
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementTagNameMap {
|
|
7
|
+
'exm-upload-item': ExmgUploadItem;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement } from 'lit/decorators.js';
|
|
3
|
+
import { style } from './styles/exm-upload-item-styles-css.js';
|
|
4
|
+
import { ExmgUploadItemBase } from './exm-upload-item-base.js';
|
|
5
|
+
let ExmgUploadItem = class ExmgUploadItem extends ExmgUploadItemBase {
|
|
6
|
+
};
|
|
7
|
+
ExmgUploadItem.styles = style;
|
|
8
|
+
ExmgUploadItem = __decorate([
|
|
9
|
+
customElement('exm-upload-item')
|
|
10
|
+
], ExmgUploadItem);
|
|
11
|
+
export { ExmgUploadItem };
|
|
12
|
+
//# sourceMappingURL=exm-upload-item.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ExmgUploadBase } from './exm-upload-base.js';
|
|
2
|
+
/**
|
|
3
|
+
* `exm-upload`
|
|
4
|
+
* Example:
|
|
5
|
+
* ```html
|
|
6
|
+
* <div>
|
|
7
|
+
* <input id="imageUpload" name="imageUrl" />
|
|
8
|
+
* <exm-upload for="imageUpload"> </exm-upload>
|
|
9
|
+
* </div>
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare class ExmgUpload extends ExmgUploadBase {
|
|
13
|
+
static styles: import("lit").CSSResult;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'exm-upload': ExmgUpload;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { style } from './styles/exm-upload-styles-css.js';
|
|
3
|
+
import { ExmgUploadBase } from './exm-upload-base.js';
|
|
4
|
+
import { customElement } from 'lit/decorators.js';
|
|
5
|
+
/**
|
|
6
|
+
* `exm-upload`
|
|
7
|
+
* Example:
|
|
8
|
+
* ```html
|
|
9
|
+
* <div>
|
|
10
|
+
* <input id="imageUpload" name="imageUrl" />
|
|
11
|
+
* <exm-upload for="imageUpload"> </exm-upload>
|
|
12
|
+
* </div>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
let ExmgUpload = class ExmgUpload extends ExmgUploadBase {
|
|
16
|
+
};
|
|
17
|
+
ExmgUpload.styles = style;
|
|
18
|
+
ExmgUpload = __decorate([
|
|
19
|
+
customElement('exm-upload')
|
|
20
|
+
], ExmgUpload);
|
|
21
|
+
export { ExmgUpload };
|
|
22
|
+
//# sourceMappingURL=exm-upload.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type Constructor<T = {}> = new (...args: any[]) => T;
|
|
3
|
+
export declare class DragAndDropInterface {
|
|
4
|
+
dragOver: boolean;
|
|
5
|
+
onDragOver(): void;
|
|
6
|
+
onDragLeave(): void;
|
|
7
|
+
onDrop(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DragAndDropMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<DragAndDropInterface> & T;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
export const DragAndDropMixin = (superClass) => {
|
|
4
|
+
class DragAndDropMixin extends superClass {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.dragOver = false;
|
|
8
|
+
}
|
|
9
|
+
onDragOver(event) {
|
|
10
|
+
event.stopPropagation();
|
|
11
|
+
event.preventDefault();
|
|
12
|
+
this.dragOver = true;
|
|
13
|
+
}
|
|
14
|
+
onDragLeave(event) {
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
this.dragOver = false;
|
|
18
|
+
}
|
|
19
|
+
onDrop() {
|
|
20
|
+
this.dragOver = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
__decorate([
|
|
24
|
+
property({ type: Boolean })
|
|
25
|
+
], DragAndDropMixin.prototype, "dragOver", void 0);
|
|
26
|
+
return DragAndDropMixin;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=exm-upload-drag-drop-mixin.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}[slot=headline]{display:flex;flex-direction:row-reverse;align-items:center}[showing-fullscreen] [slot=headline]{flex-direction:row}.headline{flex:1;display:block;text-align:left}exm-upload,::slotted(exm-upload){width:460px}`;
|
|
3
|
+
export default style;
|
|
4
|
+
//# sourceMappingURL=exm-dialog-upload-css.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `#image{z-index:99999;display:flex;max-width:100%}.image-container{max-width:300px;max-height:300px}.actions{margin-top:8px;display:flex;justify-content:flex-end}/*!
|
|
3
|
+
* Cropper.js v1.5.13
|
|
4
|
+
* https://fengyuanchen.github.io/cropperjs
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2015-present Chen Fengyuan
|
|
7
|
+
* Released under the MIT license
|
|
8
|
+
*
|
|
9
|
+
* Date: 2022-11-20T05:30:43.444Z
|
|
10
|
+
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:block;height:100%;image-orientation:0deg;max-height:none !important;max-width:none !important;min-height:0 !important;min-width:0 !important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.3333333333%;left:0;top:33.3333333333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.3333333333%;top:0;width:33.3333333333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center::before,.cropper-center::after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center::before{height:1px;left:-3px;top:0;width:7px}.cropper-center::after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media(min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media(min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media(min-width: 1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se::before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none !important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}`;
|
|
11
|
+
export default style;
|
|
12
|
+
//# sourceMappingURL=exm-upload-crop-styles-css.js.map
|