@exhaustive-ui/core 3.0.0-alpha.0 → 3.0.0-alpha.1
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/fesm2022/exhaustive-ui-core-accordion.mjs +51 -78
- package/fesm2022/exhaustive-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs +72 -73
- package/fesm2022/exhaustive-ui-core-animateonscroll.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-api.mjs +6 -13
- package/fesm2022/exhaustive-ui-core-api.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs +485 -683
- package/fesm2022/exhaustive-ui-core-autocomplete.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-autofocus.mjs +21 -31
- package/fesm2022/exhaustive-ui-core-autofocus.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-avatar.mjs +47 -63
- package/fesm2022/exhaustive-ui-core-avatar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-badge.mjs +88 -115
- package/fesm2022/exhaustive-ui-core-badge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-blockui.mjs +58 -91
- package/fesm2022/exhaustive-ui-core-blockui.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs +155 -169
- package/fesm2022/exhaustive-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-button.mjs +280 -385
- package/fesm2022/exhaustive-ui-core-button.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-carousel.mjs +379 -451
- package/fesm2022/exhaustive-ui-core-carousel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs +388 -507
- package/fesm2022/exhaustive-ui-core-cascadeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chart.mjs +75 -91
- package/fesm2022/exhaustive-ui-core-chart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-checkbox.mjs +109 -160
- package/fesm2022/exhaustive-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-chip.mjs +98 -137
- package/fesm2022/exhaustive-ui-core-chip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs +123 -190
- package/fesm2022/exhaustive-ui-core-colorpicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs +157 -332
- package/fesm2022/exhaustive-ui-core-confirmdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs +187 -210
- package/fesm2022/exhaustive-ui-core-confirmpopup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs +315 -361
- package/fesm2022/exhaustive-ui-core-contextmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dataview.mjs +225 -272
- package/fesm2022/exhaustive-ui-core-dataview.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-datepicker.mjs +1012 -1157
- package/fesm2022/exhaustive-ui-core-datepicker.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dialog.mjs +370 -507
- package/fesm2022/exhaustive-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dock.mjs +87 -115
- package/fesm2022/exhaustive-ui-core-dock.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs +98 -105
- package/fesm2022/exhaustive-ui-core-dragdrop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-drawer.mjs +174 -235
- package/fesm2022/exhaustive-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs +42 -280
- package/fesm2022/exhaustive-ui-core-dynamicdialog.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-editor.mjs +109 -121
- package/fesm2022/exhaustive-ui-core-editor.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fieldset.mjs +90 -132
- package/fesm2022/exhaustive-ui-core-fieldset.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-fileupload.mjs +486 -541
- package/fesm2022/exhaustive-ui-core-fileupload.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs +13 -16
- package/fesm2022/exhaustive-ui-core-floatlabel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-focustrap.mjs +44 -40
- package/fesm2022/exhaustive-ui-core-focustrap.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-galleria.mjs +642 -853
- package/fesm2022/exhaustive-ui-core-galleria.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-iconfield.mjs +15 -27
- package/fesm2022/exhaustive-ui-core-iconfield.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs +8 -13
- package/fesm2022/exhaustive-ui-core-icons-baseicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-image.mjs +209 -251
- package/fesm2022/exhaustive-ui-core-image.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs +39 -48
- package/fesm2022/exhaustive-ui-core-imagecompare.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inplace.mjs +64 -98
- package/fesm2022/exhaustive-ui-core-inplace.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs +10 -20
- package/fesm2022/exhaustive-ui-core-inputgroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs +15 -24
- package/fesm2022/exhaustive-ui-core-inputgroupaddon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputicon.mjs +11 -22
- package/fesm2022/exhaustive-ui-core-inputicon.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputmask.mjs +423 -392
- package/fesm2022/exhaustive-ui-core-inputmask.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs +397 -469
- package/fesm2022/exhaustive-ui-core-inputnumber.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputotp.mjs +75 -95
- package/fesm2022/exhaustive-ui-core-inputotp.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-inputtext.mjs +27 -36
- package/fesm2022/exhaustive-ui-core-inputtext.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs +29 -46
- package/fesm2022/exhaustive-ui-core-keyfilter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-knob.mjs +140 -187
- package/fesm2022/exhaustive-ui-core-knob.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-listbox.mjs +365 -546
- package/fesm2022/exhaustive-ui-core-listbox.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-megamenu.mjs +320 -371
- package/fesm2022/exhaustive-ui-core-megamenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menu.mjs +298 -348
- package/fesm2022/exhaustive-ui-core-menu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-menubar.mjs +277 -372
- package/fesm2022/exhaustive-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-metergroup.mjs +138 -166
- package/fesm2022/exhaustive-ui-core-metergroup.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-multiselect.mjs +647 -835
- package/fesm2022/exhaustive-ui-core-multiselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-orderlist.mjs +337 -409
- package/fesm2022/exhaustive-ui-core-orderlist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs +114 -175
- package/fesm2022/exhaustive-ui-core-organizationchart.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs +22 -47
- package/fesm2022/exhaustive-ui-core-overlaybadge.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-paginator.mjs +232 -320
- package/fesm2022/exhaustive-ui-core-paginator.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panel.mjs +114 -174
- package/fesm2022/exhaustive-ui-core-panel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs +171 -282
- package/fesm2022/exhaustive-ui-core-panelmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-password.mjs +317 -377
- package/fesm2022/exhaustive-ui-core-password.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-picklist.mjs +557 -655
- package/fesm2022/exhaustive-ui-core-picklist.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-popover.mjs +154 -181
- package/fesm2022/exhaustive-ui-core-popover.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-rating.mjs +87 -119
- package/fesm2022/exhaustive-ui-core-rating.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scroller.mjs +465 -596
- package/fesm2022/exhaustive-ui-core-scroller.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs +147 -155
- package/fesm2022/exhaustive-ui-core-scrollpanel.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs +81 -115
- package/fesm2022/exhaustive-ui-core-scrolltop.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-select.mjs +581 -784
- package/fesm2022/exhaustive-ui-core-select.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs +84 -120
- package/fesm2022/exhaustive-ui-core-selectbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-slider.mjs +322 -352
- package/fesm2022/exhaustive-ui-core-slider.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-speeddial.mjs +209 -268
- package/fesm2022/exhaustive-ui-core-speeddial.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs +153 -249
- package/fesm2022/exhaustive-ui-core-splitbutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-splitter.mjs +221 -237
- package/fesm2022/exhaustive-ui-core-splitter.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-steps.mjs +56 -72
- package/fesm2022/exhaustive-ui-core-steps.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-styleclass.mjs +145 -146
- package/fesm2022/exhaustive-ui-core-styleclass.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-table.mjs +2213 -2543
- package/fesm2022/exhaustive-ui-core-table.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-terminal.mjs +50 -67
- package/fesm2022/exhaustive-ui-core-terminal.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-textarea.mjs +23 -36
- package/fesm2022/exhaustive-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs +318 -394
- package/fesm2022/exhaustive-ui-core-tieredmenu.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-timeline.mjs +56 -74
- package/fesm2022/exhaustive-ui-core-timeline.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs +86 -129
- package/fesm2022/exhaustive-ui-core-togglebutton.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs +57 -94
- package/fesm2022/exhaustive-ui-core-toggleswitch.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-toolbar.mjs +36 -55
- package/fesm2022/exhaustive-ui-core-toolbar.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tooltip.mjs +264 -343
- package/fesm2022/exhaustive-ui-core-tooltip.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-tree.mjs +508 -639
- package/fesm2022/exhaustive-ui-core-tree.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treeselect.mjs +327 -421
- package/fesm2022/exhaustive-ui-core-treeselect.mjs.map +1 -1
- package/fesm2022/exhaustive-ui-core-treetable.mjs +1267 -1473
- package/fesm2022/exhaustive-ui-core-treetable.mjs.map +1 -1
- package/package.json +5 -5
- package/schematics/migrations/remove-dead-inputs/migration.js +213 -7
- package/schematics/migrations/renamed-inputs/migration.js +97 -0
- package/schematics/migrations/styleclass-to-class/migration.js +92 -1
- package/schematics/migrations.json +7 -2
- package/schematics/utils/removed-inputs.js +0 -0
- package/schematics/utils/renamed-inputs.js +175 -0
- package/schematics/utils/styleclass.js +24 -8
- package/schematics/utils/versions.json +8 -8
- package/types/exhaustive-ui-core-accordion.d.ts +8 -24
- package/types/exhaustive-ui-core-animateonscroll.d.ts +19 -21
- package/types/exhaustive-ui-core-api.d.ts +2 -3
- package/types/exhaustive-ui-core-autocomplete.d.ts +103 -176
- package/types/exhaustive-ui-core-autofocus.d.ts +4 -7
- package/types/exhaustive-ui-core-avatar.d.ts +18 -25
- package/types/exhaustive-ui-core-badge.d.ts +13 -27
- package/types/exhaustive-ui-core-blockui.d.ts +18 -30
- package/types/exhaustive-ui-core-breadcrumb.d.ts +21 -22
- package/types/exhaustive-ui-core-button.d.ts +57 -89
- package/types/exhaustive-ui-core-carousel.d.ts +56 -82
- package/types/exhaustive-ui-core-cascadeselect.d.ts +77 -111
- package/types/exhaustive-ui-core-chart.d.ts +21 -29
- package/types/exhaustive-ui-core-checkbox.d.ts +25 -39
- package/types/exhaustive-ui-core-chip.d.ts +31 -38
- package/types/exhaustive-ui-core-colorpicker.d.ts +23 -57
- package/types/exhaustive-ui-core-confirmdialog.d.ts +39 -109
- package/types/exhaustive-ui-core-confirmpopup.d.ts +24 -43
- package/types/exhaustive-ui-core-contextmenu.d.ts +54 -71
- package/types/exhaustive-ui-core-dataview.d.ts +42 -65
- package/types/exhaustive-ui-core-datepicker.d.ts +109 -191
- package/types/exhaustive-ui-core-dialog.d.ts +73 -123
- package/types/exhaustive-ui-core-dock.d.ts +16 -25
- package/types/exhaustive-ui-core-dragdrop.d.ts +32 -36
- package/types/exhaustive-ui-core-drawer.d.ts +32 -64
- package/types/exhaustive-ui-core-dynamicdialog.d.ts +9 -54
- package/types/exhaustive-ui-core-editor.d.ts +15 -25
- package/types/exhaustive-ui-core-fieldset.d.ts +15 -35
- package/types/exhaustive-ui-core-fileupload.d.ts +69 -95
- package/types/exhaustive-ui-core-floatlabel.d.ts +4 -6
- package/types/exhaustive-ui-core-focustrap.d.ts +5 -10
- package/types/exhaustive-ui-core-galleria.d.ts +124 -194
- package/types/exhaustive-ui-core-iconfield.d.ts +5 -13
- package/types/exhaustive-ui-core-icons-baseicon.d.ts +4 -5
- package/types/exhaustive-ui-core-image.d.ts +35 -68
- package/types/exhaustive-ui-core-imagecompare.d.ts +19 -20
- package/types/exhaustive-ui-core-inplace.d.ts +30 -42
- package/types/exhaustive-ui-core-inputgroup.d.ts +2 -9
- package/types/exhaustive-ui-core-inputgroupaddon.d.ts +6 -10
- package/types/exhaustive-ui-core-inputicon.d.ts +4 -11
- package/types/exhaustive-ui-core-inputmask.d.ts +53 -66
- package/types/exhaustive-ui-core-inputnumber.d.ts +62 -84
- package/types/exhaustive-ui-core-inputotp.d.ts +16 -20
- package/types/exhaustive-ui-core-inputtext.d.ts +5 -8
- package/types/exhaustive-ui-core-keyfilter.d.ts +11 -15
- package/types/exhaustive-ui-core-knob.d.ts +45 -60
- package/types/exhaustive-ui-core-listbox.d.ts +90 -126
- package/types/exhaustive-ui-core-megamenu.d.ts +45 -66
- package/types/exhaustive-ui-core-menu.d.ts +33 -53
- package/types/exhaustive-ui-core-menubar.d.ts +38 -85
- package/types/exhaustive-ui-core-metergroup.d.ts +39 -48
- package/types/exhaustive-ui-core-multiselect.d.ts +166 -219
- package/types/exhaustive-ui-core-orderlist.d.ts +58 -81
- package/types/exhaustive-ui-core-organizationchart.d.ts +32 -67
- package/types/exhaustive-ui-core-overlaybadge.d.ts +10 -20
- package/types/exhaustive-ui-core-paginator.d.ts +41 -69
- package/types/exhaustive-ui-core-panel.d.ts +18 -45
- package/types/exhaustive-ui-core-panelmenu.d.ts +31 -76
- package/types/exhaustive-ui-core-password.d.ts +56 -93
- package/types/exhaustive-ui-core-picklist.d.ts +107 -121
- package/types/exhaustive-ui-core-popover.d.ts +23 -47
- package/types/exhaustive-ui-core-rating.d.ts +18 -26
- package/types/exhaustive-ui-core-scroller.d.ts +90 -120
- package/types/exhaustive-ui-core-scrollpanel.d.ts +35 -46
- package/types/exhaustive-ui-core-scrolltop.d.ts +28 -45
- package/types/exhaustive-ui-core-select.d.ts +137 -188
- package/types/exhaustive-ui-core-selectbutton.d.ts +35 -44
- package/types/exhaustive-ui-core-slider.d.ts +52 -67
- package/types/exhaustive-ui-core-speeddial.d.ts +40 -56
- package/types/exhaustive-ui-core-splitbutton.d.ts +31 -71
- package/types/exhaustive-ui-core-splitter.d.ts +47 -59
- package/types/exhaustive-ui-core-steps.d.ts +24 -31
- package/types/exhaustive-ui-core-styleclass.d.ts +27 -33
- package/types/exhaustive-ui-core-table.d.ts +349 -453
- package/types/exhaustive-ui-core-terminal.d.ts +10 -22
- package/types/exhaustive-ui-core-textarea.d.ts +7 -10
- package/types/exhaustive-ui-core-tieredmenu.d.ts +49 -84
- package/types/exhaustive-ui-core-timeline.d.ts +20 -28
- package/types/exhaustive-ui-core-togglebutton.d.ts +32 -48
- package/types/exhaustive-ui-core-toggleswitch.d.ts +26 -37
- package/types/exhaustive-ui-core-toolbar.d.ts +17 -25
- package/types/exhaustive-ui-core-tooltip.d.ts +53 -88
- package/types/exhaustive-ui-core-tree.d.ts +82 -119
- package/types/exhaustive-ui-core-treeselect.d.ts +63 -92
- package/types/exhaustive-ui-core-treetable.d.ts +203 -280
- package/types/exhaustive-ui-core-types-chip.d.ts +1 -1
|
@@ -3,7 +3,8 @@ import * as i1 from '@angular/common';
|
|
|
3
3
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import { HttpClient, HttpEventType } from '@angular/common/http';
|
|
5
5
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { Injectable, InjectionToken, inject, output, input, ChangeDetectionStrategy, Component,
|
|
6
|
+
import { Injectable, InjectionToken, inject, output, input, ChangeDetectionStrategy, Component, afterEveryRender, afterNextRender, effect, untracked, booleanAttribute, numberAttribute, contentChild, viewChild, signal, NgZone, computed, contentChildren, ViewEncapsulation, NgModule } from '@angular/core';
|
|
7
|
+
import { toSignal } from '@angular/core/rxjs-interop';
|
|
7
8
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
9
|
import { addClass, removeClass } from '@exhaustive-ui/utils';
|
|
9
10
|
import { TranslationKeys, PrimeTemplate, SharedModule } from '@exhaustive-ui/core/api';
|
|
@@ -19,7 +20,7 @@ import { style } from '@exhaustive-ui/styles/fileupload';
|
|
|
19
20
|
import { BaseStyle } from '@exhaustive-ui/core/base';
|
|
20
21
|
|
|
21
22
|
const classes = {
|
|
22
|
-
root: ({ instance }) => `p-fileupload p-fileupload-${instance.mode} p-component`,
|
|
23
|
+
root: ({ instance }) => `p-fileupload p-fileupload-${instance.mode()} p-component`,
|
|
23
24
|
header: 'p-fileupload-header',
|
|
24
25
|
pcChooseButton: 'p-fileupload-choose-button',
|
|
25
26
|
pcUploadButton: 'p-fileupload-upload-button',
|
|
@@ -173,13 +174,12 @@ class FileContent extends BaseComponent {
|
|
|
173
174
|
</p-button>
|
|
174
175
|
</div>
|
|
175
176
|
</div>
|
|
176
|
-
}`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Badge, selector: "p-badge", inputs: ["
|
|
177
|
+
}`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Badge, selector: "p-badge", inputs: ["badgeSize", "size", "severity", "value", "badgeDisabled"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: TimesIcon, selector: "[data-p-icon=\"times\"]" }, { kind: "directive", type: Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
177
178
|
}
|
|
178
179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: FileContent, decorators: [{
|
|
179
180
|
type: Component,
|
|
180
181
|
args: [{
|
|
181
182
|
selector: '[pFileContent]',
|
|
182
|
-
standalone: true,
|
|
183
183
|
template: `@for (file of files(); track file?.name + '-' + $index; let index = $index) {
|
|
184
184
|
<div [class]="cx('file')" [pBind]="$pcFileUpload.ptm('file')">
|
|
185
185
|
<img role="presentation" [class]="cx('fileThumbnail')" [attr.alt]="file.name" [src]="file.objectURL" [width]="previewWidth()" [pBind]="$pcFileUpload.ptm('fileThumbnail')" />
|
|
@@ -213,194 +213,246 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
213
213
|
class FileUpload extends BaseComponent {
|
|
214
214
|
componentName = 'FileUpload';
|
|
215
215
|
bindDirectiveInstance = inject(Bind, { self: true });
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
constructor() {
|
|
217
|
+
super();
|
|
218
|
+
afterEveryRender(() => this.bindDirectiveInstance.setAttrs(this.ptm('host')));
|
|
219
|
+
afterNextRender(() => {
|
|
220
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
221
|
+
if (this.mode() === 'advanced') {
|
|
222
|
+
this.zone.runOutsideAngular(() => {
|
|
223
|
+
const content = this.content();
|
|
224
|
+
if (content) {
|
|
225
|
+
this.dragOverListener.set(this.renderer.listen(content.nativeElement, 'dragover', this.onDragOver.bind(this)));
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
effect(() => {
|
|
232
|
+
const files = this.files();
|
|
233
|
+
if (files !== undefined) {
|
|
234
|
+
untracked(() => {
|
|
235
|
+
const validFiles = [];
|
|
236
|
+
for (let i = 0; i < files.length; i++) {
|
|
237
|
+
let file = files[i];
|
|
238
|
+
if (this.validate(file)) {
|
|
239
|
+
if (this.isImage(file)) {
|
|
240
|
+
file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(files[i]));
|
|
241
|
+
}
|
|
242
|
+
validFiles.push(files[i]);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
this._files.set(validFiles);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
});
|
|
218
249
|
}
|
|
219
250
|
/**
|
|
220
251
|
* Name of the request parameter to identify the files at backend.
|
|
221
252
|
* @group Props
|
|
222
253
|
*/
|
|
223
|
-
name
|
|
254
|
+
name = input(/* @ts-ignore */
|
|
255
|
+
...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
|
|
224
256
|
/**
|
|
225
257
|
* Remote url to upload the files.
|
|
226
258
|
* @group Props
|
|
227
259
|
*/
|
|
228
|
-
url
|
|
260
|
+
url = input(/* @ts-ignore */
|
|
261
|
+
...(ngDevMode ? [undefined, { debugName: "url" }] : /* istanbul ignore next */ []));
|
|
229
262
|
/**
|
|
230
263
|
* HTTP method to send the files to the url such as "post" and "put".
|
|
231
264
|
* @group Props
|
|
232
265
|
*/
|
|
233
|
-
method = 'post'
|
|
266
|
+
method = input('post', /* @ts-ignore */
|
|
267
|
+
...(ngDevMode ? [{ debugName: "method" }] : /* istanbul ignore next */ []));
|
|
234
268
|
/**
|
|
235
269
|
* Used to select multiple files at once from file dialog.
|
|
236
270
|
* @group Props
|
|
237
271
|
*/
|
|
238
|
-
multiple;
|
|
272
|
+
multiple = input(undefined, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
239
273
|
/**
|
|
240
274
|
* Comma-separated list of pattern to restrict the allowed file types. Can be any combination of either the MIME types (such as "image/*") or the file extensions (such as ".jpg").
|
|
241
275
|
* @group Props
|
|
242
276
|
*/
|
|
243
|
-
accept
|
|
277
|
+
accept = input(/* @ts-ignore */
|
|
278
|
+
...(ngDevMode ? [undefined, { debugName: "accept" }] : /* istanbul ignore next */ []));
|
|
244
279
|
/**
|
|
245
280
|
* Disables the upload functionality.
|
|
246
281
|
* @group Props
|
|
247
282
|
*/
|
|
248
|
-
disabled;
|
|
283
|
+
disabled = input(undefined, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
249
284
|
/**
|
|
250
285
|
* When enabled, upload begins automatically after selection is completed.
|
|
251
286
|
* @group Props
|
|
252
287
|
*/
|
|
253
|
-
auto;
|
|
288
|
+
auto = input(undefined, { ...(ngDevMode ? { debugName: "auto" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
254
289
|
/**
|
|
255
290
|
* Cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates.
|
|
256
291
|
* @group Props
|
|
257
292
|
*/
|
|
258
|
-
withCredentials;
|
|
293
|
+
withCredentials = input(undefined, { ...(ngDevMode ? { debugName: "withCredentials" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
259
294
|
/**
|
|
260
295
|
* Maximum file size allowed in bytes.
|
|
261
296
|
* @group Props
|
|
262
297
|
*/
|
|
263
|
-
maxFileSize;
|
|
298
|
+
maxFileSize = input(undefined, { ...(ngDevMode ? { debugName: "maxFileSize" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
264
299
|
/**
|
|
265
300
|
* Summary message of the invalid file size.
|
|
266
301
|
* @group Props
|
|
267
302
|
*/
|
|
268
|
-
invalidFileSizeMessageSummary = '{0}: Invalid file size, '
|
|
303
|
+
invalidFileSizeMessageSummary = input('{0}: Invalid file size, ', /* @ts-ignore */
|
|
304
|
+
...(ngDevMode ? [{ debugName: "invalidFileSizeMessageSummary" }] : /* istanbul ignore next */ []));
|
|
269
305
|
/**
|
|
270
306
|
* Detail message of the invalid file size.
|
|
271
307
|
* @group Props
|
|
272
308
|
*/
|
|
273
|
-
invalidFileSizeMessageDetail = 'maximum upload size is {0}.'
|
|
309
|
+
invalidFileSizeMessageDetail = input('maximum upload size is {0}.', /* @ts-ignore */
|
|
310
|
+
...(ngDevMode ? [{ debugName: "invalidFileSizeMessageDetail" }] : /* istanbul ignore next */ []));
|
|
274
311
|
/**
|
|
275
312
|
* Summary message of the invalid file type.
|
|
276
313
|
* @group Props
|
|
277
314
|
*/
|
|
278
|
-
invalidFileTypeMessageSummary = '{0}: Invalid file type, '
|
|
315
|
+
invalidFileTypeMessageSummary = input('{0}: Invalid file type, ', /* @ts-ignore */
|
|
316
|
+
...(ngDevMode ? [{ debugName: "invalidFileTypeMessageSummary" }] : /* istanbul ignore next */ []));
|
|
279
317
|
/**
|
|
280
318
|
* Detail message of the invalid file type.
|
|
281
319
|
* @group Props
|
|
282
320
|
*/
|
|
283
|
-
invalidFileTypeMessageDetail = 'allowed file types: {0}.'
|
|
321
|
+
invalidFileTypeMessageDetail = input('allowed file types: {0}.', /* @ts-ignore */
|
|
322
|
+
...(ngDevMode ? [{ debugName: "invalidFileTypeMessageDetail" }] : /* istanbul ignore next */ []));
|
|
284
323
|
/**
|
|
285
324
|
* Detail message of the invalid file type.
|
|
286
325
|
* @group Props
|
|
287
326
|
*/
|
|
288
|
-
invalidFileLimitMessageDetail = 'limit is {0} at most.'
|
|
327
|
+
invalidFileLimitMessageDetail = input('limit is {0} at most.', /* @ts-ignore */
|
|
328
|
+
...(ngDevMode ? [{ debugName: "invalidFileLimitMessageDetail" }] : /* istanbul ignore next */ []));
|
|
289
329
|
/**
|
|
290
330
|
* Summary message of the invalid file type.
|
|
291
331
|
* @group Props
|
|
292
332
|
*/
|
|
293
|
-
invalidFileLimitMessageSummary = 'Maximum number of files exceeded, '
|
|
333
|
+
invalidFileLimitMessageSummary = input('Maximum number of files exceeded, ', /* @ts-ignore */
|
|
334
|
+
...(ngDevMode ? [{ debugName: "invalidFileLimitMessageSummary" }] : /* istanbul ignore next */ []));
|
|
294
335
|
/**
|
|
295
336
|
* Inline style of the element.
|
|
296
337
|
* @group Props
|
|
297
338
|
*/
|
|
298
|
-
style
|
|
339
|
+
style = input(/* @ts-ignore */
|
|
340
|
+
...(ngDevMode ? [undefined, { debugName: "style" }] : /* istanbul ignore next */ []));
|
|
299
341
|
/**
|
|
300
342
|
* Class of the element.
|
|
301
343
|
* @group Props
|
|
302
344
|
*/
|
|
303
|
-
styleClass
|
|
345
|
+
styleClass = input(/* @ts-ignore */
|
|
346
|
+
...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
|
|
304
347
|
/**
|
|
305
348
|
* Width of the image thumbnail in pixels.
|
|
306
349
|
* @group Props
|
|
307
350
|
*/
|
|
308
|
-
previewWidth = 50;
|
|
351
|
+
previewWidth = input(50, { ...(ngDevMode ? { debugName: "previewWidth" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
309
352
|
/**
|
|
310
353
|
* Label of the choose button. Defaults to Exhaustive Locale configuration.
|
|
311
354
|
* @group Props
|
|
312
355
|
*/
|
|
313
|
-
chooseLabel
|
|
356
|
+
chooseLabel = input(/* @ts-ignore */
|
|
357
|
+
...(ngDevMode ? [undefined, { debugName: "chooseLabel" }] : /* istanbul ignore next */ []));
|
|
314
358
|
/**
|
|
315
359
|
* Label of the upload button. Defaults to Exhaustive Locale configuration.
|
|
316
360
|
* @group Props
|
|
317
361
|
*/
|
|
318
|
-
uploadLabel
|
|
362
|
+
uploadLabel = input(/* @ts-ignore */
|
|
363
|
+
...(ngDevMode ? [undefined, { debugName: "uploadLabel" }] : /* istanbul ignore next */ []));
|
|
319
364
|
/**
|
|
320
365
|
* Label of the cancel button. Defaults to Exhaustive Locale configuration.
|
|
321
366
|
* @group Props
|
|
322
367
|
*/
|
|
323
|
-
cancelLabel
|
|
368
|
+
cancelLabel = input(/* @ts-ignore */
|
|
369
|
+
...(ngDevMode ? [undefined, { debugName: "cancelLabel" }] : /* istanbul ignore next */ []));
|
|
324
370
|
/**
|
|
325
371
|
* Icon of the choose button.
|
|
326
372
|
* @group Props
|
|
327
373
|
*/
|
|
328
|
-
chooseIcon
|
|
374
|
+
chooseIcon = input(/* @ts-ignore */
|
|
375
|
+
...(ngDevMode ? [undefined, { debugName: "chooseIcon" }] : /* istanbul ignore next */ []));
|
|
329
376
|
/**
|
|
330
377
|
* Icon of the upload button.
|
|
331
378
|
* @group Props
|
|
332
379
|
*/
|
|
333
|
-
uploadIcon
|
|
380
|
+
uploadIcon = input(/* @ts-ignore */
|
|
381
|
+
...(ngDevMode ? [undefined, { debugName: "uploadIcon" }] : /* istanbul ignore next */ []));
|
|
334
382
|
/**
|
|
335
383
|
* Icon of the cancel button.
|
|
336
384
|
* @group Props
|
|
337
385
|
*/
|
|
338
|
-
cancelIcon
|
|
386
|
+
cancelIcon = input(/* @ts-ignore */
|
|
387
|
+
...(ngDevMode ? [undefined, { debugName: "cancelIcon" }] : /* istanbul ignore next */ []));
|
|
339
388
|
/**
|
|
340
389
|
* Whether to show the upload button.
|
|
341
390
|
* @group Props
|
|
342
391
|
*/
|
|
343
|
-
showUploadButton = true;
|
|
392
|
+
showUploadButton = input(true, { ...(ngDevMode ? { debugName: "showUploadButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
344
393
|
/**
|
|
345
394
|
* Whether to show the cancel button.
|
|
346
395
|
* @group Props
|
|
347
396
|
*/
|
|
348
|
-
showCancelButton = true;
|
|
397
|
+
showCancelButton = input(true, { ...(ngDevMode ? { debugName: "showCancelButton" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
349
398
|
/**
|
|
350
399
|
* Defines the UI of the component.
|
|
351
400
|
* @group Props
|
|
352
401
|
*/
|
|
353
|
-
mode = 'advanced'
|
|
402
|
+
mode = input('advanced', /* @ts-ignore */
|
|
403
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
354
404
|
/**
|
|
355
405
|
* HttpHeaders class represents the header configuration options for an HTTP request.
|
|
356
406
|
* @group Props
|
|
357
407
|
*/
|
|
358
|
-
headers
|
|
408
|
+
headers = input(/* @ts-ignore */
|
|
409
|
+
...(ngDevMode ? [undefined, { debugName: "headers" }] : /* istanbul ignore next */ []));
|
|
359
410
|
/**
|
|
360
411
|
* Whether to use the default upload or a manual implementation defined in uploadHandler callback. Defaults to Exhaustive Locale configuration.
|
|
361
412
|
* @group Props
|
|
362
413
|
*/
|
|
363
|
-
customUpload;
|
|
414
|
+
customUpload = input(undefined, { ...(ngDevMode ? { debugName: "customUpload" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
364
415
|
/**
|
|
365
416
|
* Maximum number of files that can be uploaded.
|
|
366
417
|
* @group Props
|
|
367
418
|
*/
|
|
368
|
-
fileLimit;
|
|
419
|
+
fileLimit = input(undefined, { ...(ngDevMode ? { debugName: "fileLimit" } : /* istanbul ignore next */ {}), transform: (value) => numberAttribute(value, undefined) });
|
|
369
420
|
/**
|
|
370
421
|
* Style class of the upload button.
|
|
371
422
|
* @group Props
|
|
372
423
|
*/
|
|
373
|
-
uploadStyleClass
|
|
424
|
+
uploadStyleClass = input(/* @ts-ignore */
|
|
425
|
+
...(ngDevMode ? [undefined, { debugName: "uploadStyleClass" }] : /* istanbul ignore next */ []));
|
|
374
426
|
/**
|
|
375
427
|
* Style class of the cancel button.
|
|
376
428
|
* @group Props
|
|
377
429
|
*/
|
|
378
|
-
cancelStyleClass
|
|
379
|
-
|
|
380
|
-
* Style class of the remove button.
|
|
381
|
-
* @group Props
|
|
382
|
-
*/
|
|
383
|
-
removeStyleClass;
|
|
430
|
+
cancelStyleClass = input(/* @ts-ignore */
|
|
431
|
+
...(ngDevMode ? [undefined, { debugName: "cancelStyleClass" }] : /* istanbul ignore next */ []));
|
|
384
432
|
/**
|
|
385
433
|
* Style class of the choose button.
|
|
386
434
|
* @group Props
|
|
387
435
|
*/
|
|
388
|
-
chooseStyleClass
|
|
436
|
+
chooseStyleClass = input(/* @ts-ignore */
|
|
437
|
+
...(ngDevMode ? [undefined, { debugName: "chooseStyleClass" }] : /* istanbul ignore next */ []));
|
|
389
438
|
/**
|
|
390
439
|
* Used to pass all properties of the ButtonProps to the choose button inside the component.
|
|
391
440
|
* @group Props
|
|
392
441
|
*/
|
|
393
|
-
chooseButtonProps
|
|
442
|
+
chooseButtonProps = input(/* @ts-ignore */
|
|
443
|
+
...(ngDevMode ? [undefined, { debugName: "chooseButtonProps" }] : /* istanbul ignore next */ []));
|
|
394
444
|
/**
|
|
395
445
|
* Used to pass all properties of the ButtonProps to the upload button inside the component.
|
|
396
446
|
* @group Props
|
|
397
447
|
*/
|
|
398
|
-
uploadButtonProps = { severity: 'secondary' }
|
|
448
|
+
uploadButtonProps = input({ severity: 'secondary' }, /* @ts-ignore */
|
|
449
|
+
...(ngDevMode ? [{ debugName: "uploadButtonProps" }] : /* istanbul ignore next */ []));
|
|
399
450
|
/**
|
|
400
451
|
* Used to pass all properties of the ButtonProps to the cancel button inside the component.
|
|
401
452
|
* @group Props
|
|
402
453
|
*/
|
|
403
|
-
cancelButtonProps = { severity: 'secondary' }
|
|
454
|
+
cancelButtonProps = input({ severity: 'secondary' }, /* @ts-ignore */
|
|
455
|
+
...(ngDevMode ? [{ debugName: "cancelButtonProps" }] : /* istanbul ignore next */ []));
|
|
404
456
|
/**
|
|
405
457
|
* Callback to invoke before file upload is initialized.
|
|
406
458
|
* @param {FileBeforeUploadEvent} event - Custom upload event.
|
|
@@ -521,119 +573,80 @@ class FileUpload extends BaseComponent {
|
|
|
521
573
|
...(ngDevMode ? [{ debugName: "basicFileInput" }] : /* istanbul ignore next */ []));
|
|
522
574
|
content = viewChild('content', /* @ts-ignore */
|
|
523
575
|
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
return this.uploadLabel ?? this.files[0].name;
|
|
544
|
-
}
|
|
545
|
-
_files = [];
|
|
546
|
-
progress = 0;
|
|
547
|
-
dragHighlight;
|
|
548
|
-
msgs;
|
|
549
|
-
uploadedFileCount = 0;
|
|
550
|
-
focus;
|
|
551
|
-
uploading;
|
|
552
|
-
duplicateIEEvent; // flag to recognize duplicate onchange event for file input
|
|
553
|
-
translationSubscription;
|
|
554
|
-
dragOverListener;
|
|
555
|
-
uploadedFiles = [];
|
|
576
|
+
files = input(/* @ts-ignore */
|
|
577
|
+
...(ngDevMode ? [undefined, { debugName: "files" }] : /* istanbul ignore next */ []));
|
|
578
|
+
_files = signal([], /* @ts-ignore */
|
|
579
|
+
...(ngDevMode ? [{ debugName: "_files" }] : /* istanbul ignore next */ []));
|
|
580
|
+
progress = signal(0, /* @ts-ignore */
|
|
581
|
+
...(ngDevMode ? [{ debugName: "progress" }] : /* istanbul ignore next */ []));
|
|
582
|
+
msgs = signal(undefined, /* @ts-ignore */
|
|
583
|
+
...(ngDevMode ? [{ debugName: "msgs" }] : /* istanbul ignore next */ []));
|
|
584
|
+
uploadedFileCount = signal(0, /* @ts-ignore */
|
|
585
|
+
...(ngDevMode ? [{ debugName: "uploadedFileCount" }] : /* istanbul ignore next */ []));
|
|
586
|
+
focus = signal(undefined, /* @ts-ignore */
|
|
587
|
+
...(ngDevMode ? [{ debugName: "focus" }] : /* istanbul ignore next */ []));
|
|
588
|
+
uploading = signal(undefined, /* @ts-ignore */
|
|
589
|
+
...(ngDevMode ? [{ debugName: "uploading" }] : /* istanbul ignore next */ []));
|
|
590
|
+
translation = toSignal(this.config.translationObserver, { initialValue: this.config.translation });
|
|
591
|
+
dragOverListener = signal(undefined, /* @ts-ignore */
|
|
592
|
+
...(ngDevMode ? [{ debugName: "dragOverListener" }] : /* istanbul ignore next */ []));
|
|
593
|
+
uploadedFiles = signal([], /* @ts-ignore */
|
|
594
|
+
...(ngDevMode ? [{ debugName: "uploadedFiles" }] : /* istanbul ignore next */ []));
|
|
556
595
|
sanitizer = inject(DomSanitizer);
|
|
557
596
|
zone = inject(NgZone);
|
|
558
597
|
http = inject(HttpClient);
|
|
559
598
|
_componentStyle = inject(FileUploadStyle);
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
599
|
+
_headerTemplate = computed(() => this.templates()
|
|
600
|
+
.filter((item) => item.getType() === 'header')
|
|
601
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
602
|
+
...(ngDevMode ? [{ debugName: "_headerTemplate" }] : /* istanbul ignore next */ []));
|
|
603
|
+
_contentTemplate = computed(() => this.templates()
|
|
604
|
+
.filter((item) => item.getType() === 'content')
|
|
605
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
606
|
+
...(ngDevMode ? [{ debugName: "_contentTemplate" }] : /* istanbul ignore next */ []));
|
|
607
|
+
_toolbarTemplate = computed(() => this.templates()
|
|
608
|
+
.filter((item) => item.getType() === 'toolbar')
|
|
609
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
610
|
+
...(ngDevMode ? [{ debugName: "_toolbarTemplate" }] : /* istanbul ignore next */ []));
|
|
611
|
+
_chooseIconTemplate = computed(() => this.templates()
|
|
612
|
+
.filter((item) => item.getType() === 'chooseicon')
|
|
613
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
614
|
+
...(ngDevMode ? [{ debugName: "_chooseIconTemplate" }] : /* istanbul ignore next */ []));
|
|
615
|
+
_uploadIconTemplate = computed(() => this.templates()
|
|
616
|
+
.filter((item) => item.getType() === 'uploadicon')
|
|
617
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
618
|
+
...(ngDevMode ? [{ debugName: "_uploadIconTemplate" }] : /* istanbul ignore next */ []));
|
|
619
|
+
_cancelIconTemplate = computed(() => this.templates()
|
|
620
|
+
.filter((item) => item.getType() === 'cancelicon')
|
|
621
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
622
|
+
...(ngDevMode ? [{ debugName: "_cancelIconTemplate" }] : /* istanbul ignore next */ []));
|
|
623
|
+
_emptyTemplate = computed(() => this.templates()
|
|
624
|
+
.filter((item) => item.getType() === 'empty')
|
|
625
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
626
|
+
...(ngDevMode ? [{ debugName: "_emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
627
|
+
_fileTemplate = computed(() => this.templates()
|
|
628
|
+
.filter((item) => !['header', 'content', 'toolbar', 'chooseicon', 'uploadicon', 'cancelicon', 'empty', 'filelabel'].includes(item.getType()))
|
|
629
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
630
|
+
...(ngDevMode ? [{ debugName: "_fileTemplate" }] : /* istanbul ignore next */ []));
|
|
631
|
+
_fileLabelTemplate = computed(() => this.templates()
|
|
632
|
+
.filter((item) => item.getType() === 'filelabel')
|
|
633
|
+
.at(-1)?.template, /* @ts-ignore */
|
|
634
|
+
...(ngDevMode ? [{ debugName: "_fileLabelTemplate" }] : /* istanbul ignore next */ []));
|
|
586
635
|
templates = contentChildren(PrimeTemplate, /* @ts-ignore */
|
|
587
636
|
...(ngDevMode ? [{ debugName: "templates" }] : /* istanbul ignore next */ []));
|
|
588
|
-
|
|
589
|
-
this.
|
|
590
|
-
|
|
591
|
-
case 'header':
|
|
592
|
-
this._headerTemplate = item.template;
|
|
593
|
-
break;
|
|
594
|
-
case 'file':
|
|
595
|
-
this._fileTemplate = item.template;
|
|
596
|
-
break;
|
|
597
|
-
case 'content':
|
|
598
|
-
this._contentTemplate = item.template;
|
|
599
|
-
break;
|
|
600
|
-
case 'toolbar':
|
|
601
|
-
this._toolbarTemplate = item.template;
|
|
602
|
-
break;
|
|
603
|
-
case 'chooseicon':
|
|
604
|
-
this._chooseIconTemplate = item.template;
|
|
605
|
-
break;
|
|
606
|
-
case 'uploadicon':
|
|
607
|
-
this._uploadIconTemplate = item.template;
|
|
608
|
-
break;
|
|
609
|
-
case 'cancelicon':
|
|
610
|
-
this._cancelIconTemplate = item.template;
|
|
611
|
-
break;
|
|
612
|
-
case 'empty':
|
|
613
|
-
this._emptyTemplate = item.template;
|
|
614
|
-
break;
|
|
615
|
-
case 'filelabel':
|
|
616
|
-
this._fileLabelTemplate = item.template;
|
|
617
|
-
break;
|
|
618
|
-
default:
|
|
619
|
-
this._fileTemplate = item.template;
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
basicFileChosenLabel() {
|
|
625
|
-
if (this.auto)
|
|
626
|
-
return this.chooseButtonLabel;
|
|
637
|
+
basicFileChosenLabel = computed(() => {
|
|
638
|
+
if (this.auto())
|
|
639
|
+
return this.chooseButtonLabel();
|
|
627
640
|
else if (this.hasFiles()) {
|
|
628
|
-
if (this.
|
|
629
|
-
return this.
|
|
630
|
-
return this.
|
|
641
|
+
if (this._files() && this._files().length === 1)
|
|
642
|
+
return this._files()[0].name;
|
|
643
|
+
return this.translation()['fileChosenMessage']?.replace('{0}', this._files().length);
|
|
631
644
|
}
|
|
632
|
-
return this.
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
645
|
+
return this.translation()['noFileChosenMessage'] || '';
|
|
646
|
+
}, /* @ts-ignore */
|
|
647
|
+
...(ngDevMode ? [{ debugName: "basicFileChosenLabel" }] : /* istanbul ignore next */ []));
|
|
648
|
+
completedLabel = computed(() => this.translation()['completed'] || '', /* @ts-ignore */
|
|
649
|
+
...(ngDevMode ? [{ debugName: "completedLabel" }] : /* istanbul ignore next */ []));
|
|
637
650
|
getTranslation(option) {
|
|
638
651
|
return this.config.getTranslation(option);
|
|
639
652
|
}
|
|
@@ -641,15 +654,10 @@ class FileUpload extends BaseComponent {
|
|
|
641
654
|
this.advancedFileInput()?.nativeElement.click();
|
|
642
655
|
}
|
|
643
656
|
onFileSelect(event) {
|
|
644
|
-
if (
|
|
645
|
-
this.
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
if (!this.multiple) {
|
|
649
|
-
this.files = [];
|
|
657
|
+
if (!this.multiple()) {
|
|
658
|
+
this._files.set([]);
|
|
650
659
|
}
|
|
651
|
-
this.msgs
|
|
652
|
-
this.files = this.files || [];
|
|
660
|
+
this.msgs.set([]);
|
|
653
661
|
let files = event.dataTransfer ? event.dataTransfer.files : event.target.files;
|
|
654
662
|
for (let i = 0; i < files.length; i++) {
|
|
655
663
|
let file = files[i];
|
|
@@ -658,58 +666,58 @@ class FileUpload extends BaseComponent {
|
|
|
658
666
|
if (this.isImage(file)) {
|
|
659
667
|
file.objectURL = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(files[i]));
|
|
660
668
|
}
|
|
661
|
-
this.
|
|
669
|
+
this._files.update((currentFiles) => [...currentFiles, files[i]]);
|
|
662
670
|
}
|
|
663
671
|
}
|
|
664
672
|
}
|
|
665
|
-
this.onSelect.emit({ originalEvent: event, files: files, currentFiles: this.
|
|
673
|
+
this.onSelect.emit({ originalEvent: event, files: files, currentFiles: this._files() });
|
|
666
674
|
// this will check the fileLimit with the uploaded files
|
|
667
675
|
this.checkFileLimit(files);
|
|
668
|
-
if (this.hasFiles() && this.auto && (this.mode !== 'advanced' || !this.isFileLimitExceeded())) {
|
|
676
|
+
if (this.hasFiles() && this.auto() && (this.mode() !== 'advanced' || !this.isFileLimitExceeded())) {
|
|
669
677
|
this.upload();
|
|
670
678
|
}
|
|
671
|
-
|
|
672
|
-
this.clearIEInput();
|
|
673
|
-
}
|
|
674
|
-
else {
|
|
675
|
-
this.clearInputElement();
|
|
676
|
-
}
|
|
679
|
+
this.clearInputElement();
|
|
677
680
|
}
|
|
678
681
|
isFileSelected(file) {
|
|
679
|
-
for (let sFile of this.
|
|
682
|
+
for (let sFile of this._files()) {
|
|
680
683
|
if (sFile.name + sFile.type + sFile.size === file.name + file.type + file.size) {
|
|
681
684
|
return true;
|
|
682
685
|
}
|
|
683
686
|
}
|
|
684
687
|
return false;
|
|
685
688
|
}
|
|
686
|
-
isIE11() {
|
|
687
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
688
|
-
return !!this.document.defaultView['MSInputMethodContext'] && !!this.document['documentMode'];
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
689
|
validate(file) {
|
|
692
|
-
this.msgs
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
this.
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
690
|
+
this.msgs.update((msgs) => msgs || []);
|
|
691
|
+
const accept = this.accept();
|
|
692
|
+
if (accept && !this.isFileTypeValid(file)) {
|
|
693
|
+
const text = `${this.invalidFileTypeMessageSummary().replace('{0}', file.name)} ${this.invalidFileTypeMessageDetail().replace('{0}', accept)}`;
|
|
694
|
+
this.msgs.update((msgs) => [
|
|
695
|
+
...msgs,
|
|
696
|
+
{
|
|
697
|
+
severity: 'error',
|
|
698
|
+
text: text
|
|
699
|
+
}
|
|
700
|
+
]);
|
|
699
701
|
return false;
|
|
700
702
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
this.
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
703
|
+
const maxFileSize = this.maxFileSize();
|
|
704
|
+
if (maxFileSize && file.size > maxFileSize) {
|
|
705
|
+
const text = `${this.invalidFileSizeMessageSummary().replace('{0}', file.name)} ${this.invalidFileSizeMessageDetail().replace('{0}', this.formatSize(maxFileSize))}`;
|
|
706
|
+
this.msgs.update((msgs) => [
|
|
707
|
+
...msgs,
|
|
708
|
+
{
|
|
709
|
+
severity: 'error',
|
|
710
|
+
text: text
|
|
711
|
+
}
|
|
712
|
+
]);
|
|
707
713
|
return false;
|
|
708
714
|
}
|
|
709
715
|
return true;
|
|
710
716
|
}
|
|
711
717
|
isFileTypeValid(file) {
|
|
712
|
-
let acceptableTypes = this.accept
|
|
718
|
+
let acceptableTypes = this.accept()
|
|
719
|
+
?.split(',')
|
|
720
|
+
.map((type) => type.trim());
|
|
713
721
|
for (let type of acceptableTypes) {
|
|
714
722
|
let acceptable = this.isWildcard(type) ? this.getTypeClass(file.type) === this.getTypeClass(type) : file.type == type || this.getFileExtension(file).toLowerCase() === type.toLowerCase();
|
|
715
723
|
if (acceptable) {
|
|
@@ -730,40 +738,36 @@ class FileUpload extends BaseComponent {
|
|
|
730
738
|
isImage(file) {
|
|
731
739
|
return /^image\//.test(file.type);
|
|
732
740
|
}
|
|
733
|
-
onImageLoad(img) {
|
|
734
|
-
window.URL.revokeObjectURL(img.src);
|
|
735
|
-
}
|
|
736
741
|
/**
|
|
737
742
|
* Uploads the selected files.
|
|
738
743
|
* @group Method
|
|
739
744
|
*/
|
|
740
745
|
uploader() {
|
|
741
|
-
if (this.customUpload) {
|
|
742
|
-
if (this.fileLimit) {
|
|
743
|
-
this.uploadedFileCount
|
|
746
|
+
if (this.customUpload()) {
|
|
747
|
+
if (this.fileLimit()) {
|
|
748
|
+
this.uploadedFileCount.update((count) => count + this._files().length);
|
|
744
749
|
}
|
|
745
750
|
this.uploadHandler.emit({
|
|
746
|
-
files: this.
|
|
751
|
+
files: this._files()
|
|
747
752
|
});
|
|
748
|
-
this.cd.markForCheck();
|
|
749
753
|
}
|
|
750
754
|
else {
|
|
751
|
-
this.uploading
|
|
752
|
-
this.msgs
|
|
755
|
+
this.uploading.set(true);
|
|
756
|
+
this.msgs.set([]);
|
|
753
757
|
let formData = new FormData();
|
|
754
758
|
this.onBeforeUpload.emit({
|
|
755
759
|
formData: formData
|
|
756
760
|
});
|
|
757
|
-
for (let i = 0; i < this.
|
|
758
|
-
formData.append(this.name, this.
|
|
761
|
+
for (let i = 0; i < this._files().length; i++) {
|
|
762
|
+
formData.append(this.name(), this._files()[i], this._files()[i].name);
|
|
759
763
|
}
|
|
760
764
|
this.http
|
|
761
|
-
.request(this.method, this.url, {
|
|
765
|
+
.request(this.method(), this.url(), {
|
|
762
766
|
body: formData,
|
|
763
|
-
headers: this.headers,
|
|
767
|
+
headers: this.headers(),
|
|
764
768
|
reportProgress: true,
|
|
765
769
|
observe: 'events',
|
|
766
|
-
withCredentials: this.withCredentials
|
|
770
|
+
withCredentials: this.withCredentials()
|
|
767
771
|
})
|
|
768
772
|
.subscribe((event) => {
|
|
769
773
|
switch (event.type) {
|
|
@@ -774,32 +778,31 @@ class FileUpload extends BaseComponent {
|
|
|
774
778
|
});
|
|
775
779
|
break;
|
|
776
780
|
case HttpEventType.Response:
|
|
777
|
-
this.uploading
|
|
778
|
-
this.progress
|
|
781
|
+
this.uploading.set(false);
|
|
782
|
+
this.progress.set(0);
|
|
779
783
|
if (event['status'] >= 200 && event['status'] < 300) {
|
|
780
|
-
if (this.fileLimit) {
|
|
781
|
-
this.uploadedFileCount
|
|
784
|
+
if (this.fileLimit()) {
|
|
785
|
+
this.uploadedFileCount.update((count) => count + this._files().length);
|
|
782
786
|
}
|
|
783
|
-
this.onUpload.emit({ originalEvent: event, files: this.
|
|
787
|
+
this.onUpload.emit({ originalEvent: event, files: this._files() });
|
|
784
788
|
}
|
|
785
789
|
else {
|
|
786
|
-
this.onError.emit({ files: this.
|
|
790
|
+
this.onError.emit({ files: this._files() });
|
|
787
791
|
}
|
|
788
|
-
this.uploadedFiles
|
|
792
|
+
this.uploadedFiles.update((uploadedFiles) => [...uploadedFiles, ...this._files()]);
|
|
789
793
|
this.clear();
|
|
790
794
|
break;
|
|
791
795
|
case HttpEventType.UploadProgress: {
|
|
792
796
|
if (event['loaded']) {
|
|
793
|
-
this.progress
|
|
797
|
+
this.progress.set(Math.round((event['loaded'] * 100) / event['total']));
|
|
794
798
|
}
|
|
795
|
-
this.onProgress.emit({ originalEvent: event, progress: this.progress });
|
|
799
|
+
this.onProgress.emit({ originalEvent: event, progress: this.progress() });
|
|
796
800
|
break;
|
|
797
801
|
}
|
|
798
802
|
}
|
|
799
|
-
this.cd.markForCheck();
|
|
800
803
|
}, (error) => {
|
|
801
|
-
this.uploading
|
|
802
|
-
this.onError.emit({ files: this.
|
|
804
|
+
this.uploading.set(false);
|
|
805
|
+
this.onError.emit({ files: this._files(), error: error });
|
|
803
806
|
});
|
|
804
807
|
}
|
|
805
808
|
}
|
|
@@ -820,11 +823,10 @@ class FileUpload extends BaseComponent {
|
|
|
820
823
|
* @group Method
|
|
821
824
|
*/
|
|
822
825
|
clear() {
|
|
823
|
-
this.
|
|
826
|
+
this._files.set([]);
|
|
824
827
|
this.onClear.emit(undefined);
|
|
825
828
|
this.clearInputElement();
|
|
826
|
-
this.msgs
|
|
827
|
-
this.cd.markForCheck();
|
|
829
|
+
this.msgs.set([]);
|
|
828
830
|
}
|
|
829
831
|
/**
|
|
830
832
|
* Removes a single file.
|
|
@@ -834,9 +836,9 @@ class FileUpload extends BaseComponent {
|
|
|
834
836
|
*/
|
|
835
837
|
remove(event, index) {
|
|
836
838
|
this.clearInputElement();
|
|
837
|
-
this.onRemove.emit({ originalEvent: event, file: this.
|
|
838
|
-
this.files.
|
|
839
|
-
this.checkFileLimit(this.
|
|
839
|
+
this.onRemove.emit({ originalEvent: event, file: this._files()[index] });
|
|
840
|
+
this._files.update((files) => files.filter((_, i) => i !== index));
|
|
841
|
+
this.checkFileLimit(this._files());
|
|
840
842
|
}
|
|
841
843
|
/**
|
|
842
844
|
* Removes uploaded file.
|
|
@@ -844,38 +846,43 @@ class FileUpload extends BaseComponent {
|
|
|
844
846
|
* @group Method
|
|
845
847
|
*/
|
|
846
848
|
removeUploadedFile(index) {
|
|
847
|
-
let removedFile = this.uploadedFiles
|
|
848
|
-
this.uploadedFiles
|
|
849
|
-
this.onRemoveUploadedFile.emit({ file: removedFile, files: this.uploadedFiles });
|
|
849
|
+
let removedFile = this.uploadedFiles()[index];
|
|
850
|
+
this.uploadedFiles.update((uploadedFiles) => uploadedFiles.filter((_, i) => i !== index));
|
|
851
|
+
this.onRemoveUploadedFile.emit({ file: removedFile, files: this.uploadedFiles() });
|
|
850
852
|
}
|
|
851
|
-
isFileLimitExceeded() {
|
|
852
|
-
const isAutoMode = this.auto;
|
|
853
|
-
const totalFileCount = isAutoMode ? this.
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
if (this.auto) {
|
|
861
|
-
return
|
|
853
|
+
isFileLimitExceeded = computed(() => {
|
|
854
|
+
const isAutoMode = this.auto();
|
|
855
|
+
const totalFileCount = isAutoMode ? this._files().length : this._files().length + this.uploadedFileCount();
|
|
856
|
+
const fileLimit = this.fileLimit();
|
|
857
|
+
return fileLimit && fileLimit < totalFileCount;
|
|
858
|
+
}, /* @ts-ignore */
|
|
859
|
+
...(ngDevMode ? [{ debugName: "isFileLimitExceeded" }] : /* istanbul ignore next */ []));
|
|
860
|
+
isChooseDisabled = computed(() => {
|
|
861
|
+
const fileLimit = this.fileLimit();
|
|
862
|
+
if (this.auto()) {
|
|
863
|
+
return fileLimit && fileLimit <= this._files().length;
|
|
862
864
|
}
|
|
863
865
|
else {
|
|
864
|
-
return
|
|
866
|
+
return fileLimit && fileLimit <= this._files().length + this.uploadedFileCount();
|
|
865
867
|
}
|
|
866
|
-
}
|
|
868
|
+
}, /* @ts-ignore */
|
|
869
|
+
...(ngDevMode ? [{ debugName: "isChooseDisabled" }] : /* istanbul ignore next */ []));
|
|
867
870
|
checkFileLimit(files) {
|
|
868
|
-
this.msgs
|
|
869
|
-
const
|
|
871
|
+
this.msgs.update((msgs) => msgs ?? []);
|
|
872
|
+
const fileLimit = this.fileLimit();
|
|
873
|
+
const hasExistingValidationMessages = this.msgs().length > 0 && fileLimit && fileLimit < files.length;
|
|
870
874
|
if (this.isFileLimitExceeded() || hasExistingValidationMessages) {
|
|
871
|
-
const text = `${this.invalidFileLimitMessageSummary.replace('{0}',
|
|
872
|
-
this.msgs.
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
875
|
+
const text = `${this.invalidFileLimitMessageSummary().replace('{0}', fileLimit.toString())} ${this.invalidFileLimitMessageDetail().replace('{0}', fileLimit.toString())}`;
|
|
876
|
+
this.msgs.update((msgs) => [
|
|
877
|
+
...msgs,
|
|
878
|
+
{
|
|
879
|
+
severity: 'error',
|
|
880
|
+
text: text
|
|
881
|
+
}
|
|
882
|
+
]);
|
|
876
883
|
}
|
|
877
884
|
else {
|
|
878
|
-
this.msgs
|
|
885
|
+
this.msgs.update((msgs) => msgs.filter((msg) => !msg.text.includes(this.invalidFileLimitMessageSummary())));
|
|
879
886
|
}
|
|
880
887
|
}
|
|
881
888
|
clearInputElement() {
|
|
@@ -888,58 +895,48 @@ class FileUpload extends BaseComponent {
|
|
|
888
895
|
basicFileInput.nativeElement.value = '';
|
|
889
896
|
}
|
|
890
897
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
advancedFileInput.nativeElement.value = '';
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
hasFiles() {
|
|
899
|
-
return this.files && this.files.length > 0;
|
|
900
|
-
}
|
|
901
|
-
hasUploadedFiles() {
|
|
902
|
-
return this.uploadedFiles && this.uploadedFiles.length > 0;
|
|
903
|
-
}
|
|
898
|
+
hasFiles = computed(() => this._files() && this._files().length > 0, /* @ts-ignore */
|
|
899
|
+
...(ngDevMode ? [{ debugName: "hasFiles" }] : /* istanbul ignore next */ []));
|
|
900
|
+
hasUploadedFiles = computed(() => this.uploadedFiles() && this.uploadedFiles().length > 0, /* @ts-ignore */
|
|
901
|
+
...(ngDevMode ? [{ debugName: "hasUploadedFiles" }] : /* istanbul ignore next */ []));
|
|
904
902
|
onDragEnter(e) {
|
|
905
|
-
if (!this.disabled) {
|
|
903
|
+
if (!this.disabled()) {
|
|
906
904
|
e.stopPropagation();
|
|
907
905
|
e.preventDefault();
|
|
908
906
|
}
|
|
909
907
|
}
|
|
910
908
|
onDragOver(e) {
|
|
911
|
-
if (!this.disabled) {
|
|
909
|
+
if (!this.disabled()) {
|
|
912
910
|
!this.$unstyled() && addClass(this.content()?.nativeElement, 'p-fileupload-highlight');
|
|
913
911
|
this.content()?.nativeElement.setAttribute('data-p-highlight', true);
|
|
914
|
-
this.dragHighlight = true;
|
|
915
912
|
e.stopPropagation();
|
|
916
913
|
e.preventDefault();
|
|
917
914
|
}
|
|
918
915
|
}
|
|
919
916
|
onDragLeave(event) {
|
|
920
|
-
if (!this.disabled) {
|
|
917
|
+
if (!this.disabled()) {
|
|
921
918
|
!this.$unstyled() && removeClass(this.content()?.nativeElement, 'p-fileupload-highlight');
|
|
922
919
|
this.content()?.nativeElement.setAttribute('data-p-highlight', false);
|
|
923
920
|
}
|
|
924
921
|
}
|
|
925
922
|
onDrop(event) {
|
|
926
|
-
if (!this.disabled) {
|
|
923
|
+
if (!this.disabled()) {
|
|
927
924
|
!this.$unstyled() && removeClass(this.content()?.nativeElement, 'p-fileupload-highlight');
|
|
928
925
|
this.content()?.nativeElement.setAttribute('data-p-highlight', false);
|
|
929
926
|
event.stopPropagation();
|
|
930
927
|
event.preventDefault();
|
|
931
928
|
let files = event.dataTransfer ? event.dataTransfer.files : event.target.files;
|
|
932
|
-
let allowDrop = this.multiple || (files && files.length === 1);
|
|
929
|
+
let allowDrop = this.multiple() || (files && files.length === 1);
|
|
933
930
|
if (allowDrop) {
|
|
934
931
|
this.onFileSelect(event);
|
|
935
932
|
}
|
|
936
933
|
}
|
|
937
934
|
}
|
|
938
935
|
onFocus() {
|
|
939
|
-
this.focus
|
|
936
|
+
this.focus.set(true);
|
|
940
937
|
}
|
|
941
938
|
onBlur() {
|
|
942
|
-
this.focus
|
|
939
|
+
this.focus.set(false);
|
|
943
940
|
}
|
|
944
941
|
formatSize(bytes) {
|
|
945
942
|
const k = 1024;
|
|
@@ -974,109 +971,112 @@ class FileUpload extends BaseComponent {
|
|
|
974
971
|
getBlockableElement() {
|
|
975
972
|
return this.el.nativeElement.children[0];
|
|
976
973
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
return this.config.getTranslation(TranslationKeys.ARIA)[TranslationKeys.BROWSE_FILES];
|
|
988
|
-
}
|
|
989
|
-
get pendingLabel() {
|
|
990
|
-
return this.config.getTranslation(TranslationKeys.PENDING);
|
|
991
|
-
}
|
|
974
|
+
chooseButtonLabel = computed(() => this.chooseLabel() || this.translation()[TranslationKeys.CHOOSE], /* @ts-ignore */
|
|
975
|
+
...(ngDevMode ? [{ debugName: "chooseButtonLabel" }] : /* istanbul ignore next */ []));
|
|
976
|
+
uploadButtonLabel = computed(() => this.uploadLabel() || this.translation()[TranslationKeys.UPLOAD], /* @ts-ignore */
|
|
977
|
+
...(ngDevMode ? [{ debugName: "uploadButtonLabel" }] : /* istanbul ignore next */ []));
|
|
978
|
+
cancelButtonLabel = computed(() => this.cancelLabel() || this.translation()[TranslationKeys.CANCEL], /* @ts-ignore */
|
|
979
|
+
...(ngDevMode ? [{ debugName: "cancelButtonLabel" }] : /* istanbul ignore next */ []));
|
|
980
|
+
browseFilesLabel = computed(() => this.translation()[TranslationKeys.ARIA][TranslationKeys.BROWSE_FILES], /* @ts-ignore */
|
|
981
|
+
...(ngDevMode ? [{ debugName: "browseFilesLabel" }] : /* istanbul ignore next */ []));
|
|
982
|
+
pendingLabel = computed(() => this.translation()[TranslationKeys.PENDING], /* @ts-ignore */
|
|
983
|
+
...(ngDevMode ? [{ debugName: "pendingLabel" }] : /* istanbul ignore next */ []));
|
|
992
984
|
onDestroy() {
|
|
993
985
|
const content = this.content();
|
|
994
986
|
if (content && content.nativeElement) {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
987
|
+
const dragOverListener = this.dragOverListener();
|
|
988
|
+
if (dragOverListener) {
|
|
989
|
+
dragOverListener();
|
|
990
|
+
this.dragOverListener.set(null);
|
|
998
991
|
}
|
|
999
992
|
}
|
|
1000
|
-
if (this.translationSubscription) {
|
|
1001
|
-
this.translationSubscription.unsubscribe();
|
|
1002
|
-
}
|
|
1003
993
|
}
|
|
1004
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: FileUpload, deps:
|
|
1005
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: FileUpload, isStandalone: true, selector: "p-fileupload, p-fileUpload", inputs: { name: "name", url: "url", method: "method", multiple:
|
|
1006
|
-
<div [class]="cn(cx('root'), styleClass)" [ngStyle]="style" *ngIf="mode === 'advanced'" [pBind]="ptm('root')">
|
|
1007
|
-
<input
|
|
994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: FileUpload, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
995
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: FileUpload, isStandalone: true, selector: "p-fileupload, p-fileUpload", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, method: { classPropertyName: "method", publicName: "method", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, auto: { classPropertyName: "auto", publicName: "auto", isSignal: true, isRequired: false, transformFunction: null }, withCredentials: { classPropertyName: "withCredentials", publicName: "withCredentials", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, invalidFileSizeMessageSummary: { classPropertyName: "invalidFileSizeMessageSummary", publicName: "invalidFileSizeMessageSummary", isSignal: true, isRequired: false, transformFunction: null }, invalidFileSizeMessageDetail: { classPropertyName: "invalidFileSizeMessageDetail", publicName: "invalidFileSizeMessageDetail", isSignal: true, isRequired: false, transformFunction: null }, invalidFileTypeMessageSummary: { classPropertyName: "invalidFileTypeMessageSummary", publicName: "invalidFileTypeMessageSummary", isSignal: true, isRequired: false, transformFunction: null }, invalidFileTypeMessageDetail: { classPropertyName: "invalidFileTypeMessageDetail", publicName: "invalidFileTypeMessageDetail", isSignal: true, isRequired: false, transformFunction: null }, invalidFileLimitMessageDetail: { classPropertyName: "invalidFileLimitMessageDetail", publicName: "invalidFileLimitMessageDetail", isSignal: true, isRequired: false, transformFunction: null }, invalidFileLimitMessageSummary: { classPropertyName: "invalidFileLimitMessageSummary", publicName: "invalidFileLimitMessageSummary", isSignal: true, isRequired: false, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, previewWidth: { classPropertyName: "previewWidth", publicName: "previewWidth", isSignal: true, isRequired: false, transformFunction: null }, chooseLabel: { classPropertyName: "chooseLabel", publicName: "chooseLabel", isSignal: true, isRequired: false, transformFunction: null }, uploadLabel: { classPropertyName: "uploadLabel", publicName: "uploadLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, chooseIcon: { classPropertyName: "chooseIcon", publicName: "chooseIcon", isSignal: true, isRequired: false, transformFunction: null }, uploadIcon: { classPropertyName: "uploadIcon", publicName: "uploadIcon", isSignal: true, isRequired: false, transformFunction: null }, cancelIcon: { classPropertyName: "cancelIcon", publicName: "cancelIcon", isSignal: true, isRequired: false, transformFunction: null }, showUploadButton: { classPropertyName: "showUploadButton", publicName: "showUploadButton", isSignal: true, isRequired: false, transformFunction: null }, showCancelButton: { classPropertyName: "showCancelButton", publicName: "showCancelButton", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, headers: { classPropertyName: "headers", publicName: "headers", isSignal: true, isRequired: false, transformFunction: null }, customUpload: { classPropertyName: "customUpload", publicName: "customUpload", isSignal: true, isRequired: false, transformFunction: null }, fileLimit: { classPropertyName: "fileLimit", publicName: "fileLimit", isSignal: true, isRequired: false, transformFunction: null }, uploadStyleClass: { classPropertyName: "uploadStyleClass", publicName: "uploadStyleClass", isSignal: true, isRequired: false, transformFunction: null }, cancelStyleClass: { classPropertyName: "cancelStyleClass", publicName: "cancelStyleClass", isSignal: true, isRequired: false, transformFunction: null }, chooseStyleClass: { classPropertyName: "chooseStyleClass", publicName: "chooseStyleClass", isSignal: true, isRequired: false, transformFunction: null }, chooseButtonProps: { classPropertyName: "chooseButtonProps", publicName: "chooseButtonProps", isSignal: true, isRequired: false, transformFunction: null }, uploadButtonProps: { classPropertyName: "uploadButtonProps", publicName: "uploadButtonProps", isSignal: true, isRequired: false, transformFunction: null }, cancelButtonProps: { classPropertyName: "cancelButtonProps", publicName: "cancelButtonProps", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onBeforeUpload: "onBeforeUpload", onSend: "onSend", onUpload: "onUpload", onError: "onError", onClear: "onClear", onRemove: "onRemove", onSelect: "onSelect", onProgress: "onProgress", uploadHandler: "uploadHandler", onImageError: "onImageError", onRemoveUploadedFile: "onRemoveUploadedFile" }, providers: [FileUploadStyle, { provide: FILEUPLOAD_INSTANCE, useExisting: FileUpload }, { provide: PARENT_INSTANCE, useExisting: FileUpload }], queries: [{ propertyName: "fileTemplate", first: true, predicate: ["file"], isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ["header"], isSignal: true }, { propertyName: "contentTemplate", first: true, predicate: ["content"], isSignal: true }, { propertyName: "toolbarTemplate", first: true, predicate: ["toolbar"], isSignal: true }, { propertyName: "chooseIconTemplate", first: true, predicate: ["chooseicon"], isSignal: true }, { propertyName: "fileLabelTemplate", first: true, predicate: ["filelabel"], isSignal: true }, { propertyName: "uploadIconTemplate", first: true, predicate: ["uploadicon"], isSignal: true }, { propertyName: "cancelIconTemplate", first: true, predicate: ["cancelicon"], isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: ["empty"], isSignal: true }, { propertyName: "templates", predicate: PrimeTemplate, isSignal: true }], viewQueries: [{ propertyName: "advancedFileInput", first: true, predicate: ["advancedfileinput"], descendants: true, isSignal: true }, { propertyName: "basicFileInput", first: true, predicate: ["basicfileinput"], descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true, isSignal: true }], usesInheritance: true, hostDirectives: [{ directive: i2.Bind }], ngImport: i0, template: `
|
|
996
|
+
<div [class]="cn(cx('root'), styleClass())" [ngStyle]="style()" *ngIf="mode() === 'advanced'" [pBind]="ptm('root')">
|
|
997
|
+
<input
|
|
998
|
+
[attr.aria-label]="browseFilesLabel()"
|
|
999
|
+
#advancedfileinput
|
|
1000
|
+
type="file"
|
|
1001
|
+
(change)="onFileSelect($event)"
|
|
1002
|
+
[multiple]="multiple()"
|
|
1003
|
+
[accept]="accept()"
|
|
1004
|
+
[disabled]="disabled() || isChooseDisabled()"
|
|
1005
|
+
[attr.title]="''"
|
|
1006
|
+
[pBind]="ptm('input')"
|
|
1007
|
+
/>
|
|
1008
1008
|
<div [class]="cx('header')" [pBind]="ptm('header')">
|
|
1009
|
-
<ng-container *ngIf="!headerTemplate() && !_headerTemplate">
|
|
1009
|
+
<ng-container *ngIf="!headerTemplate() && !_headerTemplate()">
|
|
1010
1010
|
<p-button
|
|
1011
|
-
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass)"
|
|
1012
|
-
[disabled]="disabled || isChooseDisabled()"
|
|
1011
|
+
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass())"
|
|
1012
|
+
[disabled]="disabled() || isChooseDisabled()"
|
|
1013
1013
|
(focus)="onFocus()"
|
|
1014
|
-
[label]="chooseButtonLabel"
|
|
1014
|
+
[label]="chooseButtonLabel()"
|
|
1015
1015
|
(blur)="onBlur()"
|
|
1016
1016
|
(onClick)="choose()"
|
|
1017
1017
|
(keydown.enter)="choose()"
|
|
1018
|
-
[buttonProps]="chooseButtonProps"
|
|
1018
|
+
[buttonProps]="chooseButtonProps()"
|
|
1019
1019
|
[pt]="ptm('pcChooseButton')"
|
|
1020
1020
|
[unstyled]="unstyled()"
|
|
1021
1021
|
>
|
|
1022
1022
|
<input
|
|
1023
|
-
[attr.aria-label]="browseFilesLabel"
|
|
1023
|
+
[attr.aria-label]="browseFilesLabel()"
|
|
1024
1024
|
#advancedfileinput
|
|
1025
1025
|
type="file"
|
|
1026
1026
|
(change)="onFileSelect($event)"
|
|
1027
|
-
[multiple]="multiple"
|
|
1028
|
-
[accept]="accept"
|
|
1029
|
-
[disabled]="disabled || isChooseDisabled()"
|
|
1027
|
+
[multiple]="multiple()"
|
|
1028
|
+
[accept]="accept()"
|
|
1029
|
+
[disabled]="disabled() || isChooseDisabled()"
|
|
1030
1030
|
[attr.title]="''"
|
|
1031
1031
|
[pBind]="ptm('input')"
|
|
1032
1032
|
/>
|
|
1033
1033
|
<ng-template #icon>
|
|
1034
|
-
<span *ngIf="chooseIcon" [class]="chooseIcon" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1035
|
-
<ng-container *ngIf="!chooseIcon">
|
|
1036
|
-
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1037
|
-
<span *ngIf="chooseIconTemplate() || _chooseIconTemplate" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1038
|
-
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate"></ng-template>
|
|
1034
|
+
<span *ngIf="chooseIcon()" [class]="chooseIcon()" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1035
|
+
<ng-container *ngIf="!chooseIcon()">
|
|
1036
|
+
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate()" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1037
|
+
<span *ngIf="chooseIconTemplate() || _chooseIconTemplate()" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1038
|
+
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate()"></ng-template>
|
|
1039
1039
|
</span>
|
|
1040
1040
|
</ng-container>
|
|
1041
1041
|
</ng-template>
|
|
1042
1042
|
</p-button>
|
|
1043
1043
|
|
|
1044
1044
|
<p-button
|
|
1045
|
-
*ngIf="!auto && showUploadButton"
|
|
1046
|
-
[label]="uploadButtonLabel"
|
|
1045
|
+
*ngIf="!auto() && showUploadButton()"
|
|
1046
|
+
[label]="uploadButtonLabel()"
|
|
1047
1047
|
(onClick)="upload()"
|
|
1048
1048
|
[disabled]="!hasFiles() || isFileLimitExceeded()"
|
|
1049
|
-
[styleClass]="cn(cx('pcUploadButton'), uploadStyleClass)"
|
|
1050
|
-
[buttonProps]="uploadButtonProps"
|
|
1049
|
+
[styleClass]="cn(cx('pcUploadButton'), uploadStyleClass())"
|
|
1050
|
+
[buttonProps]="uploadButtonProps()"
|
|
1051
1051
|
[pt]="ptm('pcUploadButton')"
|
|
1052
1052
|
[unstyled]="unstyled()"
|
|
1053
1053
|
>
|
|
1054
1054
|
<ng-template #icon>
|
|
1055
|
-
<span *ngIf="uploadIcon" [ngClass]="uploadIcon" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon"></span>
|
|
1056
|
-
<ng-container *ngIf="!uploadIcon">
|
|
1057
|
-
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate" [pBind]="ptm('pcUploadButton')?.icon" />
|
|
1058
|
-
<span *ngIf="uploadIconTemplate() || _uploadIconTemplate" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon">
|
|
1059
|
-
<ng-template *ngTemplateOutlet="uploadIconTemplate() || _uploadIconTemplate"></ng-template>
|
|
1055
|
+
<span *ngIf="uploadIcon()" [ngClass]="uploadIcon()" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon"></span>
|
|
1056
|
+
<ng-container *ngIf="!uploadIcon()">
|
|
1057
|
+
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate()" [pBind]="ptm('pcUploadButton')?.icon" />
|
|
1058
|
+
<span *ngIf="uploadIconTemplate() || _uploadIconTemplate()" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon">
|
|
1059
|
+
<ng-template *ngTemplateOutlet="uploadIconTemplate() || _uploadIconTemplate()"></ng-template>
|
|
1060
1060
|
</span>
|
|
1061
1061
|
</ng-container>
|
|
1062
1062
|
</ng-template>
|
|
1063
1063
|
</p-button>
|
|
1064
1064
|
<p-button
|
|
1065
|
-
*ngIf="!auto && showCancelButton"
|
|
1066
|
-
[label]="cancelButtonLabel"
|
|
1065
|
+
*ngIf="!auto() && showCancelButton()"
|
|
1066
|
+
[label]="cancelButtonLabel()"
|
|
1067
1067
|
(onClick)="clear()"
|
|
1068
|
-
[disabled]="!hasFiles() || uploading"
|
|
1069
|
-
[styleClass]="cn(cx('pcCancelButton'), cancelStyleClass)"
|
|
1070
|
-
[buttonProps]="cancelButtonProps"
|
|
1068
|
+
[disabled]="!hasFiles() || uploading()"
|
|
1069
|
+
[styleClass]="cn(cx('pcCancelButton'), cancelStyleClass())"
|
|
1070
|
+
[buttonProps]="cancelButtonProps()"
|
|
1071
1071
|
[pt]="ptm('pcCancelButton')"
|
|
1072
1072
|
[unstyled]="unstyled()"
|
|
1073
1073
|
>
|
|
1074
1074
|
<ng-template #icon>
|
|
1075
|
-
<span *ngIf="cancelIcon" [ngClass]="cancelIcon"></span>
|
|
1076
|
-
<ng-container *ngIf="!cancelIcon">
|
|
1077
|
-
<svg data-p-icon="times" *ngIf="!cancelIconTemplate() && !_cancelIconTemplate" [attr.aria-hidden]="true" />
|
|
1078
|
-
<span *ngIf="cancelIconTemplate() || _cancelIconTemplate" [attr.aria-hidden]="true">
|
|
1079
|
-
<ng-template *ngTemplateOutlet="cancelIconTemplate() || _cancelIconTemplate"></ng-template>
|
|
1075
|
+
<span *ngIf="cancelIcon()" [ngClass]="cancelIcon()"></span>
|
|
1076
|
+
<ng-container *ngIf="!cancelIcon()">
|
|
1077
|
+
<svg data-p-icon="times" *ngIf="!cancelIconTemplate() && !_cancelIconTemplate()" [attr.aria-hidden]="true" />
|
|
1078
|
+
<span *ngIf="cancelIconTemplate() || _cancelIconTemplate()" [attr.aria-hidden]="true">
|
|
1079
|
+
<ng-template *ngTemplateOutlet="cancelIconTemplate() || _cancelIconTemplate()"></ng-template>
|
|
1080
1080
|
</span>
|
|
1081
1081
|
</ng-container>
|
|
1082
1082
|
</ng-template>
|
|
@@ -1084,210 +1084,230 @@ class FileUpload extends BaseComponent {
|
|
|
1084
1084
|
</ng-container>
|
|
1085
1085
|
<ng-container
|
|
1086
1086
|
*ngTemplateOutlet="
|
|
1087
|
-
headerTemplate() || _headerTemplate;
|
|
1087
|
+
headerTemplate() || _headerTemplate();
|
|
1088
1088
|
context: {
|
|
1089
|
-
$implicit:
|
|
1090
|
-
uploadedFiles: uploadedFiles,
|
|
1089
|
+
$implicit: _files(),
|
|
1090
|
+
uploadedFiles: uploadedFiles(),
|
|
1091
1091
|
chooseCallback: choose.bind(this),
|
|
1092
1092
|
clearCallback: clear.bind(this),
|
|
1093
1093
|
uploadCallback: upload.bind(this)
|
|
1094
1094
|
}
|
|
1095
1095
|
"
|
|
1096
1096
|
></ng-container>
|
|
1097
|
-
<ng-container *ngTemplateOutlet="toolbarTemplate() || _toolbarTemplate"></ng-container>
|
|
1097
|
+
<ng-container *ngTemplateOutlet="toolbarTemplate() || _toolbarTemplate()"></ng-container>
|
|
1098
1098
|
</div>
|
|
1099
1099
|
<div #content [class]="cx('content')" (dragenter)="onDragEnter($event)" (dragleave)="onDragLeave($event)" (drop)="onDrop($event)" [pBind]="ptm('content')">
|
|
1100
|
-
@if (contentTemplate() || _contentTemplate) {
|
|
1100
|
+
@if (contentTemplate() || _contentTemplate()) {
|
|
1101
1101
|
<ng-container
|
|
1102
1102
|
*ngTemplateOutlet="
|
|
1103
|
-
contentTemplate() || _contentTemplate;
|
|
1103
|
+
contentTemplate() || _contentTemplate();
|
|
1104
1104
|
context: {
|
|
1105
|
-
$implicit:
|
|
1106
|
-
uploadedFiles: uploadedFiles,
|
|
1105
|
+
$implicit: _files(),
|
|
1106
|
+
uploadedFiles: uploadedFiles(),
|
|
1107
1107
|
chooseCallback: choose.bind(this),
|
|
1108
1108
|
clearCallback: clear.bind(this),
|
|
1109
1109
|
removeUploadedFileCallback: removeUploadedFile.bind(this),
|
|
1110
1110
|
removeFileCallback: remove.bind(this),
|
|
1111
|
-
progress: progress,
|
|
1112
|
-
messages: msgs
|
|
1111
|
+
progress: progress(),
|
|
1112
|
+
messages: msgs()
|
|
1113
1113
|
}
|
|
1114
1114
|
"
|
|
1115
1115
|
></ng-container>
|
|
1116
1116
|
} @else {
|
|
1117
|
-
<p-progressbar [value]="progress" [showValue]="false" *ngIf="hasFiles()" [pt]="ptm('pcProgressBar')"></p-progressbar>
|
|
1118
|
-
@for (message of msgs; track message) {
|
|
1117
|
+
<p-progressbar [value]="progress()" [showValue]="false" *ngIf="hasFiles()" [pt]="ptm('pcProgressBar')"></p-progressbar>
|
|
1118
|
+
@for (message of msgs(); track message) {
|
|
1119
1119
|
<p-message [severity]="message.severity" [text]="message.text" [pt]="ptm('pcMessage')" [unstyled]="unstyled()"></p-message>
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
1122
|
@if (hasFiles()) {
|
|
1123
1123
|
<div [class]="cx('fileList')" [pBind]="ptm('fileList')">
|
|
1124
|
-
<ng-template ngFor [ngForOf]="
|
|
1125
|
-
@if (!fileTemplate() && !_fileTemplate) {
|
|
1124
|
+
<ng-template ngFor [ngForOf]="_files()" [ngForTemplate]="fileTemplate() || _fileTemplate()"></ng-template>
|
|
1125
|
+
@if (!fileTemplate() && !_fileTemplate()) {
|
|
1126
1126
|
<div
|
|
1127
1127
|
pFileContent
|
|
1128
1128
|
[unstyled]="unstyled()"
|
|
1129
|
-
[files]="
|
|
1129
|
+
[files]="_files()"
|
|
1130
1130
|
(onRemove)="onRemoveClick($event)"
|
|
1131
|
-
[badgeValue]="pendingLabel"
|
|
1132
|
-
[previewWidth]="previewWidth"
|
|
1133
|
-
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate"
|
|
1131
|
+
[badgeValue]="pendingLabel()"
|
|
1132
|
+
[previewWidth]="previewWidth()"
|
|
1133
|
+
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate()"
|
|
1134
1134
|
></div>
|
|
1135
1135
|
}
|
|
1136
1136
|
</div>
|
|
1137
1137
|
}
|
|
1138
1138
|
@if (hasUploadedFiles()) {
|
|
1139
1139
|
<div [class]="cx('fileList')" [pBind]="ptm('fileList')">
|
|
1140
|
-
<ng-template ngFor [ngForOf]="uploadedFiles" [ngForTemplate]="fileTemplate() || _fileTemplate"></ng-template>
|
|
1141
|
-
@if (!fileTemplate() && !_fileTemplate) {
|
|
1140
|
+
<ng-template ngFor [ngForOf]="uploadedFiles()" [ngForTemplate]="fileTemplate() || _fileTemplate()"></ng-template>
|
|
1141
|
+
@if (!fileTemplate() && !_fileTemplate()) {
|
|
1142
1142
|
<div
|
|
1143
1143
|
pFileContent
|
|
1144
1144
|
[unstyled]="unstyled()"
|
|
1145
|
-
[files]="uploadedFiles"
|
|
1145
|
+
[files]="uploadedFiles()"
|
|
1146
1146
|
(onRemove)="onRemoveUploadedFileClick($event)"
|
|
1147
1147
|
[badgeValue]="completedLabel()"
|
|
1148
1148
|
badgeSeverity="success"
|
|
1149
|
-
[previewWidth]="previewWidth"
|
|
1150
|
-
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate"
|
|
1149
|
+
[previewWidth]="previewWidth()"
|
|
1150
|
+
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate()"
|
|
1151
1151
|
></div>
|
|
1152
1152
|
}
|
|
1153
1153
|
</div>
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
|
-
@if ((emptyTemplate() || _emptyTemplate) && !hasFiles() && !hasUploadedFiles()) {
|
|
1157
|
-
<ng-container *ngTemplateOutlet="emptyTemplate() || _emptyTemplate" [pBind]="ptm('empty')"></ng-container>
|
|
1156
|
+
@if ((emptyTemplate() || _emptyTemplate()) && !hasFiles() && !hasUploadedFiles()) {
|
|
1157
|
+
<ng-container *ngTemplateOutlet="emptyTemplate() || _emptyTemplate()" [pBind]="ptm('empty')"></ng-container>
|
|
1158
1158
|
}
|
|
1159
1159
|
</div>
|
|
1160
1160
|
</div>
|
|
1161
|
-
<div [class]="cn(cx('root'), styleClass)" *ngIf="mode === 'basic'" [pBind]="ptm('root')">
|
|
1162
|
-
@for (message of msgs; track message) {
|
|
1161
|
+
<div [class]="cn(cx('root'), styleClass())" *ngIf="mode() === 'basic'" [pBind]="ptm('root')">
|
|
1162
|
+
@for (message of msgs(); track message) {
|
|
1163
1163
|
<p-message [severity]="message.severity" [text]="message.text" [pt]="ptm('pcMessage')" [unstyled]="unstyled()"></p-message>
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
1166
|
<div [class]="cx('basicContent')" [pBind]="ptm('basicContent')">
|
|
1167
1167
|
<p-button
|
|
1168
|
-
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass)"
|
|
1169
|
-
[disabled]="disabled"
|
|
1170
|
-
[label]="chooseButtonLabel"
|
|
1171
|
-
[style]="style"
|
|
1168
|
+
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass())"
|
|
1169
|
+
[disabled]="disabled()"
|
|
1170
|
+
[label]="chooseButtonLabel()"
|
|
1171
|
+
[style]="style()"
|
|
1172
1172
|
(onClick)="onBasicUploaderClick()"
|
|
1173
1173
|
(keydown)="onBasicKeydown($event)"
|
|
1174
|
-
[buttonProps]="chooseButtonProps"
|
|
1174
|
+
[buttonProps]="chooseButtonProps()"
|
|
1175
1175
|
[pt]="ptm('pcChooseButton')"
|
|
1176
1176
|
[unstyled]="unstyled()"
|
|
1177
1177
|
>
|
|
1178
1178
|
<ng-template #icon>
|
|
1179
|
-
@if (hasFiles() && !auto) {
|
|
1180
|
-
<span *ngIf="uploadIcon" class="p-button-icon p-button-icon-left" [ngClass]="uploadIcon" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1181
|
-
<ng-container *ngIf="!uploadIcon">
|
|
1182
|
-
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate" [class]="'p-button-icon p-button-icon-left'" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1183
|
-
<span *ngIf="_uploadIconTemplate || uploadIconTemplate()" class="p-button-icon p-button-icon-left" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1184
|
-
<ng-template *ngTemplateOutlet="_uploadIconTemplate || uploadIconTemplate()"></ng-template>
|
|
1179
|
+
@if (hasFiles() && !auto()) {
|
|
1180
|
+
<span *ngIf="uploadIcon()" class="p-button-icon p-button-icon-left" [ngClass]="uploadIcon()" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1181
|
+
<ng-container *ngIf="!uploadIcon()">
|
|
1182
|
+
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate()" [class]="'p-button-icon p-button-icon-left'" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1183
|
+
<span *ngIf="_uploadIconTemplate() || uploadIconTemplate()" class="p-button-icon p-button-icon-left" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1184
|
+
<ng-template *ngTemplateOutlet="_uploadIconTemplate() || uploadIconTemplate()"></ng-template>
|
|
1185
1185
|
</span>
|
|
1186
1186
|
</ng-container>
|
|
1187
1187
|
} @else {
|
|
1188
|
-
<span *ngIf="chooseIcon" class="p-button-icon p-button-icon-left pi" [ngClass]="chooseIcon" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1189
|
-
<ng-container *ngIf="!chooseIcon">
|
|
1190
|
-
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1191
|
-
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate"></ng-template>
|
|
1188
|
+
<span *ngIf="chooseIcon()" class="p-button-icon p-button-icon-left pi" [ngClass]="chooseIcon()" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1189
|
+
<ng-container *ngIf="!chooseIcon()">
|
|
1190
|
+
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate()" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1191
|
+
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate()"></ng-template>
|
|
1192
1192
|
</ng-container>
|
|
1193
1193
|
}
|
|
1194
1194
|
</ng-template>
|
|
1195
|
-
<input
|
|
1195
|
+
<input
|
|
1196
|
+
[attr.aria-label]="browseFilesLabel()"
|
|
1197
|
+
#basicfileinput
|
|
1198
|
+
type="file"
|
|
1199
|
+
[accept]="accept()"
|
|
1200
|
+
[multiple]="multiple()"
|
|
1201
|
+
[disabled]="disabled()"
|
|
1202
|
+
(change)="onFileSelect($event)"
|
|
1203
|
+
(focus)="onFocus()"
|
|
1204
|
+
(blur)="onBlur()"
|
|
1205
|
+
[pBind]="ptm('input')"
|
|
1206
|
+
/>
|
|
1196
1207
|
</p-button>
|
|
1197
|
-
@if (!auto) {
|
|
1198
|
-
@if (!fileLabelTemplate() && !_fileLabelTemplate) {
|
|
1208
|
+
@if (!auto()) {
|
|
1209
|
+
@if (!fileLabelTemplate() && !_fileLabelTemplate()) {
|
|
1199
1210
|
<span>
|
|
1200
1211
|
{{ basicFileChosenLabel() }}
|
|
1201
1212
|
</span>
|
|
1202
1213
|
} @else {
|
|
1203
|
-
<ng-container *ngTemplateOutlet="fileLabelTemplate() || _fileLabelTemplate; context: { $implicit:
|
|
1214
|
+
<ng-container *ngTemplateOutlet="fileLabelTemplate() || _fileLabelTemplate(); context: { $implicit: _files() }"></ng-container>
|
|
1204
1215
|
}
|
|
1205
1216
|
}
|
|
1206
1217
|
</div>
|
|
1207
1218
|
</div>
|
|
1208
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "
|
|
1219
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "valueStyleClass", "unit", "mode", "color"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "closable", "icon", "closeIcon", "life", "size", "variant", "motionOptions"], outputs: ["onClose"] }, { kind: "component", type: PlusIcon, selector: "[data-p-icon=\"plus\"]" }, { kind: "component", type: UploadIcon, selector: "[data-p-icon=\"upload\"]" }, { kind: "component", type: TimesIcon, selector: "[data-p-icon=\"times\"]" }, { kind: "ngmodule", type: SharedModule }, { kind: "component", type: FileContent, selector: "[pFileContent]", inputs: ["files", "badgeSeverity", "badgeValue", "previewWidth", "fileRemoveIconTemplate"], outputs: ["onRemove"] }, { kind: "directive", type: Bind, selector: "[pBind]", inputs: ["pBind"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1209
1220
|
}
|
|
1210
1221
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: FileUpload, decorators: [{
|
|
1211
1222
|
type: Component,
|
|
1212
1223
|
args: [{
|
|
1213
1224
|
selector: 'p-fileupload, p-fileUpload',
|
|
1214
|
-
standalone: true,
|
|
1215
1225
|
imports: [CommonModule, Button, ProgressBar, Message, PlusIcon, UploadIcon, TimesIcon, SharedModule, FileContent, Bind],
|
|
1216
1226
|
template: `
|
|
1217
|
-
<div [class]="cn(cx('root'), styleClass)" [ngStyle]="style" *ngIf="mode === 'advanced'" [pBind]="ptm('root')">
|
|
1218
|
-
<input
|
|
1227
|
+
<div [class]="cn(cx('root'), styleClass())" [ngStyle]="style()" *ngIf="mode() === 'advanced'" [pBind]="ptm('root')">
|
|
1228
|
+
<input
|
|
1229
|
+
[attr.aria-label]="browseFilesLabel()"
|
|
1230
|
+
#advancedfileinput
|
|
1231
|
+
type="file"
|
|
1232
|
+
(change)="onFileSelect($event)"
|
|
1233
|
+
[multiple]="multiple()"
|
|
1234
|
+
[accept]="accept()"
|
|
1235
|
+
[disabled]="disabled() || isChooseDisabled()"
|
|
1236
|
+
[attr.title]="''"
|
|
1237
|
+
[pBind]="ptm('input')"
|
|
1238
|
+
/>
|
|
1219
1239
|
<div [class]="cx('header')" [pBind]="ptm('header')">
|
|
1220
|
-
<ng-container *ngIf="!headerTemplate() && !_headerTemplate">
|
|
1240
|
+
<ng-container *ngIf="!headerTemplate() && !_headerTemplate()">
|
|
1221
1241
|
<p-button
|
|
1222
|
-
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass)"
|
|
1223
|
-
[disabled]="disabled || isChooseDisabled()"
|
|
1242
|
+
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass())"
|
|
1243
|
+
[disabled]="disabled() || isChooseDisabled()"
|
|
1224
1244
|
(focus)="onFocus()"
|
|
1225
|
-
[label]="chooseButtonLabel"
|
|
1245
|
+
[label]="chooseButtonLabel()"
|
|
1226
1246
|
(blur)="onBlur()"
|
|
1227
1247
|
(onClick)="choose()"
|
|
1228
1248
|
(keydown.enter)="choose()"
|
|
1229
|
-
[buttonProps]="chooseButtonProps"
|
|
1249
|
+
[buttonProps]="chooseButtonProps()"
|
|
1230
1250
|
[pt]="ptm('pcChooseButton')"
|
|
1231
1251
|
[unstyled]="unstyled()"
|
|
1232
1252
|
>
|
|
1233
1253
|
<input
|
|
1234
|
-
[attr.aria-label]="browseFilesLabel"
|
|
1254
|
+
[attr.aria-label]="browseFilesLabel()"
|
|
1235
1255
|
#advancedfileinput
|
|
1236
1256
|
type="file"
|
|
1237
1257
|
(change)="onFileSelect($event)"
|
|
1238
|
-
[multiple]="multiple"
|
|
1239
|
-
[accept]="accept"
|
|
1240
|
-
[disabled]="disabled || isChooseDisabled()"
|
|
1258
|
+
[multiple]="multiple()"
|
|
1259
|
+
[accept]="accept()"
|
|
1260
|
+
[disabled]="disabled() || isChooseDisabled()"
|
|
1241
1261
|
[attr.title]="''"
|
|
1242
1262
|
[pBind]="ptm('input')"
|
|
1243
1263
|
/>
|
|
1244
1264
|
<ng-template #icon>
|
|
1245
|
-
<span *ngIf="chooseIcon" [class]="chooseIcon" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1246
|
-
<ng-container *ngIf="!chooseIcon">
|
|
1247
|
-
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1248
|
-
<span *ngIf="chooseIconTemplate() || _chooseIconTemplate" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1249
|
-
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate"></ng-template>
|
|
1265
|
+
<span *ngIf="chooseIcon()" [class]="chooseIcon()" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1266
|
+
<ng-container *ngIf="!chooseIcon()">
|
|
1267
|
+
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate()" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1268
|
+
<span *ngIf="chooseIconTemplate() || _chooseIconTemplate()" [attr.aria-label]="true" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1269
|
+
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate()"></ng-template>
|
|
1250
1270
|
</span>
|
|
1251
1271
|
</ng-container>
|
|
1252
1272
|
</ng-template>
|
|
1253
1273
|
</p-button>
|
|
1254
1274
|
|
|
1255
1275
|
<p-button
|
|
1256
|
-
*ngIf="!auto && showUploadButton"
|
|
1257
|
-
[label]="uploadButtonLabel"
|
|
1276
|
+
*ngIf="!auto() && showUploadButton()"
|
|
1277
|
+
[label]="uploadButtonLabel()"
|
|
1258
1278
|
(onClick)="upload()"
|
|
1259
1279
|
[disabled]="!hasFiles() || isFileLimitExceeded()"
|
|
1260
|
-
[styleClass]="cn(cx('pcUploadButton'), uploadStyleClass)"
|
|
1261
|
-
[buttonProps]="uploadButtonProps"
|
|
1280
|
+
[styleClass]="cn(cx('pcUploadButton'), uploadStyleClass())"
|
|
1281
|
+
[buttonProps]="uploadButtonProps()"
|
|
1262
1282
|
[pt]="ptm('pcUploadButton')"
|
|
1263
1283
|
[unstyled]="unstyled()"
|
|
1264
1284
|
>
|
|
1265
1285
|
<ng-template #icon>
|
|
1266
|
-
<span *ngIf="uploadIcon" [ngClass]="uploadIcon" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon"></span>
|
|
1267
|
-
<ng-container *ngIf="!uploadIcon">
|
|
1268
|
-
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate" [pBind]="ptm('pcUploadButton')?.icon" />
|
|
1269
|
-
<span *ngIf="uploadIconTemplate() || _uploadIconTemplate" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon">
|
|
1270
|
-
<ng-template *ngTemplateOutlet="uploadIconTemplate() || _uploadIconTemplate"></ng-template>
|
|
1286
|
+
<span *ngIf="uploadIcon()" [ngClass]="uploadIcon()" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon"></span>
|
|
1287
|
+
<ng-container *ngIf="!uploadIcon()">
|
|
1288
|
+
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate()" [pBind]="ptm('pcUploadButton')?.icon" />
|
|
1289
|
+
<span *ngIf="uploadIconTemplate() || _uploadIconTemplate()" [attr.aria-hidden]="true" [pBind]="ptm('pcUploadButton')?.icon">
|
|
1290
|
+
<ng-template *ngTemplateOutlet="uploadIconTemplate() || _uploadIconTemplate()"></ng-template>
|
|
1271
1291
|
</span>
|
|
1272
1292
|
</ng-container>
|
|
1273
1293
|
</ng-template>
|
|
1274
1294
|
</p-button>
|
|
1275
1295
|
<p-button
|
|
1276
|
-
*ngIf="!auto && showCancelButton"
|
|
1277
|
-
[label]="cancelButtonLabel"
|
|
1296
|
+
*ngIf="!auto() && showCancelButton()"
|
|
1297
|
+
[label]="cancelButtonLabel()"
|
|
1278
1298
|
(onClick)="clear()"
|
|
1279
|
-
[disabled]="!hasFiles() || uploading"
|
|
1280
|
-
[styleClass]="cn(cx('pcCancelButton'), cancelStyleClass)"
|
|
1281
|
-
[buttonProps]="cancelButtonProps"
|
|
1299
|
+
[disabled]="!hasFiles() || uploading()"
|
|
1300
|
+
[styleClass]="cn(cx('pcCancelButton'), cancelStyleClass())"
|
|
1301
|
+
[buttonProps]="cancelButtonProps()"
|
|
1282
1302
|
[pt]="ptm('pcCancelButton')"
|
|
1283
1303
|
[unstyled]="unstyled()"
|
|
1284
1304
|
>
|
|
1285
1305
|
<ng-template #icon>
|
|
1286
|
-
<span *ngIf="cancelIcon" [ngClass]="cancelIcon"></span>
|
|
1287
|
-
<ng-container *ngIf="!cancelIcon">
|
|
1288
|
-
<svg data-p-icon="times" *ngIf="!cancelIconTemplate() && !_cancelIconTemplate" [attr.aria-hidden]="true" />
|
|
1289
|
-
<span *ngIf="cancelIconTemplate() || _cancelIconTemplate" [attr.aria-hidden]="true">
|
|
1290
|
-
<ng-template *ngTemplateOutlet="cancelIconTemplate() || _cancelIconTemplate"></ng-template>
|
|
1306
|
+
<span *ngIf="cancelIcon()" [ngClass]="cancelIcon()"></span>
|
|
1307
|
+
<ng-container *ngIf="!cancelIcon()">
|
|
1308
|
+
<svg data-p-icon="times" *ngIf="!cancelIconTemplate() && !_cancelIconTemplate()" [attr.aria-hidden]="true" />
|
|
1309
|
+
<span *ngIf="cancelIconTemplate() || _cancelIconTemplate()" [attr.aria-hidden]="true">
|
|
1310
|
+
<ng-template *ngTemplateOutlet="cancelIconTemplate() || _cancelIconTemplate()"></ng-template>
|
|
1291
1311
|
</span>
|
|
1292
1312
|
</ng-container>
|
|
1293
1313
|
</ng-template>
|
|
@@ -1295,123 +1315,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1295
1315
|
</ng-container>
|
|
1296
1316
|
<ng-container
|
|
1297
1317
|
*ngTemplateOutlet="
|
|
1298
|
-
headerTemplate() || _headerTemplate;
|
|
1318
|
+
headerTemplate() || _headerTemplate();
|
|
1299
1319
|
context: {
|
|
1300
|
-
$implicit:
|
|
1301
|
-
uploadedFiles: uploadedFiles,
|
|
1320
|
+
$implicit: _files(),
|
|
1321
|
+
uploadedFiles: uploadedFiles(),
|
|
1302
1322
|
chooseCallback: choose.bind(this),
|
|
1303
1323
|
clearCallback: clear.bind(this),
|
|
1304
1324
|
uploadCallback: upload.bind(this)
|
|
1305
1325
|
}
|
|
1306
1326
|
"
|
|
1307
1327
|
></ng-container>
|
|
1308
|
-
<ng-container *ngTemplateOutlet="toolbarTemplate() || _toolbarTemplate"></ng-container>
|
|
1328
|
+
<ng-container *ngTemplateOutlet="toolbarTemplate() || _toolbarTemplate()"></ng-container>
|
|
1309
1329
|
</div>
|
|
1310
1330
|
<div #content [class]="cx('content')" (dragenter)="onDragEnter($event)" (dragleave)="onDragLeave($event)" (drop)="onDrop($event)" [pBind]="ptm('content')">
|
|
1311
|
-
@if (contentTemplate() || _contentTemplate) {
|
|
1331
|
+
@if (contentTemplate() || _contentTemplate()) {
|
|
1312
1332
|
<ng-container
|
|
1313
1333
|
*ngTemplateOutlet="
|
|
1314
|
-
contentTemplate() || _contentTemplate;
|
|
1334
|
+
contentTemplate() || _contentTemplate();
|
|
1315
1335
|
context: {
|
|
1316
|
-
$implicit:
|
|
1317
|
-
uploadedFiles: uploadedFiles,
|
|
1336
|
+
$implicit: _files(),
|
|
1337
|
+
uploadedFiles: uploadedFiles(),
|
|
1318
1338
|
chooseCallback: choose.bind(this),
|
|
1319
1339
|
clearCallback: clear.bind(this),
|
|
1320
1340
|
removeUploadedFileCallback: removeUploadedFile.bind(this),
|
|
1321
1341
|
removeFileCallback: remove.bind(this),
|
|
1322
|
-
progress: progress,
|
|
1323
|
-
messages: msgs
|
|
1342
|
+
progress: progress(),
|
|
1343
|
+
messages: msgs()
|
|
1324
1344
|
}
|
|
1325
1345
|
"
|
|
1326
1346
|
></ng-container>
|
|
1327
1347
|
} @else {
|
|
1328
|
-
<p-progressbar [value]="progress" [showValue]="false" *ngIf="hasFiles()" [pt]="ptm('pcProgressBar')"></p-progressbar>
|
|
1329
|
-
@for (message of msgs; track message) {
|
|
1348
|
+
<p-progressbar [value]="progress()" [showValue]="false" *ngIf="hasFiles()" [pt]="ptm('pcProgressBar')"></p-progressbar>
|
|
1349
|
+
@for (message of msgs(); track message) {
|
|
1330
1350
|
<p-message [severity]="message.severity" [text]="message.text" [pt]="ptm('pcMessage')" [unstyled]="unstyled()"></p-message>
|
|
1331
1351
|
}
|
|
1332
1352
|
|
|
1333
1353
|
@if (hasFiles()) {
|
|
1334
1354
|
<div [class]="cx('fileList')" [pBind]="ptm('fileList')">
|
|
1335
|
-
<ng-template ngFor [ngForOf]="
|
|
1336
|
-
@if (!fileTemplate() && !_fileTemplate) {
|
|
1355
|
+
<ng-template ngFor [ngForOf]="_files()" [ngForTemplate]="fileTemplate() || _fileTemplate()"></ng-template>
|
|
1356
|
+
@if (!fileTemplate() && !_fileTemplate()) {
|
|
1337
1357
|
<div
|
|
1338
1358
|
pFileContent
|
|
1339
1359
|
[unstyled]="unstyled()"
|
|
1340
|
-
[files]="
|
|
1360
|
+
[files]="_files()"
|
|
1341
1361
|
(onRemove)="onRemoveClick($event)"
|
|
1342
|
-
[badgeValue]="pendingLabel"
|
|
1343
|
-
[previewWidth]="previewWidth"
|
|
1344
|
-
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate"
|
|
1362
|
+
[badgeValue]="pendingLabel()"
|
|
1363
|
+
[previewWidth]="previewWidth()"
|
|
1364
|
+
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate()"
|
|
1345
1365
|
></div>
|
|
1346
1366
|
}
|
|
1347
1367
|
</div>
|
|
1348
1368
|
}
|
|
1349
1369
|
@if (hasUploadedFiles()) {
|
|
1350
1370
|
<div [class]="cx('fileList')" [pBind]="ptm('fileList')">
|
|
1351
|
-
<ng-template ngFor [ngForOf]="uploadedFiles" [ngForTemplate]="fileTemplate() || _fileTemplate"></ng-template>
|
|
1352
|
-
@if (!fileTemplate() && !_fileTemplate) {
|
|
1371
|
+
<ng-template ngFor [ngForOf]="uploadedFiles()" [ngForTemplate]="fileTemplate() || _fileTemplate()"></ng-template>
|
|
1372
|
+
@if (!fileTemplate() && !_fileTemplate()) {
|
|
1353
1373
|
<div
|
|
1354
1374
|
pFileContent
|
|
1355
1375
|
[unstyled]="unstyled()"
|
|
1356
|
-
[files]="uploadedFiles"
|
|
1376
|
+
[files]="uploadedFiles()"
|
|
1357
1377
|
(onRemove)="onRemoveUploadedFileClick($event)"
|
|
1358
1378
|
[badgeValue]="completedLabel()"
|
|
1359
1379
|
badgeSeverity="success"
|
|
1360
|
-
[previewWidth]="previewWidth"
|
|
1361
|
-
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate"
|
|
1380
|
+
[previewWidth]="previewWidth()"
|
|
1381
|
+
[fileRemoveIconTemplate]="cancelIconTemplate() || _cancelIconTemplate()"
|
|
1362
1382
|
></div>
|
|
1363
1383
|
}
|
|
1364
1384
|
</div>
|
|
1365
1385
|
}
|
|
1366
1386
|
}
|
|
1367
|
-
@if ((emptyTemplate() || _emptyTemplate) && !hasFiles() && !hasUploadedFiles()) {
|
|
1368
|
-
<ng-container *ngTemplateOutlet="emptyTemplate() || _emptyTemplate" [pBind]="ptm('empty')"></ng-container>
|
|
1387
|
+
@if ((emptyTemplate() || _emptyTemplate()) && !hasFiles() && !hasUploadedFiles()) {
|
|
1388
|
+
<ng-container *ngTemplateOutlet="emptyTemplate() || _emptyTemplate()" [pBind]="ptm('empty')"></ng-container>
|
|
1369
1389
|
}
|
|
1370
1390
|
</div>
|
|
1371
1391
|
</div>
|
|
1372
|
-
<div [class]="cn(cx('root'), styleClass)" *ngIf="mode === 'basic'" [pBind]="ptm('root')">
|
|
1373
|
-
@for (message of msgs; track message) {
|
|
1392
|
+
<div [class]="cn(cx('root'), styleClass())" *ngIf="mode() === 'basic'" [pBind]="ptm('root')">
|
|
1393
|
+
@for (message of msgs(); track message) {
|
|
1374
1394
|
<p-message [severity]="message.severity" [text]="message.text" [pt]="ptm('pcMessage')" [unstyled]="unstyled()"></p-message>
|
|
1375
1395
|
}
|
|
1376
1396
|
|
|
1377
1397
|
<div [class]="cx('basicContent')" [pBind]="ptm('basicContent')">
|
|
1378
1398
|
<p-button
|
|
1379
|
-
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass)"
|
|
1380
|
-
[disabled]="disabled"
|
|
1381
|
-
[label]="chooseButtonLabel"
|
|
1382
|
-
[style]="style"
|
|
1399
|
+
[styleClass]="cn(cx('pcChooseButton'), chooseStyleClass())"
|
|
1400
|
+
[disabled]="disabled()"
|
|
1401
|
+
[label]="chooseButtonLabel()"
|
|
1402
|
+
[style]="style()"
|
|
1383
1403
|
(onClick)="onBasicUploaderClick()"
|
|
1384
1404
|
(keydown)="onBasicKeydown($event)"
|
|
1385
|
-
[buttonProps]="chooseButtonProps"
|
|
1405
|
+
[buttonProps]="chooseButtonProps()"
|
|
1386
1406
|
[pt]="ptm('pcChooseButton')"
|
|
1387
1407
|
[unstyled]="unstyled()"
|
|
1388
1408
|
>
|
|
1389
1409
|
<ng-template #icon>
|
|
1390
|
-
@if (hasFiles() && !auto) {
|
|
1391
|
-
<span *ngIf="uploadIcon" class="p-button-icon p-button-icon-left" [ngClass]="uploadIcon" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1392
|
-
<ng-container *ngIf="!uploadIcon">
|
|
1393
|
-
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate" [class]="'p-button-icon p-button-icon-left'" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1394
|
-
<span *ngIf="_uploadIconTemplate || uploadIconTemplate()" class="p-button-icon p-button-icon-left" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1395
|
-
<ng-template *ngTemplateOutlet="_uploadIconTemplate || uploadIconTemplate()"></ng-template>
|
|
1410
|
+
@if (hasFiles() && !auto()) {
|
|
1411
|
+
<span *ngIf="uploadIcon()" class="p-button-icon p-button-icon-left" [ngClass]="uploadIcon()" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1412
|
+
<ng-container *ngIf="!uploadIcon()">
|
|
1413
|
+
<svg data-p-icon="upload" *ngIf="!uploadIconTemplate() && !_uploadIconTemplate()" [class]="'p-button-icon p-button-icon-left'" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1414
|
+
<span *ngIf="_uploadIconTemplate() || uploadIconTemplate()" class="p-button-icon p-button-icon-left" [pBind]="ptm('pcChooseButton')?.icon">
|
|
1415
|
+
<ng-template *ngTemplateOutlet="_uploadIconTemplate() || uploadIconTemplate()"></ng-template>
|
|
1396
1416
|
</span>
|
|
1397
1417
|
</ng-container>
|
|
1398
1418
|
} @else {
|
|
1399
|
-
<span *ngIf="chooseIcon" class="p-button-icon p-button-icon-left pi" [ngClass]="chooseIcon" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1400
|
-
<ng-container *ngIf="!chooseIcon">
|
|
1401
|
-
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1402
|
-
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate"></ng-template>
|
|
1419
|
+
<span *ngIf="chooseIcon()" class="p-button-icon p-button-icon-left pi" [ngClass]="chooseIcon()" [pBind]="ptm('pcChooseButton')?.icon"></span>
|
|
1420
|
+
<ng-container *ngIf="!chooseIcon()">
|
|
1421
|
+
<svg data-p-icon="plus" *ngIf="!chooseIconTemplate() && !_chooseIconTemplate()" [pBind]="ptm('pcChooseButton')?.icon" />
|
|
1422
|
+
<ng-template *ngTemplateOutlet="chooseIconTemplate() || _chooseIconTemplate()"></ng-template>
|
|
1403
1423
|
</ng-container>
|
|
1404
1424
|
}
|
|
1405
1425
|
</ng-template>
|
|
1406
|
-
<input
|
|
1426
|
+
<input
|
|
1427
|
+
[attr.aria-label]="browseFilesLabel()"
|
|
1428
|
+
#basicfileinput
|
|
1429
|
+
type="file"
|
|
1430
|
+
[accept]="accept()"
|
|
1431
|
+
[multiple]="multiple()"
|
|
1432
|
+
[disabled]="disabled()"
|
|
1433
|
+
(change)="onFileSelect($event)"
|
|
1434
|
+
(focus)="onFocus()"
|
|
1435
|
+
(blur)="onBlur()"
|
|
1436
|
+
[pBind]="ptm('input')"
|
|
1437
|
+
/>
|
|
1407
1438
|
</p-button>
|
|
1408
|
-
@if (!auto) {
|
|
1409
|
-
@if (!fileLabelTemplate() && !_fileLabelTemplate) {
|
|
1439
|
+
@if (!auto()) {
|
|
1440
|
+
@if (!fileLabelTemplate() && !_fileLabelTemplate()) {
|
|
1410
1441
|
<span>
|
|
1411
1442
|
{{ basicFileChosenLabel() }}
|
|
1412
1443
|
</span>
|
|
1413
1444
|
} @else {
|
|
1414
|
-
<ng-container *ngTemplateOutlet="fileLabelTemplate() || _fileLabelTemplate; context: { $implicit:
|
|
1445
|
+
<ng-container *ngTemplateOutlet="fileLabelTemplate() || _fileLabelTemplate(); context: { $implicit: _files() }"></ng-container>
|
|
1415
1446
|
}
|
|
1416
1447
|
}
|
|
1417
1448
|
</div>
|
|
@@ -1422,93 +1453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
|
|
|
1422
1453
|
providers: [FileUploadStyle, { provide: FILEUPLOAD_INSTANCE, useExisting: FileUpload }, { provide: PARENT_INSTANCE, useExisting: FileUpload }],
|
|
1423
1454
|
hostDirectives: [Bind]
|
|
1424
1455
|
}]
|
|
1425
|
-
}], propDecorators: { name: [{
|
|
1426
|
-
type: Input
|
|
1427
|
-
}], url: [{
|
|
1428
|
-
type: Input
|
|
1429
|
-
}], method: [{
|
|
1430
|
-
type: Input
|
|
1431
|
-
}], multiple: [{
|
|
1432
|
-
type: Input,
|
|
1433
|
-
args: [{ transform: booleanAttribute }]
|
|
1434
|
-
}], accept: [{
|
|
1435
|
-
type: Input
|
|
1436
|
-
}], disabled: [{
|
|
1437
|
-
type: Input,
|
|
1438
|
-
args: [{ transform: booleanAttribute }]
|
|
1439
|
-
}], auto: [{
|
|
1440
|
-
type: Input,
|
|
1441
|
-
args: [{ transform: booleanAttribute }]
|
|
1442
|
-
}], withCredentials: [{
|
|
1443
|
-
type: Input,
|
|
1444
|
-
args: [{ transform: booleanAttribute }]
|
|
1445
|
-
}], maxFileSize: [{
|
|
1446
|
-
type: Input,
|
|
1447
|
-
args: [{ transform: numberAttribute }]
|
|
1448
|
-
}], invalidFileSizeMessageSummary: [{
|
|
1449
|
-
type: Input
|
|
1450
|
-
}], invalidFileSizeMessageDetail: [{
|
|
1451
|
-
type: Input
|
|
1452
|
-
}], invalidFileTypeMessageSummary: [{
|
|
1453
|
-
type: Input
|
|
1454
|
-
}], invalidFileTypeMessageDetail: [{
|
|
1455
|
-
type: Input
|
|
1456
|
-
}], invalidFileLimitMessageDetail: [{
|
|
1457
|
-
type: Input
|
|
1458
|
-
}], invalidFileLimitMessageSummary: [{
|
|
1459
|
-
type: Input
|
|
1460
|
-
}], style: [{
|
|
1461
|
-
type: Input
|
|
1462
|
-
}], styleClass: [{
|
|
1463
|
-
type: Input
|
|
1464
|
-
}], previewWidth: [{
|
|
1465
|
-
type: Input,
|
|
1466
|
-
args: [{ transform: numberAttribute }]
|
|
1467
|
-
}], chooseLabel: [{
|
|
1468
|
-
type: Input
|
|
1469
|
-
}], uploadLabel: [{
|
|
1470
|
-
type: Input
|
|
1471
|
-
}], cancelLabel: [{
|
|
1472
|
-
type: Input
|
|
1473
|
-
}], chooseIcon: [{
|
|
1474
|
-
type: Input
|
|
1475
|
-
}], uploadIcon: [{
|
|
1476
|
-
type: Input
|
|
1477
|
-
}], cancelIcon: [{
|
|
1478
|
-
type: Input
|
|
1479
|
-
}], showUploadButton: [{
|
|
1480
|
-
type: Input,
|
|
1481
|
-
args: [{ transform: booleanAttribute }]
|
|
1482
|
-
}], showCancelButton: [{
|
|
1483
|
-
type: Input,
|
|
1484
|
-
args: [{ transform: booleanAttribute }]
|
|
1485
|
-
}], mode: [{
|
|
1486
|
-
type: Input
|
|
1487
|
-
}], headers: [{
|
|
1488
|
-
type: Input
|
|
1489
|
-
}], customUpload: [{
|
|
1490
|
-
type: Input,
|
|
1491
|
-
args: [{ transform: booleanAttribute }]
|
|
1492
|
-
}], fileLimit: [{
|
|
1493
|
-
type: Input,
|
|
1494
|
-
args: [{ transform: (value) => numberAttribute(value, undefined) }]
|
|
1495
|
-
}], uploadStyleClass: [{
|
|
1496
|
-
type: Input
|
|
1497
|
-
}], cancelStyleClass: [{
|
|
1498
|
-
type: Input
|
|
1499
|
-
}], removeStyleClass: [{
|
|
1500
|
-
type: Input
|
|
1501
|
-
}], chooseStyleClass: [{
|
|
1502
|
-
type: Input
|
|
1503
|
-
}], chooseButtonProps: [{
|
|
1504
|
-
type: Input
|
|
1505
|
-
}], uploadButtonProps: [{
|
|
1506
|
-
type: Input
|
|
1507
|
-
}], cancelButtonProps: [{
|
|
1508
|
-
type: Input
|
|
1509
|
-
}], onBeforeUpload: [{ type: i0.Output, args: ["onBeforeUpload"] }], onSend: [{ type: i0.Output, args: ["onSend"] }], onUpload: [{ type: i0.Output, args: ["onUpload"] }], onError: [{ type: i0.Output, args: ["onError"] }], onClear: [{ type: i0.Output, args: ["onClear"] }], onRemove: [{ type: i0.Output, args: ["onRemove"] }], onSelect: [{ type: i0.Output, args: ["onSelect"] }], onProgress: [{ type: i0.Output, args: ["onProgress"] }], uploadHandler: [{ type: i0.Output, args: ["uploadHandler"] }], onImageError: [{ type: i0.Output, args: ["onImageError"] }], onRemoveUploadedFile: [{ type: i0.Output, args: ["onRemoveUploadedFile"] }], fileTemplate: [{ type: i0.ContentChild, args: ['file', { ...{ descendants: false }, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { ...{ descendants: false }, isSignal: true }] }], contentTemplate: [{ type: i0.ContentChild, args: ['content', { ...{ descendants: false }, isSignal: true }] }], toolbarTemplate: [{ type: i0.ContentChild, args: ['toolbar', { ...{ descendants: false }, isSignal: true }] }], chooseIconTemplate: [{ type: i0.ContentChild, args: ['chooseicon', { ...{ descendants: false }, isSignal: true }] }], fileLabelTemplate: [{ type: i0.ContentChild, args: ['filelabel', { ...{ descendants: false }, isSignal: true }] }], uploadIconTemplate: [{ type: i0.ContentChild, args: ['uploadicon', { ...{ descendants: false }, isSignal: true }] }], cancelIconTemplate: [{ type: i0.ContentChild, args: ['cancelicon', { ...{ descendants: false }, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: ['empty', { ...{ descendants: false }, isSignal: true }] }], advancedFileInput: [{ type: i0.ViewChild, args: ['advancedfileinput', { isSignal: true }] }], basicFileInput: [{ type: i0.ViewChild, args: ['basicfileinput', { isSignal: true }] }], content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], files: [{
|
|
1510
|
-
type: Input
|
|
1511
|
-
}], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
|
|
1456
|
+
}], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], url: [{ type: i0.Input, args: [{ isSignal: true, alias: "url", required: false }] }], method: [{ type: i0.Input, args: [{ isSignal: true, alias: "method", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], auto: [{ type: i0.Input, args: [{ isSignal: true, alias: "auto", required: false }] }], withCredentials: [{ type: i0.Input, args: [{ isSignal: true, alias: "withCredentials", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], invalidFileSizeMessageSummary: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidFileSizeMessageSummary", required: false }] }], invalidFileSizeMessageDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidFileSizeMessageDetail", required: false }] }], invalidFileTypeMessageSummary: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidFileTypeMessageSummary", required: false }] }], invalidFileTypeMessageDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidFileTypeMessageDetail", required: false }] }], invalidFileLimitMessageDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidFileLimitMessageDetail", required: false }] }], invalidFileLimitMessageSummary: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidFileLimitMessageSummary", required: false }] }], style: [{ type: i0.Input, args: [{ isSignal: true, alias: "style", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], previewWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "previewWidth", required: false }] }], chooseLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "chooseLabel", required: false }] }], uploadLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadLabel", required: false }] }], cancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelLabel", required: false }] }], chooseIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "chooseIcon", required: false }] }], uploadIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadIcon", required: false }] }], cancelIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelIcon", required: false }] }], showUploadButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showUploadButton", required: false }] }], showCancelButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCancelButton", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], headers: [{ type: i0.Input, args: [{ isSignal: true, alias: "headers", required: false }] }], customUpload: [{ type: i0.Input, args: [{ isSignal: true, alias: "customUpload", required: false }] }], fileLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "fileLimit", required: false }] }], uploadStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadStyleClass", required: false }] }], cancelStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelStyleClass", required: false }] }], chooseStyleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "chooseStyleClass", required: false }] }], chooseButtonProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "chooseButtonProps", required: false }] }], uploadButtonProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadButtonProps", required: false }] }], cancelButtonProps: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelButtonProps", required: false }] }], onBeforeUpload: [{ type: i0.Output, args: ["onBeforeUpload"] }], onSend: [{ type: i0.Output, args: ["onSend"] }], onUpload: [{ type: i0.Output, args: ["onUpload"] }], onError: [{ type: i0.Output, args: ["onError"] }], onClear: [{ type: i0.Output, args: ["onClear"] }], onRemove: [{ type: i0.Output, args: ["onRemove"] }], onSelect: [{ type: i0.Output, args: ["onSelect"] }], onProgress: [{ type: i0.Output, args: ["onProgress"] }], uploadHandler: [{ type: i0.Output, args: ["uploadHandler"] }], onImageError: [{ type: i0.Output, args: ["onImageError"] }], onRemoveUploadedFile: [{ type: i0.Output, args: ["onRemoveUploadedFile"] }], fileTemplate: [{ type: i0.ContentChild, args: ['file', { ...{ descendants: false }, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: ['header', { ...{ descendants: false }, isSignal: true }] }], contentTemplate: [{ type: i0.ContentChild, args: ['content', { ...{ descendants: false }, isSignal: true }] }], toolbarTemplate: [{ type: i0.ContentChild, args: ['toolbar', { ...{ descendants: false }, isSignal: true }] }], chooseIconTemplate: [{ type: i0.ContentChild, args: ['chooseicon', { ...{ descendants: false }, isSignal: true }] }], fileLabelTemplate: [{ type: i0.ContentChild, args: ['filelabel', { ...{ descendants: false }, isSignal: true }] }], uploadIconTemplate: [{ type: i0.ContentChild, args: ['uploadicon', { ...{ descendants: false }, isSignal: true }] }], cancelIconTemplate: [{ type: i0.ContentChild, args: ['cancelicon', { ...{ descendants: false }, isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: ['empty', { ...{ descendants: false }, isSignal: true }] }], advancedFileInput: [{ type: i0.ViewChild, args: ['advancedfileinput', { isSignal: true }] }], basicFileInput: [{ type: i0.ViewChild, args: ['basicfileinput', { isSignal: true }] }], content: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], templates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => PrimeTemplate), { isSignal: true }] }] } });
|
|
1512
1457
|
class FileUploadModule {
|
|
1513
1458
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: FileUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1514
1459
|
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: FileUploadModule, imports: [FileUpload, SharedModule], exports: [FileUpload, SharedModule] });
|