lkt-item-crud 1.1.5 → 1.1.6

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { Be as default };
2
- declare namespace Be {
3
- function install(a: any, U?: {}): void;
1
+ export { _e as default };
2
+ declare namespace _e {
3
+ function install(o: any, I?: {}): void;
4
4
  }
package/dist/build.js CHANGED
@@ -1,17 +1,17 @@
1
- import { defineComponent as ue, useSlots as re, ref as s, computed as o, watch as B, resolveComponent as w, openBlock as i, createElementBlock as m, createElementVNode as j, toDisplayString as M, renderSlot as O, createCommentVNode as h, withDirectives as R, createBlock as V, withCtx as A, unref as H, vShow as q, createVNode as P } from "vue";
2
- import { httpCall as oe } from "lkt-http-client";
3
- import { DataState as de } from "lkt-data-state";
4
- const ne = { class: "lkt-item-crud" }, se = {
1
+ import { defineComponent as oe, useSlots as re, ref as s, computed as d, watch as k, resolveComponent as w, openBlock as c, createElementBlock as y, createElementVNode as j, toDisplayString as U, renderSlot as O, createCommentVNode as D, withDirectives as R, createBlock as V, withCtx as H, unref as P, vShow as q, createVNode as z } from "vue";
2
+ import { httpCall as de } from "lkt-http-client";
3
+ import { DataState as ne } from "lkt-data-state";
4
+ const se = { class: "lkt-item-crud" }, ie = {
5
5
  key: 0,
6
6
  class: "lkt-item-crud_header"
7
- }, ie = { class: "lkt-item-crud_header-title" }, ce = { class: "lkt-item-crud_header-slot" }, fe = { class: "lkt-item-crud-buttons" }, ve = { key: 1 }, pe = { key: 1 }, me = {
7
+ }, ce = { class: "lkt-item-crud_header-title" }, ve = { class: "lkt-item-crud_header-slot" }, fe = { class: "lkt-item-crud-buttons" }, pe = { key: 1 }, me = { key: 1 }, ye = {
8
8
  key: 1,
9
9
  class: "lkt-item-crud_content"
10
- }, ye = {
10
+ }, he = {
11
11
  key: 0,
12
12
  class: "lkt-grid-1"
13
- }, Ce = { name: "LktItemCrud", inheritAttrs: !1 }, he = /* @__PURE__ */ ue({
14
- ...Ce,
13
+ }, Se = { name: "LktItemCrud", inheritAttrs: !1 }, ke = /* @__PURE__ */ oe({
14
+ ...Se,
15
15
  props: {
16
16
  modelValue: { type: Object, required: !1, default: () => ({}) },
17
17
  title: { type: String, default: "" },
@@ -43,170 +43,170 @@ const ne = { class: "lkt-item-crud" }, se = {
43
43
  onCreate: { type: Function, required: !1, default: () => !0 },
44
44
  onUpdate: { type: Function, required: !1, default: () => !0 }
45
45
  },
46
- emits: ["update:modelValue", "read", "create", "update", "drop", "perms", "error", "modified-data"],
47
- setup(a, { expose: U, emit: z }) {
48
- const e = a, _ = re(), d = z;
49
- let G = [];
50
- const l = s(!0), r = s(e.modelValue), y = s(G), c = s(!1), f = s(!1), v = s(!1), n = s(200), S = s(null), k = s(null), C = s(new de(r.value)), K = o(() => e.isCreate ? e.createConfirm : e.updateConfirm), Q = o(() => e.isCreate ? e.createConfirmData : e.updateConfirmData), I = o(() => e.isCreate ? e.createResource : e.updateResource), W = o(() => e.isCreate ? { ...e.createData, ...JSON.parse(JSON.stringify(r.value)) } : { ...e.updateData, ...JSON.parse(JSON.stringify(r.value)) }), X = o(() => e.isCreate ? e.createDisabled : e.updateDisabled), D = o(() => !e.isCreate && y.value.includes("update")), b = o(() => !e.isCreate && y.value.includes("drop")), L = async () => {
51
- l.value = !0, n.value = -1, v.value = !1;
46
+ emits: ["update:modelValue", "update:isCreate", "read", "create", "update", "drop", "perms", "error", "modified-data"],
47
+ setup(o, { expose: I, emit: G }) {
48
+ const e = o, L = re(), n = G;
49
+ let K = [];
50
+ const l = s(!0), r = s(e.modelValue), h = s(K), v = s(!1), f = s(!1), p = s(!1), i = s(200), C = s(null), b = s(null), S = s(new ne(r.value)), a = s(a.value), Q = d(() => a.value ? e.createConfirm : e.updateConfirm), W = d(() => a.value ? e.createConfirmData : e.updateConfirmData), N = d(() => a.value ? e.createResource : e.updateResource), X = d(() => a.value ? { ...e.createData, ...JSON.parse(JSON.stringify(r.value)) } : { ...e.updateData, ...JSON.parse(JSON.stringify(r.value)) }), Y = d(() => a.value ? e.createDisabled : e.updateDisabled), g = d(() => !a.value && h.value.includes("update")), B = d(() => !a.value && h.value.includes("drop")), M = async () => {
51
+ l.value = !0, i.value = -1, p.value = !1;
52
52
  try {
53
- const t = await oe(e.readResource, e.readData);
54
- if (l.value = !1, n.value = t.httpStatus, !t.success) {
55
- f.value = !1, n.value = t.httpStatus, d("error", t.httpStatus);
53
+ const t = await de(e.readResource, e.readData);
54
+ if (l.value = !1, i.value = t.httpStatus, !t.success) {
55
+ f.value = !1, i.value = t.httpStatus, n("error", t.httpStatus);
56
56
  return;
57
57
  }
58
- f.value = !0, r.value = t.data, y.value = t.perms, C.value.increment(r.value).turnStoredIntoOriginal(), d("read", t);
58
+ f.value = !0, r.value = t.data, h.value = t.perms, S.value.increment(r.value).turnStoredIntoOriginal(), n("read", t);
59
59
  } catch {
60
- l.value = !1, f.value = !1, n.value = 404, d("error", 404);
60
+ l.value = !1, f.value = !1, i.value = 404, n("error", 404);
61
61
  return;
62
62
  }
63
- }, Y = o(() => l.value ? !1 : e.title || !!_["post-title"]);
64
- B(() => e.modelValue, (t) => {
65
- r.value = t, C.value.increment(t);
66
- }, { deep: !0 }), B(r, (t) => {
67
- d("update:modelValue", r.value), C.value.increment(t);
68
- }, { deep: !0 }), B(y, () => d("perms", y.value));
69
- const N = o(() => X.value || !e.isCreate && !D.value || typeof e.saveValidator == "function" && !e.saveValidator(r.value) ? !1 : C.value.changed());
70
- B(N, (t) => d("modified-data", t)), e.readResource && !e.isCreate ? L() : e.isCreate && (f.value = !0, c.value = !0, l.value = !1);
71
- const Z = (t, u) => {
72
- if (l.value = !1, n.value = u.httpStatus, !u.success) {
73
- v.value = !0, d("error", u.httpStatus);
63
+ }, Z = d(() => l.value ? !1 : e.title || !!L["post-title"]);
64
+ k(() => e.modelValue, (t) => {
65
+ r.value = t, S.value.increment(t);
66
+ }, { deep: !0 }), k(r, (t) => {
67
+ n("update:modelValue", r.value), S.value.increment(t);
68
+ }, { deep: !0 }), k(h, () => n("perms", h.value));
69
+ const T = d(() => Y.value || !a.value && !g.value || typeof e.saveValidator == "function" && !e.saveValidator(r.value) ? !1 : S.value.changed());
70
+ k(T, (t) => n("modified-data", t)), k(a, (t) => n("update:isCreate", t)), e.readResource && !a.value ? M() : a.value && (f.value = !0, v.value = !0, l.value = !1);
71
+ const ee = (t, u) => {
72
+ if (l.value = !1, i.value = u.httpStatus, !u.success) {
73
+ p.value = !0, n("error", u.httpStatus);
74
74
  return;
75
75
  }
76
- v.value = !0, d("drop", u);
77
- }, ee = (t, u) => {
78
- if (I.value) {
79
- if (l.value = !1, n.value = u.httpStatus, !u.success) {
80
- v.value = !0, d("error", u.httpStatus);
76
+ p.value = !0, n("drop", u);
77
+ }, te = (t, u) => {
78
+ if (N.value) {
79
+ if (l.value = !1, i.value = u.httpStatus, !u.success) {
80
+ p.value = !0, n("error", u.httpStatus);
81
81
  return;
82
82
  }
83
- v.value = !0;
83
+ p.value = !0;
84
84
  }
85
- let g = e.isCreate ? "create" : "update";
86
- e.isCreate || C.value.turnStoredIntoOriginal(), u.autoReloadId && (e.readData.id = u.autoReloadId, L()), e.isCreate ? typeof e.onCreate == "function" && e.onCreate() : typeof e.onUpdate == "function" && e.onUpdate(), d(g, u);
87
- }, T = () => {
88
- l.value = !0, n.value = -1;
85
+ let _ = a.value ? "create" : "update";
86
+ a.value || S.value.turnStoredIntoOriginal(), u.autoReloadId && (e.readData.id = u.autoReloadId, a.value = !1, M()), a.value ? typeof e.onCreate == "function" && e.onCreate() : typeof e.onUpdate == "function" && e.onUpdate(), n(_, u);
89
87
  }, $ = () => {
88
+ l.value = !0, i.value = -1;
89
+ }, x = () => {
90
90
  l.value = !1;
91
91
  };
92
- U({
92
+ I({
93
93
  doDrop: () => {
94
- k.value && typeof k.value.click == "function" && k.value.click();
94
+ b.value && typeof b.value.click == "function" && b.value.click();
95
95
  },
96
- doRefresh: L,
96
+ doRefresh: M,
97
97
  doSave: () => {
98
- S.value && typeof S.value.click == "function" && S.value.click();
98
+ C.value && typeof C.value.click == "function" && C.value.click();
99
99
  }
100
100
  });
101
- const x = o(() => !e.hiddenDrop && !l.value && c.value && f.value), J = o(() => l.value ? !1 : e.isCreate ? !0 : !e.hiddenSave && c.value && f.value), E = o(() => !l.value && !e.isCreate && f.value), te = o(() => !e.hiddenButtons && (J.value || x.value || E.value));
101
+ const J = d(() => !e.hiddenDrop && !l.value && v.value && f.value), E = d(() => l.value ? !1 : a.value ? !0 : !e.hiddenSave && v.value && f.value), F = d(() => !l.value && !a.value && f.value), ae = d(() => !e.hiddenButtons && (E.value || J.value || F.value));
102
102
  return (t, u) => {
103
- const g = w("lkt-button"), ae = w("lkt-field-switch"), F = w("lkt-http-info"), le = w("lkt-loader");
104
- return i(), m("article", ne, [
105
- Y.value ? (i(), m("header", se, [
106
- j("h1", ie, M(a.title), 1),
107
- j("div", ce, [
103
+ const _ = w("lkt-button"), le = w("lkt-field-switch"), A = w("lkt-http-info"), ue = w("lkt-loader");
104
+ return c(), y("article", se, [
105
+ Z.value ? (c(), y("header", ie, [
106
+ j("h1", ce, U(o.title), 1),
107
+ j("div", ve, [
108
108
  O(t.$slots, "post-title", {
109
109
  item: r.value,
110
110
  loading: l.value
111
111
  })
112
112
  ])
113
- ])) : h("", !0),
113
+ ])) : D("", !0),
114
114
  R(j("div", fe, [
115
- a.isCreate ? h("", !0) : R((i(), V(g, {
115
+ a.value ? D("", !0) : R((c(), V(_, {
116
116
  key: 0,
117
- ref: (p) => k.value = p,
117
+ ref: (m) => b.value = m,
118
118
  palette: "danger",
119
- disabled: a.dropDisabled || !b.value,
120
- "confirm-modal": a.dropConfirm,
121
- "confirm-data": a.dropConfirmData,
122
- resource: a.dropResource,
123
- "resource-data": a.dropData,
124
- onLoading: T,
125
- onLoaded: $,
126
- onClick: Z
119
+ disabled: o.dropDisabled || !B.value,
120
+ "confirm-modal": o.dropConfirm,
121
+ "confirm-data": o.dropConfirmData,
122
+ resource: o.dropResource,
123
+ "resource-data": o.dropData,
124
+ onLoading: $,
125
+ onLoaded: x,
126
+ onClick: ee
127
127
  }, {
128
- default: A(() => [
129
- H(_)["button-drop"] ? O(t.$slots, "button-drop", {
128
+ default: H(() => [
129
+ P(L)["button-drop"] ? O(t.$slots, "button-drop", {
130
130
  key: 0,
131
131
  item: r.value,
132
- editMode: c.value,
133
- isCreate: a.isCreate,
134
- canUpdate: D.value,
135
- canDrop: b.value
136
- }) : (i(), m("span", ve, M(a.dropText), 1))
132
+ editMode: v.value,
133
+ isCreate: a.value,
134
+ canUpdate: g.value,
135
+ canDrop: B.value
136
+ }) : (c(), y("span", pe, U(o.dropText), 1))
137
137
  ]),
138
138
  _: 3
139
139
  }, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data"])), [
140
- [q, x.value]
140
+ [q, J.value]
141
141
  ]),
142
- R(P(g, {
143
- ref: (p) => S.value = p,
142
+ R(z(_, {
143
+ ref: (m) => C.value = m,
144
144
  palette: "success",
145
- disabled: !N.value,
146
- "confirm-modal": K.value,
147
- "confirm-data": Q.value,
148
- resource: I.value,
149
- "resource-data": W.value,
150
- onLoading: T,
151
- onLoaded: $,
152
- onClick: ee
145
+ disabled: !T.value,
146
+ "confirm-modal": Q.value,
147
+ "confirm-data": W.value,
148
+ resource: N.value,
149
+ "resource-data": X.value,
150
+ onLoading: $,
151
+ onLoaded: x,
152
+ onClick: te
153
153
  }, {
154
- default: A(() => [
155
- H(_)["button-save"] ? O(t.$slots, "button-save", {
154
+ default: H(() => [
155
+ P(L)["button-save"] ? O(t.$slots, "button-save", {
156
156
  key: 0,
157
157
  item: r.value,
158
- editMode: c.value,
159
- isCreate: a.isCreate,
160
- canUpdate: D.value,
161
- canDrop: b.value
162
- }) : (i(), m("span", pe, M(a.saveText), 1))
158
+ editMode: v.value,
159
+ isCreate: a.value,
160
+ canUpdate: g.value,
161
+ canDrop: B.value
162
+ }) : (c(), y("span", me, U(o.saveText), 1))
163
163
  ]),
164
164
  _: 3
165
165
  }, 8, ["disabled", "confirm-modal", "confirm-data", "resource", "resource-data"]), [
166
- [q, J.value]
166
+ [q, E.value]
167
167
  ]),
168
- R(P(ae, {
169
- modelValue: c.value,
170
- "onUpdate:modelValue": u[0] || (u[0] = (p) => c.value = p),
171
- label: a.editModeText
168
+ R(z(le, {
169
+ modelValue: v.value,
170
+ "onUpdate:modelValue": u[0] || (u[0] = (m) => v.value = m),
171
+ label: o.editModeText
172
172
  }, null, 8, ["modelValue", "label"]), [
173
- [q, E.value]
173
+ [q, F.value]
174
174
  ])
175
175
  ], 512), [
176
- [q, te.value]
176
+ [q, ae.value]
177
177
  ]),
178
- l.value ? h("", !0) : (i(), m("div", me, [
179
- f.value ? (i(), m("div", ye, [
180
- v.value ? (i(), V(F, {
178
+ l.value ? D("", !0) : (c(), y("div", ye, [
179
+ f.value ? (c(), y("div", he, [
180
+ p.value ? (c(), V(A, {
181
181
  key: 0,
182
- code: n.value,
182
+ code: i.value,
183
183
  quick: "",
184
- palette: n.value === 200 ? "success" : "danger",
184
+ palette: i.value === 200 ? "success" : "danger",
185
185
  "can-close": "",
186
- onClose: u[1] || (u[1] = (p) => v.value = !1)
187
- }, null, 8, ["code", "palette"])) : h("", !0),
186
+ onClose: u[1] || (u[1] = (m) => p.value = !1)
187
+ }, null, 8, ["code", "palette"])) : D("", !0),
188
188
  O(t.$slots, "item", {
189
189
  item: r.value,
190
190
  loading: l.value,
191
- editMode: c.value,
192
- isCreate: a.isCreate,
193
- canUpdate: D.value,
194
- canDrop: b.value
191
+ editMode: v.value,
192
+ isCreate: a.value,
193
+ canUpdate: g.value,
194
+ canDrop: B.value
195
195
  })
196
- ])) : (i(), V(F, {
196
+ ])) : (c(), V(A, {
197
197
  key: 1,
198
- code: n.value
198
+ code: i.value
199
199
  }, null, 8, ["code"]))
200
200
  ])),
201
- l.value ? (i(), V(le, { key: 2 })) : h("", !0)
201
+ l.value ? (c(), V(ue, { key: 2 })) : D("", !0)
202
202
  ]);
203
203
  };
204
204
  }
205
- }), Be = {
206
- install: (a, U = {}) => {
207
- a.component("lkt-item-crud") === void 0 && a.component("lkt-item-crud", he);
205
+ }), _e = {
206
+ install: (o, I = {}) => {
207
+ o.component("lkt-item-crud") === void 0 && o.component("lkt-item-crud", ke);
208
208
  }
209
209
  };
210
210
  export {
211
- Be as default
211
+ _e as default
212
212
  };
@@ -132,6 +132,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
132
132
  drop: (...args: any[]) => void;
133
133
  update: (...args: any[]) => void;
134
134
  "update:modelValue": (...args: any[]) => void;
135
+ "update:isCreate": (...args: any[]) => void;
135
136
  read: (...args: any[]) => void;
136
137
  create: (...args: any[]) => void;
137
138
  perms: (...args: any[]) => void;
@@ -266,6 +267,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
266
267
  onDrop?: ((...args: any[]) => any) | undefined;
267
268
  onUpdate?: ((...args: any[]) => any) | undefined;
268
269
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
270
+ "onUpdate:isCreate"?: ((...args: any[]) => any) | undefined;
269
271
  onRead?: ((...args: any[]) => any) | undefined;
270
272
  onCreate?: ((...args: any[]) => any) | undefined;
271
273
  onPerms?: ((...args: any[]) => any) | undefined;
@@ -304,14 +306,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
304
306
  "button-drop"?(_: {
305
307
  item: Record<string, any>;
306
308
  editMode: boolean;
307
- isCreate: false;
309
+ isCreate: any;
308
310
  canUpdate: boolean;
309
311
  canDrop: boolean;
310
312
  }): any;
311
313
  "button-save"?(_: {
312
314
  item: Record<string, any>;
313
315
  editMode: boolean;
314
- isCreate: boolean;
316
+ isCreate: any;
315
317
  canUpdate: boolean;
316
318
  canDrop: boolean;
317
319
  }): any;
@@ -319,7 +321,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
319
321
  item: Record<string, any>;
320
322
  loading: false;
321
323
  editMode: boolean;
322
- isCreate: boolean;
324
+ isCreate: any;
323
325
  canUpdate: boolean;
324
326
  canDrop: boolean;
325
327
  }): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lkt-item-crud",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "module": "./dist/build.js",
@@ -49,7 +49,7 @@ const props = defineProps({
49
49
 
50
50
  const slots = useSlots();
51
51
 
52
- const emit = defineEmits(['update:modelValue', 'read', 'create', 'update', 'drop', 'perms', 'error', 'modified-data']);
52
+ const emit = defineEmits(['update:modelValue', 'update:isCreate', 'read', 'create', 'update', 'drop', 'perms', 'error', 'modified-data']);
53
53
 
54
54
  let basePerms: string[] = [];
55
55
 
@@ -62,36 +62,37 @@ const isLoading = ref(true),
62
62
  httpStatus = ref(200),
63
63
  saveButton = ref(null),
64
64
  dropButton = ref(null),
65
- dataState = ref(new DataState(item.value));
65
+ dataState = ref(new DataState(item.value)),
66
+ createMode = ref(createMode.value);
66
67
 
67
68
  const saveConfirm = computed(() => {
68
- return props.isCreate
69
+ return createMode.value
69
70
  ? props.createConfirm
70
71
  : props.updateConfirm;
71
72
  }),
72
73
  confirmData = computed(() => {
73
- return props.isCreate
74
+ return createMode.value
74
75
  ? props.createConfirmData
75
76
  : props.updateConfirmData;
76
77
  }),
77
78
  saveResource = computed(() => {
78
- return props.isCreate
79
+ return createMode.value
79
80
  ? props.createResource
80
81
  : props.updateResource;
81
82
  }),
82
83
  saveData = computed(() => {
83
- if (props.isCreate) {
84
+ if (createMode.value) {
84
85
  return {...props.createData, ...JSON.parse(JSON.stringify(item.value))};
85
86
  }
86
87
  return {...props.updateData, ...JSON.parse(JSON.stringify(item.value))};
87
88
  }),
88
89
  saveDisabled = computed(() => {
89
- return props.isCreate
90
+ return createMode.value
90
91
  ? props.createDisabled
91
92
  : props.updateDisabled;
92
93
  }),
93
- canUpdate = computed(() => !props.isCreate && perms.value.includes('update')),
94
- canDrop = computed(() => !props.isCreate && perms.value.includes('drop'));
94
+ canUpdate = computed(() => !createMode.value && perms.value.includes('update')),
95
+ canDrop = computed(() => !createMode.value && perms.value.includes('drop'));
95
96
 
96
97
  const fetchItem = async () => {
97
98
  isLoading.value = true;
@@ -141,17 +142,18 @@ watch(perms, () => emit('perms', perms.value));
141
142
 
142
143
  const ableToSave = computed(() => {
143
144
  if (saveDisabled.value) return false;
144
- if (!props.isCreate && !canUpdate.value) return false;
145
+ if (!createMode.value && !canUpdate.value) return false;
145
146
 
146
147
  if (typeof props.saveValidator === 'function' && !props.saveValidator(item.value)) return false;
147
148
 
148
149
  return dataState.value.changed();
149
150
  });
150
151
  watch(ableToSave, (v) => emit('modified-data', v));
152
+ watch(createMode, (v) => emit('update:isCreate', v));
151
153
 
152
154
  // Fetch item
153
- if (props.readResource && !props.isCreate) fetchItem();
154
- else if (props.isCreate) {
155
+ if (props.readResource && !createMode.value) fetchItem();
156
+ else if (createMode.value) {
155
157
  httpSuccessRead.value = true;
156
158
  editMode.value = true;
157
159
  isLoading.value = false;
@@ -180,16 +182,17 @@ const onDrop = ($event: PointerEvent, r: HTTPResponse) => {
180
182
  }
181
183
  showStoreMessage.value = true;
182
184
  }
183
- let emits: 'create' | 'update' = props.isCreate ? 'create' : 'update';
184
- if (!props.isCreate) {
185
+ let emits: 'create' | 'update' = createMode.value ? 'create' : 'update';
186
+ if (!createMode.value) {
185
187
  dataState.value.turnStoredIntoOriginal();
186
188
  }
187
189
 
188
190
  if (r.autoReloadId) {
189
191
  props.readData['id'] = r.autoReloadId;
192
+ createMode.value = false;
190
193
  fetchItem();
191
194
  }
192
- if (props.isCreate) {
195
+ if (createMode.value) {
193
196
  if (typeof props.onCreate === 'function') props.onCreate();
194
197
  } else {
195
198
  if (typeof props.onUpdate === 'function') props.onUpdate();
@@ -227,7 +230,7 @@ const showDropButton = computed(() => {
227
230
  showSaveButton = computed(() => {
228
231
  if (isLoading.value) return false;
229
232
 
230
- if (props.isCreate) return true;
233
+ if (createMode.value) return true;
231
234
 
232
235
  return !props.hiddenSave
233
236
  && editMode.value
@@ -235,7 +238,7 @@ const showDropButton = computed(() => {
235
238
  }),
236
239
  showSwitchButton = computed(() => {
237
240
  return !isLoading.value
238
- && !props.isCreate
241
+ && !createMode.value
239
242
  && httpSuccessRead.value;
240
243
  }),
241
244
  showButtons = computed(() => {
@@ -255,7 +258,7 @@ const showDropButton = computed(() => {
255
258
  <lkt-button
256
259
  :ref="(el:any) => dropButton = el"
257
260
  v-show="showDropButton"
258
- v-if="!isCreate"
261
+ v-if="!createMode"
259
262
  palette="danger"
260
263
  v-bind:disabled="dropDisabled || !canDrop"
261
264
  v-bind:confirm-modal="dropConfirm"
@@ -267,7 +270,7 @@ const showDropButton = computed(() => {
267
270
  v-on:click="onDrop">
268
271
  <slot v-if="!!slots['button-drop']" name="button-drop" v-bind:item="item"
269
272
  v-bind:edit-mode="editMode"
270
- v-bind:is-create="isCreate"
273
+ v-bind:is-create="createMode"
271
274
  v-bind:can-update="canUpdate"
272
275
  v-bind:can-drop="canDrop"></slot>
273
276
  <span v-else>{{ dropText }}</span>
@@ -287,7 +290,7 @@ const showDropButton = computed(() => {
287
290
  v-on:click="onSave">
288
291
  <slot v-if="!!slots['button-save']" name="button-save" v-bind:item="item"
289
292
  v-bind:edit-mode="editMode"
290
- v-bind:is-create="isCreate"
293
+ v-bind:is-create="createMode"
291
294
  v-bind:can-update="canUpdate"
292
295
  v-bind:can-drop="canDrop"></slot>
293
296
  <span v-else>{{ saveText }}</span>
@@ -303,7 +306,7 @@ const showDropButton = computed(() => {
303
306
  :palette="httpStatus === 200 ? 'success' : 'danger'" can-close
304
307
  v-on:close="showStoreMessage = false"></lkt-http-info>
305
308
  <slot name="item" v-bind:item="item" v-bind:loading="isLoading" v-bind:edit-mode="editMode"
306
- v-bind:is-create="isCreate"
309
+ v-bind:is-create="createMode"
307
310
  v-bind:can-update="canUpdate"
308
311
  v-bind:can-drop="canDrop"></slot>
309
312
  </div>