lkt-item-crud 2.0.10 → 2.0.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.d.ts +6 -6
- package/dist/build.js +452 -354
- package/dist/components/ButtonNav.vue.d.ts +458 -12
- package/dist/lib-components/LktItemCrud.vue.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/ButtonNav.vue +161 -72
- package/src/lib-components/LktItemCrud.vue +3 -1
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
updateButton?: ButtonConfig|false
|
|
32
32
|
dropButton?: ButtonConfig|false
|
|
33
33
|
editModeButton?: ButtonConfig|false
|
|
34
|
+
groupButton?: ButtonConfig|boolean
|
|
34
35
|
|
|
35
36
|
dataChanged: boolean
|
|
36
37
|
|
|
@@ -51,7 +52,8 @@
|
|
|
51
52
|
const safeCreateButton = ref(ensureButtonConfig(props.createButton, LktSettings.defaultCreateButton)),
|
|
52
53
|
safeUpdateButton = ref(ensureButtonConfig(props.updateButton, LktSettings.defaultUpdateButton)),
|
|
53
54
|
safeDropButton = ref(ensureButtonConfig(props.dropButton, LktSettings.defaultDropButton)),
|
|
54
|
-
safeEditModeButton = ref(ensureButtonConfig(props.editModeButton, LktSettings.defaultEditModeButton))
|
|
55
|
+
safeEditModeButton = ref(ensureButtonConfig(props.editModeButton, LktSettings.defaultEditModeButton)),
|
|
56
|
+
safeGroupButton = ref(ensureButtonConfig(props.groupButton, LktSettings.defaultGroupButton));
|
|
55
57
|
|
|
56
58
|
watch(() => props.createButton, v => {
|
|
57
59
|
safeCreateButton.value = ensureButtonConfig(v, LktSettings.defaultCreateButton);
|
|
@@ -190,76 +192,163 @@
|
|
|
190
192
|
<template>
|
|
191
193
|
<div v-if="showButtons" class="lkt-item-crud-buttons">
|
|
192
194
|
|
|
193
|
-
<
|
|
194
|
-
<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
195
|
+
<template v-if="groupButton !== false">
|
|
196
|
+
<lkt-button
|
|
197
|
+
ref="groupButton"
|
|
198
|
+
v-bind="safeGroupButton"
|
|
199
|
+
class="lkt-item-crud-group-button"
|
|
200
|
+
>
|
|
201
|
+
<template #split>
|
|
202
|
+
<lkt-button
|
|
203
|
+
v-if="showSwitchButton"
|
|
204
|
+
v-bind="safeEditModeButton"
|
|
205
|
+
v-model:checked="isEditing"
|
|
206
|
+
class="lkt-item-crud--switch-mode-button" />
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
<template v-if="slots['prev-buttons-ever']" v-show="!isLoading">
|
|
210
|
+
<slot name="prev-buttons-ever"
|
|
211
|
+
:can-update="canUpdate"
|
|
212
|
+
:can-drop="canDrop"
|
|
213
|
+
:perms="perms"
|
|
214
|
+
/>
|
|
215
|
+
</template>
|
|
216
|
+
|
|
217
|
+
<template v-if="slots['prev-buttons']" v-show="isEditing && !isLoading">
|
|
218
|
+
<slot name="prev-buttons"
|
|
219
|
+
:can-update="canUpdate"
|
|
220
|
+
:can-drop="canDrop"
|
|
221
|
+
:perms="perms"
|
|
222
|
+
/>
|
|
223
|
+
</template>
|
|
224
|
+
|
|
225
|
+
<lkt-button
|
|
226
|
+
ref="saveButtonRef"
|
|
227
|
+
v-if="mode === ItemCrudMode.Update && showSaveButton"
|
|
228
|
+
v-bind="safeUpdateButton"
|
|
229
|
+
:disabled="!ableToUpdate"
|
|
230
|
+
@loading="onButtonLoading"
|
|
231
|
+
@loaded="onButtonLoaded"
|
|
232
|
+
@click="onSave">
|
|
233
|
+
<slot v-if="!!slots['button-save']" name="button-save" :item="item"
|
|
234
|
+
:edit-mode="isEditing"
|
|
235
|
+
:is-create="false"
|
|
236
|
+
:can-update="canUpdate"
|
|
237
|
+
:can-drop="canDrop" />
|
|
238
|
+
</lkt-button>
|
|
239
|
+
|
|
240
|
+
<lkt-button
|
|
241
|
+
ref="saveButtonRef"
|
|
242
|
+
v-else-if="mode === ItemCrudMode.Create && showSaveButton"
|
|
243
|
+
v-bind="safeCreateButton"
|
|
244
|
+
:disabled="!ableToCreate"
|
|
245
|
+
@loading="onButtonLoading"
|
|
246
|
+
@loaded="onButtonLoaded"
|
|
247
|
+
@click="onCreate">
|
|
248
|
+
<slot v-if="!!slots['button-save']" name="button-save" :item="item"
|
|
249
|
+
:edit-mode="isEditing"
|
|
250
|
+
:is-create="true"
|
|
251
|
+
:can-update="canUpdate"
|
|
252
|
+
:can-drop="canDrop" />
|
|
253
|
+
</lkt-button>
|
|
254
|
+
|
|
255
|
+
<lkt-button
|
|
256
|
+
ref="dropButtonRef"
|
|
257
|
+
v-show="showDropButton"
|
|
258
|
+
v-if="mode !== ItemCrudMode.Create"
|
|
259
|
+
v-bind="safeDropButton"
|
|
260
|
+
:disabled="!ableToDrop"
|
|
261
|
+
@loading="onButtonLoading"
|
|
262
|
+
@loaded="onButtonLoaded"
|
|
263
|
+
@click="onDrop">
|
|
264
|
+
<slot v-if="!!slots['button-drop']" name="button-drop" :item="item"
|
|
265
|
+
:edit-mode="isEditing"
|
|
266
|
+
:is-create="false"
|
|
267
|
+
:can-update="canUpdate"
|
|
268
|
+
:can-drop="canDrop" />
|
|
269
|
+
</lkt-button>
|
|
270
|
+
|
|
271
|
+
<template v-if="slots.buttons" v-show="isEditing && !isLoading">
|
|
272
|
+
<slot name="buttons" />
|
|
273
|
+
</template>
|
|
274
|
+
</template>
|
|
275
|
+
</lkt-button>
|
|
276
|
+
</template>
|
|
277
|
+
|
|
278
|
+
<template v-else>
|
|
279
|
+
|
|
280
|
+
<div class="lkt-item-crud-buttons" v-if="slots['prev-buttons-ever']" v-show="!isLoading">
|
|
281
|
+
<slot name="prev-buttons-ever"
|
|
282
|
+
:can-update="canUpdate"
|
|
283
|
+
:can-drop="canDrop"
|
|
284
|
+
:perms="perms"
|
|
285
|
+
/>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
<div class="lkt-item-crud-buttons" v-if="slots['prev-buttons']" v-show="isEditing && !isLoading">
|
|
289
|
+
<slot name="prev-buttons"
|
|
290
|
+
:can-update="canUpdate"
|
|
291
|
+
:can-drop="canDrop"
|
|
292
|
+
:perms="perms"
|
|
293
|
+
/>
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
<lkt-button
|
|
297
|
+
ref="saveButtonRef"
|
|
298
|
+
v-if="mode === ItemCrudMode.Update && showSaveButton"
|
|
299
|
+
v-bind="safeUpdateButton"
|
|
300
|
+
:disabled="!ableToUpdate"
|
|
301
|
+
@loading="onButtonLoading"
|
|
302
|
+
@loaded="onButtonLoaded"
|
|
303
|
+
@click="onSave">
|
|
304
|
+
<slot v-if="!!slots['button-save']" name="button-save" :item="item"
|
|
305
|
+
:edit-mode="isEditing"
|
|
306
|
+
:is-create="false"
|
|
307
|
+
:can-update="canUpdate"
|
|
308
|
+
:can-drop="canDrop" />
|
|
309
|
+
</lkt-button>
|
|
310
|
+
|
|
311
|
+
<lkt-button
|
|
312
|
+
ref="saveButtonRef"
|
|
313
|
+
v-else-if="mode === ItemCrudMode.Create && showSaveButton"
|
|
314
|
+
v-bind="safeCreateButton"
|
|
315
|
+
:disabled="!ableToCreate"
|
|
316
|
+
@loading="onButtonLoading"
|
|
317
|
+
@loaded="onButtonLoaded"
|
|
318
|
+
@click="onCreate">
|
|
319
|
+
<slot v-if="!!slots['button-save']" name="button-save" :item="item"
|
|
320
|
+
:edit-mode="isEditing"
|
|
321
|
+
:is-create="true"
|
|
322
|
+
:can-update="canUpdate"
|
|
323
|
+
:can-drop="canDrop" />
|
|
324
|
+
</lkt-button>
|
|
325
|
+
|
|
326
|
+
<lkt-button
|
|
327
|
+
ref="dropButtonRef"
|
|
328
|
+
v-show="showDropButton"
|
|
329
|
+
v-if="mode !== ItemCrudMode.Create"
|
|
330
|
+
v-bind="safeDropButton"
|
|
331
|
+
:disabled="!ableToDrop"
|
|
332
|
+
@loading="onButtonLoading"
|
|
333
|
+
@loaded="onButtonLoaded"
|
|
334
|
+
@click="onDrop">
|
|
335
|
+
<slot v-if="!!slots['button-drop']" name="button-drop" :item="item"
|
|
336
|
+
:edit-mode="isEditing"
|
|
337
|
+
:is-create="false"
|
|
338
|
+
:can-update="canUpdate"
|
|
339
|
+
:can-drop="canDrop" />
|
|
340
|
+
</lkt-button>
|
|
341
|
+
|
|
342
|
+
<div class="lkt-item-crud-buttons" v-if="slots.buttons" v-show="isEditing && !isLoading">
|
|
343
|
+
<slot name="buttons" />
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
<lkt-button
|
|
347
|
+
v-if="showSwitchButton"
|
|
348
|
+
v-bind="safeEditModeButton"
|
|
349
|
+
v-model:checked="isEditing"
|
|
350
|
+
class="lkt-item-crud--switch-mode-button" />
|
|
351
|
+
|
|
352
|
+
</template>
|
|
264
353
|
</div>
|
|
265
354
|
</template>
|
|
@@ -357,6 +357,7 @@
|
|
|
357
357
|
:update-button="updateButton"
|
|
358
358
|
:drop-button="dropButton"
|
|
359
359
|
:edit-mode-button="editModeButton"
|
|
360
|
+
:group-button="groupButton"
|
|
360
361
|
:data-changed="dataChanged"
|
|
361
362
|
:http-success-read="httpSuccessRead"
|
|
362
363
|
:can-update="canUpdate"
|
|
@@ -374,7 +375,7 @@
|
|
|
374
375
|
:perms="perms"
|
|
375
376
|
/>
|
|
376
377
|
</template>
|
|
377
|
-
<template #prev-buttons
|
|
378
|
+
<template #prev-buttons="{canUpdate, canDrop, perms}" v-if="slots['prev-buttons']">
|
|
378
379
|
<slot name="prev-buttons"
|
|
379
380
|
:can-update="canUpdate"
|
|
380
381
|
:can-drop="canDrop"
|
|
@@ -415,6 +416,7 @@
|
|
|
415
416
|
:update-button="updateButton"
|
|
416
417
|
:drop-button="dropButton"
|
|
417
418
|
:edit-mode-button="editModeButton"
|
|
419
|
+
:group-button="groupButton"
|
|
418
420
|
:data-changed="dataChanged"
|
|
419
421
|
:http-success-read="httpSuccessRead"
|
|
420
422
|
:can-update="canUpdate"
|