dromo-uploader-angular 0.1.8 → 2.0.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/README.md +26 -41
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
})
|
|
70
70
|
|
|
71
71
|
export class MyUploader implements DromoMethods {
|
|
72
|
-
licenseKey =
|
|
72
|
+
licenseKey = "<YOUR LICENSE KEY>";
|
|
73
73
|
|
|
74
74
|
user = { id: 'angular tester' };
|
|
75
75
|
|
|
@@ -185,77 +185,62 @@ export class AppModule {}
|
|
|
185
185
|
|
|
186
186
|
```TypeScript
|
|
187
187
|
// my-uploader.component.ts
|
|
188
|
-
import { Component
|
|
188
|
+
import { Component } from "@angular/core";
|
|
189
189
|
import {
|
|
190
|
-
DromoMethods,
|
|
191
|
-
IColumnHook,
|
|
192
|
-
IColumnHookInput,
|
|
193
|
-
IRowDeleteHook,
|
|
194
|
-
IDeveloperField,
|
|
195
|
-
IDeveloperSettings,
|
|
196
|
-
IRowHook,
|
|
197
190
|
IUser,
|
|
198
|
-
IStepHook,
|
|
199
|
-
IUploadStepData,
|
|
200
191
|
IBeforeFinishCallback,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
} from 'dromo-uploader-angular';
|
|
192
|
+
DromoSavedSchemaMethods
|
|
193
|
+
} from "dromo-uploader-angular";
|
|
204
194
|
@Component({
|
|
205
|
-
selector:
|
|
195
|
+
selector: "app-dromo-importer",
|
|
206
196
|
template: `
|
|
207
197
|
<lib-dromo-uploader
|
|
208
198
|
[licenseKey]="licenseKey"
|
|
209
199
|
[schemaName]="schemaName"
|
|
210
200
|
[user]="user"
|
|
211
|
-
[settings]="settings"
|
|
212
201
|
[styles]="styles"
|
|
213
202
|
[class]="class"
|
|
214
|
-
class="dromo-importer"
|
|
215
203
|
[onCancel]="onCancel"
|
|
216
204
|
[onResults]="onResults"
|
|
217
205
|
[beforeFinish]="beforeFinish"
|
|
206
|
+
[developmentMode]="developmentMode"
|
|
207
|
+
class="dromo-importer"
|
|
218
208
|
>Import with Dromo!</lib-dromo-uploader
|
|
219
209
|
>
|
|
220
210
|
`,
|
|
221
|
-
styleUrls: [
|
|
211
|
+
styleUrls: ["./dromo-importer.component.css"]
|
|
222
212
|
})
|
|
223
213
|
export class DromoImporterComponent implements DromoSavedSchemaMethods {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
settings: IDeveloperSettings = {
|
|
230
|
-
importIdentifier: 'angular test',
|
|
231
|
-
developmentMode: true,
|
|
232
|
-
};
|
|
233
|
-
onCancel = () => alert('Something I said?');
|
|
214
|
+
schemaName = "demo";
|
|
215
|
+
licenseKey = "<YOUR LICENSE KEY>";
|
|
216
|
+
user: IUser = { id: "angular tester" };
|
|
217
|
+
developmentMode = true;
|
|
218
|
+
onCancel = () => alert("Something I said?");
|
|
234
219
|
onResults = (data: any[], metaData: any) => {
|
|
235
220
|
alert(`Submitted ${data.length} records`);
|
|
236
221
|
console.table(data);
|
|
237
|
-
console.log(
|
|
222
|
+
console.log("MetaData", metaData);
|
|
238
223
|
};
|
|
239
224
|
|
|
240
225
|
beforeFinish: IBeforeFinishCallback = (data, metaData, _instance) => {
|
|
241
226
|
console.log(`${data.length} total rows!`);
|
|
242
227
|
if (metaData.rowsWithError.length > 2) {
|
|
243
|
-
return { cancel: true, message:
|
|
228
|
+
return { cancel: true, message: "More than two errors, fix them first!" };
|
|
244
229
|
}
|
|
245
230
|
return undefined;
|
|
246
231
|
};
|
|
247
|
-
class =
|
|
232
|
+
class = "dromo-button";
|
|
248
233
|
styles = {
|
|
249
|
-
|
|
250
|
-
border:
|
|
251
|
-
|
|
252
|
-
color:
|
|
253
|
-
padding:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
display:
|
|
257
|
-
|
|
258
|
-
|
|
234
|
+
"background-color": "rgb(0, 123, 255)",
|
|
235
|
+
border: "1px solid rgb(0, 123, 255)",
|
|
236
|
+
"border-radius": " 0.25rem",
|
|
237
|
+
color: "white",
|
|
238
|
+
padding: "15px",
|
|
239
|
+
"text-align": "center",
|
|
240
|
+
"text-decoration": "none",
|
|
241
|
+
display: "inline-block",
|
|
242
|
+
"font-size": "16px",
|
|
243
|
+
"box-shadow": "5px 5px 5px 0px #7F7F7F"
|
|
259
244
|
};
|
|
260
245
|
|
|
261
246
|
ngOnInit(): void {}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dromo-uploader-angular",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
6
6
|
"@angular/core": "^13.0.0 || ^14.0.0 || ^15.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"dromo-uploader-js": "^
|
|
9
|
+
"dromo-uploader-js": "^2.0.5",
|
|
10
10
|
"tslib": "^2.3.0"
|
|
11
11
|
},
|
|
12
12
|
"module": "fesm2015/dromo-uploader-angular.mjs",
|