@oniti/quasar-ui-vlank-collection-crud 3.7.45 → 3.7.46

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/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @oniti/quasar-ui-vlank-collection-crud v3.5.11
3
- * (c) 2022 Oniti
2
+ * @oniti/quasar-ui-vlank-collection-crud v3.7.45
3
+ * (c) 2024 Oniti
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
@@ -77,7 +77,8 @@
77
77
  }, props.props.modalDeleteOptions.dialog, {
78
78
  "transition-show": __props.isMobile ? 'slide-up' : 'fade',
79
79
  "transition-hide": __props.isMobile ? 'slide-down' : 'fade',
80
- position: __props.isMobile ? 'bottom' : 'standard',
80
+ "transition-duration": "150",
81
+ position: "standard",
81
82
  "full-width": __props.isMobile
82
83
  }), {
83
84
  default: vue.withCtx(function () { return [
@@ -153,7 +154,7 @@
153
154
  }, 16 /* FULL_PROPS */)
154
155
  ]; }),
155
156
  _: 3 /* FORWARDED */
156
- }, 16 /* FULL_PROPS */, ["modelValue", "transition-show", "transition-hide", "position", "full-width"]))
157
+ }, 16 /* FULL_PROPS */, ["modelValue", "transition-show", "transition-hide", "full-width"]))
157
158
  }
158
159
  }
159
160
 
@@ -165,7 +166,6 @@
165
166
  var _hoisted_2$3 = /*#__PURE__*/vue.createTextVNode("Modification");
166
167
 
167
168
 
168
-
169
169
  var script$4 = {
170
170
  __name: 'VlankEditModal',
171
171
  props: {
@@ -174,14 +174,15 @@
174
174
  modalEditOptions: Object,
175
175
  collection: String,
176
176
  extraRequestParams: Object,
177
+ useSendFiles: Boolean,
177
178
  storeKey: String,
178
179
  isMobile: Boolean,
179
180
  closeModalAfterValidation: Boolean,
180
181
  propsLibelleTitle: String,
181
182
  },
182
183
  emits: ['close'],
183
- setup: function setup(__props, ref) {
184
- var $emit = ref.emit;
184
+ setup: function setup(__props, ref$1) {
185
+ var $emit = ref$1.emit;
185
186
 
186
187
 
187
188
  var props = __props;
@@ -212,28 +213,70 @@
212
213
 
213
214
  function onConfirmeEditAdd() {
214
215
  var action = props.localDetail.uuid ? "update" : "create";
216
+ var message_notification = props.localDetail.uuid
217
+ ? "Modification effectuée"
218
+ : "Création effectuée";
215
219
  var extraParams =
216
220
  action === "update"
217
221
  ? Object.assign({}, props.extraRequestParams.update)
218
222
  : Object.assign({}, props.extraRequestParams.store);
219
- $collectionCrud
220
- .collectionAction({
221
- collectionName: props.collection,
222
- action: action,
223
- params: Object.assign({}, props.localDetail, extraParams),
224
- list_field: props.storeKey
225
- })
226
- .then(function (obj) {
227
- if (props.closeModalAfterValidation) {
228
- close(obj, action);
229
- }
230
- });
223
+
224
+ if (props.useSendFiles) {
225
+ $collectionCrud
226
+ .collectionAction({
227
+ collectionName: props.collection,
228
+ action: "send-file",
229
+ params: Object.assign({}, props.localDetail, extraParams),
230
+ list_field: props.storeKey,
231
+ axios_options: {
232
+ oniti_success_notification_message: message_notification,
233
+ },
234
+ })
235
+ .then(function (obj) {
236
+ if (props.closeModalAfterValidation) {
237
+ close(obj, action);
238
+ }
239
+ });
240
+ } else {
241
+ $collectionCrud
242
+ .collectionAction({
243
+ collectionName: props.collection,
244
+ action: action,
245
+ params: Object.assign({}, props.localDetail, extraParams),
246
+ list_field: props.storeKey
247
+ })
248
+ .then(function (obj) {
249
+ if (props.closeModalAfterValidation) {
250
+ close(obj, action);
251
+ }
252
+ });
253
+ }
231
254
  }
232
255
 
233
256
  function close(obj, action) {
234
257
  $emit("close", { obj: obj, action: action });
235
258
  }
236
259
 
260
+ var modalContent = vue.ref(null);
261
+ var modalContentDetail = vue.ref(null);
262
+
263
+ var observer = new ResizeObserver(function (entries) {
264
+ entries.forEach(function (entry) {
265
+ scrollAreaStyle.value.height = props.isMobile ? '100vh' : entry.contentRect.height < 800 ? entry.contentRect.height + 'px' : '80vh';
266
+ });
267
+ });
268
+
269
+ var scrollAreaStyle = vue.ref({
270
+ height: props.isMobile ? '100vh' : modalContent.value ? modalContent.value.clientHeight < 800 ? modalContent.value.clientHeight + 'px' : '80vh' : '80vh'
271
+ });
272
+
273
+ vue.watch(modalContent, function (value) {
274
+ scrollAreaStyle.value.height = props.isMobile ? '100vh' : value ? value.clientHeight < 800 ? value.clientHeight + 'px' : '80vh' : '80vh';
275
+ if(modalContent.value){
276
+ observer.observe(modalContent.value);
277
+ }
278
+ }, { immediate: true, deep: true });
279
+
237
280
  return function (_ctx, _cache) {
238
281
  var _directive_close_popup = vue.resolveDirective("close-popup");
239
282
 
@@ -333,13 +376,24 @@
333
376
  ]; }),
334
377
  _: 3 /* FORWARDED */
335
378
  }, 16 /* FULL_PROPS */, ["class"]),
336
- vue.createElementVNode("div", {
337
- class: vue.normalizeClass({'mobile-content': __props.isMobile })
338
- }, [
339
- vue.renderSlot(_ctx.$slots, "create-edit-modal-content", {
340
- data: props.localDetail
341
- })
342
- ], 2 /* CLASS */),
379
+ vue.createVNode(vue.unref(quasar.QScrollArea), {
380
+ style: vue.normalizeStyle(scrollAreaStyle.value)
381
+ }, {
382
+ default: vue.withCtx(function () { return [
383
+ vue.createElementVNode("div", {
384
+ class: vue.normalizeClass({'mobile-content': __props.isMobile }),
385
+ ref_key: "modalContent",
386
+ ref: modalContent
387
+ }, [
388
+ vue.renderSlot(_ctx.$slots, "create-edit-modal-content", {
389
+ data: props.localDetail,
390
+ ref_key: "modalContentDetail",
391
+ ref: modalContentDetail
392
+ })
393
+ ], 2 /* CLASS */)
394
+ ]; }),
395
+ _: 3 /* FORWARDED */
396
+ }, 8 /* PROPS */, ["style"]),
343
397
  (!__props.isMobile)
344
398
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QCardActions), {
345
399
  key: 0,
@@ -422,9 +476,11 @@
422
476
  props: {
423
477
  data: Object,
424
478
  colOptions: Object,
425
- props: Object
479
+ props: Object,
480
+ rowIndex: Number,
481
+ cellIndex: Number,
426
482
  },
427
- emits: ['update'],
483
+ emits: ['update', 'onEditCellHandler', 'onClickTabHandler'],
428
484
  setup: function setup(__props, ref$1) {
429
485
  var $emit = ref$1.emit;
430
486
 
@@ -440,9 +496,7 @@
440
496
 
441
497
  var getRawValue = vue.computed({
442
498
  get: function () {
443
- if (props.colOptions.format)
444
- { return props.colOptions.format(localDetail.value[props.colOptions.name]); }
445
- else { return localDetail.value[props.colOptions.name]; }
499
+ return localDetail.value[props.colOptions.name];
446
500
  },
447
501
  set: function (newValue) {
448
502
  localDetail.value[props.colOptions.name] = newValue;
@@ -475,13 +529,22 @@
475
529
  list_field: props.props.storeKey
476
530
  })
477
531
  .then(function (obj) {
478
- $emit("update", { obj: obj, action: "update" });
532
+ $emit("update", { obj: obj, action: "update", callback: function () {
533
+ $emit("onClickTabHandler", props.rowIndex, props.cellIndex);
534
+ }});
479
535
  });
480
536
  }
481
537
 
482
- return function (_ctx, _cache) {
483
- var _component_q_input = vue.resolveComponent("q-input");
538
+ function onEditCellHandler(field, value) {
539
+ $emit("onEditCellHandler", field, value);
540
+ }
541
+
542
+ function onClickTabHandler(event) {
543
+ var newValue = event.target.value;
544
+ $emit("onClickTabHandler", props.rowIndex, props.cellIndex, newValue != localValue.value);
545
+ }
484
546
 
547
+ return function (_ctx, _cache) {
485
548
  return (vue.openBlock(), vue.createElementBlock("td", null, [
486
549
  (localDetail.value[props.colOptions.name] && props.colOptions.type === 'boolean')
487
550
  ? vue.renderSlot(_ctx.$slots, getScopedSlotName('boolean-check', props.colOptions.name), { key: 0 }, function () { return [
@@ -499,18 +562,21 @@
499
562
  modelValue: localValue.value,
500
563
  "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((localValue).value = $event); }),
501
564
  "auto-save": "",
502
- onSave: onSave
565
+ onSave: onSave,
566
+ onKeydown: vue.withKeys(vue.withModifiers(onClickTabHandler, ["prevent","stop"]), ["tab"])
503
567
  }, {
504
568
  default: vue.withCtx(function (scope) { return [
505
- vue.createVNode(_component_q_input, {
569
+ vue.createVNode(vue.unref(quasar.QInput), vue.mergeProps(props.colOptions.inputOptions, {
570
+ autofocus: "",
571
+ "emit-value": "",
506
572
  modelValue: scope.value,
507
- "onUpdate:modelValue": function ($event) { return ((scope.value) = $event); },
573
+ "onUpdate:modelValue": [function ($event) { return ((scope.value) = $event); }, function ($event) { return (onEditCellHandler(props.colOptions.field, scope.value)); }],
508
574
  label: props.colOptions.label,
509
575
  onKeyup: vue.withKeys(scope.set, ["enter"])
510
- }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue", "label", "onKeyup"])
576
+ }), null, 16 /* FULL_PROPS */, ["modelValue", "onUpdate:modelValue", "label", "onKeyup"])
511
577
  ]; }),
512
578
  _: 1 /* STABLE */
513
- }, 8 /* PROPS */, ["modelValue"])
579
+ }, 8 /* PROPS */, ["modelValue", "onKeydown"])
514
580
  ]))
515
581
  }
516
582
  }
@@ -554,6 +620,7 @@
554
620
  table: {
555
621
  title: "Titre Non défini",
556
622
  },
623
+ useSendFiles: false,
557
624
  extraRequestParams: {
558
625
  index: {},
559
626
  show: {},
@@ -580,10 +647,12 @@
580
647
  props.modalEditOptions);
581
648
  props.modalEditOptions.showBtn = Object.assign({}, defaultOptions.modalEditOptions.showBtn,
582
649
  props.modalEditOptions.showBtn);
650
+ var extraRequestParamsTemp = {};
583
651
  Object.keys(defaultOptions.extraRequestParams).forEach(function (key) {
584
- props.extraRequestParams[key] = Object.assign({}, defaultOptions.extraRequestParams[key],
652
+ extraRequestParamsTemp[key] = Object.assign({}, defaultOptions.extraRequestParams[key],
585
653
  props.extraRequestParams[key]);
586
654
  });
655
+ props.extraRequestParams = extraRequestParamsTemp;
587
656
  return props;
588
657
  });
589
658
 
@@ -689,7 +758,9 @@
689
758
  align: "left",
690
759
  sortable: true,
691
760
  type: "string",
761
+ classes: props.value.getRowCellClass,
692
762
  };
763
+
693
764
  // Option de la table par défaut
694
765
  var defautOptionsTable = {
695
766
  loading: $collectionCrud.getFromCollection(
@@ -701,7 +772,8 @@
701
772
  "row-key": function (row) { return config.columns
702
773
  .filter(function (c) { return c.name !== undefined || c.field !== undefined; })
703
774
  .map(function (c) { return row[c.name ? c.name : c.field]; })
704
- .join(); },
775
+ .join() +
776
+ row[$collectionCrud.getRouteParameterName(props.value.collection)]; },
705
777
  "rows-per-page-options": [20, 50, 100],
706
778
  };
707
779
 
@@ -797,7 +869,7 @@
797
869
  /**
798
870
  * Renvoie le nom de la route pour les liens de type A pour les édition en page
799
871
  */
800
- var collectionCreateNamedRoute = vue.computed(function () {
872
+ var collectionCreateNamedRoute = vue.computed(function () {
801
873
  return props.value.collection + "-store";
802
874
  });
803
875
 
@@ -810,6 +882,10 @@
810
882
  return typeof options.to === "function";
811
883
  }
812
884
 
885
+ function getAdditionalClassActionBtns(row) {
886
+ return props.value.getRowCellClass ? ' '+props.value.getRowCellClass(row) : "";
887
+ }
888
+
813
889
  return {
814
890
  customFields: customFields,
815
891
  table: table,
@@ -818,6 +894,7 @@
818
894
  collectionEditNamedRoute: collectionEditNamedRoute,
819
895
  collectionCreateNamedRoute: collectionCreateNamedRoute,
820
896
  isTdClickable: isTdClickable,
897
+ getAdditionalClassActionBtns: getAdditionalClassActionBtns,
821
898
  };
822
899
  }
823
900
 
@@ -1088,6 +1165,7 @@
1088
1165
  var rowsPerPage = ref.rowsPerPage;
1089
1166
  var sortBy = ref.sortBy;
1090
1167
  var descending = ref.descending;
1168
+
1091
1169
  var filter = options.filter;
1092
1170
  asyncProps.value = options;
1093
1171
 
@@ -1180,6 +1258,7 @@
1180
1258
  stringlifyAndCheck(newValue.index, extraRequestParamsIndexStringlify)
1181
1259
  ) {
1182
1260
  getList(true);
1261
+ extraRequestParamsIndexStringlify.value = JSON.stringify(newValue.index);
1183
1262
  }
1184
1263
  }
1185
1264
  });
@@ -1206,11 +1285,26 @@
1206
1285
  }
1207
1286
  }
1208
1287
 
1288
+ function useSelection(props)
1289
+ {
1290
+ var selectedData = vue.ref([]);
1291
+ var selectionMode = vue.ref(props.value.table.selection ? props.value.table.selection : 'none');
1292
+
1293
+ vue.watch(selectedData,function(){
1294
+ props.value.table.selected = selectedData.value;
1295
+ });
1296
+
1297
+ return {
1298
+ selectedData: selectedData,
1299
+ selectionMode: selectionMode,
1300
+ }
1301
+ }
1302
+
1209
1303
  var _hoisted_1$2 = { class: "col" };
1210
1304
  var _hoisted_2$2 = { key: 1 };
1211
1305
  var _hoisted_3$2 = { key: 2 };
1212
1306
  var _hoisted_4$2 = ["props", "onClick"];
1213
- var _hoisted_5$2 = ["props", "onClick"];
1307
+ var _hoisted_5$1 = ["props", "onClick"];
1214
1308
  var _hoisted_6 = { class: "top-right-content" };
1215
1309
  var _hoisted_7 = { id: "search-slot" };
1216
1310
  var _hoisted_8 = { id: "top-right-under-add" };
@@ -1227,6 +1321,10 @@
1227
1321
  showBtnEdit: Boolean,
1228
1322
  showSlideLeft: Boolean,
1229
1323
  showBtnCreate: Boolean,
1324
+ showBtnCreateTooltip:{
1325
+ type: Boolean,
1326
+ default: false
1327
+ },
1230
1328
  storeKey: {
1231
1329
  type: String,
1232
1330
  default: 'list'
@@ -1261,6 +1359,7 @@
1261
1359
  type: Object,
1262
1360
  default: vue.ref({})
1263
1361
  },
1362
+ useSendFiles: Boolean,
1264
1363
  modalDeleteOptions: Object,
1265
1364
  modalEditOptions: Object,
1266
1365
  persistTableOptions: Object,
@@ -1274,12 +1373,18 @@
1274
1373
  type: Boolean,
1275
1374
  default: true
1276
1375
  },
1376
+ getRowCellClass: {
1377
+ type: Function,
1378
+ default: null
1379
+ },
1277
1380
  },
1278
1381
  emits: [
1279
1382
  "detailChange",
1280
1383
  "modalOpenCreateUpdate",
1281
1384
  "actionsCallback",
1282
- "actionsSlideLeft" ],
1385
+ "actionsSlideLeft",
1386
+ "onEditCellHandler"
1387
+ ],
1283
1388
  setup: function setup(__props, ref$1) {
1284
1389
  var $emit = ref$1.emit;
1285
1390
 
@@ -1302,8 +1407,8 @@
1302
1407
  });
1303
1408
 
1304
1409
  var isMobile = vue.computed(function () {
1305
- if ($q.config.collectionCrudOptions && $q.screen.lt[$q.config.collectionCrudOptions.maximalMobileScreenSize]) {
1306
- return $q.screen.lt[$q.config.collectionCrudOptions.maximalMobileScreenSize]
1410
+ if ($q.config.collectionCrudOptions && $q.config.collectionCrudOptions.maximalMobileScreenSize) {
1411
+ return !!$q.screen.lt[$q.config.collectionCrudOptions.maximalMobileScreenSize]
1307
1412
  } else {
1308
1413
  return $q.screen.lt.md
1309
1414
  }
@@ -1340,6 +1445,7 @@
1340
1445
  var collectionEditNamedRoute = ref$4.collectionEditNamedRoute;
1341
1446
  var collectionCreateNamedRoute = ref$4.collectionCreateNamedRoute;
1342
1447
  var isTdClickable = ref$4.isTdClickable;
1448
+ var getAdditionalClassActionBtns = ref$4.getAdditionalClassActionBtns;
1343
1449
 
1344
1450
  var ref$5 = usePagination(props);
1345
1451
  var pagination = ref$5.pagination;
@@ -1371,6 +1477,10 @@
1371
1477
  var onCloseEditModal = ref$7.onCloseEditModal;
1372
1478
  var onCloseDeleteModal = ref$7.onCloseDeleteModal;
1373
1479
 
1480
+ var ref$8 = useSelection(props);
1481
+ var selectedData = ref$8.selectedData;
1482
+ var selectionMode = ref$8.selectionMode;
1483
+
1374
1484
 
1375
1485
  useWatchs($attrs, getList, pagination, ccrudTable);
1376
1486
 
@@ -1392,7 +1502,7 @@
1392
1502
  clearTimeout(timer);
1393
1503
  });
1394
1504
  function onClickRow(row) {
1395
- onClickEdit(row);
1505
+ onClickEdit(row);
1396
1506
  }
1397
1507
  function onSlideLeft(details, row) {
1398
1508
  $emit("actionsSlideLeft", details, row);
@@ -1422,8 +1532,54 @@
1422
1532
  document.getElementsByClassName(slideItemClass)[index].style.visibility = 'hidden';
1423
1533
  }
1424
1534
  }
1425
- //
1426
1535
 
1536
+ function onEditCellHandler(field, value) {
1537
+ $emit("onEditCellHandler", field, value);
1538
+ }
1539
+
1540
+ // Gestion de la tabulation dans le tableau
1541
+ var popupCells = vue.ref([]);
1542
+
1543
+ var delayNextTabOption = vue.ref(null);
1544
+ vue.watch(rows, function (newValue, oldValue) {
1545
+ if (delayNextTabOption.value) {
1546
+ setTimeout(function () {
1547
+ if (delayNextTabOption.value) {
1548
+ onClickTabHandler(delayNextTabOption.value.rowIndex, delayNextTabOption.value.cellIndex, false, false);
1549
+ }
1550
+ }, 400);
1551
+ }
1552
+ }, { deep: true });
1553
+
1554
+ function onClickTabHandler(rowIndex, cellIndex, updated, openPrevious) {
1555
+ if ( updated === void 0 ) updated = false;
1556
+ if ( openPrevious === void 0 ) openPrevious = true;
1557
+
1558
+ if (openPrevious) {
1559
+ popupCells.value[rowIndex + '_' + cellIndex].$el.click();
1560
+ }
1561
+ if (updated) {
1562
+ delayNextTabOption.value = {
1563
+ rowIndex: rowIndex,
1564
+ cellIndex: cellIndex
1565
+ };
1566
+ } else {
1567
+ delayNextTabOption.value = null;
1568
+ popupCells.value[getNextCellIndex(rowIndex, cellIndex)].$el.click();
1569
+ }
1570
+ }
1571
+ function getRowIndex(row) {
1572
+ return rows.value.indexOf(row);
1573
+ }function getNextCellIndex(rowIndex, cellIndex) {
1574
+ if (getEditablesTd.value.length > parseInt(cellIndex) + 1) {
1575
+ return rowIndex + '_' + (parseInt(cellIndex) + 1)
1576
+ } else {
1577
+ return (parseInt(rowIndex) + 1) + '_' + 0
1578
+ }
1579
+ }
1580
+ function onClearSearchHandler() {
1581
+ filter.value = "";
1582
+ }
1427
1583
 
1428
1584
  return function (_ctx, _cache) {
1429
1585
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
@@ -1433,10 +1589,13 @@
1433
1589
  }, vue.unref(table), {
1434
1590
  filter: filter.value,
1435
1591
  onRequest: vue.unref(asyncRequest),
1592
+ ref_key: "ccrudTable",
1593
+ ref: ccrudTable,
1436
1594
  pagination: vue.unref(pagination),
1437
1595
  "onUpdate:pagination": _cache[1] || (_cache[1] = function ($event) { return (vue.isRef(pagination) ? (pagination).value = $event : null); }),
1438
- ref_key: "ccrudTable",
1439
- ref: ccrudTable
1596
+ selection: vue.unref(selectionMode),
1597
+ selected: vue.unref(selectedData),
1598
+ "onUpdate:selected": _cache[2] || (_cache[2] = function ($event) { return (vue.isRef(selectedData) ? (selectedData).value = $event : null); })
1440
1599
  }), vue.createSlots({
1441
1600
  "top-left": vue.withCtx(function () { return [
1442
1601
  vue.createElementVNode("div", null, [
@@ -1454,16 +1613,27 @@
1454
1613
  modelValue: filter.value,
1455
1614
  "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((filter).value = $event); }),
1456
1615
  placeholder: "Recherche",
1457
- filled: "",
1458
- "bg-color": "grey-2",
1459
- square: "",
1616
+ outlined: "",
1617
+ rounded: vue.unref(isMobile),
1460
1618
  style: {"width":"180px"}
1461
1619
  }, {
1462
1620
  append: vue.withCtx(function () { return [
1463
- vue.createVNode(vue.unref(quasar.QIcon), { name: "search" })
1621
+ (filter.value)
1622
+ ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
1623
+ key: 0,
1624
+ dense: "",
1625
+ flat: "",
1626
+ round: "",
1627
+ icon: "mdi-close",
1628
+ onClick: onClearSearchHandler
1629
+ }))
1630
+ : (vue.openBlock(), vue.createBlock(vue.unref(quasar.QIcon), {
1631
+ key: 1,
1632
+ name: "search"
1633
+ }))
1464
1634
  ]; }),
1465
1635
  _: 1 /* STABLE */
1466
- }, 8 /* PROPS */, ["modelValue"]))
1636
+ }, 8 /* PROPS */, ["modelValue", "rounded"]))
1467
1637
  : vue.createCommentVNode("v-if", true),
1468
1638
  (vue.unref(showBtnCreatePage))
1469
1639
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
@@ -1475,7 +1645,12 @@
1475
1645
  color: "primary",
1476
1646
  style: {"margin-left":"1em"},
1477
1647
  square: ""
1478
- }, null, 8 /* PROPS */, ["to", "label"]))
1648
+ }, {
1649
+ default: vue.withCtx(function () { return [
1650
+ vue.renderSlot(_ctx.$slots, "create-btn-tooltip")
1651
+ ]; }),
1652
+ _: 3 /* FORWARDED */
1653
+ }, 8 /* PROPS */, ["to", "label"]))
1479
1654
  : (vue.unref(showBtnCreate))
1480
1655
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
1481
1656
  key: 2,
@@ -1485,7 +1660,12 @@
1485
1660
  style: {"margin-left":"1em"},
1486
1661
  onClick: vue.unref(onClickAdd),
1487
1662
  square: ""
1488
- }, null, 8 /* PROPS */, ["label", "onClick"]))
1663
+ }, {
1664
+ default: vue.withCtx(function () { return [
1665
+ vue.renderSlot(_ctx.$slots, "create-btn-tooltip")
1666
+ ]; }),
1667
+ _: 3 /* FORWARDED */
1668
+ }, 8 /* PROPS */, ["label", "onClick"]))
1489
1669
  : vue.createCommentVNode("v-if", true),
1490
1670
  vue.renderSlot(_ctx.$slots, "top-right-after-add")
1491
1671
  ]),
@@ -1500,7 +1680,7 @@
1500
1680
  return [
1501
1681
  vue.createElementVNode("td", {
1502
1682
  props: props,
1503
- class: "action-buttons"
1683
+ class: vue.normalizeClass('action-buttons' + vue.unref(getAdditionalClassActionBtns)(props.row))
1504
1684
  }, [
1505
1685
  vue.renderSlot(_ctx.$slots, "row-action-before-controllers", {
1506
1686
  key: 0,
@@ -1520,24 +1700,18 @@
1520
1700
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
1521
1701
  key: 2,
1522
1702
  type: "a",
1523
- to: {
1524
- name: vue.unref(collectionEditNamedRoute),
1525
- params: ( obj = {}, obj[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj ),
1526
- },
1703
+ to: { name: vue.unref(collectionEditNamedRoute), params: ( obj = {}, obj[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj ) },
1527
1704
  color: "primary",
1528
1705
  icon: "edit",
1529
1706
  flat: "",
1530
1707
  round: vue.unref(isMobile)
1531
1708
  }, null, 8 /* PROPS */, ["to", "round"]))
1532
1709
  : vue.createCommentVNode("v-if", true),
1533
- (!__props.editablePage && __props.displayActionCallback(props.row, 'show'))
1710
+ (!__props.editablePage && vue.unref(showBtnEditPage) && __props.displayActionCallback(props.row, 'show'))
1534
1711
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
1535
1712
  key: 3,
1536
1713
  type: "a",
1537
- to: {
1538
- name: vue.unref(collectionEditNamedRoute),
1539
- params: ( obj$1 = {}, obj$1[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj$1 ),
1540
- },
1714
+ to: { name: vue.unref(collectionEditNamedRoute), params: ( obj$1 = {}, obj$1[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj$1 ) },
1541
1715
  color: "primary",
1542
1716
  icon: "mdi-magnify-plus-outline",
1543
1717
  flat: ""
@@ -1556,7 +1730,7 @@
1556
1730
  vue.renderSlot(_ctx.$slots, "row-action-after-controllers", {
1557
1731
  data: props.row
1558
1732
  })
1559
- ], 8 /* PROPS */, _hoisted_9)
1733
+ ], 10 /* CLASS, PROPS */, _hoisted_9)
1560
1734
  ];
1561
1735
  }),
1562
1736
  _: 2 /* DYNAMIC */
@@ -1584,13 +1758,13 @@
1584
1758
  default: vue.withCtx(function () { return [
1585
1759
  vue.createVNode(vue.unref(quasar.QItem), {
1586
1760
  style: {"align-items":"center"},
1587
- class: "mobile-item"
1761
+ class: vue.normalizeClass('mobile-item' + vue.unref(getAdditionalClassActionBtns)(props.row))
1588
1762
  }, {
1589
1763
  default: vue.withCtx(function () { return [
1590
1764
  vue.createCommentVNode(" On affiche la première colonne seulement et on garde celle des actions "),
1591
1765
  vue.createVNode(vue.unref(quasar.QItemSection), {
1592
1766
  class: "mobile-item-content",
1593
- onClick: function ($event) { return (vue.unref(showBtnEdit) ? onClickRow(props.row):''); }
1767
+ onClick: function ($event) { return (vue.unref(showBtnEdit) ? onClickRow(props.row) : ''); }
1594
1768
  }, {
1595
1769
  default: vue.withCtx(function () { return [
1596
1770
  (vue.unref($slots)['body-cell-mobile'])
@@ -1606,7 +1780,7 @@
1606
1780
  _: 2 /* DYNAMIC */
1607
1781
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]),
1608
1782
  vue.createVNode(vue.unref(quasar.QItemSection), {
1609
- style: {"display":"flex","flex-direction":"row"},
1783
+ style: {"display":"flex","flex-direction":"row","align-items":"center"},
1610
1784
  side: ""
1611
1785
  }, {
1612
1786
  default: vue.withCtx(function () { return [
@@ -1620,7 +1794,7 @@
1620
1794
  }, 1024 /* DYNAMIC_SLOTS */)
1621
1795
  ]; }),
1622
1796
  _: 2 /* DYNAMIC */
1623
- }, 1024 /* DYNAMIC_SLOTS */)
1797
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class"])
1624
1798
  ]; }),
1625
1799
  _: 2 /* DYNAMIC */
1626
1800
  }, [
@@ -1656,7 +1830,7 @@
1656
1830
  ? (vue.openBlock(), vue.createElementBlock("td", {
1657
1831
  props: props,
1658
1832
  key: options.slotName,
1659
- class: vue.normalizeClass(vue.unref(isTdClickable)(options) ? 'cursor-pointer' : ''),
1833
+ class: vue.normalizeClass((vue.unref(isTdClickable)(options) ? 'cursor-pointer' : '') + vue.unref(getAdditionalClassActionBtns)(props.row)),
1660
1834
  onClick: function ($event) { return (vue.unref(isTdClickable)(options) ? options.to(props.row) : null); }
1661
1835
  }, [
1662
1836
  (props.row[options.field])
@@ -1678,11 +1852,11 @@
1678
1852
  : (vue.openBlock(), vue.createElementBlock("td", {
1679
1853
  props: props,
1680
1854
  key: options.slotName + '-else',
1681
- class: "cursor-pointer",
1855
+ class: vue.normalizeClass('cursor-pointer' + vue.unref(getAdditionalClassActionBtns)(props.row)),
1682
1856
  onClick: function ($event) { return (options.to(props.row)); }
1683
1857
  }, vue.toDisplayString(options.format
1684
- ? options.format(props.row)
1685
- : props.row[options.field]), 9 /* TEXT, PROPS */, _hoisted_5$2))
1858
+ ? options.format(props.row)
1859
+ : props.row[options.field]), 11 /* TEXT, CLASS, PROPS */, _hoisted_5$1))
1686
1860
  ]; })
1687
1861
  }
1688
1862
  }),
@@ -1694,17 +1868,22 @@
1694
1868
  ]; })
1695
1869
  }
1696
1870
  }),
1697
- vue.renderList(vue.unref(getEditablesTd), function (config) {
1871
+ vue.renderList(vue.unref(getEditablesTd), function (config, index) {
1698
1872
  return {
1699
1873
  name: config.slotName,
1700
1874
  fn: vue.withCtx(function (slotProps) { return [
1701
1875
  (vue.unref(editOnTable))
1702
1876
  ? (vue.openBlock(), vue.createBlock(script$3, {
1877
+ ref: function (el) { popupCells.value[getRowIndex(slotProps.row) + '_' + index] = el; },
1703
1878
  key: config.slotName,
1879
+ rowIndex: getRowIndex(slotProps.row),
1880
+ cellIndex: index,
1704
1881
  data: slotProps.row,
1705
1882
  props: vue.unref(props),
1706
1883
  colOptions: config.options,
1707
- onUpdate: vue.unref(onUpdateTd)
1884
+ onUpdate: vue.unref(onUpdateTd),
1885
+ onOnEditCellHandler: onEditCellHandler,
1886
+ onOnClickTabHandler: onClickTabHandler
1708
1887
  }, vue.createSlots({ _: 2 /* DYNAMIC */ }, [
1709
1888
  vue.renderList(vue.unref($slots), function (_, slot) {
1710
1889
  return {
@@ -1714,12 +1893,12 @@
1714
1893
  ]; })
1715
1894
  }
1716
1895
  })
1717
- ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["data", "props", "colOptions", "onUpdate"]))
1896
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["rowIndex", "cellIndex", "data", "props", "colOptions", "onUpdate"]))
1718
1897
  : vue.createCommentVNode("v-if", true)
1719
1898
  ]; })
1720
1899
  }
1721
1900
  })
1722
- ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["rows", "filter", "onRequest", "pagination"]),
1901
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["rows", "filter", "onRequest", "pagination", "selection", "selected"]),
1723
1902
  vue.createCommentVNode(" Modal de Confirmation Suppression "),
1724
1903
  vue.createVNode(script$5, {
1725
1904
  localDetail: localDetail.value,
@@ -1755,7 +1934,7 @@
1755
1934
  name: slot,
1756
1935
  fn: vue.withCtx(function (scope) { return [
1757
1936
  (vue.openBlock(), vue.createElementBlock("div", {
1758
- class: vue.normalizeClass(vue.unref(isMobile) ? 'mobile-content modal-content':'modal-content'),
1937
+ class: vue.normalizeClass(vue.unref(isMobile) ? 'mobile-content modal-content' : 'modal-content'),
1759
1938
  key: slot
1760
1939
  }, [
1761
1940
  vue.renderSlot(_ctx.$slots, slot, vue.normalizeProps(vue.guardReactiveProps(scope)))
@@ -1770,23 +1949,35 @@
1770
1949
 
1771
1950
  };
1772
1951
 
1773
- var css_248z$2 = "\n.action-buttons[data-v-60881ef8] {\n text-align: end;\n}\n.modal-content[data-v-60881ef8] {\n padding: 15px;\n}\n.q-table-control[data-v-60881ef8] {\n flex: 0 1 55%;\n}\n#search-slot[data-v-60881ef8] {\n display: flex;\n}\n#top-right-under-add[data-v-60881ef8] {\n margin-top: 20px;\n display: flex;\n flex-direction: column;\n}\n.mobile-item[data-v-60881ef8] {\n min-height: 8.5vh;\n border-bottom: solid 1px lightgrey;\n}\n.mobile-item-content>span[data-v-60881ef8] {\n word-break: break-all;\n}\n.body-cell-mobile[data-v-60881ef8] {\n word-break: break-all;\n}\n";
1952
+ var css_248z$2 = "\n.action-buttons[data-v-60881ef8] {\n text-align: end;\n}\n.modal-content[data-v-60881ef8] {\n padding: 15px;\n}\n.q-table-control[data-v-60881ef8] {\n flex: 0 1 55%;\n}\n#search-slot[data-v-60881ef8] {\n display: flex;\n align-items: center;\n}\n#top-right-under-add[data-v-60881ef8] {\n margin-top: 20px;\n display: flex;\n flex-direction: column;\n}\n.mobile-item[data-v-60881ef8] {\n min-height: 8.5vh;\n border-bottom: solid 1px lightgrey;\n}\n.mobile-item-content>span[data-v-60881ef8] {\n word-break: break-all;\n}\n.body-cell-mobile[data-v-60881ef8] {\n word-break: break-all;\n}\n";
1774
1953
  styleInject(css_248z$2);
1775
1954
 
1776
1955
  script$2.__scopeId = "data-v-60881ef8";
1777
1956
  script$2.__file = "src/components/VlankCollectionCrud.vue";
1778
1957
 
1779
- var _hoisted_1$1 = {
1780
- key: 0,
1781
- class: "edit-page-header"
1782
- };
1783
- var _hoisted_2$1 = { style: {"display":"flex","align-items":"center"} };
1784
- var _hoisted_3$1 = { key: 0 };
1785
- var _hoisted_4$1 = {
1958
+ function onClickBack(route, router) {
1959
+ if(!route || !route.meta) {
1960
+ router.go(-1);
1961
+ return;
1962
+ }
1963
+ var localStorageRoute = localStorage.getItem(route.meta.goBackRoute);
1964
+ if (localStorageRoute) {
1965
+ router.push(localStorageRoute);
1966
+ localStorage.removeItem(route.meta.goBackRoute);
1967
+ } else if (route.meta.mainParentRoutePath) {
1968
+ router.push(route.meta.mainParentRoutePath);
1969
+ } else {
1970
+ router.go(-1);
1971
+ }
1972
+ }
1973
+
1974
+ var _hoisted_1$1 = { style: {"display":"flex","align-items":"center"} };
1975
+ var _hoisted_2$1 = { key: 0 };
1976
+ var _hoisted_3$1 = {
1786
1977
  key: 1,
1787
1978
  class: "edit-page-body"
1788
1979
  };
1789
- var _hoisted_5$1 = {
1980
+ var _hoisted_4$1 = {
1790
1981
  key: 2,
1791
1982
  class: "edit-page-body"
1792
1983
  };
@@ -1800,12 +1991,17 @@
1800
1991
  var $emit = ref$1.emit;
1801
1992
 
1802
1993
 
1803
- var router = vueRouter.useRouter();
1804
1994
  var route = vueRouter.useRoute();
1995
+ var router = vueRouter.useRouter();
1805
1996
  var store = vuex.useStore();
1806
1997
  var collectionCrud = vue.inject('vlank-ccrud');
1807
1998
 
1808
1999
 
2000
+ function onClickBackTemplate(){
2001
+ onClickBack(route, router);
2002
+ }
2003
+
2004
+
1809
2005
 
1810
2006
  var localDetail = vue.ref(null);
1811
2007
  var containerMode = vue.ref(route.meta.containerMode);
@@ -1833,13 +2029,6 @@
1833
2029
  : { label: "Valider", icon: "mdi-check" };
1834
2030
  });
1835
2031
 
1836
- var onClickBack = function () {
1837
- if (route.meta.mainParentRoutePath) {
1838
- router.push(route.meta.mainParentRoutePath);
1839
- } else {
1840
- router.go(-1);
1841
- }
1842
- };
1843
2032
  var onCustomTitle = function (title) {
1844
2033
  customTitle.value = title;
1845
2034
  };
@@ -1856,20 +2045,48 @@
1856
2045
  var onExtraRequestParams = function (extraRequestParamsValue) {
1857
2046
  if (extraRequestParamsValue) { extraRequestParams.value = extraRequestParamsValue; }
1858
2047
  };
2048
+
2049
+ var submitLoading = vue.ref(false);
1859
2050
  var onClickSubmit = function () {
1860
- collectionCrud
2051
+ submitLoading.value = true;
2052
+ if (route.meta.useSendFiles) {
2053
+ collectionCrud
2054
+ .collectionAction({
2055
+ collectionName: route.meta.collection,
2056
+ action: "send-file",
2057
+ params: Object.assign({}, localDetail.value, extraRequestParams.value),
2058
+ axios_options: {
2059
+ oniti_success_notification_message: 'Modification effectuée'
2060
+ },
2061
+ })
2062
+ .then(function (obj) {
2063
+ submitCallback(obj);
2064
+ }).finally(function () {
2065
+ submitLoading.value = false;
2066
+ });
2067
+ } else {
2068
+ collectionCrud
1861
2069
  .collectionAction({
1862
2070
  collectionName: route.meta.collection,
1863
2071
  action: "update",
1864
2072
  params: Object.assign({}, localDetail.value, extraRequestParams.value),
1865
2073
  })
1866
2074
  .then(function (obj) {
1867
- if (route.meta.goBackAfterValidation) {
1868
- onClickBack();
1869
- }
1870
- localDetail.value = obj;
2075
+ submitCallback(obj);
2076
+ }).finally(function () {
2077
+ submitLoading.value = false;
1871
2078
  });
2079
+ }
1872
2080
  };
2081
+
2082
+ function submitCallback(obj) {
2083
+ if (route.meta.goBackAfterValidation) {
2084
+ onClickBack(route, router);
2085
+ }
2086
+ localDetail.value = JSON.parse(JSON.stringify(obj));
2087
+ previousLocalDetail.value = JSON.parse(JSON.stringify(obj));
2088
+ }
2089
+
1873
2090
  var onSubscribe = function (mutation, state) {
1874
2091
 
1875
2092
  if (
@@ -1881,15 +2098,27 @@
1881
2098
  }
1882
2099
  };
1883
2100
 
1884
- vue.onMounted(function () {
2101
+ var route_parameter_name = collectionCrud.getRouteParameterName(route.meta.collection);
2102
+ var actual_route = route;
2103
+ var actual_collection = vue.ref(route.meta.collection);
2104
+ vue.watch(router.currentRoute,function (new_current_route, old_current_route ) {
2105
+ if(new_current_route.meta.collection){
2106
+ actual_route = new_current_route;
2107
+ route_parameter_name = collectionCrud.getRouteParameterName(new_current_route.meta.collection);
2108
+ propsLibelleTitle.value = new_current_route.meta.propsLibelleTitle;
2109
+ actual_collection.value = new_current_route.meta.collection;
2110
+ fetchDetail();
2111
+ }
2112
+ },{deep:true});
2113
+
2114
+ function fetchDetail(){
1885
2115
  var obj;
1886
2116
 
1887
2117
  if (!containerMode.value) {
1888
- var parameter_route_value = route.params[route_parameter_name];
1889
-
2118
+ var parameter_route_value = actual_route.params[route_parameter_name];
1890
2119
  collectionCrud
1891
2120
  .collectionAction({
1892
- collectionName: route.meta.collection,
2121
+ collectionName: actual_route.meta.collection,
1893
2122
  action: "detail",
1894
2123
  lazy: true,
1895
2124
  params: ( obj = {}, obj[route_parameter_name] = parameter_route_value, obj ),
@@ -1898,7 +2127,24 @@
1898
2127
  localDetail.value = Object.assign({}, obj);
1899
2128
  $emit("collectionCrudUpdateLocalDetail", localDetail.value);
1900
2129
  });
2130
+ }else {
2131
+ localDetail.value = null;
1901
2132
  }
2133
+ }
2134
+
2135
+ var isLocalDetailUpdated = vue.ref(false);
2136
+ var previousLocalDetail = vue.ref(null);
2137
+
2138
+ vue.watch(localDetail, function (newVal) {
2139
+ if (newVal && !previousLocalDetail.value) {
2140
+ previousLocalDetail.value = JSON.parse(JSON.stringify(newVal));
2141
+ } else {
2142
+ isLocalDetailUpdated.value = JSON.stringify(newVal) !== JSON.stringify(previousLocalDetail.value);
2143
+ }
2144
+ }, {deep:true});
2145
+
2146
+ vue.onMounted(function () {
2147
+ fetchDetail();
1902
2148
  unsubscribe = store.subscribe(onSubscribe);
1903
2149
  });
1904
2150
 
@@ -1908,41 +2154,46 @@
1908
2154
  }
1909
2155
  });
1910
2156
 
1911
- var route_parameter_name = collectionCrud.getRouteParameterName(route.meta.collection);
1912
2157
 
1913
2158
  return function (_ctx, _cache) {
1914
2159
  return (vue.openBlock(), vue.createBlock(vue.unref(quasar.QPage), null, {
1915
2160
  default: vue.withCtx(function () { return [
1916
2161
  (!containerMode.value)
1917
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
1918
- vue.createElementVNode("div", _hoisted_2$1, [
2162
+ ? (vue.openBlock(), vue.createElementBlock("div", {
2163
+ class: "edit-page-header",
2164
+ key: actual_collection.value
2165
+ }, [
2166
+ vue.createElementVNode("div", _hoisted_1$1, [
1919
2167
  vue.createVNode(vue.unref(quasar.QBtn), {
1920
- onClick: onClickBack,
2168
+ onClick: onClickBackTemplate,
1921
2169
  color: "primary",
1922
2170
  icon: "arrow_back"
1923
2171
  }),
1924
2172
  vue.createElementVNode("h2", null, vue.toDisplayString(vue.unref(getTitle)), 1 /* TEXT */)
1925
2173
  ]),
1926
2174
  (!containerMode.value && editablePage.value)
1927
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
2175
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
1928
2176
  vue.createVNode(vue.unref(quasar.QBtn), {
1929
- color: "primary",
1930
2177
  icon: vue.unref(getSubmitBtn).icon,
1931
- onClick: onClickSubmit
2178
+ onClick: onClickSubmit,
2179
+ disable: !isLocalDetailUpdated.value,
2180
+ color: isLocalDetailUpdated.value ? 'primary' : 'grey-5',
2181
+ loading: submitLoading.value
1932
2182
  }, {
1933
2183
  default: vue.withCtx(function () { return [
1934
2184
  vue.createTextVNode(vue.toDisplayString(vue.unref(getSubmitBtn).label), 1 /* TEXT */)
1935
2185
  ]; }),
1936
2186
  _: 1 /* STABLE */
1937
- }, 8 /* PROPS */, ["icon"])
2187
+ }, 8 /* PROPS */, ["icon", "disable", "color", "loading"])
1938
2188
  ]))
1939
2189
  : vue.createCommentVNode("v-if", true)
1940
2190
  ]))
1941
2191
  : vue.createCommentVNode("v-if", true),
1942
2192
  (localDetail.value)
1943
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
2193
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
1944
2194
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(Components__default["default"])[vue.unref(formComponent)]), {
1945
2195
  data: localDetail.value,
2196
+ key: localDetail.value[vue.unref(route_parameter_name)],
1946
2197
  onExtraRequestParams: onExtraRequestParams,
1947
2198
  onCustomTitle: onCustomTitle,
1948
2199
  onCustomSubmitBtn: onCustomSubmitBtn,
@@ -1950,7 +2201,7 @@
1950
2201
  onEditablePage: onEditablePage
1951
2202
  }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["data"]))
1952
2203
  ]))
1953
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [
2204
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
1954
2205
  vue.createVNode(vue.unref(quasar.QSpinner), {
1955
2206
  class: "loader",
1956
2207
  color: "accent"
@@ -1994,10 +2245,15 @@
1994
2245
  var $emit = ref$1.emit;
1995
2246
 
1996
2247
 
1997
- var router = vueRouter.useRouter();
1998
2248
  var route = vueRouter.useRoute();
2249
+ var router = vueRouter.useRouter();
1999
2250
  var collectionCrud = vue.inject('vlank-ccrud');
2000
2251
 
2252
+ function onClickBackTemplate(){
2253
+ onClickBack(route, router);
2254
+ }
2255
+
2256
+
2001
2257
 
2002
2258
 
2003
2259
  var localDetail = vue.ref(null);
@@ -2024,14 +2280,6 @@
2024
2280
  : { label: "Valider", icon: "mdi-check" };
2025
2281
  });
2026
2282
 
2027
- var onClickBack = function () {
2028
- if (route.meta.mainParentRoutePath) {
2029
- router.push(route.meta.mainParentRoutePath);
2030
- } else {
2031
- router.go(-1);
2032
- }
2033
- };
2034
-
2035
2283
  var onCustomSubmitBtn = function (button) {
2036
2284
  customSubmitBtn.value.label = button.label;
2037
2285
  customSubmitBtn.value.icon = button.icon;
@@ -2043,8 +2291,27 @@
2043
2291
  var onExtraRequestParams = function (extraRequestParamsValue) {
2044
2292
  if (extraRequestParamsValue) { extraRequestParams.value = extraRequestParamsValue; }
2045
2293
  };
2294
+
2295
+ var submitLoading = vue.ref(false);
2046
2296
  var onClickSubmit = function () {
2047
- collectionCrud
2297
+ submitLoading.value = true;
2298
+ if (route.meta.useSendFiles) {
2299
+ collectionCrud
2300
+ .collectionAction({
2301
+ collectionName: route.meta.collection,
2302
+ action: "send-file",
2303
+ params: Object.assign({}, localDetail.value, extraRequestParams.value),
2304
+ })
2305
+ .then(function (obj) {
2306
+ if (route.meta.goBackAfterValidation) {
2307
+ onClickBack(route, router);
2308
+ }
2309
+ localDetail.value = obj;
2310
+ }).finally(function () {
2311
+ submitLoading.value = false;
2312
+ });
2313
+ } else {
2314
+ collectionCrud
2048
2315
  .collectionAction({
2049
2316
  collectionName: route.meta.collection,
2050
2317
  action: "create",
@@ -2052,10 +2319,14 @@
2052
2319
  })
2053
2320
  .then(function (obj) {
2054
2321
  if (route.meta.goBackAfterValidation) {
2055
- onClickBack();
2322
+ onClickBack(route, router);
2056
2323
  }
2057
2324
  localDetail.value = obj;
2325
+ }).finally(function () {
2326
+ submitLoading.value = false;
2058
2327
  });
2328
+ }
2329
+
2059
2330
  };
2060
2331
  vue.onMounted(function () {
2061
2332
  collectionCrud
@@ -2078,7 +2349,7 @@
2078
2349
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
2079
2350
  vue.createElementVNode("div", _hoisted_2, [
2080
2351
  vue.createVNode(vue.unref(quasar.QBtn), {
2081
- onClick: onClickBack,
2352
+ onClick: onClickBackTemplate,
2082
2353
  color: "primary",
2083
2354
  icon: "arrow_back"
2084
2355
  }),
@@ -2089,13 +2360,14 @@
2089
2360
  vue.createVNode(vue.unref(quasar.QBtn), {
2090
2361
  color: "primary",
2091
2362
  icon: vue.unref(getSubmitBtn).icon,
2092
- onClick: onClickSubmit
2363
+ onClick: onClickSubmit,
2364
+ loading: submitLoading.value
2093
2365
  }, {
2094
2366
  default: vue.withCtx(function () { return [
2095
2367
  vue.createTextVNode(vue.toDisplayString(vue.unref(getSubmitBtn).label), 1 /* TEXT */)
2096
2368
  ]; }),
2097
2369
  _: 1 /* STABLE */
2098
- }, 8 /* PROPS */, ["icon"])
2370
+ }, 8 /* PROPS */, ["icon", "loading"])
2099
2371
  ]))
2100
2372
  : vue.createCommentVNode("v-if", true)
2101
2373
  ]))
@@ -2129,7 +2401,7 @@
2129
2401
  script.__scopeId = "data-v-29e3989a";
2130
2402
  script.__file = "src/components/VlankCreatePage.vue";
2131
2403
 
2132
- var version = '3.5.11';
2404
+ var version = '3.7.45';
2133
2405
 
2134
2406
  function install (app) {
2135
2407
  app.component(script$2.name, script$2);