@memberjunction/ng-file-storage 1.2.2 → 1.3.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { FileEntity } from '@memberjunction/core-entities';
|
|
3
3
|
import { FileInfo, SelectEvent } from '@progress/kendo-angular-upload';
|
|
4
|
+
import { z } from 'zod';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export type FileUploadEvent = {
|
|
6
7
|
success: true;
|
|
@@ -9,10 +10,132 @@ export type FileUploadEvent = {
|
|
|
9
10
|
success: false;
|
|
10
11
|
file: FileInfo;
|
|
11
12
|
};
|
|
13
|
+
declare const FileUploadMutationSchema: z.ZodObject<{
|
|
14
|
+
CreateFile: z.ZodObject<{
|
|
15
|
+
NameExists: z.ZodBoolean;
|
|
16
|
+
UploadUrl: z.ZodString;
|
|
17
|
+
File: z.ZodObject<{
|
|
18
|
+
Category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
CategoryID: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
|
+
ContentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
CreatedAt: z.ZodNumber;
|
|
22
|
+
Description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
|
+
ID: z.ZodNumber;
|
|
24
|
+
Name: z.ZodString;
|
|
25
|
+
Provider: z.ZodString;
|
|
26
|
+
ProviderID: z.ZodNumber;
|
|
27
|
+
ProviderKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
Status: z.ZodString;
|
|
29
|
+
UpdatedAt: z.ZodNumber;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
ID: number;
|
|
32
|
+
Name: string;
|
|
33
|
+
CreatedAt: number;
|
|
34
|
+
Provider: string;
|
|
35
|
+
ProviderID: number;
|
|
36
|
+
Status: string;
|
|
37
|
+
UpdatedAt: number;
|
|
38
|
+
Category?: string | null | undefined;
|
|
39
|
+
CategoryID?: number | null | undefined;
|
|
40
|
+
ContentType?: string | null | undefined;
|
|
41
|
+
Description?: string | null | undefined;
|
|
42
|
+
ProviderKey?: string | null | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
ID: number;
|
|
45
|
+
Name: string;
|
|
46
|
+
CreatedAt: number;
|
|
47
|
+
Provider: string;
|
|
48
|
+
ProviderID: number;
|
|
49
|
+
Status: string;
|
|
50
|
+
UpdatedAt: number;
|
|
51
|
+
Category?: string | null | undefined;
|
|
52
|
+
CategoryID?: number | null | undefined;
|
|
53
|
+
ContentType?: string | null | undefined;
|
|
54
|
+
Description?: string | null | undefined;
|
|
55
|
+
ProviderKey?: string | null | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
NameExists: boolean;
|
|
59
|
+
UploadUrl: string;
|
|
60
|
+
File: {
|
|
61
|
+
ID: number;
|
|
62
|
+
Name: string;
|
|
63
|
+
CreatedAt: number;
|
|
64
|
+
Provider: string;
|
|
65
|
+
ProviderID: number;
|
|
66
|
+
Status: string;
|
|
67
|
+
UpdatedAt: number;
|
|
68
|
+
Category?: string | null | undefined;
|
|
69
|
+
CategoryID?: number | null | undefined;
|
|
70
|
+
ContentType?: string | null | undefined;
|
|
71
|
+
Description?: string | null | undefined;
|
|
72
|
+
ProviderKey?: string | null | undefined;
|
|
73
|
+
};
|
|
74
|
+
}, {
|
|
75
|
+
NameExists: boolean;
|
|
76
|
+
UploadUrl: string;
|
|
77
|
+
File: {
|
|
78
|
+
ID: number;
|
|
79
|
+
Name: string;
|
|
80
|
+
CreatedAt: number;
|
|
81
|
+
Provider: string;
|
|
82
|
+
ProviderID: number;
|
|
83
|
+
Status: string;
|
|
84
|
+
UpdatedAt: number;
|
|
85
|
+
Category?: string | null | undefined;
|
|
86
|
+
CategoryID?: number | null | undefined;
|
|
87
|
+
ContentType?: string | null | undefined;
|
|
88
|
+
Description?: string | null | undefined;
|
|
89
|
+
ProviderKey?: string | null | undefined;
|
|
90
|
+
};
|
|
91
|
+
}>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
CreateFile: {
|
|
94
|
+
NameExists: boolean;
|
|
95
|
+
UploadUrl: string;
|
|
96
|
+
File: {
|
|
97
|
+
ID: number;
|
|
98
|
+
Name: string;
|
|
99
|
+
CreatedAt: number;
|
|
100
|
+
Provider: string;
|
|
101
|
+
ProviderID: number;
|
|
102
|
+
Status: string;
|
|
103
|
+
UpdatedAt: number;
|
|
104
|
+
Category?: string | null | undefined;
|
|
105
|
+
CategoryID?: number | null | undefined;
|
|
106
|
+
ContentType?: string | null | undefined;
|
|
107
|
+
Description?: string | null | undefined;
|
|
108
|
+
ProviderKey?: string | null | undefined;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}, {
|
|
112
|
+
CreateFile: {
|
|
113
|
+
NameExists: boolean;
|
|
114
|
+
UploadUrl: string;
|
|
115
|
+
File: {
|
|
116
|
+
ID: number;
|
|
117
|
+
Name: string;
|
|
118
|
+
CreatedAt: number;
|
|
119
|
+
Provider: string;
|
|
120
|
+
ProviderID: number;
|
|
121
|
+
Status: string;
|
|
122
|
+
UpdatedAt: number;
|
|
123
|
+
Category?: string | null | undefined;
|
|
124
|
+
CategoryID?: number | null | undefined;
|
|
125
|
+
ContentType?: string | null | undefined;
|
|
126
|
+
Description?: string | null | undefined;
|
|
127
|
+
ProviderKey?: string | null | undefined;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
}>;
|
|
131
|
+
type ApiFile = z.infer<typeof FileUploadMutationSchema>['CreateFile']['File'];
|
|
132
|
+
type UploadTuple = [FileInfo, ApiFile, string];
|
|
12
133
|
export declare class FileUploadComponent implements OnInit {
|
|
13
|
-
|
|
134
|
+
ConfirmQueue: Array<UploadTuple>;
|
|
135
|
+
UploadQueue: Array<FileInfo>;
|
|
14
136
|
private defaultProviderID;
|
|
15
137
|
private md;
|
|
138
|
+
get IsUploading(): boolean;
|
|
16
139
|
constructor();
|
|
17
140
|
disabled: boolean;
|
|
18
141
|
CategoryID: number | undefined;
|
|
@@ -20,8 +143,13 @@ export declare class FileUploadComponent implements OnInit {
|
|
|
20
143
|
fileUpload: EventEmitter<FileUploadEvent>;
|
|
21
144
|
ngOnInit(): void;
|
|
22
145
|
Refresh(): Promise<void>;
|
|
23
|
-
|
|
146
|
+
Confirm(): void;
|
|
147
|
+
CancelConfirm(): Promise<void>;
|
|
148
|
+
SelectEventHandler(e: SelectEvent): Promise<void>;
|
|
149
|
+
private _processUploadQueue;
|
|
150
|
+
private _uploadFile;
|
|
24
151
|
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadComponent, never>;
|
|
25
152
|
static ɵcmp: i0.ɵɵComponentDeclaration<FileUploadComponent, "mj-files-file-upload", never, { "disabled": { "alias": "disabled"; "required": false; }; "CategoryID": { "alias": "CategoryID"; "required": false; }; }, { "uploadStarted": "uploadStarted"; "fileUpload": "fileUpload"; }, never, never, false, never>;
|
|
26
153
|
}
|
|
154
|
+
export {};
|
|
27
155
|
//# sourceMappingURL=file-upload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/lib/file-upload/file-upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAS,MAAM,EAAU,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,UAAU,EAA6B,MAAM,+BAA+B,CAAC;AAGtF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;;
|
|
1
|
+
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../../src/lib/file-upload/file-upload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAS,MAAM,EAAU,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,UAAU,EAA6B,MAAM,+BAA+B,CAAC;AAGtF,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;;AAExB,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAgCvG,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB5B,CAAC;AAEH,KAAK,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9E,KAAK,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAE/C,qBAKa,mBAAoB,YAAW,MAAM;IACzC,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAM;IACtC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAM;IACzC,OAAO,CAAC,iBAAiB,CAAM;IAC/B,OAAO,CAAC,EAAE,CAAkB;IAE5B,IAAI,WAAW,IAAI,OAAO,CAEzB;;IAIQ,QAAQ,UAAS;IACjB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAa;IAC1C,aAAa,qBAA4B;IACzC,UAAU,gCAAuC;IAE3D,QAAQ,IAAI,IAAI;IAIV,OAAO;IASb,OAAO;IAOD,aAAa;IAab,kBAAkB,CAAC,CAAC,EAAE,WAAW;YAQzB,mBAAmB;YAkCnB,WAAW;yCA5Fd,mBAAmB;2CAAnB,mBAAmB;CAoH/B"}
|
|
@@ -12,7 +12,31 @@ import { Metadata, RunView } from '@memberjunction/core';
|
|
|
12
12
|
import { GraphQLDataProvider, gql } from '@memberjunction/graphql-dataprovider';
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
import * as i0 from "@angular/core";
|
|
15
|
-
import * as i1 from "@
|
|
15
|
+
import * as i1 from "@angular/common";
|
|
16
|
+
import * as i2 from "@progress/kendo-angular-dialog";
|
|
17
|
+
import * as i3 from "@progress/kendo-angular-buttons";
|
|
18
|
+
import * as i4 from "@progress/kendo-angular-upload";
|
|
19
|
+
function FileUploadComponent_kendo_dialog_2_Template(rf, ctx) { if (rf & 1) {
|
|
20
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
21
|
+
i0.ɵɵelementStart(0, "kendo-dialog", 2);
|
|
22
|
+
i0.ɵɵlistener("close", function FileUploadComponent_kendo_dialog_2_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.CancelConfirm()); });
|
|
23
|
+
i0.ɵɵelementStart(1, "p", 3);
|
|
24
|
+
i0.ɵɵtext(2);
|
|
25
|
+
i0.ɵɵelementEnd();
|
|
26
|
+
i0.ɵɵelementStart(3, "kendo-dialog-actions")(4, "button", 4);
|
|
27
|
+
i0.ɵɵlistener("click", function FileUploadComponent_kendo_dialog_2_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r2); const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.CancelConfirm()); });
|
|
28
|
+
i0.ɵɵtext(5, "Cancel");
|
|
29
|
+
i0.ɵɵelementEnd();
|
|
30
|
+
i0.ɵɵelementStart(6, "button", 5);
|
|
31
|
+
i0.ɵɵlistener("click", function FileUploadComponent_kendo_dialog_2_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r2); const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.Confirm()); });
|
|
32
|
+
i0.ɵɵtext(7, "Overwrite");
|
|
33
|
+
i0.ɵɵelementEnd()()();
|
|
34
|
+
} if (rf & 2) {
|
|
35
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
36
|
+
i0.ɵɵproperty("minWidth", 250)("width", 450);
|
|
37
|
+
i0.ɵɵadvance(2);
|
|
38
|
+
i0.ɵɵtextInterpolate1(" This will overwrite an existing file named '", ctx_r0.ConfirmQueue[0][0].name, "'. Are you sure you want to continue? ");
|
|
39
|
+
} }
|
|
16
40
|
const FileFieldsFragment = gql `
|
|
17
41
|
fragment FileFields on File_ {
|
|
18
42
|
Category
|
|
@@ -33,6 +57,7 @@ const FileUploadMutation = gql `
|
|
|
33
57
|
${FileFieldsFragment}
|
|
34
58
|
mutation CreateFile($input: CreateFileInput!) {
|
|
35
59
|
CreateFile(input: $input) {
|
|
60
|
+
NameExists
|
|
36
61
|
UploadUrl
|
|
37
62
|
File {
|
|
38
63
|
...FileFields
|
|
@@ -42,6 +67,7 @@ const FileUploadMutation = gql `
|
|
|
42
67
|
`;
|
|
43
68
|
const FileUploadMutationSchema = z.object({
|
|
44
69
|
CreateFile: z.object({
|
|
70
|
+
NameExists: z.boolean(),
|
|
45
71
|
UploadUrl: z.string(),
|
|
46
72
|
File: z.object({
|
|
47
73
|
Category: z.string().nullish(),
|
|
@@ -60,8 +86,12 @@ const FileUploadMutationSchema = z.object({
|
|
|
60
86
|
}),
|
|
61
87
|
});
|
|
62
88
|
export class FileUploadComponent {
|
|
89
|
+
get IsUploading() {
|
|
90
|
+
return this.UploadQueue.length + this.ConfirmQueue.length > 0;
|
|
91
|
+
}
|
|
63
92
|
constructor() {
|
|
64
|
-
this.
|
|
93
|
+
this.ConfirmQueue = [];
|
|
94
|
+
this.UploadQueue = [];
|
|
65
95
|
this.defaultProviderID = -1;
|
|
66
96
|
this.md = new Metadata();
|
|
67
97
|
this.disabled = false;
|
|
@@ -82,13 +112,37 @@ export class FileUploadComponent {
|
|
|
82
112
|
}
|
|
83
113
|
});
|
|
84
114
|
}
|
|
85
|
-
|
|
115
|
+
Confirm() {
|
|
116
|
+
const confirmed = this.ConfirmQueue.shift();
|
|
117
|
+
if (confirmed) {
|
|
118
|
+
this._uploadFile(...confirmed);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
CancelConfirm() {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
const cancelled = this.ConfirmQueue.shift();
|
|
124
|
+
if (cancelled) {
|
|
125
|
+
const [file, fileRecord] = cancelled;
|
|
126
|
+
const fileEntity = yield this.md.GetEntityObject('Files');
|
|
127
|
+
yield fileEntity.LoadFromData(fileRecord);
|
|
128
|
+
yield fileEntity.Delete();
|
|
129
|
+
this.fileUpload.emit({ success: false, file });
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
SelectEventHandler(e) {
|
|
86
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
135
|
e.preventDefault();
|
|
88
|
-
this.isUploading = true;
|
|
89
136
|
this.uploadStarted.emit();
|
|
137
|
+
this.UploadQueue = e.files;
|
|
138
|
+
this._processUploadQueue();
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
_processUploadQueue() {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
143
|
// for each selected file to upload
|
|
91
|
-
|
|
144
|
+
let file = this.UploadQueue.shift();
|
|
145
|
+
while (file) {
|
|
92
146
|
const input = {
|
|
93
147
|
Name: file.name,
|
|
94
148
|
ProviderID: this.defaultProviderID,
|
|
@@ -100,49 +154,66 @@ export class FileUploadComponent {
|
|
|
100
154
|
// make sure the response is correct
|
|
101
155
|
const parsedResult = FileUploadMutationSchema.safeParse(result);
|
|
102
156
|
if (parsedResult.success) {
|
|
103
|
-
const { File, UploadUrl } = parsedResult.data.CreateFile;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
headers: { 'x-ms-blob-type': 'BlockBlob' },
|
|
109
|
-
body: file.rawFile,
|
|
110
|
-
});
|
|
111
|
-
// now update that file to set status
|
|
112
|
-
const fileEntity = yield this.md.GetEntityObject('Files');
|
|
113
|
-
yield fileEntity.LoadFromData(File);
|
|
114
|
-
fileEntity.Status = 'Uploaded';
|
|
115
|
-
yield fileEntity.Save();
|
|
116
|
-
// emit an event about a new file uploaded, include the file data
|
|
117
|
-
this.fileUpload.emit({ success: true, file: fileEntity });
|
|
118
|
-
// Could also emit a progress event with each iteration
|
|
157
|
+
const { File, UploadUrl, NameExists } = parsedResult.data.CreateFile;
|
|
158
|
+
const uploadTuple = [file, File, UploadUrl];
|
|
159
|
+
// Confirm we want to overwrite
|
|
160
|
+
if (NameExists) {
|
|
161
|
+
this.ConfirmQueue.push(uploadTuple);
|
|
119
162
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// something failed when actually uploading or when updating the API, what do to about pending file?
|
|
123
|
-
this.fileUpload.emit({ success: false, file });
|
|
163
|
+
else {
|
|
164
|
+
yield this._uploadFile(...uploadTuple);
|
|
124
165
|
}
|
|
125
166
|
}
|
|
126
167
|
else {
|
|
127
168
|
console.error('The API returned an unexpected result', parsedResult.error);
|
|
128
169
|
this.fileUpload.emit({ success: false, file });
|
|
129
170
|
}
|
|
171
|
+
file = this.UploadQueue.shift();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
_uploadFile(file, fileRecord, uploadUrl) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
try {
|
|
178
|
+
// now upload to the url
|
|
179
|
+
yield window.fetch(uploadUrl, {
|
|
180
|
+
method: 'PUT',
|
|
181
|
+
headers: { 'x-ms-blob-type': 'BlockBlob' },
|
|
182
|
+
body: file.rawFile,
|
|
183
|
+
});
|
|
184
|
+
// now update that file to set status
|
|
185
|
+
const fileEntity = yield this.md.GetEntityObject('Files');
|
|
186
|
+
yield fileEntity.LoadFromData(fileRecord);
|
|
187
|
+
fileEntity.Status = 'Uploaded';
|
|
188
|
+
yield fileEntity.Save();
|
|
189
|
+
// emit an event about a new file uploaded, include the file data
|
|
190
|
+
this.fileUpload.emit({ success: true, file: fileEntity });
|
|
191
|
+
// Could also emit a progress event with each iteration
|
|
192
|
+
}
|
|
193
|
+
catch (e) {
|
|
194
|
+
console.error(e);
|
|
195
|
+
// something failed when actually uploading or when updating the API, what do to about pending file?
|
|
196
|
+
this.fileUpload.emit({ success: false, file });
|
|
130
197
|
}
|
|
131
|
-
this.isUploading = false;
|
|
132
198
|
});
|
|
133
199
|
}
|
|
134
200
|
}
|
|
135
201
|
FileUploadComponent.ɵfac = function FileUploadComponent_Factory(t) { return new (t || FileUploadComponent)(); };
|
|
136
|
-
FileUploadComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FileUploadComponent, selectors: [["mj-files-file-upload"]], inputs: { disabled: "disabled", CategoryID: "CategoryID" }, outputs: { uploadStarted: "uploadStarted", fileUpload: "fileUpload" }, decls:
|
|
137
|
-
i0.ɵɵelementStart(0, "kendo-fileselect", 0);
|
|
138
|
-
i0.ɵɵlistener("select", function
|
|
202
|
+
FileUploadComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FileUploadComponent, selectors: [["mj-files-file-upload"]], inputs: { disabled: "disabled", CategoryID: "CategoryID" }, outputs: { uploadStarted: "uploadStarted", fileUpload: "fileUpload" }, decls: 3, vars: 3, consts: [[3, "disabled", "multiple", "select"], ["title", "Please confirm", 3, "minWidth", "width", "close", 4, "ngIf"], ["title", "Please confirm", 3, "minWidth", "width", "close"], [2, "margin", "30px", "text-align", "center"], ["kendoButton", "", 3, "click"], ["kendoButton", "", "themeColor", "primary", 3, "click"]], template: function FileUploadComponent_Template(rf, ctx) { if (rf & 1) {
|
|
203
|
+
i0.ɵɵelementStart(0, "div")(1, "kendo-fileselect", 0);
|
|
204
|
+
i0.ɵɵlistener("select", function FileUploadComponent_Template_kendo_fileselect_select_1_listener($event) { return ctx.SelectEventHandler($event); });
|
|
205
|
+
i0.ɵɵelementEnd();
|
|
206
|
+
i0.ɵɵtemplate(2, FileUploadComponent_kendo_dialog_2_Template, 8, 3, "kendo-dialog", 1);
|
|
139
207
|
i0.ɵɵelementEnd();
|
|
140
208
|
} if (rf & 2) {
|
|
141
|
-
i0.ɵɵ
|
|
142
|
-
|
|
209
|
+
i0.ɵɵadvance();
|
|
210
|
+
i0.ɵɵproperty("disabled", ctx.IsUploading || ctx.disabled)("multiple", false);
|
|
211
|
+
i0.ɵɵadvance();
|
|
212
|
+
i0.ɵɵproperty("ngIf", ctx.ConfirmQueue.length > 0);
|
|
213
|
+
} }, dependencies: [i1.NgIf, i2.DialogComponent, i2.DialogActionsComponent, i3.ButtonComponent, i4.FileSelectComponent] });
|
|
143
214
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FileUploadComponent, [{
|
|
144
215
|
type: Component,
|
|
145
|
-
args: [{ selector: 'mj-files-file-upload', template: "<kendo-fileselect [disabled]=\"
|
|
216
|
+
args: [{ selector: 'mj-files-file-upload', template: "<div>\n <kendo-fileselect [disabled]=\"IsUploading || disabled\" [multiple]=\"false\" (select)=\"SelectEventHandler($event)\"> </kendo-fileselect>\n <kendo-dialog title=\"Please confirm\" *ngIf=\"ConfirmQueue.length > 0\" (close)=\"CancelConfirm()\" [minWidth]=\"250\" [width]=\"450\">\n <p style=\"margin: 30px; text-align: center\">\n This will overwrite an existing file named '{{ConfirmQueue[0][0].name}}'. Are you sure you want to continue?\n </p>\n <kendo-dialog-actions>\n <button kendoButton (click)=\"CancelConfirm()\">Cancel</button>\n <button kendoButton (click)=\"Confirm()\" themeColor=\"primary\">Overwrite</button>\n </kendo-dialog-actions>\n </kendo-dialog>\n</div>\n" }]
|
|
146
217
|
}], () => [], { disabled: [{
|
|
147
218
|
type: Input
|
|
148
219
|
}], CategoryID: [{
|
|
@@ -152,4 +223,4 @@ FileUploadComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FileUpl
|
|
|
152
223
|
}], fileUpload: [{
|
|
153
224
|
type: Output
|
|
154
225
|
}] }); })();
|
|
155
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FileUploadComponent, { className: "FileUploadComponent", filePath: "src/lib/file-upload/file-upload.ts", lineNumber:
|
|
226
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FileUploadComponent, { className: "FileUploadComponent", filePath: "src/lib/file-upload/file-upload.ts", lineNumber: 70 }); })();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-file-storage",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "MemberJunction: Angular components for managing files, and related components.",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"@angular/router": "~17.2.2"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@memberjunction/core": "~1.
|
|
30
|
-
"@memberjunction/core-entities": "~1.
|
|
31
|
-
"@memberjunction/global": "~1.
|
|
32
|
-
"@memberjunction/ng-container-directives": "~1.
|
|
33
|
-
"@memberjunction/ng-shared": "~1.
|
|
29
|
+
"@memberjunction/core": "~1.3.1",
|
|
30
|
+
"@memberjunction/core-entities": "~1.3.1",
|
|
31
|
+
"@memberjunction/global": "~1.3.1",
|
|
32
|
+
"@memberjunction/ng-container-directives": "~1.3.1",
|
|
33
|
+
"@memberjunction/ng-shared": "~1.3.1",
|
|
34
34
|
"@progress/kendo-angular-buttons": "~15.1.0",
|
|
35
35
|
"@progress/kendo-angular-dialog": "~15.1.0",
|
|
36
36
|
"@progress/kendo-angular-dropdowns": "~15.1.0",
|