@cdek-it/angular-ui-kit 0.2.6-test → 0.2.8-test
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/components/avatar/index.d.ts +2 -2
- package/components/button/index.d.ts +6 -6
- package/components/confirm-dialog/index.d.ts +1 -1
- package/components/fileupload/index.d.ts +62 -0
- package/components/message/index.d.ts +3 -1
- package/components/progressspinner/index.d.ts +1 -1
- package/components/select-button/index.d.ts +38 -0
- package/components/tag/index.d.ts +1 -1
- package/components/togglebutton/index.d.ts +41 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-avatar.mjs +2 -2
- package/fesm2022/cdek-it-angular-ui-kit-components-avatar.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-button.mjs +9 -9
- package/fesm2022/cdek-it-angular-ui-kit-components-button.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-confirm-dialog.mjs +2 -2
- package/fesm2022/cdek-it-angular-ui-kit-components-confirm-dialog.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-fileupload.mjs +436 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-fileupload.mjs.map +1 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-message.mjs +11 -4
- package/fesm2022/cdek-it-angular-ui-kit-components-message.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-progressspinner.mjs +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-progressspinner.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-select-button.mjs +136 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-select-button.mjs.map +1 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-stepper.mjs +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-stepper.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-tag.mjs +2 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-tag.mjs.map +1 -1
- package/fesm2022/cdek-it-angular-ui-kit-components-togglebutton.mjs +167 -0
- package/fesm2022/cdek-it-angular-ui-kit-components-togglebutton.mjs.map +1 -0
- package/fesm2022/cdek-it-angular-ui-kit-providers.mjs +5189 -3114
- package/fesm2022/cdek-it-angular-ui-kit-providers.mjs.map +1 -1
- package/package.json +22 -2
- package/tailwind/theme.css +467 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, ChangeDetectorRef, EventEmitter, forwardRef, Output, Input, ViewChild, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
|
+
import { FileUpload } from 'primeng/fileupload';
|
|
5
|
+
import { ProgressBar } from 'primeng/progressbar';
|
|
6
|
+
import { Message } from 'primeng/message';
|
|
7
|
+
import { PrimeTemplate } from 'primeng/api';
|
|
8
|
+
import { ExtraButtonComponent } from '@cdek-it/angular-ui-kit/components/button';
|
|
9
|
+
|
|
10
|
+
class ExtraFileUploadComponent {
|
|
11
|
+
el = inject(ElementRef);
|
|
12
|
+
cdr = inject(ChangeDetectorRef);
|
|
13
|
+
fuRef;
|
|
14
|
+
name = 'files[]';
|
|
15
|
+
url = '/api/upload';
|
|
16
|
+
multiple = true;
|
|
17
|
+
accept = 'image/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
18
|
+
maxFileSize = 1000000;
|
|
19
|
+
fileLimit = undefined;
|
|
20
|
+
disabled = false;
|
|
21
|
+
dropzoneTitle = 'Чтобы загрузить файлы кликните или перетащите их в эту область';
|
|
22
|
+
dropzoneCaption = 'Можно загрузить не более 10 файлов размером 1 MB';
|
|
23
|
+
invalidFileSizeMessageSummary = '{0}: Некорректный размер файла';
|
|
24
|
+
invalidFileSizeMessageDetail = 'Максимальный размер — {0}';
|
|
25
|
+
invalidFileTypeMessageSummary = '{0}: Некорректный тип файла';
|
|
26
|
+
invalidFileTypeMessageDetail = 'Допустимые типы: {0}';
|
|
27
|
+
invalidFileLimitMessageSummary = 'Превышен лимит файлов';
|
|
28
|
+
invalidFileLimitMessageDetail = 'Максимум: {0}';
|
|
29
|
+
onSelectEvent = new EventEmitter();
|
|
30
|
+
onRemoveEvent = new EventEmitter();
|
|
31
|
+
onClearEvent = new EventEmitter();
|
|
32
|
+
onError = new EventEmitter();
|
|
33
|
+
onUpload = new EventEmitter();
|
|
34
|
+
selectedFiles = [];
|
|
35
|
+
uploadedFiles = [];
|
|
36
|
+
totalSize = 0;
|
|
37
|
+
totalSizePercent = 0;
|
|
38
|
+
uploadSuccess = false;
|
|
39
|
+
isUploading = false;
|
|
40
|
+
uploadCbRef = null;
|
|
41
|
+
clearCbRef = null;
|
|
42
|
+
onChange = () => { };
|
|
43
|
+
onTouched = () => { };
|
|
44
|
+
writeValue(files) {
|
|
45
|
+
this.selectedFiles = files ?? [];
|
|
46
|
+
this.cdr.markForCheck();
|
|
47
|
+
}
|
|
48
|
+
registerOnChange(fn) {
|
|
49
|
+
this.onChange = fn;
|
|
50
|
+
}
|
|
51
|
+
registerOnTouched(fn) {
|
|
52
|
+
this.onTouched = fn;
|
|
53
|
+
}
|
|
54
|
+
setDisabledState(isDisabled) {
|
|
55
|
+
this.disabled = isDisabled;
|
|
56
|
+
this.cdr.markForCheck();
|
|
57
|
+
}
|
|
58
|
+
get uploadCb() {
|
|
59
|
+
return this.uploadCbRef;
|
|
60
|
+
}
|
|
61
|
+
storeCallbacks(upload, clear) {
|
|
62
|
+
this.uploadCbRef = upload;
|
|
63
|
+
this.clearCbRef = clear;
|
|
64
|
+
return '';
|
|
65
|
+
}
|
|
66
|
+
onDrop(event) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
const files = event.dataTransfer?.files;
|
|
69
|
+
if (!files?.length || this.disabled)
|
|
70
|
+
return;
|
|
71
|
+
const accepted = this.filterFilesByAccept(Array.from(files));
|
|
72
|
+
if (!accepted.length)
|
|
73
|
+
return;
|
|
74
|
+
const dt = new DataTransfer();
|
|
75
|
+
accepted.forEach(f => dt.items.add(f));
|
|
76
|
+
this.fuRef.onFileSelect({ target: { files: dt.files } });
|
|
77
|
+
}
|
|
78
|
+
filterFilesByAccept(files) {
|
|
79
|
+
if (!this.accept)
|
|
80
|
+
return files;
|
|
81
|
+
const types = this.accept.split(',').map(t => t.trim());
|
|
82
|
+
return files.filter(file => types.some(type => {
|
|
83
|
+
if (type.includes('*')) {
|
|
84
|
+
return file.type.startsWith(type.replace('*', ''));
|
|
85
|
+
}
|
|
86
|
+
if (type.startsWith('.')) {
|
|
87
|
+
return file.name.toLowerCase().endsWith(type.toLowerCase());
|
|
88
|
+
}
|
|
89
|
+
return file.type === type;
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
onChooseClick() {
|
|
93
|
+
const input = this.el.nativeElement.querySelector('input[type="file"]');
|
|
94
|
+
input?.click();
|
|
95
|
+
}
|
|
96
|
+
isImage(file) {
|
|
97
|
+
return file.type.startsWith('image/');
|
|
98
|
+
}
|
|
99
|
+
formatSize(bytes) {
|
|
100
|
+
if (bytes === 0)
|
|
101
|
+
return '0 B';
|
|
102
|
+
const k = 1024;
|
|
103
|
+
const sizes = ['B', 'KB', 'MB', 'GB'];
|
|
104
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
105
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(3)) + ' ' + sizes[i];
|
|
106
|
+
}
|
|
107
|
+
onSelectedFiles(event) {
|
|
108
|
+
this.selectedFiles = [...(this.fuRef?.files || [])];
|
|
109
|
+
this.totalSize = this.selectedFiles.reduce((acc, f) => acc + f.size, 0);
|
|
110
|
+
this.uploadSuccess = false;
|
|
111
|
+
this.isUploading = this.selectedFiles.length > 0;
|
|
112
|
+
this.totalSizePercent = 0;
|
|
113
|
+
let progress = 0;
|
|
114
|
+
const interval = setInterval(() => {
|
|
115
|
+
progress += 10;
|
|
116
|
+
this.totalSizePercent = Math.min(progress, 100);
|
|
117
|
+
if (progress >= 100)
|
|
118
|
+
clearInterval(interval);
|
|
119
|
+
this.cdr.markForCheck();
|
|
120
|
+
}, 40);
|
|
121
|
+
this.onChange(this.selectedFiles);
|
|
122
|
+
this.onTouched();
|
|
123
|
+
this.cdr.markForCheck();
|
|
124
|
+
this.onSelectEvent.emit(event);
|
|
125
|
+
}
|
|
126
|
+
onUploader(event) {
|
|
127
|
+
setTimeout(() => {
|
|
128
|
+
this.clearCbRef?.();
|
|
129
|
+
this.selectedFiles = [];
|
|
130
|
+
this.uploadedFiles = [...(event.files || [])];
|
|
131
|
+
this.totalSize = 0;
|
|
132
|
+
this.totalSizePercent = 0;
|
|
133
|
+
this.uploadSuccess = true;
|
|
134
|
+
this.isUploading = false;
|
|
135
|
+
this.onChange([]);
|
|
136
|
+
this.cdr.markForCheck();
|
|
137
|
+
}, 1500);
|
|
138
|
+
this.onUpload.emit(event);
|
|
139
|
+
}
|
|
140
|
+
onRemoveFile(file, removeFileCallback, index) {
|
|
141
|
+
removeFileCallback(index);
|
|
142
|
+
this.selectedFiles = [...(this.fuRef?.files || [])];
|
|
143
|
+
this.totalSize -= file.size;
|
|
144
|
+
this.totalSizePercent = Math.min((this.totalSize / (this.maxFileSize || 1000000)) * 100, 100);
|
|
145
|
+
if (this.totalSize <= 0) {
|
|
146
|
+
this.isUploading = false;
|
|
147
|
+
}
|
|
148
|
+
this.onChange(this.selectedFiles);
|
|
149
|
+
this.cdr.markForCheck();
|
|
150
|
+
}
|
|
151
|
+
onClearUpload() {
|
|
152
|
+
this.clearCbRef?.();
|
|
153
|
+
this.selectedFiles = [];
|
|
154
|
+
this.uploadedFiles = [];
|
|
155
|
+
this.totalSize = 0;
|
|
156
|
+
this.totalSizePercent = 0;
|
|
157
|
+
this.uploadSuccess = false;
|
|
158
|
+
this.isUploading = false;
|
|
159
|
+
this.onChange([]);
|
|
160
|
+
this.cdr.markForCheck();
|
|
161
|
+
}
|
|
162
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
163
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ExtraFileUploadComponent, isStandalone: true, selector: "extra-fileupload", inputs: { name: "name", url: "url", multiple: "multiple", accept: "accept", maxFileSize: "maxFileSize", fileLimit: "fileLimit", disabled: "disabled", dropzoneTitle: "dropzoneTitle", dropzoneCaption: "dropzoneCaption", invalidFileSizeMessageSummary: "invalidFileSizeMessageSummary", invalidFileSizeMessageDetail: "invalidFileSizeMessageDetail", invalidFileTypeMessageSummary: "invalidFileTypeMessageSummary", invalidFileTypeMessageDetail: "invalidFileTypeMessageDetail", invalidFileLimitMessageSummary: "invalidFileLimitMessageSummary", invalidFileLimitMessageDetail: "invalidFileLimitMessageDetail" }, outputs: { onSelectEvent: "onSelectEvent", onRemoveEvent: "onRemoveEvent", onClearEvent: "onClearEvent", onError: "onError", onUpload: "onUpload" }, host: { styleAttribute: "display: contents" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ExtraFileUploadComponent), multi: true }], viewQueries: [{ propertyName: "fuRef", first: true, predicate: ["fuRef"], descendants: true }], ngImport: i0, template: `
|
|
164
|
+
<p-fileupload
|
|
165
|
+
#fuRef
|
|
166
|
+
[name]="name"
|
|
167
|
+
[url]="url"
|
|
168
|
+
[multiple]="multiple"
|
|
169
|
+
[accept]="accept"
|
|
170
|
+
[maxFileSize]="maxFileSize"
|
|
171
|
+
[fileLimit]="fileLimit"
|
|
172
|
+
[disabled]="disabled"
|
|
173
|
+
[customUpload]="true"
|
|
174
|
+
[auto]="false"
|
|
175
|
+
[invalidFileSizeMessageSummary]="invalidFileSizeMessageSummary"
|
|
176
|
+
[invalidFileSizeMessageDetail]="invalidFileSizeMessageDetail"
|
|
177
|
+
[invalidFileTypeMessageSummary]="invalidFileTypeMessageSummary"
|
|
178
|
+
[invalidFileTypeMessageDetail]="invalidFileTypeMessageDetail"
|
|
179
|
+
[invalidFileLimitMessageSummary]="invalidFileLimitMessageSummary"
|
|
180
|
+
[invalidFileLimitMessageDetail]="invalidFileLimitMessageDetail"
|
|
181
|
+
(onSelect)="onSelectedFiles($event)"
|
|
182
|
+
(uploadHandler)="onUploader($event)"
|
|
183
|
+
(onRemove)="onRemoveEvent.emit($event)"
|
|
184
|
+
(onClear)="onClearEvent.emit()"
|
|
185
|
+
(onError)="onError.emit($event)"
|
|
186
|
+
>
|
|
187
|
+
<ng-template pTemplate="header" let-uploadCallback="uploadCallback" let-clearCallback="clearCallback">
|
|
188
|
+
<div class="fu-header" [attr.data-ref]="storeCallbacks(uploadCallback, clearCallback)">
|
|
189
|
+
<div class="fu-dropzone"
|
|
190
|
+
[class.fu-dropzone--disabled]="disabled"
|
|
191
|
+
(click)="onChooseClick()"
|
|
192
|
+
(dragover)="$event.preventDefault()"
|
|
193
|
+
(drop)="onDrop($event)">
|
|
194
|
+
<i class="ti ti-upload fu-dropzone__icon"></i>
|
|
195
|
+
<div class="fu-dropzone__info">
|
|
196
|
+
<span class="fu-dropzone__title">{{ dropzoneTitle }}</span>
|
|
197
|
+
<span class="fu-dropzone__caption">
|
|
198
|
+
<i class="ti ti-info-circle"></i>
|
|
199
|
+
{{ dropzoneCaption }}
|
|
200
|
+
</span>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
</ng-template>
|
|
205
|
+
|
|
206
|
+
<ng-template pTemplate="content"
|
|
207
|
+
let-removeFileCallback="removeFileCallback" let-removeUploadedFileCallback="removeUploadedFileCallback">
|
|
208
|
+
<div class="fu-content">
|
|
209
|
+
@if (isUploading) {
|
|
210
|
+
<p-progressBar [value]="totalSizePercent" [showValue]="false"></p-progressBar>
|
|
211
|
+
}
|
|
212
|
+
@if (uploadSuccess) {
|
|
213
|
+
<p-message severity="success" icon="ti ti-circle-check" [closable]="true" (onClose)="uploadSuccess = false">
|
|
214
|
+
Файлы успешно загружены
|
|
215
|
+
</p-message>
|
|
216
|
+
}
|
|
217
|
+
@if (selectedFiles.length > 0) {
|
|
218
|
+
<div class="fu-file-list">
|
|
219
|
+
@for (file of selectedFiles; track file.name + file.size; let i = $index) {
|
|
220
|
+
<div class="fu-file-card">
|
|
221
|
+
<div class="fu-file-card__wrap">
|
|
222
|
+
@if (isImage(file)) {
|
|
223
|
+
<img [src]="file.objectURL" [alt]="file.name" class="fu-file-card__thumbnail" />
|
|
224
|
+
} @else {
|
|
225
|
+
<i class="ti ti-file fu-file-card__icon"></i>
|
|
226
|
+
}
|
|
227
|
+
<div class="fu-file-card__info">
|
|
228
|
+
<span class="fu-file-card__name">{{ file.name }}</span>
|
|
229
|
+
<span class="fu-file-card__size">
|
|
230
|
+
<i class="ti ti-info-circle"></i>
|
|
231
|
+
{{ formatSize(file.size) }}
|
|
232
|
+
</span>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
<extra-button icon="ti ti-trash" variant="text" [rounded]="true" size="small" [iconOnly]="true"
|
|
236
|
+
(click)="onRemoveFile(file, removeFileCallback, i)"></extra-button>
|
|
237
|
+
</div>
|
|
238
|
+
}
|
|
239
|
+
</div>
|
|
240
|
+
}
|
|
241
|
+
@if (uploadedFiles.length > 0) {
|
|
242
|
+
<div class="fu-file-list">
|
|
243
|
+
@for (file of uploadedFiles; track file.name + file.size; let i = $index) {
|
|
244
|
+
<div class="fu-file-card fu-file-card--uploaded">
|
|
245
|
+
<div class="fu-file-card__wrap">
|
|
246
|
+
<i class="ti ti-file-check fu-file-card__icon"></i>
|
|
247
|
+
<div class="fu-file-card__info">
|
|
248
|
+
<span class="fu-file-card__name">{{ file.name }}</span>
|
|
249
|
+
<span class="fu-file-card__size">Загружено</span>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
<extra-button icon="ti ti-trash" variant="text" [rounded]="true" size="small" [iconOnly]="true"
|
|
253
|
+
(click)="removeUploadedFileCallback(i)"></extra-button>
|
|
254
|
+
</div>
|
|
255
|
+
}
|
|
256
|
+
</div>
|
|
257
|
+
}
|
|
258
|
+
@if (selectedFiles.length > 0 || uploadedFiles.length > 0) {
|
|
259
|
+
<div class="fu-footer">
|
|
260
|
+
<extra-button label="Отправить" [disabled]="!selectedFiles.length" (click)="uploadCb?.()"></extra-button>
|
|
261
|
+
<extra-button label="Очистить" severity="danger" variant="text"
|
|
262
|
+
[disabled]="!selectedFiles.length && !uploadedFiles.length" (click)="onClearUpload()"></extra-button>
|
|
263
|
+
</div>
|
|
264
|
+
}
|
|
265
|
+
</div>
|
|
266
|
+
</ng-template>
|
|
267
|
+
</p-fileupload>
|
|
268
|
+
`, isInline: true, dependencies: [{ kind: "component", type: FileUpload, selector: "p-fileupload, p-fileUpload", inputs: ["name", "url", "method", "multiple", "accept", "disabled", "auto", "withCredentials", "maxFileSize", "invalidFileSizeMessageSummary", "invalidFileSizeMessageDetail", "invalidFileTypeMessageSummary", "invalidFileTypeMessageDetail", "invalidFileLimitMessageDetail", "invalidFileLimitMessageSummary", "style", "styleClass", "previewWidth", "chooseLabel", "uploadLabel", "cancelLabel", "chooseIcon", "uploadIcon", "cancelIcon", "showUploadButton", "showCancelButton", "mode", "headers", "customUpload", "fileLimit", "uploadStyleClass", "cancelStyleClass", "removeStyleClass", "chooseStyleClass", "chooseButtonProps", "uploadButtonProps", "cancelButtonProps", "files"], outputs: ["onBeforeUpload", "onSend", "onUpload", "onError", "onClear", "onRemove", "onSelect", "onProgress", "uploadHandler", "onImageError", "onRemoveUploadedFile"] }, { kind: "component", type: ProgressBar, selector: "p-progressBar, p-progressbar, p-progress-bar", inputs: ["value", "showValue", "styleClass", "valueStyleClass", "unit", "mode", "color"] }, { kind: "component", type: Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "directive", type: PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: ExtraButtonComponent, selector: "extra-button", inputs: ["label", "variant", "severity", "size", "rounded", "iconPosition", "iconOnly", "icon", "disabled", "loading", "badge", "badgeSeverity", "showBadge", "fluid", "ariaLabel", "autofocus", "tabindex", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
269
|
+
}
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraFileUploadComponent, decorators: [{
|
|
271
|
+
type: Component,
|
|
272
|
+
args: [{
|
|
273
|
+
selector: 'extra-fileupload',
|
|
274
|
+
standalone: true,
|
|
275
|
+
imports: [FileUpload, ProgressBar, Message, PrimeTemplate, ExtraButtonComponent],
|
|
276
|
+
host: { style: 'display: contents' },
|
|
277
|
+
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ExtraFileUploadComponent), multi: true }],
|
|
278
|
+
template: `
|
|
279
|
+
<p-fileupload
|
|
280
|
+
#fuRef
|
|
281
|
+
[name]="name"
|
|
282
|
+
[url]="url"
|
|
283
|
+
[multiple]="multiple"
|
|
284
|
+
[accept]="accept"
|
|
285
|
+
[maxFileSize]="maxFileSize"
|
|
286
|
+
[fileLimit]="fileLimit"
|
|
287
|
+
[disabled]="disabled"
|
|
288
|
+
[customUpload]="true"
|
|
289
|
+
[auto]="false"
|
|
290
|
+
[invalidFileSizeMessageSummary]="invalidFileSizeMessageSummary"
|
|
291
|
+
[invalidFileSizeMessageDetail]="invalidFileSizeMessageDetail"
|
|
292
|
+
[invalidFileTypeMessageSummary]="invalidFileTypeMessageSummary"
|
|
293
|
+
[invalidFileTypeMessageDetail]="invalidFileTypeMessageDetail"
|
|
294
|
+
[invalidFileLimitMessageSummary]="invalidFileLimitMessageSummary"
|
|
295
|
+
[invalidFileLimitMessageDetail]="invalidFileLimitMessageDetail"
|
|
296
|
+
(onSelect)="onSelectedFiles($event)"
|
|
297
|
+
(uploadHandler)="onUploader($event)"
|
|
298
|
+
(onRemove)="onRemoveEvent.emit($event)"
|
|
299
|
+
(onClear)="onClearEvent.emit()"
|
|
300
|
+
(onError)="onError.emit($event)"
|
|
301
|
+
>
|
|
302
|
+
<ng-template pTemplate="header" let-uploadCallback="uploadCallback" let-clearCallback="clearCallback">
|
|
303
|
+
<div class="fu-header" [attr.data-ref]="storeCallbacks(uploadCallback, clearCallback)">
|
|
304
|
+
<div class="fu-dropzone"
|
|
305
|
+
[class.fu-dropzone--disabled]="disabled"
|
|
306
|
+
(click)="onChooseClick()"
|
|
307
|
+
(dragover)="$event.preventDefault()"
|
|
308
|
+
(drop)="onDrop($event)">
|
|
309
|
+
<i class="ti ti-upload fu-dropzone__icon"></i>
|
|
310
|
+
<div class="fu-dropzone__info">
|
|
311
|
+
<span class="fu-dropzone__title">{{ dropzoneTitle }}</span>
|
|
312
|
+
<span class="fu-dropzone__caption">
|
|
313
|
+
<i class="ti ti-info-circle"></i>
|
|
314
|
+
{{ dropzoneCaption }}
|
|
315
|
+
</span>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
</ng-template>
|
|
320
|
+
|
|
321
|
+
<ng-template pTemplate="content"
|
|
322
|
+
let-removeFileCallback="removeFileCallback" let-removeUploadedFileCallback="removeUploadedFileCallback">
|
|
323
|
+
<div class="fu-content">
|
|
324
|
+
@if (isUploading) {
|
|
325
|
+
<p-progressBar [value]="totalSizePercent" [showValue]="false"></p-progressBar>
|
|
326
|
+
}
|
|
327
|
+
@if (uploadSuccess) {
|
|
328
|
+
<p-message severity="success" icon="ti ti-circle-check" [closable]="true" (onClose)="uploadSuccess = false">
|
|
329
|
+
Файлы успешно загружены
|
|
330
|
+
</p-message>
|
|
331
|
+
}
|
|
332
|
+
@if (selectedFiles.length > 0) {
|
|
333
|
+
<div class="fu-file-list">
|
|
334
|
+
@for (file of selectedFiles; track file.name + file.size; let i = $index) {
|
|
335
|
+
<div class="fu-file-card">
|
|
336
|
+
<div class="fu-file-card__wrap">
|
|
337
|
+
@if (isImage(file)) {
|
|
338
|
+
<img [src]="file.objectURL" [alt]="file.name" class="fu-file-card__thumbnail" />
|
|
339
|
+
} @else {
|
|
340
|
+
<i class="ti ti-file fu-file-card__icon"></i>
|
|
341
|
+
}
|
|
342
|
+
<div class="fu-file-card__info">
|
|
343
|
+
<span class="fu-file-card__name">{{ file.name }}</span>
|
|
344
|
+
<span class="fu-file-card__size">
|
|
345
|
+
<i class="ti ti-info-circle"></i>
|
|
346
|
+
{{ formatSize(file.size) }}
|
|
347
|
+
</span>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
<extra-button icon="ti ti-trash" variant="text" [rounded]="true" size="small" [iconOnly]="true"
|
|
351
|
+
(click)="onRemoveFile(file, removeFileCallback, i)"></extra-button>
|
|
352
|
+
</div>
|
|
353
|
+
}
|
|
354
|
+
</div>
|
|
355
|
+
}
|
|
356
|
+
@if (uploadedFiles.length > 0) {
|
|
357
|
+
<div class="fu-file-list">
|
|
358
|
+
@for (file of uploadedFiles; track file.name + file.size; let i = $index) {
|
|
359
|
+
<div class="fu-file-card fu-file-card--uploaded">
|
|
360
|
+
<div class="fu-file-card__wrap">
|
|
361
|
+
<i class="ti ti-file-check fu-file-card__icon"></i>
|
|
362
|
+
<div class="fu-file-card__info">
|
|
363
|
+
<span class="fu-file-card__name">{{ file.name }}</span>
|
|
364
|
+
<span class="fu-file-card__size">Загружено</span>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
<extra-button icon="ti ti-trash" variant="text" [rounded]="true" size="small" [iconOnly]="true"
|
|
368
|
+
(click)="removeUploadedFileCallback(i)"></extra-button>
|
|
369
|
+
</div>
|
|
370
|
+
}
|
|
371
|
+
</div>
|
|
372
|
+
}
|
|
373
|
+
@if (selectedFiles.length > 0 || uploadedFiles.length > 0) {
|
|
374
|
+
<div class="fu-footer">
|
|
375
|
+
<extra-button label="Отправить" [disabled]="!selectedFiles.length" (click)="uploadCb?.()"></extra-button>
|
|
376
|
+
<extra-button label="Очистить" severity="danger" variant="text"
|
|
377
|
+
[disabled]="!selectedFiles.length && !uploadedFiles.length" (click)="onClearUpload()"></extra-button>
|
|
378
|
+
</div>
|
|
379
|
+
}
|
|
380
|
+
</div>
|
|
381
|
+
</ng-template>
|
|
382
|
+
</p-fileupload>
|
|
383
|
+
`,
|
|
384
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
385
|
+
}]
|
|
386
|
+
}], propDecorators: { fuRef: [{
|
|
387
|
+
type: ViewChild,
|
|
388
|
+
args: ['fuRef']
|
|
389
|
+
}], name: [{
|
|
390
|
+
type: Input
|
|
391
|
+
}], url: [{
|
|
392
|
+
type: Input
|
|
393
|
+
}], multiple: [{
|
|
394
|
+
type: Input
|
|
395
|
+
}], accept: [{
|
|
396
|
+
type: Input
|
|
397
|
+
}], maxFileSize: [{
|
|
398
|
+
type: Input
|
|
399
|
+
}], fileLimit: [{
|
|
400
|
+
type: Input
|
|
401
|
+
}], disabled: [{
|
|
402
|
+
type: Input
|
|
403
|
+
}], dropzoneTitle: [{
|
|
404
|
+
type: Input
|
|
405
|
+
}], dropzoneCaption: [{
|
|
406
|
+
type: Input
|
|
407
|
+
}], invalidFileSizeMessageSummary: [{
|
|
408
|
+
type: Input
|
|
409
|
+
}], invalidFileSizeMessageDetail: [{
|
|
410
|
+
type: Input
|
|
411
|
+
}], invalidFileTypeMessageSummary: [{
|
|
412
|
+
type: Input
|
|
413
|
+
}], invalidFileTypeMessageDetail: [{
|
|
414
|
+
type: Input
|
|
415
|
+
}], invalidFileLimitMessageSummary: [{
|
|
416
|
+
type: Input
|
|
417
|
+
}], invalidFileLimitMessageDetail: [{
|
|
418
|
+
type: Input
|
|
419
|
+
}], onSelectEvent: [{
|
|
420
|
+
type: Output
|
|
421
|
+
}], onRemoveEvent: [{
|
|
422
|
+
type: Output
|
|
423
|
+
}], onClearEvent: [{
|
|
424
|
+
type: Output
|
|
425
|
+
}], onError: [{
|
|
426
|
+
type: Output
|
|
427
|
+
}], onUpload: [{
|
|
428
|
+
type: Output
|
|
429
|
+
}] } });
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Generated bundle index. Do not edit.
|
|
433
|
+
*/
|
|
434
|
+
|
|
435
|
+
export { ExtraFileUploadComponent };
|
|
436
|
+
//# sourceMappingURL=cdek-it-angular-ui-kit-components-fileupload.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdek-it-angular-ui-kit-components-fileupload.mjs","sources":["../../src/lib/components/fileupload/fileupload.component.ts","../../src/lib/components/fileupload/cdek-it-angular-ui-kit-components-fileupload.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, ChangeDetectorRef, ChangeDetectionStrategy, inject, forwardRef } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n FileUpload,\n FileSelectEvent,\n FileRemoveEvent,\n FileUploadErrorEvent,\n FileUploadHandlerEvent,\n} from 'primeng/fileupload';\nimport { ProgressBar } from 'primeng/progressbar';\nimport { Message } from 'primeng/message';\nimport { PrimeTemplate } from 'primeng/api';\nimport { ExtraButtonComponent } from '@cdek-it/angular-ui-kit/components/button';\n\n// PrimeNG добавляет objectURL для превью в рантайме, но не типизирует его\ntype PreviewFile = File & { objectURL?: string };\n\n@Component({\n selector: 'extra-fileupload',\n standalone: true,\n imports: [FileUpload, ProgressBar, Message, PrimeTemplate, ExtraButtonComponent],\n host: { style: 'display: contents' },\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => ExtraFileUploadComponent), multi: true }],\n template: `\n <p-fileupload\n #fuRef\n [name]=\"name\"\n [url]=\"url\"\n [multiple]=\"multiple\"\n [accept]=\"accept\"\n [maxFileSize]=\"maxFileSize\"\n [fileLimit]=\"fileLimit\"\n [disabled]=\"disabled\"\n [customUpload]=\"true\"\n [auto]=\"false\"\n [invalidFileSizeMessageSummary]=\"invalidFileSizeMessageSummary\"\n [invalidFileSizeMessageDetail]=\"invalidFileSizeMessageDetail\"\n [invalidFileTypeMessageSummary]=\"invalidFileTypeMessageSummary\"\n [invalidFileTypeMessageDetail]=\"invalidFileTypeMessageDetail\"\n [invalidFileLimitMessageSummary]=\"invalidFileLimitMessageSummary\"\n [invalidFileLimitMessageDetail]=\"invalidFileLimitMessageDetail\"\n (onSelect)=\"onSelectedFiles($event)\"\n (uploadHandler)=\"onUploader($event)\"\n (onRemove)=\"onRemoveEvent.emit($event)\"\n (onClear)=\"onClearEvent.emit()\"\n (onError)=\"onError.emit($event)\"\n >\n <ng-template pTemplate=\"header\" let-uploadCallback=\"uploadCallback\" let-clearCallback=\"clearCallback\">\n <div class=\"fu-header\" [attr.data-ref]=\"storeCallbacks(uploadCallback, clearCallback)\">\n <div class=\"fu-dropzone\"\n [class.fu-dropzone--disabled]=\"disabled\"\n (click)=\"onChooseClick()\"\n (dragover)=\"$event.preventDefault()\"\n (drop)=\"onDrop($event)\">\n <i class=\"ti ti-upload fu-dropzone__icon\"></i>\n <div class=\"fu-dropzone__info\">\n <span class=\"fu-dropzone__title\">{{ dropzoneTitle }}</span>\n <span class=\"fu-dropzone__caption\">\n <i class=\"ti ti-info-circle\"></i>\n {{ dropzoneCaption }}\n </span>\n </div>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"content\"\n let-removeFileCallback=\"removeFileCallback\" let-removeUploadedFileCallback=\"removeUploadedFileCallback\">\n <div class=\"fu-content\">\n @if (isUploading) {\n <p-progressBar [value]=\"totalSizePercent\" [showValue]=\"false\"></p-progressBar>\n }\n @if (uploadSuccess) {\n <p-message severity=\"success\" icon=\"ti ti-circle-check\" [closable]=\"true\" (onClose)=\"uploadSuccess = false\">\n Файлы успешно загружены\n </p-message>\n }\n @if (selectedFiles.length > 0) {\n <div class=\"fu-file-list\">\n @for (file of selectedFiles; track file.name + file.size; let i = $index) {\n <div class=\"fu-file-card\">\n <div class=\"fu-file-card__wrap\">\n @if (isImage(file)) {\n <img [src]=\"file.objectURL\" [alt]=\"file.name\" class=\"fu-file-card__thumbnail\" />\n } @else {\n <i class=\"ti ti-file fu-file-card__icon\"></i>\n }\n <div class=\"fu-file-card__info\">\n <span class=\"fu-file-card__name\">{{ file.name }}</span>\n <span class=\"fu-file-card__size\">\n <i class=\"ti ti-info-circle\"></i>\n {{ formatSize(file.size) }}\n </span>\n </div>\n </div>\n <extra-button icon=\"ti ti-trash\" variant=\"text\" [rounded]=\"true\" size=\"small\" [iconOnly]=\"true\"\n (click)=\"onRemoveFile(file, removeFileCallback, i)\"></extra-button>\n </div>\n }\n </div>\n }\n @if (uploadedFiles.length > 0) {\n <div class=\"fu-file-list\">\n @for (file of uploadedFiles; track file.name + file.size; let i = $index) {\n <div class=\"fu-file-card fu-file-card--uploaded\">\n <div class=\"fu-file-card__wrap\">\n <i class=\"ti ti-file-check fu-file-card__icon\"></i>\n <div class=\"fu-file-card__info\">\n <span class=\"fu-file-card__name\">{{ file.name }}</span>\n <span class=\"fu-file-card__size\">Загружено</span>\n </div>\n </div>\n <extra-button icon=\"ti ti-trash\" variant=\"text\" [rounded]=\"true\" size=\"small\" [iconOnly]=\"true\"\n (click)=\"removeUploadedFileCallback(i)\"></extra-button>\n </div>\n }\n </div>\n }\n @if (selectedFiles.length > 0 || uploadedFiles.length > 0) {\n <div class=\"fu-footer\">\n <extra-button label=\"Отправить\" [disabled]=\"!selectedFiles.length\" (click)=\"uploadCb?.()\"></extra-button>\n <extra-button label=\"Очистить\" severity=\"danger\" variant=\"text\"\n [disabled]=\"!selectedFiles.length && !uploadedFiles.length\" (click)=\"onClearUpload()\"></extra-button>\n </div>\n }\n </div>\n </ng-template>\n </p-fileupload>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ExtraFileUploadComponent implements ControlValueAccessor {\n private el = inject(ElementRef);\n private cdr = inject(ChangeDetectorRef);\n @ViewChild('fuRef') fuRef!: FileUpload;\n\n @Input() name = 'files[]';\n @Input() url = '/api/upload';\n @Input() multiple = true;\n @Input() accept = 'image/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document';\n @Input() maxFileSize = 1000000;\n @Input() fileLimit: number | undefined = undefined;\n @Input() disabled = false;\n @Input() dropzoneTitle = 'Чтобы загрузить файлы кликните или перетащите их в эту область';\n @Input() dropzoneCaption = 'Можно загрузить не более 10 файлов размером 1 MB';\n\n @Input() invalidFileSizeMessageSummary = '{0}: Некорректный размер файла';\n @Input() invalidFileSizeMessageDetail = 'Максимальный размер — {0}';\n @Input() invalidFileTypeMessageSummary = '{0}: Некорректный тип файла';\n @Input() invalidFileTypeMessageDetail = 'Допустимые типы: {0}';\n @Input() invalidFileLimitMessageSummary = 'Превышен лимит файлов';\n @Input() invalidFileLimitMessageDetail = 'Максимум: {0}';\n\n @Output() onSelectEvent = new EventEmitter<FileSelectEvent>();\n @Output() onRemoveEvent = new EventEmitter<FileRemoveEvent>();\n @Output() onClearEvent = new EventEmitter<void>();\n @Output() onError = new EventEmitter<FileUploadErrorEvent>();\n @Output() onUpload = new EventEmitter<FileUploadHandlerEvent>();\n\n selectedFiles: PreviewFile[] = [];\n uploadedFiles: PreviewFile[] = [];\n totalSize = 0;\n totalSizePercent = 0;\n uploadSuccess = false;\n isUploading = false;\n\n private uploadCbRef: (() => void) | null = null;\n private clearCbRef: (() => void) | null = null;\n private onChange: (files: File[]) => void = () => {};\n private onTouched: () => void = () => {};\n\n writeValue(files: File[]): void {\n this.selectedFiles = files ?? [];\n this.cdr.markForCheck();\n }\n\n registerOnChange(fn: (files: File[]) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.cdr.markForCheck();\n }\n\n get uploadCb(): (() => void) | null {\n return this.uploadCbRef;\n }\n\n storeCallbacks(upload: () => void, clear: () => void): string {\n this.uploadCbRef = upload;\n this.clearCbRef = clear;\n return '';\n }\n\n onDrop(event: DragEvent): void {\n event.preventDefault();\n const files = event.dataTransfer?.files;\n if (!files?.length || this.disabled) return;\n const accepted = this.filterFilesByAccept(Array.from(files));\n if (!accepted.length) return;\n const dt = new DataTransfer();\n accepted.forEach(f => dt.items.add(f));\n this.fuRef.onFileSelect({ target: { files: dt.files } } as unknown as Event);\n }\n\n private filterFilesByAccept(files: File[]): File[] {\n if (!this.accept) return files;\n const types = this.accept.split(',').map(t => t.trim());\n return files.filter(file =>\n types.some(type => {\n if (type.includes('*')) {\n return file.type.startsWith(type.replace('*', ''));\n }\n if (type.startsWith('.')) {\n return file.name.toLowerCase().endsWith(type.toLowerCase());\n }\n return file.type === type;\n }),\n );\n }\n\n onChooseClick(): void {\n const input = this.el.nativeElement.querySelector('input[type=\"file\"]') as HTMLInputElement;\n input?.click();\n }\n\n isImage(file: File): boolean {\n return file.type.startsWith('image/');\n }\n\n formatSize(bytes: number): string {\n if (bytes === 0) return '0 B';\n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(3)) + ' ' + sizes[i];\n }\n\n onSelectedFiles(event: FileSelectEvent): void {\n this.selectedFiles = [...(this.fuRef?.files || [])];\n this.totalSize = this.selectedFiles.reduce((acc, f) => acc + f.size, 0);\n this.uploadSuccess = false;\n this.isUploading = this.selectedFiles.length > 0;\n this.totalSizePercent = 0;\n\n let progress = 0;\n const interval = setInterval(() => {\n progress += 10;\n this.totalSizePercent = Math.min(progress, 100);\n if (progress >= 100) clearInterval(interval);\n this.cdr.markForCheck();\n }, 40);\n\n this.onChange(this.selectedFiles);\n this.onTouched();\n this.cdr.markForCheck();\n this.onSelectEvent.emit(event);\n }\n\n onUploader(event: FileUploadHandlerEvent): void {\n setTimeout(() => {\n this.clearCbRef?.();\n this.selectedFiles = [];\n this.uploadedFiles = [...(event.files || [])];\n this.totalSize = 0;\n this.totalSizePercent = 0;\n this.uploadSuccess = true;\n this.isUploading = false;\n this.onChange([]);\n this.cdr.markForCheck();\n }, 1500);\n this.onUpload.emit(event);\n }\n\n onRemoveFile(file: File, removeFileCallback: (index: number) => void, index: number): void {\n removeFileCallback(index);\n this.selectedFiles = [...(this.fuRef?.files || [])];\n this.totalSize -= file.size;\n this.totalSizePercent = Math.min((this.totalSize / (this.maxFileSize || 1000000)) * 100, 100);\n if (this.totalSize <= 0) {\n this.isUploading = false;\n }\n this.onChange(this.selectedFiles);\n this.cdr.markForCheck();\n }\n\n onClearUpload(): void {\n this.clearCbRef?.();\n this.selectedFiles = [];\n this.uploadedFiles = [];\n this.totalSize = 0;\n this.totalSizePercent = 0;\n this.uploadSuccess = false;\n this.isUploading = false;\n this.onChange([]);\n this.cdr.markForCheck();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAmIa,wBAAwB,CAAA;AAC3B,IAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AACvB,IAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AACnB,IAAA,KAAK;IAEhB,IAAI,GAAG,SAAS;IAChB,GAAG,GAAG,aAAa;IACnB,QAAQ,GAAG,IAAI;IACf,MAAM,GAAG,oHAAoH;IAC7H,WAAW,GAAG,OAAO;IACrB,SAAS,GAAuB,SAAS;IACzC,QAAQ,GAAG,KAAK;IAChB,aAAa,GAAG,gEAAgE;IAChF,eAAe,GAAG,kDAAkD;IAEpE,6BAA6B,GAAG,gCAAgC;IAChE,4BAA4B,GAAG,2BAA2B;IAC1D,6BAA6B,GAAG,6BAA6B;IAC7D,4BAA4B,GAAG,sBAAsB;IACrD,8BAA8B,GAAG,uBAAuB;IACxD,6BAA6B,GAAG,eAAe;AAE9C,IAAA,aAAa,GAAG,IAAI,YAAY,EAAmB;AACnD,IAAA,aAAa,GAAG,IAAI,YAAY,EAAmB;AACnD,I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AAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;sBAIE,SAAS;uBAAC,OAAO;;sBAEjB;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;;AC7JH;;AAEG;;;;"}
|
|
@@ -8,8 +8,8 @@ import { SharedModule } from 'primeng/api';
|
|
|
8
8
|
const SEVERITY_ICONS = {
|
|
9
9
|
info: 'ti ti-info-circle',
|
|
10
10
|
success: 'ti ti-circle-check',
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
warning: 'ti ti-alert-triangle',
|
|
12
|
+
danger: 'ti ti-alert-circle'
|
|
13
13
|
};
|
|
14
14
|
class ExtraMessageComponent {
|
|
15
15
|
severity = 'info';
|
|
@@ -22,9 +22,16 @@ class ExtraMessageComponent {
|
|
|
22
22
|
get resolvedIcon() {
|
|
23
23
|
return this.icon ?? SEVERITY_ICONS[this.severity] ?? 'ti ti-info-circle';
|
|
24
24
|
}
|
|
25
|
+
get primeSeverity() {
|
|
26
|
+
if (this.severity === 'warning')
|
|
27
|
+
return 'warn';
|
|
28
|
+
if (this.severity === 'danger')
|
|
29
|
+
return 'error';
|
|
30
|
+
return this.severity;
|
|
31
|
+
}
|
|
25
32
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: ExtraMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
26
33
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: ExtraMessageComponent, isStandalone: true, selector: "extra-message", inputs: { severity: "severity", summary: "summary", detail: "detail", icon: "icon", closable: "closable", life: "life" }, outputs: { onClose: "onClose" }, ngImport: i0, template: `
|
|
27
|
-
<p-message [severity]="
|
|
34
|
+
<p-message [severity]="primeSeverity" [closable]="false" [life]="life">
|
|
28
35
|
<ng-template pTemplate="container" let-closeCallback="closeCallback">
|
|
29
36
|
<div class="p-message-accent-line"></div>
|
|
30
37
|
<i [class]="resolvedIcon + ' p-message-icon'"></i>
|
|
@@ -56,7 +63,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
56
63
|
standalone: true,
|
|
57
64
|
imports: [Message, ButtonDirective, SharedModule],
|
|
58
65
|
template: `
|
|
59
|
-
<p-message [severity]="
|
|
66
|
+
<p-message [severity]="primeSeverity" [closable]="false" [life]="life">
|
|
60
67
|
<ng-template pTemplate="container" let-closeCallback="closeCallback">
|
|
61
68
|
<div class="p-message-accent-line"></div>
|
|
62
69
|
<i [class]="resolvedIcon + ' p-message-icon'"></i>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdek-it-angular-ui-kit-components-message.mjs","sources":["../../src/lib/components/message/message.component.ts","../../src/lib/components/message/cdek-it-angular-ui-kit-components-message.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { Message } from 'primeng/message';\nimport { ButtonDirective } from 'primeng/button';\nimport { SharedModule } from 'primeng/api';\n\nexport type ExtraMessageSeverity = 'success' | 'info' | 'warn' | 'error' | 'secondary' | 'contrast';\n\nconst SEVERITY_ICONS: Record<string, string> = {\n info: 'ti ti-info-circle',\n success: 'ti ti-circle-check',\n
|
|
1
|
+
{"version":3,"file":"cdek-it-angular-ui-kit-components-message.mjs","sources":["../../src/lib/components/message/message.component.ts","../../src/lib/components/message/cdek-it-angular-ui-kit-components-message.ts"],"sourcesContent":["import { Component, EventEmitter, Input, Output } from '@angular/core';\nimport { Message } from 'primeng/message';\nimport { ButtonDirective } from 'primeng/button';\nimport { SharedModule } from 'primeng/api';\n\nexport type ExtraMessageSeverity = 'success' | 'info' | 'warning' | 'danger' | 'secondary' | 'contrast';\n\ntype PrimeMessageSeverity = 'success' | 'info' | 'warn' | 'error' | 'secondary' | 'contrast';\n\nconst SEVERITY_ICONS: Record<string, string> = {\n info: 'ti ti-info-circle',\n success: 'ti ti-circle-check',\n warning: 'ti ti-alert-triangle',\n danger: 'ti ti-alert-circle'\n};\n\n@Component({\n selector: 'extra-message',\n standalone: true,\n imports: [Message, ButtonDirective, SharedModule],\n template: `\n <p-message [severity]=\"primeSeverity\" [closable]=\"false\" [life]=\"life\">\n <ng-template pTemplate=\"container\" let-closeCallback=\"closeCallback\">\n <div class=\"p-message-accent-line\"></div>\n <i [class]=\"resolvedIcon + ' p-message-icon'\"></i>\n <div class=\"p-message-text\">\n <span class=\"p-message-summary\">{{ summary }}</span>\n @if (detail) {\n <div class=\"p-message-detail\">{{ detail }}</div>\n }\n <ng-content></ng-content>\n </div>\n @if (closable) {\n <button\n type=\"button\"\n pButton\n [text]=\"true\"\n icon=\"ti ti-x\"\n class=\"p-message-close-button\"\n (click)=\"closeCallback($event); onClose.emit($event)\"\n ></button>\n }\n </ng-template>\n </p-message>\n `\n})\nexport class ExtraMessageComponent {\n @Input() severity: ExtraMessageSeverity = 'info';\n @Input() summary = '';\n @Input() detail = '';\n @Input() icon: string | undefined = undefined;\n @Input() closable = false;\n @Input() life: number | undefined = undefined;\n\n @Output() onClose = new EventEmitter<Event>();\n\n get resolvedIcon(): string {\n return this.icon ?? SEVERITY_ICONS[this.severity] ?? 'ti ti-info-circle';\n }\n\n get primeSeverity(): PrimeMessageSeverity {\n if (this.severity === 'warning') return 'warn';\n if (this.severity === 'danger') return 'error';\n return this.severity;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AASA,MAAM,cAAc,GAA2B;AAC7C,IAAA,IAAI,EAAE,mBAAmB;AACzB,IAAA,OAAO,EAAE,oBAAoB;AAC7B,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,MAAM,EAAE;CACT;MAgCY,qBAAqB,CAAA;IACvB,QAAQ,GAAyB,MAAM;IACvC,OAAO,GA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ExtraProgressSpinnerComponent {
|
|
6
|
-
size = '
|
|
6
|
+
size = 'base';
|
|
7
7
|
multicolor = true;
|
|
8
8
|
strokeWidth = '2';
|
|
9
9
|
fill = 'none';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdek-it-angular-ui-kit-components-progressspinner.mjs","sources":["../../src/lib/components/progressspinner/progressspinner.component.ts","../../src/lib/components/progressspinner/cdek-it-angular-ui-kit-components-progressspinner.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n// Let's import the component directly. Wait, index.d.ts exports { ProgressSpinner, ProgressSpinnerModule }. Either is fine. Let's use ProgressSpinner.\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nexport type ExtraProgressSpinnerSize = 'small' | '
|
|
1
|
+
{"version":3,"file":"cdek-it-angular-ui-kit-components-progressspinner.mjs","sources":["../../src/lib/components/progressspinner/progressspinner.component.ts","../../src/lib/components/progressspinner/cdek-it-angular-ui-kit-components-progressspinner.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n// Let's import the component directly. Wait, index.d.ts exports { ProgressSpinner, ProgressSpinnerModule }. Either is fine. Let's use ProgressSpinner.\nimport { ProgressSpinner } from 'primeng/progressspinner';\n\nexport type ExtraProgressSpinnerSize = 'small' | 'base' | 'large' | 'xlarge';\n\n@Component({\n selector: 'extra-progressspinner',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ProgressSpinner],\n template: `\n <p-progressSpinner\n [styleClass]=\"primeStyleClass\"\n [strokeWidth]=\"strokeWidth\"\n [fill]=\"fill\"\n [animationDuration]=\"animationDuration\"\n [ariaLabel]=\"ariaLabel\"\n ></p-progressSpinner>\n `\n})\nexport class ExtraProgressSpinnerComponent {\n @Input() size: ExtraProgressSpinnerSize = 'base';\n @Input() multicolor = true;\n @Input() strokeWidth = '2';\n @Input() fill = 'none';\n @Input() animationDuration = '2s';\n @Input() ariaLabel: string | undefined = undefined;\n\n get primeStyleClass(): string {\n const sizeClass = `p-progressspinner-${this.size}`;\n const colorClass = this.multicolor ? '' : 'p-progressspinner-monochrome';\n return `${sizeClass} ${colorClass}`.trim();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAqBa,6BAA6B,CAAA;IAC/B,IAAI,GAA6B,MAAM;IACvC,UAAU,GAAG,IAAI;IACjB,WAAW,GAAG,GAAG;IACjB,IAAI,GAAG,MAAM;IACb,iBAAiB,GAAG,IAAI;IACxB,SAAS,GAAuB,SAAS;AAElD,IAAA,IAAI,eAAe,GAAA;AACjB,QAAA,MAAM,SAAS,GAAG,CAAA,kBAAA,EAAqB,IAAI,CAAC,IAAI,EAAE;AAClD,QAAA,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,EAAE,GAAG,8BAA8B;QACxE,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,UAAU,EAAE,CAAC,IAAI,EAAE;IAC5C;wGAZW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA7B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,6BAA6B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,UAAA,EAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,IAAA,EAAA,MAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAV9B;;;;;;;;AAQT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IA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