lkt-item-crud 1.1.9 → 1.1.11

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/dist/build.js CHANGED
@@ -91,7 +91,7 @@ const p = (...u) => {
91
91
  m.value = !0;
92
92
  }
93
93
  let b = a.value ? "create" : "update";
94
- a.value || (p("onSave -> turn stored data into original"), k.value.turnStoredIntoOriginal()), l.autoReloadId && (p("onSave -> autoReloadId detected: ", l.autoReloadId), e.readData.id = l.autoReloadId, p("onSave -> turning off create mode"), a.value = !1, U()), b === "create" ? typeof e.onCreate == "function" && (p("onSave -> trigger onCreate callback"), e.onCreate()) : typeof e.onUpdate == "function" && (p("onSave -> trigger onUpdate callback"), e.onUpdate()), n(b, l);
94
+ a.value || (p("onSave -> turn stored data into original"), k.value.turnStoredIntoOriginal()), b === "create" ? typeof e.onCreate == "function" && (p("onSave -> trigger onCreate callback"), e.onCreate(l)) : typeof e.onUpdate == "function" && (p("onSave -> trigger onUpdate callback"), e.onUpdate(l)), l.autoReloadId && (p("onSave -> autoReloadId detected: ", l.autoReloadId), e.readData.id = l.autoReloadId, p("onSave -> turning off create mode"), a.value = !1, U()), n(b, l);
95
95
  }, J = () => {
96
96
  o.value = !0, i.value = -1;
97
97
  }, F = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -192,24 +192,25 @@ const onDrop = ($event: PointerEvent, r: HTTPResponse) => {
192
192
  dataState.value.turnStoredIntoOriginal();
193
193
  }
194
194
 
195
- if (r.autoReloadId) {
196
- debug('onSave -> autoReloadId detected: ', r.autoReloadId);
197
- props.readData['id'] = r.autoReloadId;
198
- debug('onSave -> turning off create mode');
199
- createMode.value = false;
200
- fetchItem();
201
- }
202
195
  if (emits === 'create') {
203
196
  if (typeof props.onCreate === 'function') {
204
197
  debug('onSave -> trigger onCreate callback');
205
- props.onCreate();
198
+ props.onCreate(r);
206
199
  }
207
200
  } else {
208
201
  if (typeof props.onUpdate === 'function') {
209
202
  debug('onSave -> trigger onUpdate callback');
210
- props.onUpdate();
203
+ props.onUpdate(r);
211
204
  }
212
205
  }
206
+
207
+ if (r.autoReloadId) {
208
+ debug('onSave -> autoReloadId detected: ', r.autoReloadId);
209
+ props.readData['id'] = r.autoReloadId;
210
+ debug('onSave -> turning off create mode');
211
+ createMode.value = false;
212
+ fetchItem();
213
+ }
213
214
  emit(emits, r)
214
215
  },
215
216
  onButtonLoading = () => {