@dile/crud 1.0.0 → 1.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.
|
@@ -129,6 +129,8 @@ export class DileCrudActions extends DileI18nMixin(LitElement) {
|
|
|
129
129
|
cancelLabel="${this.translations.cancel_label}"
|
|
130
130
|
acceptLabel="${this.translations.accept_label}"
|
|
131
131
|
@dile-confirm-accepted=${this.doAction}
|
|
132
|
+
@dile-confirm-cancelled=${this.cancelAction}
|
|
133
|
+
dontCloseOnAccept
|
|
132
134
|
>
|
|
133
135
|
<div class="modalcontainer">
|
|
134
136
|
${this.actionsTemplateRunner}
|
|
@@ -183,6 +185,8 @@ export class DileCrudActions extends DileI18nMixin(LitElement) {
|
|
|
183
185
|
|
|
184
186
|
doSuccessAction(e) {
|
|
185
187
|
this.selectedActionForm.resetData();
|
|
188
|
+
this.selectedActionForm.clearErrors();
|
|
189
|
+
this.confirmElement.close();
|
|
186
190
|
this.responseAdapter.setResponse(e.detail);
|
|
187
191
|
this.dispatchEvent(new CustomEvent('crud-action-success', {
|
|
188
192
|
bubbles: true,
|
|
@@ -197,6 +201,7 @@ export class DileCrudActions extends DileI18nMixin(LitElement) {
|
|
|
197
201
|
|
|
198
202
|
doErrorAction(e) {
|
|
199
203
|
this.responseAdapter.setResponse(e.detail);
|
|
204
|
+
this.selectedActionForm.showErrors(e.detail.errors);
|
|
200
205
|
this.dispatchEvent(new CustomEvent('crud-action-error', {
|
|
201
206
|
bubbles: true,
|
|
202
207
|
composed: true,
|
|
@@ -206,4 +211,13 @@ export class DileCrudActions extends DileI18nMixin(LitElement) {
|
|
|
206
211
|
}));
|
|
207
212
|
}
|
|
208
213
|
|
|
214
|
+
getActionForm() {
|
|
215
|
+
let actionForm = this.shadowRoot.querySelector(`[action="${this.selection}"]`)
|
|
216
|
+
return actionForm;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
cancelAction() {
|
|
220
|
+
this.selectedActionForm.clearErrors();
|
|
221
|
+
this.selectedActionForm.resetData();
|
|
222
|
+
}
|
|
209
223
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dile/crud",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Components to create a generic crud system based on Web Components and Lit",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://dile-components.com/",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@dile/ui": "^2.
|
|
27
|
+
"@dile/ui": "^2.11.0",
|
|
28
28
|
"axios": "^1.13.0",
|
|
29
29
|
"lit": "^2.7.0 || ^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "0ffe79bf145624b0a861b9b450a94546358a72ba"
|
|
35
35
|
}
|