@bexis2/bexis2-core-ui 0.4.76 → 0.4.78

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 CHANGED
@@ -1,4 +1,8 @@
1
1
  # bexis-core-ui
2
+ ## 0.4.78
3
+ - Fileuploader
4
+ - after submited add the responce to the event
5
+
2
6
  ## 0.4.76
3
7
  - API
4
8
  - Extending the API with custom headers and configuration
@@ -14,6 +14,7 @@ declare const __propDef: {
14
14
  submit: CustomEvent<any>;
15
15
  submited: CustomEvent<any>;
16
16
  success: CustomEvent<any>;
17
+ submiterror: CustomEvent<any>;
17
18
  } & {
18
19
  [evt: string]: CustomEvent<any>;
19
20
  };
@@ -81,12 +81,21 @@ async function handleSubmit() {
81
81
  }
82
82
  const response = await Api.post(url, formData);
83
83
  if (response.status == 200) {
84
- dispatch("submited");
84
+ dispatch("submited", {
85
+ status: 200,
86
+ data: response.data
87
+ });
85
88
  let message = files.accepted.length + " is/are uploaded";
86
89
  let fileList = [];
87
90
  files.accepted.forEach((f) => fileList.push(f.name));
88
91
  dispatch("success", { text: message, files: fileList });
89
92
  files.accepted = [];
93
+ } else {
94
+ dispatch("submiterror", {
95
+ status: response.status,
96
+ data: response.data
97
+ });
98
+ console.log("Error uploading file(s)", response);
90
99
  }
91
100
  }
92
101
  isUploading = false;
@@ -14,6 +14,7 @@ declare const __propDef: {
14
14
  submit: CustomEvent<any>;
15
15
  submited: CustomEvent<any>;
16
16
  success: CustomEvent<any>;
17
+ submiterror: CustomEvent<any>;
17
18
  } & {
18
19
  [evt: string]: CustomEvent<any>;
19
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bexis2/bexis2-core-ui",
3
- "version": "0.4.76",
3
+ "version": "0.4.78",
4
4
  "private": false,
5
5
  "description": "Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).",
6
6
  "keywords": [
@@ -148,7 +148,9 @@
148
148
  const response = await Api.post(url, formData);
149
149
 
150
150
  if (response.status == 200) {
151
- dispatch('submited');
151
+ dispatch('submited',{
152
+ status:200,
153
+ data:response.data});
152
154
 
153
155
  let message = files.accepted.length + ' is/are uploaded';
154
156
 
@@ -159,6 +161,13 @@
159
161
 
160
162
  files.accepted = [];
161
163
  }
164
+ else
165
+ {
166
+ dispatch('submiterror', {
167
+ status:response.status,
168
+ data:response.data});
169
+ console.log('Error uploading file(s)', response);
170
+ }
162
171
  }
163
172
 
164
173
  isUploading = false;