uitec-ng-upload-order 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,198 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Input, Output, ViewChild, NgModule } from '@angular/core';
3
+ import * as i2 from 'ngx-filepond';
4
+ import { registerPlugin, FilePondModule } from 'ngx-filepond';
5
+ import * as i1 from 'ngx-lightbox';
6
+ import { LightboxModule } from 'ngx-lightbox';
7
+ import { CommonModule } from '@angular/common';
8
+ import * as FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type';
9
+ import * as FilePondPluginImagePreview from 'filepond-plugin-image-preview';
10
+ import * as FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation';
11
+ import * as FilePondPluginFileValidateSize from 'filepond-plugin-file-validate-size';
12
+ import * as FilePondPluginImageCrop from 'filepond-plugin-image-crop';
13
+ import * as FilePondPluginImageResize from 'filepond-plugin-image-resize';
14
+
15
+ class UiUploadOrderComponent {
16
+ constructor(_lightbox) {
17
+ this._lightbox = _lightbox;
18
+ this.multiple = true;
19
+ this.maxFiles = 6;
20
+ this.onRemove = new EventEmitter();
21
+ this.onAdded = new EventEmitter();
22
+ this.onActivate = new EventEmitter();
23
+ this.onInit = new EventEmitter();
24
+ this.onMaxReached = new EventEmitter();
25
+ this.onReOrder = new EventEmitter();
26
+ this.pondOptions = {
27
+ allowMultiple: this.multiple,
28
+ labelIdle: 'Arraste seus arquivos<br>ou<br><span class="filepond--label-action">Clique aqui</span> para selecionar',
29
+ allowReorder: true,
30
+ maxFiles: this.maxFiles,
31
+ acceptedFileTypes: ['image/*'],
32
+ instantUpload: true,
33
+ dropValidation: true,
34
+ iconRemove: '<img src="assets/icons/delete_forever.svg" alt="SVG Icon">',
35
+ styleButtonRemoveItemPosition: 'right',
36
+ imageResizeMode: 'contain',
37
+ styleItemPanelAspectRatio: '0.75',
38
+ itemInsertLocation: 'after',
39
+ server: {
40
+ process: {
41
+ url: 'https://upload.uishop.com.br/imagem/upload?id=7737&bucket=hom-produto&path=12510&name=Egito', //this.url
42
+ },
43
+ load: (source, load, error, progress, abort, headers) => {
44
+ var myRequest = new Request(source);
45
+ fetch(myRequest).then(response => {
46
+ response.blob().then(myBlob => {
47
+ load(myBlob);
48
+ });
49
+ }).catch(error => {
50
+ console.log('ERROR: ', error);
51
+ });
52
+ },
53
+ },
54
+ };
55
+ this.pondFiles = [];
56
+ this.album = [];
57
+ }
58
+ ngOnInit() {
59
+ if (this.initialFiles) {
60
+ this.pondFiles = this.initialFiles.map((item) => {
61
+ return {
62
+ source: item,
63
+ options: {
64
+ type: 'local',
65
+ },
66
+ };
67
+ });
68
+ }
69
+ }
70
+ pondHandleInit() {
71
+ this.onInit.emit(this.pondFiles);
72
+ }
73
+ pondHandleAddFile(event) {
74
+ this.onAdded.emit(event.file);
75
+ }
76
+ pondHandleActivateFile(event) {
77
+ this.onActivate.emit(event.file);
78
+ this.openLightBox(event.file.filenameWithoutExtension);
79
+ }
80
+ pondHandleUpdate(event) {
81
+ this.fillAlbum(event.items);
82
+ }
83
+ pondHandleRemove(event) {
84
+ this.onRemove.emit(event.file);
85
+ }
86
+ onReorderFiles(event) {
87
+ this.fillAlbum(event.items, true);
88
+ this.onReOrder.emit(event.items);
89
+ }
90
+ warning(event) {
91
+ if (event.error.code == 0) {
92
+ this.onMaxReached.emit(`Limite de Arquivos atingido. Você pode inserir um total de ${this.maxFiles} arquivos.`);
93
+ }
94
+ }
95
+ openLightBox(fileName) {
96
+ let index = this.album.map(function (e) { return e.caption; }).indexOf(fileName);
97
+ this._lightbox.open(this.album, index);
98
+ }
99
+ async fillAlbum(files, reOrder) {
100
+ if (files.length !== this.album.length || reOrder) {
101
+ const preAlbum = await Promise.all(files.map(async (file) => {
102
+ let fileUrl;
103
+ if (file.source instanceof File) {
104
+ fileUrl = await this.readFileAsync(file.source);
105
+ }
106
+ else {
107
+ fileUrl = file.source.toString();
108
+ }
109
+ return {
110
+ src: fileUrl,
111
+ caption: file.filenameWithoutExtension,
112
+ thumb: ''
113
+ };
114
+ }));
115
+ this.album = preAlbum;
116
+ }
117
+ }
118
+ readFileAsync(file) {
119
+ return new Promise((resolve) => {
120
+ const reader = new FileReader();
121
+ reader.readAsDataURL(file);
122
+ reader.onload = () => {
123
+ const dataUrl = reader.result;
124
+ const fileUrl = dataUrl.toString();
125
+ resolve(fileUrl);
126
+ };
127
+ });
128
+ }
129
+ }
130
+ UiUploadOrderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UiUploadOrderComponent, deps: [{ token: i1.Lightbox }], target: i0.ɵɵFactoryTarget.Component });
131
+ UiUploadOrderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: UiUploadOrderComponent, selector: "ui-upload-order", inputs: { url: "url", uploadHandler: "uploadHandler", initialFiles: "initialFiles", multiple: "multiple", maxFiles: "maxFiles" }, outputs: { onRemove: "onRemove", onAdded: "onAdded", onActivate: "onActivate", onInit: "onInit", onMaxReached: "onMaxReached", onReOrder: "onReOrder" }, viewQueries: [{ propertyName: "myPond", first: true, predicate: ["myPond"], descendants: true }], ngImport: i0, template: "<!-- app.component.html -->\r\n<file-pond\r\n #myPond\r\n name='UploadForm[imagem][]'\r\n [options]=\"pondOptions\"\r\n (oninit)=\"pondHandleInit()\"\r\n [files]=\"pondFiles\"\r\n (onaddfile)=\"pondHandleAddFile($event)\"\r\n (onupdatefiles)=\"pondHandleUpdate($event)\"\r\n (onactivatefile)=\"pondHandleActivateFile($event)\"\r\n (onremovefile)=\"pondHandleRemove($event)\"\r\n (onreorderfiles)=\"onReorderFiles($event)\"\r\n (onwarning)=\"warning($event)\"\r\n/>\r\n", styles: [":host ::ng-deep .filepond--root .filepond--drop-label{height:128px}:host ::ng-deep .filepond--drop-label{color:#555}:host ::ng-deep .filepond--panel-root{background-color:#fff;border:1.5px solid rgba(173,181,189,.5019607843);border-style:dashed}:host ::ng-deep .filepond--image-preview-overlay{display:none}:host ::ng-deep .filepond--file-action-button{background-color:#f73264}:host ::ng-deep .filepond--list{margin-left:5%}@media (min-width: 30em){:host ::ng-deep .filepond--item{width:calc(40% - .5em)}}@media (min-width: 50em){:host ::ng-deep .filepond--item{width:calc(24% - .5em)}}\n"], dependencies: [{ kind: "component", type: i2.FilePondComponent, selector: "file-pond", inputs: ["options", "files"], outputs: ["oninit", "onwarning", "onerror", "oninitfile", "onactivatefile", "onaddfilestart", "onaddfileprogress", "onaddfile", "onprocessfilestart", "onprocessfileprogress", "onprocessfileabort", "onprocessfilerevert", "onprocessfile", "onprocessfiles", "onremovefile", "onpreparefile", "onupdatefiles", "onreorderfiles"] }] });
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UiUploadOrderComponent, decorators: [{
133
+ type: Component,
134
+ args: [{ selector: 'ui-upload-order', template: "<!-- app.component.html -->\r\n<file-pond\r\n #myPond\r\n name='UploadForm[imagem][]'\r\n [options]=\"pondOptions\"\r\n (oninit)=\"pondHandleInit()\"\r\n [files]=\"pondFiles\"\r\n (onaddfile)=\"pondHandleAddFile($event)\"\r\n (onupdatefiles)=\"pondHandleUpdate($event)\"\r\n (onactivatefile)=\"pondHandleActivateFile($event)\"\r\n (onremovefile)=\"pondHandleRemove($event)\"\r\n (onreorderfiles)=\"onReorderFiles($event)\"\r\n (onwarning)=\"warning($event)\"\r\n/>\r\n", styles: [":host ::ng-deep .filepond--root .filepond--drop-label{height:128px}:host ::ng-deep .filepond--drop-label{color:#555}:host ::ng-deep .filepond--panel-root{background-color:#fff;border:1.5px solid rgba(173,181,189,.5019607843);border-style:dashed}:host ::ng-deep .filepond--image-preview-overlay{display:none}:host ::ng-deep .filepond--file-action-button{background-color:#f73264}:host ::ng-deep .filepond--list{margin-left:5%}@media (min-width: 30em){:host ::ng-deep .filepond--item{width:calc(40% - .5em)}}@media (min-width: 50em){:host ::ng-deep .filepond--item{width:calc(24% - .5em)}}\n"] }]
135
+ }], ctorParameters: function () { return [{ type: i1.Lightbox }]; }, propDecorators: { url: [{
136
+ type: Input
137
+ }], uploadHandler: [{
138
+ type: Input
139
+ }], initialFiles: [{
140
+ type: Input
141
+ }], multiple: [{
142
+ type: Input
143
+ }], maxFiles: [{
144
+ type: Input
145
+ }], onRemove: [{
146
+ type: Output
147
+ }], onAdded: [{
148
+ type: Output
149
+ }], onActivate: [{
150
+ type: Output
151
+ }], onInit: [{
152
+ type: Output
153
+ }], onMaxReached: [{
154
+ type: Output
155
+ }], onReOrder: [{
156
+ type: Output
157
+ }], myPond: [{
158
+ type: ViewChild,
159
+ args: ["myPond"]
160
+ }] } });
161
+
162
+ registerPlugin(FilePondPluginFileValidateType, FilePondPluginImagePreview, FilePondPluginImageExifOrientation, FilePondPluginFileValidateSize, FilePondPluginImageCrop, FilePondPluginImageResize);
163
+ class UiUploadOrderModule {
164
+ }
165
+ UiUploadOrderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UiUploadOrderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
166
+ UiUploadOrderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: UiUploadOrderModule, declarations: [UiUploadOrderComponent], imports: [CommonModule,
167
+ FilePondModule,
168
+ LightboxModule], exports: [UiUploadOrderComponent] });
169
+ UiUploadOrderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UiUploadOrderModule, imports: [CommonModule,
170
+ FilePondModule,
171
+ LightboxModule] });
172
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: UiUploadOrderModule, decorators: [{
173
+ type: NgModule,
174
+ args: [{
175
+ declarations: [
176
+ UiUploadOrderComponent
177
+ ],
178
+ imports: [
179
+ CommonModule,
180
+ FilePondModule,
181
+ LightboxModule
182
+ ],
183
+ exports: [
184
+ UiUploadOrderComponent
185
+ ]
186
+ }]
187
+ }] });
188
+
189
+ /*
190
+ * Public API Surface of ui-upload-order
191
+ */
192
+
193
+ /**
194
+ * Generated bundle index. Do not edit.
195
+ */
196
+
197
+ export { UiUploadOrderComponent, UiUploadOrderModule };
198
+ //# sourceMappingURL=uitec-upload-order.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uitec-upload-order.mjs","sources":["../../../projects/ui-upload-order/src/lib/ui-upload-order.component.ts","../../../projects/ui-upload-order/src/lib/ui-upload-order.component.html","../../../projects/ui-upload-order/src/lib/ui-upload-order.module.ts","../../../projects/ui-upload-order/src/public-api.ts","../../../projects/ui-upload-order/src/uitec-upload-order.ts"],"sourcesContent":["import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from \"@angular/core\";\r\nimport { FilePondComponent, } from \"ngx-filepond\";\r\nimport { FilePondCallbackProps, FilePondFile, FilePondOptions } from \"filepond\";\r\nimport { IAlbum, Lightbox } from 'ngx-lightbox';\r\n\r\n@Component({\r\n selector: 'ui-upload-order',\r\n templateUrl: './ui-upload-order.component.html',\r\n styleUrls: ['./ui-upload-order.component.scss']\r\n})\r\nexport class UiUploadOrderComponent implements OnInit {\r\n @Input() url: string;\r\n @Input() uploadHandler: any;\r\n @Input() initialFiles: string[];\r\n @Input() multiple: boolean = true;\r\n @Input() maxFiles: number = 6;\r\n\r\n\r\n @Output() onRemove = new EventEmitter<FilePondFile>();\r\n @Output() onAdded = new EventEmitter<FilePondFile>();\r\n @Output() onActivate = new EventEmitter<FilePondFile>();\r\n @Output() onInit = new EventEmitter<FilePondOptions[\"files\"]>();\r\n @Output() onMaxReached = new EventEmitter<string>();\r\n @Output() onReOrder = new EventEmitter<FilePondFile[]>();\r\n\r\n @ViewChild(\"myPond\") myPond: FilePondComponent;\r\n\r\n constructor(private _lightbox: Lightbox) {\r\n\r\n }\r\n\r\n pondOptions: FilePondOptions = {\r\n allowMultiple: this.multiple,\r\n labelIdle: 'Arraste seus arquivos<br>ou<br><span class=\"filepond--label-action\">Clique aqui</span> para selecionar',\r\n allowReorder: true,\r\n maxFiles: this.maxFiles,\r\n acceptedFileTypes: ['image/*'],\r\n instantUpload: true,\r\n dropValidation: true,\r\n iconRemove: '<img src=\"assets/icons/delete_forever.svg\" alt=\"SVG Icon\">',\r\n styleButtonRemoveItemPosition: 'right',\r\n imageResizeMode: 'contain',\r\n styleItemPanelAspectRatio: '0.75',\r\n itemInsertLocation: 'after',\r\n server: {\r\n process: {\r\n url: 'https://upload.uishop.com.br/imagem/upload?id=7737&bucket=hom-produto&path=12510&name=Egito', //this.url\r\n },\r\n load: (source, load, error, progress, abort, headers) => {\r\n var myRequest = new Request(source);\r\n fetch(myRequest).then(response => {\r\n response.blob().then(myBlob => {\r\n load(myBlob)\r\n });\r\n }).catch(error => {\r\n console.log('ERROR: ', error)\r\n });\r\n },\r\n },\r\n\r\n };\r\n\r\n pondFiles: FilePondOptions[\"files\"] = [];\r\n\r\n public album: IAlbum[] = [];\r\n\r\n ngOnInit(): void {\r\n if (this.initialFiles) {\r\n this.pondFiles = this.initialFiles.map((item: string) => {\r\n return {\r\n source: item,\r\n options: {\r\n type: 'local',\r\n },\r\n };\r\n });\r\n }\r\n }\r\n\r\n pondHandleInit() {\r\n this.onInit.emit(this.pondFiles)\r\n }\r\n\r\n pondHandleAddFile(event: any) {\r\n this.onAdded.emit(event.file)\r\n }\r\n\r\n pondHandleActivateFile(event: any) {\r\n this.onActivate.emit(event.file)\r\n this.openLightBox(event.file.filenameWithoutExtension)\r\n\r\n }\r\n\r\n pondHandleUpdate(event: any) {\r\n this.fillAlbum(event.items)\r\n\r\n }\r\n\r\n pondHandleRemove(event: any) {\r\n this.onRemove.emit(event.file)\r\n }\r\n\r\n onReorderFiles(event: any) {\r\n this.fillAlbum(event.items, true)\r\n this.onReOrder.emit(event.items)\r\n }\r\n\r\n warning(event: any) {\r\n if (event.error.code == 0) {\r\n this.onMaxReached.emit(`Limite de Arquivos atingido. Você pode inserir um total de ${this.maxFiles} arquivos.`)\r\n }\r\n }\r\n\r\n openLightBox(fileName: string): void {\r\n let index = this.album.map(function (e) { return e.caption; }).indexOf(fileName);\r\n this._lightbox.open(this.album, index);\r\n }\r\n\r\n\r\n async fillAlbum(files: [], reOrder?: boolean) {\r\n if (files.length !== this.album.length || reOrder) {\r\n\r\n const preAlbum = await Promise.all(files.map(async (file: FilePondFile) => {\r\n let fileUrl: string;\r\n\r\n if (file.source instanceof File) {\r\n fileUrl = await this.readFileAsync(file.source);\r\n } else {\r\n fileUrl = file.source.toString();\r\n }\r\n\r\n return {\r\n src: fileUrl,\r\n caption: file.filenameWithoutExtension,\r\n thumb: ''\r\n };\r\n }));\r\n\r\n this.album = preAlbum;\r\n }\r\n }\r\n\r\n readFileAsync(file: File): Promise<string> {\r\n return new Promise((resolve) => {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = () => {\r\n const dataUrl = reader.result;\r\n const fileUrl = dataUrl.toString();\r\n resolve(fileUrl);\r\n };\r\n });\r\n }\r\n}\r\n","<!-- app.component.html -->\r\n<file-pond\r\n #myPond\r\n name='UploadForm[imagem][]'\r\n [options]=\"pondOptions\"\r\n (oninit)=\"pondHandleInit()\"\r\n [files]=\"pondFiles\"\r\n (onaddfile)=\"pondHandleAddFile($event)\"\r\n (onupdatefiles)=\"pondHandleUpdate($event)\"\r\n (onactivatefile)=\"pondHandleActivateFile($event)\"\r\n (onremovefile)=\"pondHandleRemove($event)\"\r\n (onreorderfiles)=\"onReorderFiles($event)\"\r\n (onwarning)=\"warning($event)\"\r\n/>\r\n","import { NgModule } from '@angular/core';\r\nimport { UiUploadOrderComponent } from './ui-upload-order.component';\r\nimport { CommonModule } from '@angular/common';\r\nimport { LightboxModule } from 'ngx-lightbox';\r\n\r\n// import filepond module\r\nimport { FilePondModule, registerPlugin } from \"ngx-filepond\";\r\n\r\n// import and register filepond plugins\r\nimport * as FilePondPluginFileValidateType from \"filepond-plugin-file-validate-type\";\r\nimport * as FilePondPluginImagePreview from 'filepond-plugin-image-preview';\r\nimport * as FilePondPluginImageExifOrientation from 'filepond-plugin-image-exif-orientation';\r\nimport * as FilePondPluginFileValidateSize from 'filepond-plugin-file-validate-size';\r\nimport * as FilePondPluginImageCrop from 'filepond-plugin-image-crop';\r\nimport * as FilePondPluginImageResize from 'filepond-plugin-image-resize';\r\n\r\nregisterPlugin(\r\n FilePondPluginFileValidateType,\r\n FilePondPluginImagePreview,\r\n FilePondPluginImageExifOrientation,\r\n FilePondPluginFileValidateSize,\r\n FilePondPluginImageCrop,\r\n FilePondPluginImageResize\r\n);\r\n\r\n@NgModule({\r\n declarations: [\r\n UiUploadOrderComponent\r\n ],\r\n imports: [\r\n CommonModule,\r\n FilePondModule,\r\n LightboxModule\r\n ],\r\n exports: [\r\n UiUploadOrderComponent\r\n ]\r\n})\r\nexport class UiUploadOrderModule { }\r\n","/*\r\n * Public API Surface of ui-upload-order\r\n */\r\n\r\nexport * from './lib/ui-upload-order.component';\r\nexport * from './lib/ui-upload-order.module';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAUa,sBAAsB,CAAA;AAiB/B,IAAA,WAAA,CAAoB,SAAmB,EAAA;QAAnB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAU;QAb9B,IAAQ,CAAA,QAAA,GAAY,IAAI,CAAC;QACzB,IAAQ,CAAA,QAAA,GAAW,CAAC,CAAC;AAGpB,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YAAY,EAAgB,CAAC;AAC5C,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,YAAY,EAAgB,CAAC;AAC3C,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAgB,CAAC;AAC9C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,YAAY,EAA4B,CAAC;A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,EAAA,CAAA;kBAb/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,YAAY,EAAE;wBACV,sBAAsB;AACzB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,YAAY;wBACZ,cAAc;wBACd,cAAc;AACjB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACL,sBAAsB;AACzB,qBAAA;AACJ,iBAAA,CAAA;;;ACrCD;;AAEG;;ACFH;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="uitec-ng-upload-order" />
5
+ export * from './public-api';
@@ -0,0 +1,37 @@
1
+ import { EventEmitter, OnInit } from "@angular/core";
2
+ import { FilePondComponent } from "ngx-filepond";
3
+ import { FilePondFile, FilePondOptions } from "filepond";
4
+ import { IAlbum, Lightbox } from 'ngx-lightbox';
5
+ import * as i0 from "@angular/core";
6
+ export declare class UiUploadOrderComponent implements OnInit {
7
+ private _lightbox;
8
+ url: string;
9
+ uploadHandler: any;
10
+ initialFiles: string[];
11
+ multiple: boolean;
12
+ maxFiles: number;
13
+ onRemove: EventEmitter<FilePondFile>;
14
+ onAdded: EventEmitter<FilePondFile>;
15
+ onActivate: EventEmitter<FilePondFile>;
16
+ onInit: EventEmitter<(string | Blob | import("filepond").ActualFileObject | import("filepond").FilePondInitialFile)[]>;
17
+ onMaxReached: EventEmitter<string>;
18
+ onReOrder: EventEmitter<FilePondFile[]>;
19
+ myPond: FilePondComponent;
20
+ constructor(_lightbox: Lightbox);
21
+ pondOptions: FilePondOptions;
22
+ pondFiles: FilePondOptions["files"];
23
+ album: IAlbum[];
24
+ ngOnInit(): void;
25
+ pondHandleInit(): void;
26
+ pondHandleAddFile(event: any): void;
27
+ pondHandleActivateFile(event: any): void;
28
+ pondHandleUpdate(event: any): void;
29
+ pondHandleRemove(event: any): void;
30
+ onReorderFiles(event: any): void;
31
+ warning(event: any): void;
32
+ openLightBox(fileName: string): void;
33
+ fillAlbum(files: [], reOrder?: boolean): Promise<void>;
34
+ readFileAsync(file: File): Promise<string>;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiUploadOrderComponent, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<UiUploadOrderComponent, "ui-upload-order", never, { "url": "url"; "uploadHandler": "uploadHandler"; "initialFiles": "initialFiles"; "multiple": "multiple"; "maxFiles": "maxFiles"; }, { "onRemove": "onRemove"; "onAdded": "onAdded"; "onActivate": "onActivate"; "onInit": "onInit"; "onMaxReached": "onMaxReached"; "onReOrder": "onReOrder"; }, never, never, false, never>;
37
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./ui-upload-order.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "ngx-filepond";
5
+ import * as i4 from "ngx-lightbox";
6
+ export declare class UiUploadOrderModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<UiUploadOrderModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UiUploadOrderModule, [typeof i1.UiUploadOrderComponent], [typeof i2.CommonModule, typeof i3.FilePondModule, typeof i4.LightboxModule], [typeof i1.UiUploadOrderComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<UiUploadOrderModule>;
10
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "uitec-ng-upload-order",
3
+ "version": "1.0.0",
4
+ "peerDependencies": {
5
+ "@angular/common": "^15.2.0",
6
+ "@angular/core": "^15.2.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false,
12
+ "module": "fesm2015/uitec-ng-upload-order.mjs",
13
+ "es2020": "fesm2020/uitec-ng-upload-order.mjs",
14
+ "esm2020": "esm2020/uitec-ng-upload-order.mjs",
15
+ "fesm2020": "fesm2020/uitec-ng-upload-order.mjs",
16
+ "fesm2015": "fesm2015/uitec-ng-upload-order.mjs",
17
+ "typings": "index.d.ts",
18
+ "exports": {
19
+ "./package.json": {
20
+ "default": "./package.json"
21
+ },
22
+ ".": {
23
+ "types": "./index.d.ts",
24
+ "esm2020": "./esm2020/uitec-ng-upload-order.mjs",
25
+ "es2020": "./fesm2020/uitec-ng-upload-order.mjs",
26
+ "es2015": "./fesm2015/uitec-ng-upload-order.mjs",
27
+ "node": "./fesm2015/uitec-ng-upload-order.mjs",
28
+ "default": "./fesm2020/uitec-ng-upload-order.mjs"
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,2 @@
1
+ export * from './lib/ui-upload-order.component';
2
+ export * from './lib/ui-upload-order.module';