@acorex/components 21.0.0-next.2 → 21.0.0-next.20
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/autocomplete/index.d.ts +23 -9
- package/code-editor/README.md +291 -1
- package/code-editor/index.d.ts +260 -12
- package/command/index.d.ts +1 -0
- package/data-table/index.d.ts +1 -1
- package/drawer/README.md +2 -2
- package/drawer/index.d.ts +33 -57
- package/drawer-legacy/README.md +3 -0
- package/drawer-legacy/index.d.ts +86 -0
- package/editor/README.md +3 -0
- package/editor/index.d.ts +80 -0
- package/fesm2022/acorex-components-accordion.mjs +14 -14
- package/fesm2022/acorex-components-accordion.mjs.map +1 -1
- package/fesm2022/acorex-components-action-sheet.mjs +10 -10
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +8 -8
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-aspect-ratio.mjs +4 -4
- package/fesm2022/acorex-components-aspect-ratio.mjs.map +1 -1
- package/fesm2022/acorex-components-audio-wave.mjs +8 -8
- package/fesm2022/acorex-components-audio-wave.mjs.map +1 -1
- package/fesm2022/acorex-components-autocomplete.mjs +30 -13
- package/fesm2022/acorex-components-autocomplete.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +11 -11
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +8 -8
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-bottom-navigation.mjs +11 -11
- package/fesm2022/acorex-components-bottom-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +11 -11
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +13 -13
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +15 -15
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +14 -14
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +8 -8
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-chips.mjs +8 -8
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +8 -8
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-code-editor.mjs +494 -162
- package/fesm2022/acorex-components-code-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +11 -26
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +9 -9
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +30 -30
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-command.mjs +18 -11
- package/fesm2022/acorex-components-command.mjs.map +1 -1
- package/fesm2022/acorex-components-comment.mjs +30 -30
- package/fesm2022/acorex-components-comment.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation.mjs +54 -63
- package/fesm2022/acorex-components-conversation.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs +53 -53
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
- package/fesm2022/acorex-components-data-list.mjs +5 -5
- package/fesm2022/acorex-components-data-list.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +50 -38
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +46 -43
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +8 -8
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-input.mjs +8 -8
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +9 -9
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-decorators.mjs +83 -41
- package/fesm2022/acorex-components-decorators.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +21 -12
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer-legacy.mjs +218 -0
- package/fesm2022/acorex-components-drawer-legacy.mjs.map +1 -0
- package/fesm2022/acorex-components-drawer.mjs +66 -149
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown-button.mjs +9 -9
- package/fesm2022/acorex-components-dropdown-button.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +15 -15
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-editor.mjs +189 -0
- package/fesm2022/acorex-components-editor.mjs.map +1 -0
- package/fesm2022/acorex-components-file-explorer.mjs +28 -28
- package/fesm2022/acorex-components-file-explorer.mjs.map +1 -1
- package/fesm2022/acorex-components-flow-chart.mjs +18 -18
- package/fesm2022/acorex-components-flow-chart.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +22 -28
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +12 -12
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-image-editor.mjs +38 -38
- package/fesm2022/acorex-components-image-editor.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +8 -8
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-json-viewer.mjs +8 -8
- package/fesm2022/acorex-components-json-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-kanban.mjs +4 -4
- package/fesm2022/acorex-components-kanban.mjs.map +1 -1
- package/fesm2022/acorex-components-kbd.mjs +7 -7
- package/fesm2022/acorex-components-kbd.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +7 -7
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +8 -8
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +21 -12
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +16 -16
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-map.mjs +15 -14
- package/fesm2022/acorex-components-map.mjs.map +1 -1
- package/fesm2022/acorex-components-media-viewer.mjs +61 -87
- package/fesm2022/acorex-components-media-viewer.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +19 -19
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs → acorex-components-modal-acorex-components-modal-iYSPzoLn.mjs} +23 -23
- package/fesm2022/acorex-components-modal-acorex-components-modal-iYSPzoLn.mjs.map +1 -0
- package/fesm2022/{acorex-components-modal-modal-content.component-B6tyMLdU.mjs → acorex-components-modal-modal-content.component-sZWKhYM-.mjs} +7 -30
- package/fesm2022/acorex-components-modal-modal-content.component-sZWKhYM-.mjs.map +1 -0
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-navbar.mjs +7 -7
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +10 -10
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box-legacy.mjs +412 -0
- package/fesm2022/acorex-components-number-box-legacy.mjs.map +1 -0
- package/fesm2022/acorex-components-number-box.mjs +98 -331
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +8 -8
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-page.mjs +10 -10
- package/fesm2022/acorex-components-page.mjs.map +1 -1
- package/fesm2022/acorex-components-paint.mjs +27 -27
- package/fesm2022/acorex-components-paint.mjs.map +1 -1
- package/fesm2022/acorex-components-password-box.mjs +11 -11
- package/fesm2022/acorex-components-password-box.mjs.map +1 -1
- package/fesm2022/acorex-components-pdf-reader.mjs +8 -8
- package/fesm2022/acorex-components-pdf-reader.mjs.map +1 -1
- package/fesm2022/acorex-components-phone-box.mjs +9 -9
- package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +15 -15
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +8 -8
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +10 -10
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +7 -7
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-qrcode.mjs +8 -8
- package/fesm2022/acorex-components-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-components-query-builder.mjs +8 -8
- package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +7 -7
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-rail-navigation.mjs +15 -15
- package/fesm2022/acorex-components-rail-navigation.mjs.map +1 -1
- package/fesm2022/acorex-components-range-slider.mjs +8 -8
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-rate-picker.mjs +8 -8
- package/fesm2022/acorex-components-rate-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-rest-api-generator.mjs +23 -23
- package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +7 -7
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +7 -7
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-rrule.mjs +111 -16
- package/fesm2022/acorex-components-rrule.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler-picker.mjs +2339 -0
- package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -0
- package/fesm2022/acorex-components-scheduler.mjs +43 -43
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-scss.mjs +4 -4
- package/fesm2022/acorex-components-scss.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +8 -8
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +34 -17
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list-2.mjs +8 -8
- package/fesm2022/acorex-components-selection-list-2.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +8 -8
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +31 -38
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +7 -7
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-slider.mjs +8 -8
- package/fesm2022/acorex-components-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-sliding-item.mjs +16 -16
- package/fesm2022/acorex-components-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-components-step-wizard.mjs +15 -15
- package/fesm2022/acorex-components-step-wizard.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +10 -10
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +15 -15
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag-box.mjs +51 -21
- package/fesm2022/acorex-components-tag-box.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +45 -9
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +7 -7
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +11 -11
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-time-duration.mjs +54 -14
- package/fesm2022/acorex-components-time-duration.mjs.map +1 -1
- package/fesm2022/acorex-components-time-line.mjs +13 -28
- package/fesm2022/acorex-components-time-line.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +10 -10
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-toolbar.mjs +8 -8
- package/fesm2022/acorex-components-toolbar.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +11 -11
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-tree-view.mjs +16 -45
- package/fesm2022/acorex-components-tree-view.mjs.map +1 -1
- package/fesm2022/acorex-components-tree2.mjs +689 -0
- package/fesm2022/acorex-components-tree2.mjs.map +1 -0
- package/fesm2022/acorex-components-uploader.mjs +26 -639
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/fesm2022/acorex-components-video-player.mjs +8 -8
- package/fesm2022/acorex-components-video-player.mjs.map +1 -1
- package/fesm2022/acorex-components-wysiwyg.mjs +207 -458
- package/fesm2022/acorex-components-wysiwyg.mjs.map +1 -1
- package/media-viewer/index.d.ts +1 -0
- package/number-box/README.md +2 -2
- package/number-box/index.d.ts +31 -171
- package/number-box-legacy/README.md +3 -0
- package/number-box-legacy/index.d.ts +191 -0
- package/package.json +37 -14
- package/phone-box/index.d.ts +4 -4
- package/rrule/index.d.ts +96 -1
- package/scheduler-picker/README.md +15 -0
- package/scheduler-picker/index.d.ts +1360 -0
- package/select-box/index.d.ts +15 -10
- package/side-menu/index.d.ts +3 -2
- package/tag/index.d.ts +8 -2
- package/tag-box/index.d.ts +12 -3
- package/time-duration/index.d.ts +19 -3
- package/tree2/README.md +3 -0
- package/tree2/index.d.ts +337 -0
- package/uploader/index.d.ts +4 -331
- package/wysiwyg/index.d.ts +56 -159
- package/drawer-2/README.md +0 -3
- package/drawer-2/index.d.ts +0 -62
- package/fesm2022/acorex-components-drawer-2.mjs +0 -134
- package/fesm2022/acorex-components-drawer-2.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-acorex-components-modal-h5Y-qcbh.mjs.map +0 -1
- package/fesm2022/acorex-components-modal-modal-content.component-B6tyMLdU.mjs.map +0 -1
- package/fesm2022/acorex-components-number-box-2.mjs +0 -183
- package/fesm2022/acorex-components-number-box-2.mjs.map +0 -1
- package/number-box-2/README.md +0 -3
- package/number-box-2/index.d.ts +0 -41
|
@@ -1,560 +1,12 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, computed, inject, Injectable, ElementRef, ChangeDetectorRef, DOCUMENT, PLATFORM_ID, EventEmitter, HostBinding, Output, Input, Directive, ViewEncapsulation, Component, input, NgModule } from '@angular/core';
|
|
3
|
-
import { AXTranslationService, AXTranslatorPipe, AXTranslationModule } from '@acorex/core/translation';
|
|
4
|
-
import { AXUnsubscriber } from '@acorex/core/utils';
|
|
5
|
-
import { isPlatformBrowser, AsyncPipe, NgClass, CommonModule } from '@angular/common';
|
|
6
|
-
import { AXPopupService, AXPopupModule } from '@acorex/components/popup';
|
|
7
|
-
import { AXFileService, AXFileModule } from '@acorex/core/file';
|
|
8
|
-
import { sumBy } from 'lodash-es';
|
|
9
|
-
import { Subject, BehaviorSubject, map } from 'rxjs';
|
|
10
1
|
import { AXComponent, AXClosableComponent, MXBaseComponent } from '@acorex/cdk/common';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
class AXUploadRequest {
|
|
20
|
-
get name() {
|
|
21
|
-
return this.file.name;
|
|
22
|
-
}
|
|
23
|
-
get ext() {
|
|
24
|
-
const parts = this.name.split('.');
|
|
25
|
-
if (parts.length > 1) {
|
|
26
|
-
return parts[parts.length - 1];
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
// No extension found
|
|
30
|
-
return '';
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
get size() {
|
|
34
|
-
return this.file.size;
|
|
35
|
-
}
|
|
36
|
-
get file() {
|
|
37
|
-
return this.uploadFile;
|
|
38
|
-
}
|
|
39
|
-
constructor(uploadFile) {
|
|
40
|
-
this.uploadFile = uploadFile;
|
|
41
|
-
this._progress = signal(0, ...(ngDevMode ? [{ debugName: "_progress" }] : []));
|
|
42
|
-
this.progress = computed(() => this._progress(), ...(ngDevMode ? [{ debugName: "progress" }] : []));
|
|
43
|
-
this._estimateTime = signal(0, ...(ngDevMode ? [{ debugName: "_estimateTime" }] : []));
|
|
44
|
-
this.estimateTime = computed(() => this._estimateTime(), ...(ngDevMode ? [{ debugName: "estimateTime" }] : []));
|
|
45
|
-
this._status = signal('new', ...(ngDevMode ? [{ debugName: "_status" }] : []));
|
|
46
|
-
this.status = computed(() => this._status(), ...(ngDevMode ? [{ debugName: "status" }] : []));
|
|
47
|
-
this._message = signal(null, ...(ngDevMode ? [{ debugName: "_message" }] : []));
|
|
48
|
-
this.message = computed(() => this._message(), ...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
49
|
-
this._isDetermined = signal(false, ...(ngDevMode ? [{ debugName: "_isDetermined" }] : []));
|
|
50
|
-
this.isDetermined = computed(() => this._isDetermined(), ...(ngDevMode ? [{ debugName: "isDetermined" }] : []));
|
|
51
|
-
this.bytesTransferred = 0;
|
|
52
|
-
this.onCancel = new Subject();
|
|
53
|
-
this.onStart = new Subject();
|
|
54
|
-
this.onFailed = new Subject();
|
|
55
|
-
this.onComplete = new BehaviorSubject(null);
|
|
56
|
-
}
|
|
57
|
-
estimateTimeRemaining(bytesTransferred) {
|
|
58
|
-
const now = Date.now();
|
|
59
|
-
const elapsed = now - this.startTime; // Time in milliseconds
|
|
60
|
-
if (isNaN(elapsed) || elapsed === 0) {
|
|
61
|
-
return null; // Avoid division by zero
|
|
62
|
-
}
|
|
63
|
-
const speed = (bytesTransferred || 1) / elapsed; // Bytes per millisecond
|
|
64
|
-
const remainingBytes = this.size - bytesTransferred;
|
|
65
|
-
const estimatedTime = Math.ceil(remainingBytes / speed); // Time in milliseconds
|
|
66
|
-
return estimatedTime; // Return the estimated time in milliseconds
|
|
67
|
-
}
|
|
68
|
-
setTransferredBytes(value) {
|
|
69
|
-
this.bytesTransferred = value;
|
|
70
|
-
if (value > 0 && !this._isDetermined() && (this.status() == 'new' || this.status() == 'inprogress')) {
|
|
71
|
-
this._isDetermined.set(true);
|
|
72
|
-
}
|
|
73
|
-
this.updateEstimateTime();
|
|
74
|
-
}
|
|
75
|
-
updateEstimateTime() {
|
|
76
|
-
this._estimateTime.set(this.estimateTimeRemaining(this.bytesTransferred));
|
|
77
|
-
const progress = Math.floor((this.bytesTransferred / this.size) * 100);
|
|
78
|
-
this._progress.set(progress);
|
|
79
|
-
}
|
|
80
|
-
async upload() {
|
|
81
|
-
this.startTime = Date.now();
|
|
82
|
-
this._progress.set(0);
|
|
83
|
-
this._status.set('inprogress');
|
|
84
|
-
this.onStart.next();
|
|
85
|
-
}
|
|
86
|
-
cancel() {
|
|
87
|
-
this._status.set('canceled');
|
|
88
|
-
this.bytesTransferred = 0;
|
|
89
|
-
this._estimateTime.set(0);
|
|
90
|
-
this._progress.set(0);
|
|
91
|
-
this.onCancel.next();
|
|
92
|
-
}
|
|
93
|
-
redo() {
|
|
94
|
-
// this.startTime = Date.now();
|
|
95
|
-
this._progress.set(0);
|
|
96
|
-
this._status.set('inprogress');
|
|
97
|
-
this._message.set(null);
|
|
98
|
-
this.onStart.next();
|
|
99
|
-
}
|
|
100
|
-
error(message) {
|
|
101
|
-
this._status.set('failed');
|
|
102
|
-
this.bytesTransferred = 0;
|
|
103
|
-
this._estimateTime.set(0);
|
|
104
|
-
this._progress.set(0);
|
|
105
|
-
this._message.set(message);
|
|
106
|
-
this.onFailed.next();
|
|
107
|
-
}
|
|
108
|
-
finish(data) {
|
|
109
|
-
this._status.set('completed');
|
|
110
|
-
this.bytesTransferred = this.size;
|
|
111
|
-
this._estimateTime.set(0);
|
|
112
|
-
this._progress.set(100);
|
|
113
|
-
this.onComplete.next(data);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Service for managing file uploads with drag-and-drop support, progress tracking, and dialog management.
|
|
119
|
-
* @category Services
|
|
120
|
-
*/
|
|
121
|
-
class AXUploaderService {
|
|
122
|
-
constructor() {
|
|
123
|
-
/**
|
|
124
|
-
* Popup service for showing upload dialogs.
|
|
125
|
-
* @ignore
|
|
126
|
-
*/
|
|
127
|
-
this.popupService = inject(AXPopupService);
|
|
128
|
-
/**
|
|
129
|
-
* Translation service for localized text.
|
|
130
|
-
* @ignore
|
|
131
|
-
*/
|
|
132
|
-
this.translateService = inject(AXTranslationService);
|
|
133
|
-
/**
|
|
134
|
-
* File service for file operations.
|
|
135
|
-
* @ignore
|
|
136
|
-
*/
|
|
137
|
-
this.fileService = inject(AXFileService);
|
|
138
|
-
/**
|
|
139
|
-
* Behavior subject for managing upload requests.
|
|
140
|
-
* @ignore
|
|
141
|
-
*/
|
|
142
|
-
this._files$ = new BehaviorSubject([]);
|
|
143
|
-
/**
|
|
144
|
-
* Gets the files behavior subject for observing upload requests.
|
|
145
|
-
*/
|
|
146
|
-
this.files = this._files$.asObservable();
|
|
147
|
-
/**
|
|
148
|
-
* Subject for file upload start events.
|
|
149
|
-
*/
|
|
150
|
-
this.onFileUploadStart = new Subject();
|
|
151
|
-
/**
|
|
152
|
-
* Subject for file upload complete events.
|
|
153
|
-
*/
|
|
154
|
-
this.onFileUploadComplete = new Subject();
|
|
155
|
-
/**
|
|
156
|
-
* Subject for all files upload complete events.
|
|
157
|
-
*/
|
|
158
|
-
this.onFilesUploadComplete = new Subject();
|
|
159
|
-
/**
|
|
160
|
-
* Subject for file upload canceled events.
|
|
161
|
-
*/
|
|
162
|
-
this.onFileUploadCanceled = new Subject();
|
|
163
|
-
/**
|
|
164
|
-
* Signal indicating if any upload has determined progress.
|
|
165
|
-
*/
|
|
166
|
-
this.isAnyDetermined = computed(() => this._files$.value.some((file) => file.isDetermined()), ...(ngDevMode ? [{ debugName: "isAnyDetermined" }] : []));
|
|
167
|
-
/**
|
|
168
|
-
* Observable for total estimated upload time.
|
|
169
|
-
*/
|
|
170
|
-
this.totalEstimateTime = this._files$.pipe(map((files) => sumBy(files, (file) => (file.status() === 'inprogress' ? file.estimateTime() : 0))));
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Shows the upload dialog with the list of files.
|
|
174
|
-
* @private
|
|
175
|
-
*/
|
|
176
|
-
async showDialog() {
|
|
177
|
-
const filesCount = this._files$.getValue().length;
|
|
178
|
-
Promise.resolve().then(function () { return uploaderList_component; }).then(async (c) => {
|
|
179
|
-
this.popupService
|
|
180
|
-
.open(c.AXUploaderListComponent, {
|
|
181
|
-
size: 'sm',
|
|
182
|
-
title: filesCount > 1
|
|
183
|
-
? await this.translateService.translateAsync('@acorex:uploader.zone.uploadFiles')
|
|
184
|
-
: await this.translateService.translateAsync('@acorex:uploader.zone.uploadFile'),
|
|
185
|
-
})
|
|
186
|
-
.then(async () => {
|
|
187
|
-
await this.cancelAll();
|
|
188
|
-
this.clearAll();
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Converts a File object to an AXUploadRequest.
|
|
194
|
-
* @private
|
|
195
|
-
*/
|
|
196
|
-
convertFileToRequest(file) {
|
|
197
|
-
return new AXUploadRequest(file);
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Starts uploading files that are in 'new' status.
|
|
201
|
-
* @private
|
|
202
|
-
*/
|
|
203
|
-
async startUpload() {
|
|
204
|
-
const newFiles = this._files$.value.filter((c) => c.status() === 'new');
|
|
205
|
-
for (const file of newFiles) {
|
|
206
|
-
await this.bindEvents(file);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Binds event handlers to an upload request.
|
|
211
|
-
* @private
|
|
212
|
-
*/
|
|
213
|
-
async bindEvents(c) {
|
|
214
|
-
c.onStart.subscribe(() => {
|
|
215
|
-
this.onFileUploadStart.next({
|
|
216
|
-
component: this,
|
|
217
|
-
uploadedFile: c,
|
|
218
|
-
isUserInteraction: false,
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
c.onComplete.subscribe((data) => {
|
|
222
|
-
Object.assign(c, { metaData: data });
|
|
223
|
-
this.onFileUploadComplete.next({
|
|
224
|
-
component: this,
|
|
225
|
-
uploadedFile: c,
|
|
226
|
-
isUserInteraction: false,
|
|
227
|
-
});
|
|
228
|
-
const isAllDone = this._files$.value.every((f) => f.status() === 'completed' || f.status() === 'canceled' || f.status() === 'failed');
|
|
229
|
-
if (isAllDone) {
|
|
230
|
-
this.onFilesUploadComplete.next({
|
|
231
|
-
component: this,
|
|
232
|
-
uploadedFiles: this._files$.value,
|
|
233
|
-
isUserInteraction: false,
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
c.onCancel.subscribe(() => {
|
|
238
|
-
this.onFileUploadCanceled.next({
|
|
239
|
-
component: this,
|
|
240
|
-
uploadedFile: c,
|
|
241
|
-
isUserInteraction: false,
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Opens the file browser dialog and returns selected files as upload requests.
|
|
247
|
-
* @param options - Configuration options for file selection
|
|
248
|
-
* @returns Promise that resolves to an array of upload requests
|
|
249
|
-
*/
|
|
250
|
-
async browse(options = { multiple: false }) {
|
|
251
|
-
try {
|
|
252
|
-
const files = await this.fileService.choose({ multiple: options?.multiple || false, accept: options.accept });
|
|
253
|
-
if (files.length) {
|
|
254
|
-
return this.add(files);
|
|
255
|
-
}
|
|
256
|
-
return [];
|
|
257
|
-
}
|
|
258
|
-
catch (error) {
|
|
259
|
-
// It's good practice to log the error.
|
|
260
|
-
console.error('File browse failed:', error);
|
|
261
|
-
return [];
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Adds files to the upload queue and starts the upload process.
|
|
266
|
-
* @param files - Files to add to the upload queue
|
|
267
|
-
* @returns Promise that resolves to an array of upload requests
|
|
268
|
-
*/
|
|
269
|
-
async add(files) {
|
|
270
|
-
const list = Array.from(files).map((f) => this.convertFileToRequest(f));
|
|
271
|
-
const newFiles = [...this._files$.value, ...list];
|
|
272
|
-
this._files$.next(newFiles);
|
|
273
|
-
await this.showDialog();
|
|
274
|
-
this.startUpload();
|
|
275
|
-
return list;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Cancels all pending and in-progress uploads.
|
|
279
|
-
*/
|
|
280
|
-
async cancelAll() {
|
|
281
|
-
await Promise.all(this._files$.value.filter((c) => c.status() !== 'completed').map((c) => c.cancel()));
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* Clears all completed uploads from the queue.
|
|
285
|
-
*/
|
|
286
|
-
clearAll() {
|
|
287
|
-
const remainingFiles = this._files$.value.filter((c) => c.status() === 'inprogress');
|
|
288
|
-
this._files$.next(remainingFiles);
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Removes a specific upload request from the queue.
|
|
292
|
-
* @param item - The upload request to remove
|
|
293
|
-
*/
|
|
294
|
-
remove(item) {
|
|
295
|
-
const updatedFiles = this._files$.value.filter((c) => c !== item);
|
|
296
|
-
this._files$.next(updatedFiles);
|
|
297
|
-
}
|
|
298
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
299
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderService, providedIn: 'root' }); }
|
|
300
|
-
}
|
|
301
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderService, decorators: [{
|
|
302
|
-
type: Injectable,
|
|
303
|
-
args: [{ providedIn: 'root' }]
|
|
304
|
-
}] });
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* A directive that provides drag-and-drop and file upload functionality.
|
|
308
|
-
* When applied to an element, it enables drag-and-drop file uploads and file browsing.
|
|
309
|
-
* @category Directives
|
|
310
|
-
*/
|
|
311
|
-
class AXUploaderZoneDirective {
|
|
312
|
-
/**
|
|
313
|
-
* Initializes the directive with event listeners and service subscriptions.
|
|
314
|
-
*/
|
|
315
|
-
constructor() {
|
|
316
|
-
/**
|
|
317
|
-
* The element reference for the directive host.
|
|
318
|
-
* @ignore
|
|
319
|
-
*/
|
|
320
|
-
this.elementRef = inject(ElementRef);
|
|
321
|
-
/**
|
|
322
|
-
* Whether multiple files can be selected.
|
|
323
|
-
* @defaultValue true
|
|
324
|
-
*/
|
|
325
|
-
this.multiple = true;
|
|
326
|
-
/**
|
|
327
|
-
* File types that are accepted for upload.
|
|
328
|
-
* @defaultValue null
|
|
329
|
-
*/
|
|
330
|
-
this.accept = null;
|
|
331
|
-
/**
|
|
332
|
-
* Change detector reference.
|
|
333
|
-
* @ignore
|
|
334
|
-
*/
|
|
335
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
336
|
-
/**
|
|
337
|
-
* Document reference.
|
|
338
|
-
* @ignore
|
|
339
|
-
*/
|
|
340
|
-
this.document = inject(DOCUMENT);
|
|
341
|
-
/**
|
|
342
|
-
* Platform ID for browser detection.
|
|
343
|
-
* @ignore
|
|
344
|
-
*/
|
|
345
|
-
this.platformID = inject(PLATFORM_ID);
|
|
346
|
-
/**
|
|
347
|
-
* Upload service instance.
|
|
348
|
-
* @ignore
|
|
349
|
-
*/
|
|
350
|
-
this.uploadService = inject(AXUploaderService);
|
|
351
|
-
/**
|
|
352
|
-
* Unsubscriber service instance.
|
|
353
|
-
* @ignore
|
|
354
|
-
*/
|
|
355
|
-
this.unsubscriber = inject(AXUnsubscriber);
|
|
356
|
-
/**
|
|
357
|
-
* Translation service instance.
|
|
358
|
-
* @ignore
|
|
359
|
-
*/
|
|
360
|
-
this.translateService = inject(AXTranslationService);
|
|
361
|
-
/**
|
|
362
|
-
* Emitted when files are changed (added, removed, etc.).
|
|
363
|
-
*/
|
|
364
|
-
this.onChanged = new EventEmitter();
|
|
365
|
-
/**
|
|
366
|
-
* Emitted when a single file upload is completed.
|
|
367
|
-
*/
|
|
368
|
-
this.onFileUploadComplete = new EventEmitter();
|
|
369
|
-
/**
|
|
370
|
-
* Emitted when all files upload is completed.
|
|
371
|
-
*/
|
|
372
|
-
this.onFilesUploadComplete = new EventEmitter();
|
|
373
|
-
/**
|
|
374
|
-
* CSS class for the overlay state.
|
|
375
|
-
* @ignore
|
|
376
|
-
*/
|
|
377
|
-
this.stateClass = 'ax-uploader-overlay-state';
|
|
378
|
-
this.element = this.elementRef.nativeElement;
|
|
379
|
-
this.element.style.position = 'relative';
|
|
380
|
-
//
|
|
381
|
-
this.uploadService.onFileUploadComplete.pipe(this.unsubscriber.takeUntilDestroy).subscribe((c) => {
|
|
382
|
-
this.onFileUploadComplete.next(c);
|
|
383
|
-
});
|
|
384
|
-
this.uploadService.onFilesUploadComplete.pipe(this.unsubscriber.takeUntilDestroy).subscribe((c) => {
|
|
385
|
-
this.onFilesUploadComplete.next(c);
|
|
386
|
-
});
|
|
387
|
-
//
|
|
388
|
-
setTimeout(() => {
|
|
389
|
-
const browseHandlers = this.element.querySelectorAll('[data-ax-uploader-browse-handle="true"]');
|
|
390
|
-
if (browseHandlers.length <= 0)
|
|
391
|
-
this.element.addEventListener('click', this.browser.bind(this), true);
|
|
392
|
-
});
|
|
393
|
-
this.element.addEventListener('dragenter', this.handleDragEnter.bind(this), true);
|
|
394
|
-
this.element.addEventListener('dragover', this.handleDragOver.bind(this), true);
|
|
395
|
-
this.element.addEventListener('drop', this.handleOnDrop.bind(this), true);
|
|
396
|
-
this.element.addEventListener('dragleave', this.removeZone.bind(this), true);
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Cleans up event listeners when the directive is destroyed.
|
|
400
|
-
*/
|
|
401
|
-
ngOnDestroy() {
|
|
402
|
-
this.element.removeEventListener('click', this.browser.bind(this));
|
|
403
|
-
this.element.removeEventListener('dragenter', this.handleDragEnter.bind(this));
|
|
404
|
-
this.element.removeEventListener('drop', this.handleOnDrop.bind(this));
|
|
405
|
-
this.element.removeEventListener('dragover', this.handleDragOver.bind(this));
|
|
406
|
-
this.element.removeEventListener('dragleave', this.removeZone.bind(this));
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Handles drag enter events to show the upload overlay.
|
|
410
|
-
* @private
|
|
411
|
-
*/
|
|
412
|
-
async handleDragEnter(event) {
|
|
413
|
-
this.createZone();
|
|
414
|
-
event.preventDefault();
|
|
415
|
-
event.stopImmediatePropagation();
|
|
416
|
-
}
|
|
417
|
-
/**
|
|
418
|
-
* Handles drop events to process dropped files.
|
|
419
|
-
* @private
|
|
420
|
-
*/
|
|
421
|
-
async handleOnDrop(event) {
|
|
422
|
-
event.preventDefault();
|
|
423
|
-
event.stopImmediatePropagation();
|
|
424
|
-
const requests = await this.uploadService.add(event.dataTransfer?.files);
|
|
425
|
-
this.onChanged.emit({
|
|
426
|
-
component: this,
|
|
427
|
-
requests,
|
|
428
|
-
isUserInteraction: true,
|
|
429
|
-
});
|
|
430
|
-
this.removeZone();
|
|
431
|
-
this.cdr.detectChanges();
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Handles drag over events to allow dropping.
|
|
435
|
-
* @private
|
|
436
|
-
*/
|
|
437
|
-
handleDragOver(event) {
|
|
438
|
-
event.preventDefault();
|
|
439
|
-
event.stopImmediatePropagation();
|
|
440
|
-
}
|
|
441
|
-
/**
|
|
442
|
-
* Creates the visual overlay for drag and drop feedback.
|
|
443
|
-
* @private
|
|
444
|
-
*/
|
|
445
|
-
async createZone() {
|
|
446
|
-
if (isPlatformBrowser(this.platformID)) {
|
|
447
|
-
this.overlayElement = this.document.createElement('div');
|
|
448
|
-
this.overlayElement.classList.add('ax-uploader-overlay-state', '-ax-z-1');
|
|
449
|
-
this.overlayElement.id = 'ax-uploader-overlay-state';
|
|
450
|
-
const icon = this.document.createElement('span');
|
|
451
|
-
icon.classList.add('ax-icon', 'ax-icon-upload');
|
|
452
|
-
const text = this.document.createElement('span');
|
|
453
|
-
text.innerText = await this.translateService.translateAsync('@acorex:uploader.zone.text');
|
|
454
|
-
this.overlayElement.appendChild(icon);
|
|
455
|
-
this.overlayElement.appendChild(text);
|
|
456
|
-
this.element.appendChild(this.overlayElement);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
/**
|
|
460
|
-
* Removes the visual overlay for drag and drop feedback.
|
|
461
|
-
* @private
|
|
462
|
-
*/
|
|
463
|
-
removeZone() {
|
|
464
|
-
if (isPlatformBrowser(this.platformID)) {
|
|
465
|
-
this.element.removeChild(this.document.getElementById('ax-uploader-overlay-state'));
|
|
466
|
-
this.overlayElement.remove();
|
|
467
|
-
//console.log(this.overlayElement);
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* Opens the file browser dialog and processes selected files.
|
|
472
|
-
* @returns Promise that resolves when files are processed
|
|
473
|
-
*/
|
|
474
|
-
async browser() {
|
|
475
|
-
const requests = await this.uploadService.browse({ accept: this.accept, multiple: this.multiple });
|
|
476
|
-
this.onChanged.emit({
|
|
477
|
-
component: this,
|
|
478
|
-
requests,
|
|
479
|
-
isUserInteraction: true,
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* Host binding for CSS class.
|
|
484
|
-
* @ignore
|
|
485
|
-
*/
|
|
486
|
-
get __hostClass() {
|
|
487
|
-
return `ax-drop-zone`;
|
|
488
|
-
}
|
|
489
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderZoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
490
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXUploaderZoneDirective, isStandalone: true, selector: "[axUploaderZone]", inputs: { multiple: "multiple", accept: "accept" }, outputs: { onChanged: "onChanged", onFileUploadComplete: "onFileUploadComplete", onFilesUploadComplete: "onFilesUploadComplete" }, host: { properties: { "class": "this.__hostClass" } }, providers: [AXUnsubscriber], ngImport: i0 }); }
|
|
491
|
-
}
|
|
492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderZoneDirective, decorators: [{
|
|
493
|
-
type: Directive,
|
|
494
|
-
args: [{
|
|
495
|
-
selector: '[axUploaderZone]',
|
|
496
|
-
providers: [AXUnsubscriber],
|
|
497
|
-
}]
|
|
498
|
-
}], ctorParameters: () => [], propDecorators: { multiple: [{
|
|
499
|
-
type: Input
|
|
500
|
-
}], accept: [{
|
|
501
|
-
type: Input
|
|
502
|
-
}], onChanged: [{
|
|
503
|
-
type: Output
|
|
504
|
-
}], onFileUploadComplete: [{
|
|
505
|
-
type: Output
|
|
506
|
-
}], onFilesUploadComplete: [{
|
|
507
|
-
type: Output
|
|
508
|
-
}], __hostClass: [{
|
|
509
|
-
type: HostBinding,
|
|
510
|
-
args: ['class']
|
|
511
|
-
}] } });
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* A directive that provides browse functionality for file uploads.
|
|
515
|
-
* When applied to an element, clicking it will trigger the file browser dialog.
|
|
516
|
-
* @category Directives
|
|
517
|
-
*/
|
|
518
|
-
class AXUploaderBrowseDirective {
|
|
519
|
-
constructor() {
|
|
520
|
-
/**
|
|
521
|
-
* The uploader zone directive instance.
|
|
522
|
-
* @ignore
|
|
523
|
-
*/
|
|
524
|
-
this.uploaderZone = inject(AXUploaderZoneDirective);
|
|
525
|
-
/**
|
|
526
|
-
* The element reference for the directive host.
|
|
527
|
-
* @ignore
|
|
528
|
-
*/
|
|
529
|
-
this.elemenrRef = inject((ElementRef));
|
|
530
|
-
}
|
|
531
|
-
/**
|
|
532
|
-
* Initializes the directive by adding click event listener and data attribute.
|
|
533
|
-
*/
|
|
534
|
-
ngOnInit() {
|
|
535
|
-
this.elemenrRef.nativeElement.addEventListener('click', this.handleClick.bind(this));
|
|
536
|
-
this.elemenrRef.nativeElement.dataset['axUploaderBrowseHandle'] = 'true';
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Cleans up the directive by removing event listeners.
|
|
540
|
-
*/
|
|
541
|
-
ngOnDestroy() {
|
|
542
|
-
this.elemenrRef.nativeElement.removeEventListener('click', this.handleClick.bind(this));
|
|
543
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* Handles the click event to trigger file browser.
|
|
546
|
-
* @private
|
|
547
|
-
*/
|
|
548
|
-
async handleClick() {
|
|
549
|
-
await this.uploaderZone.browser();
|
|
550
|
-
}
|
|
551
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderBrowseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
552
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXUploaderBrowseDirective, isStandalone: true, selector: "[axUploaderBrowseHandle]", ngImport: i0 }); }
|
|
553
|
-
}
|
|
554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderBrowseDirective, decorators: [{
|
|
555
|
-
type: Directive,
|
|
556
|
-
args: [{ selector: '[axUploaderBrowseHandle]' }]
|
|
557
|
-
}] });
|
|
2
|
+
import { AXTranslatorPipe } from '@acorex/core/translation';
|
|
3
|
+
import { AsyncPipe, NgClass } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, ViewEncapsulation, Component, input, NgModule } from '@angular/core';
|
|
6
|
+
import { AXUploaderService } from '@acorex/cdk/uploader';
|
|
7
|
+
import { AXProgressBarComponent } from '@acorex/components/progress-bar';
|
|
8
|
+
import { AXFormatPipe } from '@acorex/core/format';
|
|
9
|
+
import { AXDecoratorIconComponent } from '@acorex/components/decorators';
|
|
558
10
|
|
|
559
11
|
/**
|
|
560
12
|
* A component that displays a list of uploaded files.
|
|
@@ -568,19 +20,14 @@ class AXUploaderListComponent {
|
|
|
568
20
|
*/
|
|
569
21
|
this.uploadService = inject(AXUploaderService);
|
|
570
22
|
}
|
|
571
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
572
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: AXUploaderListComponent, isStandalone: true, selector: "ax-uploader-list", providers: [{ provide: AXComponent, useExisting: AXUploaderListComponent }], ngImport: i0, template: "<!-- @if ((uploadService.totalEstimateTime | async) > 0) { -->\n<div class=\"ax-uploader-progress-status\" [class.ax-hide]=\"(uploadService.totalEstimateTime | async) <= 0\">\n @if (uploadService.isAnyDetermined()) {\n <span>{{ '@acorex:common.status.processing' | translate | async }}</span>\n } @else {\n <div>{{ uploadService.totalEstimateTime | async | format: 'timeleft' | async }}</div>\n }\n <button (click)=\"uploadService.cancelAll()\">{{ '@acorex:common.actions.cancel' | translate | async }}</button>\n</div>\n<!-- } -->\n\n<ul class=\"ax-uploader-list-items\">\n @for (item of uploadService.files | async; track item.name) {\n <li>\n <div class=\"ax-file\">\n <span>{{ item.ext }}</span>\n </div>\n <div class=\"ax-item-container\">\n <div class=\"ax-item-name\" [title]=\"item.name\">{{ item.name }}</div>\n <div class=\"ax-status\">\n @switch (item.status()) {\n @case ('inprogress') {\n <span>{{ item.size | format: 'filesize' | async }}</span> /\n {{\n item.isDetermined()\n ? (item.estimateTime() | format: 'timeleft' | async)\n : ('@acorex:common.status.processing' | translate | async)\n }}\n }\n @case ('failed') {\n <div class=\"ax-state-failed\">\n <span>{{ item.message() }}</span>\n </div>\n }\n @case ('completed') {\n <div class=\"ax-state-completed\">\n <span>{{ '@acorex:common.status.completed' | translate | async }}</span>\n </div>\n }\n }\n </div>\n </div>\n <div class=\"ax-status\">\n @switch (item.status()) {\n @case ('completed') {\n <i class=\"ax-icon ax-icon-solid ax-icon-check-circle ax-state-completed\"></i>\n }\n @case ('canceled') {\n <div>\n <span class=\"ax-state-canceled\">{{ '@acorex:common.actions.canceled' | translate | async }}</span>\n <!-- <i class=\"ax-icon ax-icon-solid ax-icon-redo\" (click)=\"item.redo()\" title=\"{{ 'retry' | translate | async }}\"></i> -->\n </div>\n }\n @case ('failed') {\n <div class=\"ax-state-failed\">\n <span>{{ '@acorex:common.status.failed' | translate | async }}</span>\n <i\n class=\"ax-icon ax-icon-solid ax-icon-redo\"\n (click)=\"item.redo()\"\n title=\"{{ '@acorex:common.actions.retry' | translate | async }}\"\n ></i>\n </div>\n }\n @default {\n <!-- <ax-circular-progress\n [mode]=\"item.isDetermined() ? 'determinate' : 'indeterminate'\"\n [size]=\"22\"\n [stroke]=\"6\"\n [progress]=\"item.isDetermined() ? item.progress() : 60\"\n class=\"ax-show\"\n >\n </ax-circular-progress> -->\n <i\n class=\"ax-icon ax-icon-solid ax-icon-close\"\n (click)=\"item.cancel()\"\n title=\"{{ '@acorex:common.actions.cancel' | translate | async }}\"\n ></i>\n }\n }\n </div>\n </li>\n @let completed = item.status() === 'completed';\n @if (item.status() === 'inprogress' || completed) {\n <div class=\"ax-status-loading\" [class.ax-status-loading-hide]=\"completed\">\n <ax-progress-bar\n [height]=\"4\"\n [mode]=\"completed ? 'determinate' : 'indeterminate'\"\n [progress]=\"completed ? 100 : 60\"\n [color]=\"completed ? 'success' : 'primary'\"\n ></ax-progress-bar>\n </div>\n }\n }\n</ul>\n", styles: ["ax-uploader-list .ax-uploader-progress-status{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;border-top-width:1px;border-color:rgba(var(--ax-sys-color-primary-lightest-surface));background-color:rgba(var(--ax-sys-color-primary-lightest-surface));padding:.5rem .75rem;font-size:.875rem;line-height:1.25rem;color:rgba(var(--ax-sys-color-on-primary-lightest-surface));transition:.3s ease-out}ax-uploader-list .ax-uploader-progress-status.ax-hide{opacity:0;overflow:hidden;height:0;padding-top:0;padding-bottom:0;transition:.3s ease-out}ax-uploader-list .ax-uploader-list-items{max-height:75vh;width:100%;overflow-y:auto;overflow-x:hidden;gap:.5rem;display:flex;flex-direction:column}ax-uploader-list .ax-uploader-list-items li{display:flex;padding:.5rem 1rem;align-items:center;font-size:.875rem;line-height:1.25rem;gap:1rem;width:100%}ax-uploader-list .ax-uploader-list-items li .ax-item-container{display:flex;flex-direction:column;flex:1;-webkit-user-select:none;user-select:none}ax-uploader-list .ax-uploader-list-items li .ax-item-container .ax-item-name{font-size:.875rem;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:12rem}ax-uploader-list .ax-uploader-list-items li .ax-status{position:relative;color:rgba(var(--ax-sys-color-on-surface),.5)}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-icon{font-size:1.375rem}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-icon-close{cursor:pointer}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-canceled span{color:rgba(var(--ax-sys-color-secondary-surface))}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-failed{display:flex;align-items:center;gap:.5rem}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-failed span{color:rgba(var(--ax-sys-color-danger-surface))}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-failed i{cursor:pointer}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-completed{color:rgba(var(--ax-sys-color-success-surface))}ax-uploader-list .ax-uploader-list-items li:hover .ax-hide{display:flex!important}ax-uploader-list .ax-uploader-list-items li:hover .ax-show{display:none!important}ax-uploader-list .ax-uploader-list-items li .ax-show{display:flex!important}ax-uploader-list .ax-uploader-list-items li .ax-hide{display:none!important}ax-uploader-list .ax-uploader-list-items .ax-status-loading.ax-status-loading-hide{transition:all 1s linear;opacity:0;overflow:hidden}.ax-file{position:relative;display:flex;align-items:center;justify-content:center;width:1.5rem;aspect-ratio:.7;border-radius:.25rem;color:rgba(var(--ax-sys-color-light-surface));background-color:rgba(var(--ax-sys-color-success-surface))!important}.ax-file>*{position:absolute;bottom:.3rem;font-weight:700;font-size:.65rem;line-height:.65rem}.ax-file:before{content:\"\";position:absolute;top:0;right:0;border-width:0 12px 12px 0;border-color:rgba(var(--ax-sys-color-surface)) rgba(var(--ax-sys-color-surface)) rgba(var(--ax-sys-color-on-surface),.3) rgba(var(--ax-sys-color-on-surface),.3)}\n"], dependencies: [{ kind: "component", type: AXProgressBarComponent, selector: "ax-progress-bar", inputs: ["color", "mode", "progress", "height"], outputs: ["ValueChange", "sizeChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }, { kind: "pipe", type: AXFormatPipe, name: "format" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
573
25
|
}
|
|
574
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderListComponent, decorators: [{
|
|
575
27
|
type: Component,
|
|
576
28
|
args: [{ selector: 'ax-uploader-list', encapsulation: ViewEncapsulation.None, imports: [AXProgressBarComponent, AsyncPipe, AXTranslatorPipe, AXFormatPipe], providers: [{ provide: AXComponent, useExisting: AXUploaderListComponent }], template: "<!-- @if ((uploadService.totalEstimateTime | async) > 0) { -->\n<div class=\"ax-uploader-progress-status\" [class.ax-hide]=\"(uploadService.totalEstimateTime | async) <= 0\">\n @if (uploadService.isAnyDetermined()) {\n <span>{{ '@acorex:common.status.processing' | translate | async }}</span>\n } @else {\n <div>{{ uploadService.totalEstimateTime | async | format: 'timeleft' | async }}</div>\n }\n <button (click)=\"uploadService.cancelAll()\">{{ '@acorex:common.actions.cancel' | translate | async }}</button>\n</div>\n<!-- } -->\n\n<ul class=\"ax-uploader-list-items\">\n @for (item of uploadService.files | async; track item.name) {\n <li>\n <div class=\"ax-file\">\n <span>{{ item.ext }}</span>\n </div>\n <div class=\"ax-item-container\">\n <div class=\"ax-item-name\" [title]=\"item.name\">{{ item.name }}</div>\n <div class=\"ax-status\">\n @switch (item.status()) {\n @case ('inprogress') {\n <span>{{ item.size | format: 'filesize' | async }}</span> /\n {{\n item.isDetermined()\n ? (item.estimateTime() | format: 'timeleft' | async)\n : ('@acorex:common.status.processing' | translate | async)\n }}\n }\n @case ('failed') {\n <div class=\"ax-state-failed\">\n <span>{{ item.message() }}</span>\n </div>\n }\n @case ('completed') {\n <div class=\"ax-state-completed\">\n <span>{{ '@acorex:common.status.completed' | translate | async }}</span>\n </div>\n }\n }\n </div>\n </div>\n <div class=\"ax-status\">\n @switch (item.status()) {\n @case ('completed') {\n <i class=\"ax-icon ax-icon-solid ax-icon-check-circle ax-state-completed\"></i>\n }\n @case ('canceled') {\n <div>\n <span class=\"ax-state-canceled\">{{ '@acorex:common.actions.canceled' | translate | async }}</span>\n <!-- <i class=\"ax-icon ax-icon-solid ax-icon-redo\" (click)=\"item.redo()\" title=\"{{ 'retry' | translate | async }}\"></i> -->\n </div>\n }\n @case ('failed') {\n <div class=\"ax-state-failed\">\n <span>{{ '@acorex:common.status.failed' | translate | async }}</span>\n <i\n class=\"ax-icon ax-icon-solid ax-icon-redo\"\n (click)=\"item.redo()\"\n title=\"{{ '@acorex:common.actions.retry' | translate | async }}\"\n ></i>\n </div>\n }\n @default {\n <!-- <ax-circular-progress\n [mode]=\"item.isDetermined() ? 'determinate' : 'indeterminate'\"\n [size]=\"22\"\n [stroke]=\"6\"\n [progress]=\"item.isDetermined() ? item.progress() : 60\"\n class=\"ax-show\"\n >\n </ax-circular-progress> -->\n <i\n class=\"ax-icon ax-icon-solid ax-icon-close\"\n (click)=\"item.cancel()\"\n title=\"{{ '@acorex:common.actions.cancel' | translate | async }}\"\n ></i>\n }\n }\n </div>\n </li>\n @let completed = item.status() === 'completed';\n @if (item.status() === 'inprogress' || completed) {\n <div class=\"ax-status-loading\" [class.ax-status-loading-hide]=\"completed\">\n <ax-progress-bar\n [height]=\"4\"\n [mode]=\"completed ? 'determinate' : 'indeterminate'\"\n [progress]=\"completed ? 100 : 60\"\n [color]=\"completed ? 'success' : 'primary'\"\n ></ax-progress-bar>\n </div>\n }\n }\n</ul>\n", styles: ["ax-uploader-list .ax-uploader-progress-status{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;border-top-width:1px;border-color:rgba(var(--ax-sys-color-primary-lightest-surface));background-color:rgba(var(--ax-sys-color-primary-lightest-surface));padding:.5rem .75rem;font-size:.875rem;line-height:1.25rem;color:rgba(var(--ax-sys-color-on-primary-lightest-surface));transition:.3s ease-out}ax-uploader-list .ax-uploader-progress-status.ax-hide{opacity:0;overflow:hidden;height:0;padding-top:0;padding-bottom:0;transition:.3s ease-out}ax-uploader-list .ax-uploader-list-items{max-height:75vh;width:100%;overflow-y:auto;overflow-x:hidden;gap:.5rem;display:flex;flex-direction:column}ax-uploader-list .ax-uploader-list-items li{display:flex;padding:.5rem 1rem;align-items:center;font-size:.875rem;line-height:1.25rem;gap:1rem;width:100%}ax-uploader-list .ax-uploader-list-items li .ax-item-container{display:flex;flex-direction:column;flex:1;-webkit-user-select:none;user-select:none}ax-uploader-list .ax-uploader-list-items li .ax-item-container .ax-item-name{font-size:.875rem;line-height:1.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:12rem}ax-uploader-list .ax-uploader-list-items li .ax-status{position:relative;color:rgba(var(--ax-sys-color-on-surface),.5)}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-icon{font-size:1.375rem}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-icon-close{cursor:pointer}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-canceled span{color:rgba(var(--ax-sys-color-secondary-surface))}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-failed{display:flex;align-items:center;gap:.5rem}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-failed span{color:rgba(var(--ax-sys-color-danger-surface))}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-failed i{cursor:pointer}ax-uploader-list .ax-uploader-list-items li .ax-status .ax-state-completed{color:rgba(var(--ax-sys-color-success-surface))}ax-uploader-list .ax-uploader-list-items li:hover .ax-hide{display:flex!important}ax-uploader-list .ax-uploader-list-items li:hover .ax-show{display:none!important}ax-uploader-list .ax-uploader-list-items li .ax-show{display:flex!important}ax-uploader-list .ax-uploader-list-items li .ax-hide{display:none!important}ax-uploader-list .ax-uploader-list-items .ax-status-loading.ax-status-loading-hide{transition:all 1s linear;opacity:0;overflow:hidden}.ax-file{position:relative;display:flex;align-items:center;justify-content:center;width:1.5rem;aspect-ratio:.7;border-radius:.25rem;color:rgba(var(--ax-sys-color-light-surface));background-color:rgba(var(--ax-sys-color-success-surface))!important}.ax-file>*{position:absolute;bottom:.3rem;font-weight:700;font-size:.65rem;line-height:.65rem}.ax-file:before{content:\"\";position:absolute;top:0;right:0;border-width:0 12px 12px 0;border-color:rgba(var(--ax-sys-color-surface)) rgba(var(--ax-sys-color-surface)) rgba(var(--ax-sys-color-on-surface),.3) rgba(var(--ax-sys-color-on-surface),.3)}\n"] }]
|
|
577
29
|
}] });
|
|
578
30
|
|
|
579
|
-
var uploaderList_component = /*#__PURE__*/Object.freeze({
|
|
580
|
-
__proto__: null,
|
|
581
|
-
AXUploaderListComponent: AXUploaderListComponent
|
|
582
|
-
});
|
|
583
|
-
|
|
584
31
|
/**
|
|
585
32
|
* A container for managing the uploader dialog with collapse and expand animations.
|
|
586
33
|
* @category Components
|
|
@@ -610,26 +57,12 @@ class AXUploaderDialogContainerComponent {
|
|
|
610
57
|
toggle() {
|
|
611
58
|
this.isCollapsed = !this.isCollapsed;
|
|
612
59
|
}
|
|
613
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
614
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
615
|
-
trigger('collapse', [
|
|
616
|
-
state('false', style({ height: AUTO_STYLE, visibility: AUTO_STYLE })),
|
|
617
|
-
state('true', style({ height: '0', visibility: 'hidden' })),
|
|
618
|
-
transition('false => true', animate(150 + 'ms ease-in')),
|
|
619
|
-
transition('true => false', animate(150 + 'ms ease-out')),
|
|
620
|
-
]),
|
|
621
|
-
], encapsulation: i0.ViewEncapsulation.None }); }
|
|
60
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderDialogContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
61
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: AXUploaderDialogContainerComponent, isStandalone: true, selector: "ax-uploader-dialog-container", providers: [{ provide: AXComponent, useExisting: AXUploaderDialogContainerComponent }], ngImport: i0, template: "<div class=\"ax-uploader-list-header\">\n <div>{{ '@acorex:common.actions.uploading' | translate | async }}</div>\n <div>\n <i\n class=\"ax-icon\"\n [ngClass]=\"{ 'ax-icon-chevron-down': !isCollapsed, 'ax-icon-chevron-up': isCollapsed }\"\n (click)=\"toggle()\"\n ></i>\n <i class=\"ax-icon ax-icon-close\" (click)=\"close()\"></i>\n </div>\n</div>\n@if (isCollapsed) {\n <div animate.enter=\"ax-fade-slide-in\" animate.leave=\"ax-fade-slide-out\">\n <ax-uploader-list></ax-uploader-list>\n </div>\n}\n", styles: ["ax-uploader-dialog-container{display:block;background-color:rgba(var(--ax-sys-color-surface));-webkit-border-top-left-radius:.75rem;-webkit-border-top-right-radius:.75rem;-moz-border-radius-topleft:.75rem;-moz-border-radius-topright:.75rem;border-top-left-radius:.75rem;border-top-right-radius:.75rem;overflow:hidden;box-shadow:-1px -1px 10px #00000029;border:1px solid;border-color:rgba(var(--ax-sys-color-border-lightest-surface));outline-color:rgba(var(--ax-sys-color-primary-surface))}ax-uploader-dialog-container .ax-uploader-list-header{display:flex;justify-content:space-between;background-color:rgba(var(--ax-sys-color-surface));padding:.75rem 1rem;font-weight:500;color:rgba(var(--ax-sys-color-surface-fore))}ax-uploader-dialog-container .ax-uploader-list-header .ax-icon{margin-inline-start:.5rem;cursor:pointer}ax-uploader-dialog-container .ax-uploader-list-header .ax-icon:hover{opacity:.75}@keyframes fadeSlideIn{0%{opacity:0;max-height:0}to{opacity:1;max-height:350px}}@keyframes fadeSlideOut{0%{opacity:1;max-height:350px}to{opacity:0;max-height:0}}ax-uploader-dialog-container .ax-fade-slide-in{animation:fadeSlideIn var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}ax-uploader-dialog-container .ax-fade-slide-out{animation:fadeSlideOut var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: AXUploaderListComponent, selector: "ax-uploader-list" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
622
62
|
}
|
|
623
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderDialogContainerComponent, decorators: [{
|
|
624
64
|
type: Component,
|
|
625
|
-
args: [{ selector: 'ax-uploader-dialog-container', encapsulation: ViewEncapsulation.None,
|
|
626
|
-
trigger('collapse', [
|
|
627
|
-
state('false', style({ height: AUTO_STYLE, visibility: AUTO_STYLE })),
|
|
628
|
-
state('true', style({ height: '0', visibility: 'hidden' })),
|
|
629
|
-
transition('false => true', animate(150 + 'ms ease-in')),
|
|
630
|
-
transition('true => false', animate(150 + 'ms ease-out')),
|
|
631
|
-
]),
|
|
632
|
-
], imports: [NgClass, AXUploaderListComponent, AsyncPipe, AXTranslatorPipe], providers: [{ provide: AXComponent, useExisting: AXUploaderDialogContainerComponent }], template: "<div class=\"ax-uploader-list-header\">\n <div>{{ '@acorex:common.actions.uploading' | translate | async }}</div>\n <div>\n <i\n class=\"ax-icon\"\n [ngClass]=\"{ 'ax-icon-chevron-down': !isCollapsed, 'ax-icon-chevron-up': isCollapsed }\"\n (click)=\"toggle()\"\n ></i>\n <i class=\"ax-icon ax-icon-close\" (click)=\"close()\"></i>\n </div>\n</div>\n<div [@collapse]=\"isCollapsed\">\n <ax-uploader-list></ax-uploader-list>\n</div>\n", styles: ["ax-uploader-dialog-container{display:block;background-color:rgba(var(--ax-sys-color-surface));-webkit-border-top-left-radius:.75rem;-webkit-border-top-right-radius:.75rem;-moz-border-radius-topleft:.75rem;-moz-border-radius-topright:.75rem;border-top-left-radius:.75rem;border-top-right-radius:.75rem;overflow:hidden;box-shadow:-1px -1px 10px #00000029;border:1px solid;border-color:rgba(var(--ax-sys-color-border-lightest-surface));outline-color:rgba(var(--ax-sys-color-primary-surface))}ax-uploader-dialog-container .ax-uploader-list-header{display:flex;justify-content:space-between;background-color:rgba(var(--ax-sys-color-surface));padding:.75rem 1rem;font-weight:500;color:rgba(var(--ax-sys-color-surface-fore))}ax-uploader-dialog-container .ax-uploader-list-header .ax-icon{margin-inline-start:.5rem;cursor:pointer}ax-uploader-dialog-container .ax-uploader-list-header .ax-icon:hover{opacity:.75}\n"] }]
|
|
65
|
+
args: [{ selector: 'ax-uploader-dialog-container', encapsulation: ViewEncapsulation.None, imports: [NgClass, AXUploaderListComponent, AsyncPipe, AXTranslatorPipe], providers: [{ provide: AXComponent, useExisting: AXUploaderDialogContainerComponent }], template: "<div class=\"ax-uploader-list-header\">\n <div>{{ '@acorex:common.actions.uploading' | translate | async }}</div>\n <div>\n <i\n class=\"ax-icon\"\n [ngClass]=\"{ 'ax-icon-chevron-down': !isCollapsed, 'ax-icon-chevron-up': isCollapsed }\"\n (click)=\"toggle()\"\n ></i>\n <i class=\"ax-icon ax-icon-close\" (click)=\"close()\"></i>\n </div>\n</div>\n@if (isCollapsed) {\n <div animate.enter=\"ax-fade-slide-in\" animate.leave=\"ax-fade-slide-out\">\n <ax-uploader-list></ax-uploader-list>\n </div>\n}\n", styles: ["ax-uploader-dialog-container{display:block;background-color:rgba(var(--ax-sys-color-surface));-webkit-border-top-left-radius:.75rem;-webkit-border-top-right-radius:.75rem;-moz-border-radius-topleft:.75rem;-moz-border-radius-topright:.75rem;border-top-left-radius:.75rem;border-top-right-radius:.75rem;overflow:hidden;box-shadow:-1px -1px 10px #00000029;border:1px solid;border-color:rgba(var(--ax-sys-color-border-lightest-surface));outline-color:rgba(var(--ax-sys-color-primary-surface))}ax-uploader-dialog-container .ax-uploader-list-header{display:flex;justify-content:space-between;background-color:rgba(var(--ax-sys-color-surface));padding:.75rem 1rem;font-weight:500;color:rgba(var(--ax-sys-color-surface-fore))}ax-uploader-dialog-container .ax-uploader-list-header .ax-icon{margin-inline-start:.5rem;cursor:pointer}ax-uploader-dialog-container .ax-uploader-list-header .ax-icon:hover{opacity:.75}@keyframes fadeSlideIn{0%{opacity:0;max-height:0}to{opacity:1;max-height:350px}}@keyframes fadeSlideOut{0%{opacity:1;max-height:350px}to{opacity:0;max-height:0}}ax-uploader-dialog-container .ax-fade-slide-in{animation:fadeSlideIn var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}ax-uploader-dialog-container .ax-fade-slide-out{animation:fadeSlideOut var(--ax-sys-transition-duration) var(--ax-sys-transition-timing-function)}\n"] }]
|
|
633
66
|
}] });
|
|
634
67
|
|
|
635
68
|
/**
|
|
@@ -652,70 +85,24 @@ class AXUploaderDropZoneComponent extends MXBaseComponent {
|
|
|
652
85
|
preventRefresh() {
|
|
653
86
|
return false;
|
|
654
87
|
}
|
|
655
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
656
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.
|
|
88
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderDropZoneComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
89
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.9", type: AXUploaderDropZoneComponent, isStandalone: true, selector: "ax-uploader-drop-zone", inputs: { description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: AXComponent, useExisting: AXUploaderDropZoneComponent }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-uploader-drop-zone-container\">\n <ax-icon class=\"ax-icon ax-icon-upload\"></ax-icon>\n <div class=\"ax-uploader-drop-zone-description\">\n <span>\n {{ '@acorex:uploader.zone.drag' | translate | async }}\n <a href=\"\" (click)=\"preventRefresh()\">\n {{ '@acorex:uploader.zone.choose' | translate | async }}\n </a>\n {{ '@acorex:uploader.zone.to-upload' | translate | async }}\n </span>\n <!-- <p>SVG, PNG, JPG or GIF (MAX. 800x400px)</p> -->\n @if (description()) {\n <p>{{ description() }}</p>\n }\n </div>\n</div>\n", styles: ["ax-uploader-drop-zone{width:100%;height:100%;display:block;cursor:pointer}ax-uploader-drop-zone .ax-uploader-drop-zone-container{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:.5rem;margin:1rem;padding:1rem;gap:1rem;border:2px dashed;border-color:rgba(var(--ax-sys-color-border-lightest-surface));pointer-events:none}ax-uploader-drop-zone .ax-uploader-drop-zone-container:hover{border-color:rgba(var(--ax-sys-color-primary-surface));background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}ax-uploader-drop-zone .ax-uploader-drop-zone-container ax-icon{font-size:1.875rem;line-height:2.25rem;color:#a3a3a3;width:1.75rem;height:2rem}ax-uploader-drop-zone .ax-uploader-drop-zone-container .ax-uploader-drop-zone-description{display:flex;flex-direction:column;gap:.5rem}ax-uploader-drop-zone .ax-uploader-drop-zone-container .ax-uploader-drop-zone-description a{color:rgba(var(--ax-sys-color-primary-surface))}ax-uploader-drop-zone .ax-uploader-drop-zone-container .ax-uploader-drop-zone-description p{font-size:.875rem;line-height:1.25rem;color:#a3a3a3}\n"], dependencies: [{ kind: "component", type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
657
90
|
}
|
|
658
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderDropZoneComponent, decorators: [{
|
|
659
92
|
type: Component,
|
|
660
93
|
args: [{ selector: 'ax-uploader-drop-zone', encapsulation: ViewEncapsulation.None, imports: [AXDecoratorIconComponent, AsyncPipe, AXTranslatorPipe], providers: [{ provide: AXComponent, useExisting: AXUploaderDropZoneComponent }], template: "<div class=\"ax-uploader-drop-zone-container\">\n <ax-icon class=\"ax-icon ax-icon-upload\"></ax-icon>\n <div class=\"ax-uploader-drop-zone-description\">\n <span>\n {{ '@acorex:uploader.zone.drag' | translate | async }}\n <a href=\"\" (click)=\"preventRefresh()\">\n {{ '@acorex:uploader.zone.choose' | translate | async }}\n </a>\n {{ '@acorex:uploader.zone.to-upload' | translate | async }}\n </span>\n <!-- <p>SVG, PNG, JPG or GIF (MAX. 800x400px)</p> -->\n @if (description()) {\n <p>{{ description() }}</p>\n }\n </div>\n</div>\n", styles: ["ax-uploader-drop-zone{width:100%;height:100%;display:block;cursor:pointer}ax-uploader-drop-zone .ax-uploader-drop-zone-container{display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:.5rem;margin:1rem;padding:1rem;gap:1rem;border:2px dashed;border-color:rgba(var(--ax-sys-color-border-lightest-surface));pointer-events:none}ax-uploader-drop-zone .ax-uploader-drop-zone-container:hover{border-color:rgba(var(--ax-sys-color-primary-surface));background-color:rgba(var(--ax-sys-color-primary-lightest-surface))}ax-uploader-drop-zone .ax-uploader-drop-zone-container ax-icon{font-size:1.875rem;line-height:2.25rem;color:#a3a3a3;width:1.75rem;height:2rem}ax-uploader-drop-zone .ax-uploader-drop-zone-container .ax-uploader-drop-zone-description{display:flex;flex-direction:column;gap:.5rem}ax-uploader-drop-zone .ax-uploader-drop-zone-container .ax-uploader-drop-zone-description a{color:rgba(var(--ax-sys-color-primary-surface))}ax-uploader-drop-zone .ax-uploader-drop-zone-container .ax-uploader-drop-zone-description p{font-size:.875rem;line-height:1.25rem;color:#a3a3a3}\n"] }]
|
|
661
|
-
}] });
|
|
94
|
+
}], propDecorators: { description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }] } });
|
|
662
95
|
|
|
663
|
-
const COMPONENTS = [
|
|
664
|
-
AXUploaderDropZoneComponent,
|
|
665
|
-
AXUploaderListComponent,
|
|
666
|
-
AXUploaderZoneDirective,
|
|
667
|
-
AXUploaderBrowseDirective,
|
|
668
|
-
AXUploaderDialogContainerComponent,
|
|
669
|
-
];
|
|
96
|
+
const COMPONENTS = [AXUploaderListComponent, AXUploaderDialogContainerComponent];
|
|
670
97
|
class AXUploaderModule {
|
|
671
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
672
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.
|
|
673
|
-
|
|
674
|
-
AXButtonModule,
|
|
675
|
-
AXTranslationModule,
|
|
676
|
-
AXProgressBarModule,
|
|
677
|
-
AXFormatModule,
|
|
678
|
-
AXFileModule,
|
|
679
|
-
AXDateTimeModule,
|
|
680
|
-
AXCircularProgressModule,
|
|
681
|
-
AXPopupModule, AXUploaderDropZoneComponent,
|
|
682
|
-
AXUploaderListComponent,
|
|
683
|
-
AXUploaderZoneDirective,
|
|
684
|
-
AXUploaderBrowseDirective,
|
|
685
|
-
AXUploaderDialogContainerComponent], exports: [AXUploaderDropZoneComponent,
|
|
686
|
-
AXUploaderListComponent,
|
|
687
|
-
AXUploaderZoneDirective,
|
|
688
|
-
AXUploaderBrowseDirective,
|
|
689
|
-
AXUploaderDialogContainerComponent] }); }
|
|
690
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXUploaderModule, imports: [CommonModule,
|
|
691
|
-
AXDecoratorModule,
|
|
692
|
-
AXButtonModule,
|
|
693
|
-
AXTranslationModule,
|
|
694
|
-
AXProgressBarModule,
|
|
695
|
-
AXFormatModule,
|
|
696
|
-
AXFileModule,
|
|
697
|
-
AXDateTimeModule,
|
|
698
|
-
AXCircularProgressModule,
|
|
699
|
-
AXPopupModule, AXUploaderDropZoneComponent,
|
|
700
|
-
AXUploaderListComponent,
|
|
701
|
-
AXUploaderDialogContainerComponent] }); }
|
|
98
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
99
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderModule, imports: [AXUploaderListComponent, AXUploaderDialogContainerComponent], exports: [AXUploaderListComponent, AXUploaderDialogContainerComponent] }); }
|
|
100
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderModule, imports: [COMPONENTS] }); }
|
|
702
101
|
}
|
|
703
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AXUploaderModule, decorators: [{
|
|
704
103
|
type: NgModule,
|
|
705
104
|
args: [{
|
|
706
|
-
imports: [
|
|
707
|
-
CommonModule,
|
|
708
|
-
AXDecoratorModule,
|
|
709
|
-
AXButtonModule,
|
|
710
|
-
AXTranslationModule,
|
|
711
|
-
AXProgressBarModule,
|
|
712
|
-
AXFormatModule,
|
|
713
|
-
AXFileModule,
|
|
714
|
-
AXDateTimeModule,
|
|
715
|
-
AXCircularProgressModule,
|
|
716
|
-
AXPopupModule,
|
|
717
|
-
...COMPONENTS,
|
|
718
|
-
],
|
|
105
|
+
imports: [...COMPONENTS],
|
|
719
106
|
exports: [...COMPONENTS],
|
|
720
107
|
providers: [],
|
|
721
108
|
}]
|
|
@@ -725,5 +112,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImpor
|
|
|
725
112
|
* Generated bundle index. Do not edit.
|
|
726
113
|
*/
|
|
727
114
|
|
|
728
|
-
export {
|
|
115
|
+
export { AXUploaderDialogContainerComponent, AXUploaderDropZoneComponent, AXUploaderListComponent, AXUploaderModule };
|
|
729
116
|
//# sourceMappingURL=acorex-components-uploader.mjs.map
|