@oniti/quasar-ui-vlank-collection-crud 3.7.41 → 3.7.42

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.7.41
3
- * (c) 2024 Oniti
2
+ * @oniti/quasar-ui-vlank-collection-crud v3.5.2
3
+ * (c) 2022 Oniti
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
@@ -77,8 +77,7 @@
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
- "transition-duration": "150",
81
- position: "standard",
80
+ position: __props.isMobile ? 'bottom' : 'standard',
82
81
  "full-width": __props.isMobile
83
82
  }), {
84
83
  default: vue.withCtx(function () { return [
@@ -154,7 +153,7 @@
154
153
  }, 16 /* FULL_PROPS */)
155
154
  ]; }),
156
155
  _: 3 /* FORWARDED */
157
- }, 16 /* FULL_PROPS */, ["modelValue", "transition-show", "transition-hide", "full-width"]))
156
+ }, 16 /* FULL_PROPS */, ["modelValue", "transition-show", "transition-hide", "position", "full-width"]))
158
157
  }
159
158
  }
160
159
 
@@ -166,6 +165,7 @@
166
165
  var _hoisted_2$3 = /*#__PURE__*/vue.createTextVNode("Modification");
167
166
 
168
167
 
168
+
169
169
  var script$4 = {
170
170
  __name: 'VlankEditModal',
171
171
  props: {
@@ -174,15 +174,12 @@
174
174
  modalEditOptions: Object,
175
175
  collection: String,
176
176
  extraRequestParams: Object,
177
- useSendFiles: Boolean,
178
177
  storeKey: String,
179
178
  isMobile: Boolean,
180
- closeModalAfterValidation: Boolean,
181
- propsLibelleTitle: String,
182
179
  },
183
180
  emits: ['close'],
184
- setup: function setup(__props, ref$1) {
185
- var $emit = ref$1.emit;
181
+ setup: function setup(__props, ref) {
182
+ var $emit = ref.emit;
186
183
 
187
184
 
188
185
  var props = __props;
@@ -213,75 +210,31 @@
213
210
 
214
211
  function onConfirmeEditAdd() {
215
212
  var action = props.localDetail.uuid ? "update" : "create";
216
- var message_notification = props.localDetail.uuid
217
- ? "Modification effectuée"
218
- : "Création effectuée";
219
213
  var extraParams =
220
214
  action === "update"
221
215
  ? Object.assign({}, props.extraRequestParams.update)
222
216
  : Object.assign({}, props.extraRequestParams.store);
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
- }
217
+ $collectionCrud
218
+ .collectionAction({
219
+ collectionName: props.collection,
220
+ action: action,
221
+ params: Object.assign({}, props.localDetail, extraParams),
222
+ list_field: props.storeKey
223
+ })
224
+ .then(function (obj) {
225
+ close(obj, action);
226
+ });
254
227
  }
255
228
 
256
229
  function close(obj, action) {
257
230
  $emit("close", { obj: obj, action: action });
258
231
  }
259
232
 
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
-
280
233
  return function (_ctx, _cache) {
281
234
  var _directive_close_popup = vue.resolveDirective("close-popup");
282
235
 
283
236
  return (vue.openBlock(), vue.createBlock(vue.unref(quasar.QDialog), vue.mergeProps({
284
- class: { 'mobile-modal': __props.isMobile },
237
+ class: {'mobile-modal': __props.isMobile},
285
238
  modelValue: vue.unref(editModalLocal),
286
239
  "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return (vue.isRef(editModalLocal) ? (editModalLocal).value = $event : null); })
287
240
  }, props.modalEditOptions.dialog, {
@@ -294,7 +247,7 @@
294
247
  vue.createVNode(vue.unref(quasar.QCard), vue.mergeProps({ style: {"width":"700px","max-width":"80vw"} }, props.modalEditOptions.card), {
295
248
  default: vue.withCtx(function () { return [
296
249
  vue.createVNode(vue.unref(quasar.QToolbar), vue.mergeProps({
297
- class: __props.isMobile ?'mobile-toolbar bg-primary' : 'bg-primary',
250
+ class: "bg-primary",
298
251
  style: {"color":"#fff"}
299
252
  }, props.modalEditOptions.toolbar), {
300
253
  default: vue.withCtx(function () { return [
@@ -329,17 +282,14 @@
329
282
  _: 1 /* STABLE */
330
283
  }))
331
284
  : (
332
- props.propsLibelleTitle && props.localDetail[props.propsLibelleTitle]
333
- )
334
- ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QToolbarTitle), {
335
- key: 3,
336
- class: vue.normalizeClass({ 'toolbar-title': __props.isMobile })
337
- }, {
285
+ props.propsLibelleTitle && props.localDetail[props.propsLibelleTitle]
286
+ )
287
+ ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QToolbarTitle), { key: 3 }, {
338
288
  default: vue.withCtx(function () { return [
339
- vue.createTextVNode(vue.toDisplayString(!__props.isMobile ? 'Modification' : null) + " " + vue.toDisplayString(props.localDetail[props.propsLibelleTitle]), 1 /* TEXT */)
289
+ vue.createTextVNode(" Modification : " + vue.toDisplayString(props.localDetail[props.propsLibelleTitle]), 1 /* TEXT */)
340
290
  ]; }),
341
291
  _: 1 /* STABLE */
342
- }, 8 /* PROPS */, ["class"]))
292
+ }))
343
293
  : (vue.openBlock(), vue.createBlock(vue.unref(quasar.QToolbarTitle), { key: 4 }, {
344
294
  default: vue.withCtx(function () { return [
345
295
  _hoisted_2$3
@@ -375,30 +325,14 @@
375
325
  ])
376
326
  ]; }),
377
327
  _: 3 /* FORWARDED */
378
- }, 16 /* FULL_PROPS */, ["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"]),
328
+ }, 16 /* FULL_PROPS */),
329
+ vue.renderSlot(_ctx.$slots, "create-edit-modal-content", {
330
+ data: props.localDetail
331
+ }),
397
332
  (!__props.isMobile)
398
333
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QCardActions), {
399
334
  key: 0,
400
- align: "right",
401
- class: "scroll"
335
+ align: "right"
402
336
  }, {
403
337
  default: vue.withCtx(function () { return [
404
338
  vue.renderSlot(_ctx.$slots, "create-edit-modal-custom-actions", {
@@ -466,7 +400,7 @@
466
400
  }
467
401
  }
468
402
 
469
- var css_248z$3 = ".mobile-modal .q-dialog__inner {\n padding: 0px !important;\n}\n.mobile-modal .toolbar-title {\n font-size: 0.9rem;\n max-width: 19rem;\n}\n\n.mobile-toolbar {\n position: fixed;\n top: 0;\n z-index: 999;\n}\n\n.mobile-content {\n padding-top: 4rem;\n}";
403
+ var css_248z$3 = ".mobile-modal .q-dialog__inner {\n padding: 0px !important;\n}";
470
404
  styleInject(css_248z$3);
471
405
 
472
406
  script$4.__file = "src/components/VlankEditModal.vue";
@@ -476,11 +410,9 @@
476
410
  props: {
477
411
  data: Object,
478
412
  colOptions: Object,
479
- props: Object,
480
- rowIndex: Number,
481
- cellIndex: Number,
413
+ props: Object
482
414
  },
483
- emits: ['update', 'onEditCellHandler', 'onClickTabHandler'],
415
+ emits: ['update'],
484
416
  setup: function setup(__props, ref$1) {
485
417
  var $emit = ref$1.emit;
486
418
 
@@ -496,7 +428,9 @@
496
428
 
497
429
  var getRawValue = vue.computed({
498
430
  get: function () {
499
- return localDetail.value[props.colOptions.name];
431
+ if (props.colOptions.format)
432
+ { return props.colOptions.format(localDetail.value[props.colOptions.name]); }
433
+ else { return localDetail.value[props.colOptions.name]; }
500
434
  },
501
435
  set: function (newValue) {
502
436
  localDetail.value[props.colOptions.name] = newValue;
@@ -529,22 +463,13 @@
529
463
  list_field: props.props.storeKey
530
464
  })
531
465
  .then(function (obj) {
532
- $emit("update", { obj: obj, action: "update", callback: function () {
533
- $emit("onClickTabHandler", props.rowIndex, props.cellIndex);
534
- }});
466
+ $emit("update", { obj: obj, action: "update" });
535
467
  });
536
468
  }
537
469
 
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
- }
546
-
547
470
  return function (_ctx, _cache) {
471
+ var _component_q_input = vue.resolveComponent("q-input");
472
+
548
473
  return (vue.openBlock(), vue.createElementBlock("td", null, [
549
474
  (localDetail.value[props.colOptions.name] && props.colOptions.type === 'boolean')
550
475
  ? vue.renderSlot(_ctx.$slots, getScopedSlotName('boolean-check', props.colOptions.name), { key: 0 }, function () { return [
@@ -562,21 +487,18 @@
562
487
  modelValue: localValue.value,
563
488
  "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((localValue).value = $event); }),
564
489
  "auto-save": "",
565
- onSave: onSave,
566
- onKeydown: vue.withKeys(vue.withModifiers(onClickTabHandler, ["prevent","stop"]), ["tab"])
490
+ onSave: onSave
567
491
  }, {
568
492
  default: vue.withCtx(function (scope) { return [
569
- vue.createVNode(vue.unref(quasar.QInput), vue.mergeProps(props.colOptions.inputOptions, {
570
- autofocus: "",
571
- "emit-value": "",
493
+ vue.createVNode(_component_q_input, {
572
494
  modelValue: scope.value,
573
- "onUpdate:modelValue": [function ($event) { return ((scope.value) = $event); }, function ($event) { return (onEditCellHandler(props.colOptions.field, scope.value)); }],
495
+ "onUpdate:modelValue": function ($event) { return ((scope.value) = $event); },
574
496
  label: props.colOptions.label,
575
497
  onKeyup: vue.withKeys(scope.set, ["enter"])
576
- }), null, 16 /* FULL_PROPS */, ["modelValue", "onUpdate:modelValue", "label", "onKeyup"])
498
+ }, null, 8 /* PROPS */, ["modelValue", "onUpdate:modelValue", "label", "onKeyup"])
577
499
  ]; }),
578
500
  _: 1 /* STABLE */
579
- }, 8 /* PROPS */, ["modelValue", "onKeydown"])
501
+ }, 8 /* PROPS */, ["modelValue"])
580
502
  ]))
581
503
  }
582
504
  }
@@ -593,7 +515,6 @@
593
515
  collection: null,
594
516
  showBtnDelete: false,
595
517
  showBtnEdit: false,
596
- showSlideLeft: false,
597
518
  showInputSearch: true,
598
519
  showBtnCreate: false,
599
520
  lazy: false,
@@ -620,7 +541,6 @@
620
541
  table: {
621
542
  title: "Titre Non défini",
622
543
  },
623
- useSendFiles: false,
624
544
  extraRequestParams: {
625
545
  index: {},
626
546
  show: {},
@@ -647,12 +567,10 @@
647
567
  props.modalEditOptions);
648
568
  props.modalEditOptions.showBtn = Object.assign({}, defaultOptions.modalEditOptions.showBtn,
649
569
  props.modalEditOptions.showBtn);
650
- var extraRequestParamsTemp = {};
651
570
  Object.keys(defaultOptions.extraRequestParams).forEach(function (key) {
652
- extraRequestParamsTemp[key] = Object.assign({}, defaultOptions.extraRequestParams[key],
571
+ props.extraRequestParams[key] = Object.assign({}, defaultOptions.extraRequestParams[key],
653
572
  props.extraRequestParams[key]);
654
573
  });
655
- props.extraRequestParams = extraRequestParamsTemp;
656
574
  return props;
657
575
  });
658
576
 
@@ -758,9 +676,7 @@
758
676
  align: "left",
759
677
  sortable: true,
760
678
  type: "string",
761
- classes: props.value.getRowCellClass,
762
679
  };
763
-
764
680
  // Option de la table par défaut
765
681
  var defautOptionsTable = {
766
682
  loading: $collectionCrud.getFromCollection(
@@ -772,8 +688,7 @@
772
688
  "row-key": function (row) { return config.columns
773
689
  .filter(function (c) { return c.name !== undefined || c.field !== undefined; })
774
690
  .map(function (c) { return row[c.name ? c.name : c.field]; })
775
- .join() +
776
- row[$collectionCrud.getRouteParameterName(props.value.collection)]; },
691
+ .join(); },
777
692
  "rows-per-page-options": [20, 50, 100],
778
693
  };
779
694
 
@@ -869,7 +784,7 @@
869
784
  /**
870
785
  * Renvoie le nom de la route pour les liens de type A pour les édition en page
871
786
  */
872
- var collectionCreateNamedRoute = vue.computed(function () {
787
+ var collectionCreateNamedRoute = vue.computed(function () {
873
788
  return props.value.collection + "-store";
874
789
  });
875
790
 
@@ -882,10 +797,6 @@
882
797
  return typeof options.to === "function";
883
798
  }
884
799
 
885
- function getAdditionalClassActionBtns(row) {
886
- return props.value.getRowCellClass ? ' '+props.value.getRowCellClass(row) : "";
887
- }
888
-
889
800
  return {
890
801
  customFields: customFields,
891
802
  table: table,
@@ -894,7 +805,6 @@
894
805
  collectionEditNamedRoute: collectionEditNamedRoute,
895
806
  collectionCreateNamedRoute: collectionCreateNamedRoute,
896
807
  isTdClickable: isTdClickable,
897
- getAdditionalClassActionBtns: getAdditionalClassActionBtns,
898
808
  };
899
809
  }
900
810
 
@@ -1165,7 +1075,6 @@
1165
1075
  var rowsPerPage = ref.rowsPerPage;
1166
1076
  var sortBy = ref.sortBy;
1167
1077
  var descending = ref.descending;
1168
-
1169
1078
  var filter = options.filter;
1170
1079
  asyncProps.value = options;
1171
1080
 
@@ -1258,7 +1167,6 @@
1258
1167
  stringlifyAndCheck(newValue.index, extraRequestParamsIndexStringlify)
1259
1168
  ) {
1260
1169
  getList(true);
1261
- extraRequestParamsIndexStringlify.value = JSON.stringify(newValue.index);
1262
1170
  }
1263
1171
  }
1264
1172
  });
@@ -1285,30 +1193,13 @@
1285
1193
  }
1286
1194
  }
1287
1195
 
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
-
1303
1196
  var _hoisted_1$2 = { class: "col" };
1304
- var _hoisted_2$2 = { key: 1 };
1305
- var _hoisted_3$2 = { key: 2 };
1306
- var _hoisted_4$2 = ["props", "onClick"];
1307
- var _hoisted_5$1 = ["props", "onClick"];
1308
- var _hoisted_6 = { class: "top-right-content" };
1309
- var _hoisted_7 = { id: "search-slot" };
1310
- var _hoisted_8 = { id: "top-right-under-add" };
1311
- var _hoisted_9 = ["props"];
1197
+ var _hoisted_2$2 = ["props", "onClick"];
1198
+ var _hoisted_3$2 = ["props", "onClick"];
1199
+ var _hoisted_4$2 = { class: "top-right-content" };
1200
+ var _hoisted_5$2 = { id: "search-slot" };
1201
+ var _hoisted_6 = { id: "top-right-under-add" };
1202
+ var _hoisted_7 = ["props"];
1312
1203
 
1313
1204
 
1314
1205
  var script$2 = {
@@ -1319,7 +1210,6 @@
1319
1210
  propsLibelleTitle: String,
1320
1211
  showBtnDelete: Boolean,
1321
1212
  showBtnEdit: Boolean,
1322
- showSlideLeft: Boolean,
1323
1213
  showBtnCreate: Boolean,
1324
1214
  storeKey: {
1325
1215
  type: String,
@@ -1355,7 +1245,6 @@
1355
1245
  type: Object,
1356
1246
  default: vue.ref({})
1357
1247
  },
1358
- useSendFiles: Boolean,
1359
1248
  modalDeleteOptions: Object,
1360
1249
  modalEditOptions: Object,
1361
1250
  persistTableOptions: Object,
@@ -1365,22 +1254,11 @@
1365
1254
  type: Function,
1366
1255
  default: function (row, type) { return true; }
1367
1256
  },
1368
- closeModalAfterValidation: {
1369
- type: Boolean,
1370
- default: true
1371
- },
1372
- getRowCellClass: {
1373
- type: Function,
1374
- default: null
1375
- },
1376
1257
  },
1377
1258
  emits: [
1378
1259
  "detailChange",
1379
1260
  "modalOpenCreateUpdate",
1380
- "actionsCallback",
1381
- "actionsSlideLeft",
1382
- "onEditCellHandler"
1383
- ],
1261
+ "actionsCallback" ],
1384
1262
  setup: function setup(__props, ref$1) {
1385
1263
  var $emit = ref$1.emit;
1386
1264
 
@@ -1394,20 +1272,8 @@
1394
1272
  var ccrudTable = vue.ref(null);
1395
1273
 
1396
1274
  var $q = quasar.useQuasar();
1397
-
1398
- var mobileColumn = vue.computed(function () {
1399
- if ($attrs.table.columns.filter(function (column) { return column.displayMobile; }).length > 1) {
1400
- throw new Error("Merci de ne saisir qu'une seule colonne en displayMobile.");
1401
- }
1402
- return $attrs.table.columns.filter(function (column) { return column.displayMobile; })[0]
1403
- });
1404
-
1405
1275
  var isMobile = vue.computed(function () {
1406
- if ($q.config.collectionCrudOptions && $q.config.collectionCrudOptions.maximalMobileScreenSize) {
1407
- return !!$q.screen.lt[$q.config.collectionCrudOptions.maximalMobileScreenSize]
1408
- } else {
1409
- return $q.screen.lt.md
1410
- }
1276
+ return $q.screen.lt.md
1411
1277
  });
1412
1278
 
1413
1279
  var $collectionCrud = vue.inject('vlank-ccrud');
@@ -1441,19 +1307,18 @@
1441
1307
  var collectionEditNamedRoute = ref$4.collectionEditNamedRoute;
1442
1308
  var collectionCreateNamedRoute = ref$4.collectionCreateNamedRoute;
1443
1309
  var isTdClickable = ref$4.isTdClickable;
1444
- var getAdditionalClassActionBtns = ref$4.getAdditionalClassActionBtns;
1445
1310
 
1446
1311
  var ref$5 = usePagination(props);
1447
1312
  var pagination = ref$5.pagination;
1448
1313
 
1449
1314
  useSaveAndExportTable(props, pagination, filter);
1450
1315
 
1451
- function getlocalDetailValue() {
1452
- if ($attrs.defaultValues instanceof Object) {
1316
+ function getlocalDetailValue(){
1317
+ if($attrs.defaultValues instanceof Object){
1453
1318
  return $attrs.defaultValues
1454
- } else if ($collectionCrud.getFromCollection(props.value.collection, 'detail')) {
1319
+ }else if($collectionCrud.getFromCollection(props.value.collection, 'detail')){
1455
1320
  return $collectionCrud.getFromCollection(props.value.collection, 'detail')
1456
- } else {
1321
+ }else {
1457
1322
  return {}
1458
1323
  }
1459
1324
  }
@@ -1473,10 +1338,6 @@
1473
1338
  var onCloseEditModal = ref$7.onCloseEditModal;
1474
1339
  var onCloseDeleteModal = ref$7.onCloseDeleteModal;
1475
1340
 
1476
- var ref$8 = useSelection(props);
1477
- var selectedData = ref$8.selectedData;
1478
- var selectionMode = ref$8.selectionMode;
1479
-
1480
1341
 
1481
1342
  useWatchs($attrs, getList, pagination, ccrudTable);
1482
1343
 
@@ -1485,97 +1346,6 @@
1485
1346
  return baseSlotName + "-" + field;
1486
1347
  }
1487
1348
 
1488
- // Partie sliderItem pour Mobile
1489
- var timer;
1490
- var mobileSlideItem = vue.ref(null);
1491
- function finalize(reset) {
1492
- clearTimeout(timer);
1493
- timer = setTimeout(function () {
1494
- reset();
1495
- }, 50);
1496
- }
1497
- vue.onBeforeUnmount(function () {
1498
- clearTimeout(timer);
1499
- });
1500
- function onClickRow(row) {
1501
- onClickEdit(row);
1502
- }
1503
- function onSlideLeft(details, row) {
1504
- $emit("actionsSlideLeft", details, row);
1505
- finalize(details.reset);
1506
- resetSlideItemsVisibility('q-slide-item__left');
1507
- }
1508
- function onSlideRight(ref, row) {
1509
- var reset = ref.reset;
1510
-
1511
- onClickDelete(row);
1512
- finalize(reset);
1513
- resetSlideItemsVisibility('q-slide-item__right');
1514
- }
1515
- function onSlide(ref) {
1516
- ref.side;
1517
- ref.ratio;
1518
- var isReset = ref.isReset;
1519
-
1520
- clearTimeout(timer);
1521
- if (isReset) {
1522
- resetSlideItemsVisibility('q-slide-item__left');
1523
- resetSlideItemsVisibility('q-slide-item__right');
1524
- }
1525
- }
1526
- function resetSlideItemsVisibility(slideItemClass) {
1527
- for (var index = 0; index < document.getElementsByClassName(slideItemClass).length; index++) {
1528
- document.getElementsByClassName(slideItemClass)[index].style.visibility = 'hidden';
1529
- }
1530
- }
1531
-
1532
- function onEditCellHandler(field, value) {
1533
- $emit("onEditCellHandler", field, value);
1534
- }
1535
-
1536
- // Gestion de la tabulation dans le tableau
1537
- var popupCells = vue.ref([]);
1538
-
1539
- var delayNextTabOption = vue.ref(null);
1540
- vue.watch(rows, function (newValue, oldValue) {
1541
- if (delayNextTabOption.value) {
1542
- setTimeout(function () {
1543
- if (delayNextTabOption.value) {
1544
- onClickTabHandler(delayNextTabOption.value.rowIndex, delayNextTabOption.value.cellIndex, false, false);
1545
- }
1546
- }, 400);
1547
- }
1548
- }, { deep: true });
1549
-
1550
- function onClickTabHandler(rowIndex, cellIndex, updated, openPrevious) {
1551
- if ( updated === void 0 ) updated = false;
1552
- if ( openPrevious === void 0 ) openPrevious = true;
1553
-
1554
- if (openPrevious) {
1555
- popupCells.value[rowIndex + '_' + cellIndex].$el.click();
1556
- }
1557
- if (updated) {
1558
- delayNextTabOption.value = {
1559
- rowIndex: rowIndex,
1560
- cellIndex: cellIndex
1561
- };
1562
- } else {
1563
- delayNextTabOption.value = null;
1564
- popupCells.value[getNextCellIndex(rowIndex, cellIndex)].$el.click();
1565
- }
1566
- }
1567
- function getRowIndex(row) {
1568
- return rows.value.indexOf(row);
1569
- }function getNextCellIndex(rowIndex, cellIndex) {
1570
- if (getEditablesTd.value.length > parseInt(cellIndex) + 1) {
1571
- return rowIndex + '_' + (parseInt(cellIndex) + 1)
1572
- } else {
1573
- return (parseInt(rowIndex) + 1) + '_' + 0
1574
- }
1575
- }
1576
- function onClearSearchHandler() {
1577
- filter.value = "";
1578
- }
1579
1349
 
1580
1350
  return function (_ctx, _cache) {
1581
1351
  return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
@@ -1585,13 +1355,10 @@
1585
1355
  }, vue.unref(table), {
1586
1356
  filter: filter.value,
1587
1357
  onRequest: vue.unref(asyncRequest),
1588
- ref_key: "ccrudTable",
1589
- ref: ccrudTable,
1590
1358
  pagination: vue.unref(pagination),
1591
1359
  "onUpdate:pagination": _cache[1] || (_cache[1] = function ($event) { return (vue.isRef(pagination) ? (pagination).value = $event : null); }),
1592
- selection: vue.unref(selectionMode),
1593
- selected: vue.unref(selectedData),
1594
- "onUpdate:selected": _cache[2] || (_cache[2] = function ($event) { return (vue.isRef(selectedData) ? (selectedData).value = $event : null); })
1360
+ ref_key: "ccrudTable",
1361
+ ref: ccrudTable
1595
1362
  }), vue.createSlots({
1596
1363
  "top-left": vue.withCtx(function () { return [
1597
1364
  vue.createElementVNode("div", null, [
@@ -1599,8 +1366,8 @@
1599
1366
  ])
1600
1367
  ]; }),
1601
1368
  "top-right": vue.withCtx(function () { return [
1602
- vue.createElementVNode("div", _hoisted_6, [
1603
- vue.createElementVNode("div", _hoisted_7, [
1369
+ vue.createElementVNode("div", _hoisted_4$2, [
1370
+ vue.createElementVNode("div", _hoisted_5$2, [
1604
1371
  (vue.unref(showInputSearch))
1605
1372
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QInput), {
1606
1373
  key: 0,
@@ -1609,27 +1376,16 @@
1609
1376
  modelValue: filter.value,
1610
1377
  "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return ((filter).value = $event); }),
1611
1378
  placeholder: "Recherche",
1612
- outlined: "",
1613
- rounded: vue.unref(isMobile),
1379
+ filled: "",
1380
+ "bg-color": "grey-2",
1381
+ square: "",
1614
1382
  style: {"width":"180px"}
1615
1383
  }, {
1616
1384
  append: vue.withCtx(function () { return [
1617
- (filter.value)
1618
- ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
1619
- key: 0,
1620
- dense: "",
1621
- flat: "",
1622
- round: "",
1623
- icon: "mdi-close",
1624
- onClick: onClearSearchHandler
1625
- }))
1626
- : (vue.openBlock(), vue.createBlock(vue.unref(quasar.QIcon), {
1627
- key: 1,
1628
- name: "search"
1629
- }))
1385
+ vue.createVNode(vue.unref(quasar.QIcon), { name: "search" })
1630
1386
  ]; }),
1631
1387
  _: 1 /* STABLE */
1632
- }, 8 /* PROPS */, ["modelValue", "rounded"]))
1388
+ }, 8 /* PROPS */, ["modelValue"]))
1633
1389
  : vue.createCommentVNode("v-if", true),
1634
1390
  (vue.unref(showBtnCreatePage))
1635
1391
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
@@ -1655,7 +1411,7 @@
1655
1411
  : vue.createCommentVNode("v-if", true),
1656
1412
  vue.renderSlot(_ctx.$slots, "top-right-after-add")
1657
1413
  ]),
1658
- vue.createElementVNode("div", _hoisted_8, [
1414
+ vue.createElementVNode("div", _hoisted_6, [
1659
1415
  vue.renderSlot(_ctx.$slots, "top-right-under-add")
1660
1416
  ])
1661
1417
  ])
@@ -1666,7 +1422,7 @@
1666
1422
  return [
1667
1423
  vue.createElementVNode("td", {
1668
1424
  props: props,
1669
- class: vue.normalizeClass('action-buttons' + vue.unref(getAdditionalClassActionBtns)(props.row))
1425
+ class: "action-buttons"
1670
1426
  }, [
1671
1427
  vue.renderSlot(_ctx.$slots, "row-action-before-controllers", {
1672
1428
  key: 0,
@@ -1686,18 +1442,24 @@
1686
1442
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
1687
1443
  key: 2,
1688
1444
  type: "a",
1689
- to: { name: vue.unref(collectionEditNamedRoute), params: ( obj = {}, obj[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj ) },
1445
+ to: {
1446
+ name: vue.unref(collectionEditNamedRoute),
1447
+ params: ( obj = {}, obj[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj ),
1448
+ },
1690
1449
  color: "primary",
1691
1450
  icon: "edit",
1692
1451
  flat: "",
1693
1452
  round: vue.unref(isMobile)
1694
1453
  }, null, 8 /* PROPS */, ["to", "round"]))
1695
1454
  : vue.createCommentVNode("v-if", true),
1696
- (!__props.editablePage && vue.unref(showBtnEditPage) && __props.displayActionCallback(props.row, 'show'))
1455
+ (!__props.editablePage && __props.displayActionCallback(props.row, 'show'))
1697
1456
  ? (vue.openBlock(), vue.createBlock(vue.unref(quasar.QBtn), {
1698
1457
  key: 3,
1699
1458
  type: "a",
1700
- to: { name: vue.unref(collectionEditNamedRoute), params: ( obj$1 = {}, obj$1[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj$1 ) },
1459
+ to: {
1460
+ name: vue.unref(collectionEditNamedRoute),
1461
+ params: ( obj$1 = {}, obj$1[vue.unref(route_parameter_name)] = props.row[vue.unref(route_parameter_name)], obj$1 ),
1462
+ },
1701
1463
  color: "primary",
1702
1464
  icon: "mdi-magnify-plus-outline",
1703
1465
  flat: ""
@@ -1716,98 +1478,11 @@
1716
1478
  vue.renderSlot(_ctx.$slots, "row-action-after-controllers", {
1717
1479
  data: props.row
1718
1480
  })
1719
- ], 10 /* CLASS, PROPS */, _hoisted_9)
1481
+ ], 8 /* PROPS */, _hoisted_7)
1720
1482
  ];
1721
1483
  }),
1722
1484
  _: 2 /* DYNAMIC */
1723
1485
  }, [
1724
- (vue.unref(isMobile))
1725
- ? {
1726
- name: "header",
1727
- fn: vue.withCtx(function (props) { return []; })
1728
- }
1729
- : undefined,
1730
- (vue.unref(isMobile))
1731
- ? {
1732
- name: "body",
1733
- fn: vue.withCtx(function (props) { return [
1734
- vue.createVNode(vue.unref(quasar.QSlideItem), {
1735
- ref_key: "mobileSlideItem",
1736
- ref: mobileSlideItem,
1737
- onLeft: function (element) { return onSlideLeft(element, props.row); },
1738
- onRight: function (element) { return onSlideRight(element, props.row); },
1739
- onSlide: onSlide,
1740
- reset: "",
1741
- "right-color": "negative",
1742
- "left-color": "accent"
1743
- }, vue.createSlots({
1744
- default: vue.withCtx(function () { return [
1745
- vue.createVNode(vue.unref(quasar.QItem), {
1746
- style: {"align-items":"center"},
1747
- class: vue.normalizeClass('mobile-item' + vue.unref(getAdditionalClassActionBtns)(props.row))
1748
- }, {
1749
- default: vue.withCtx(function () { return [
1750
- vue.createCommentVNode(" On affiche la première colonne seulement et on garde celle des actions "),
1751
- vue.createVNode(vue.unref(quasar.QItemSection), {
1752
- class: "mobile-item-content",
1753
- onClick: function ($event) { return (vue.unref(showBtnEdit) ? onClickRow(props.row) : ''); }
1754
- }, {
1755
- default: vue.withCtx(function () { return [
1756
- (vue.unref($slots)['body-cell-mobile'])
1757
- ? vue.renderSlot(_ctx.$slots, "body-cell-mobile", {
1758
- key: 0,
1759
- data: props.row,
1760
- class: "body-cell-mobile"
1761
- })
1762
- : (vue.unref(mobileColumn))
1763
- ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$2, vue.toDisplayString(props.cols.filter(function (col) { return col.name === vue.unref(mobileColumn).name; })[0].value), 1 /* TEXT */))
1764
- : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$2, vue.toDisplayString(props.cols[0].value), 1 /* TEXT */))
1765
- ]; }),
1766
- _: 2 /* DYNAMIC */
1767
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]),
1768
- vue.createVNode(vue.unref(quasar.QItemSection), {
1769
- style: {"display":"flex","flex-direction":"row","align-items":"center"},
1770
- side: ""
1771
- }, {
1772
- default: vue.withCtx(function () { return [
1773
- vue.renderSlot(_ctx.$slots, "row-action-before-controllers", {
1774
- key: 0,
1775
- data: props.row
1776
- })
1777
-
1778
- ]; }),
1779
- _: 2 /* DYNAMIC */
1780
- }, 1024 /* DYNAMIC_SLOTS */)
1781
- ]; }),
1782
- _: 2 /* DYNAMIC */
1783
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class"])
1784
- ]; }),
1785
- _: 2 /* DYNAMIC */
1786
- }, [
1787
- (__props.showSlideLeft)
1788
- ? {
1789
- name: "left",
1790
- fn: vue.withCtx(function () { return [
1791
- vue.renderSlot(_ctx.$slots, "content-slider-left", {
1792
- data: props.row
1793
- }, function () { return [
1794
- vue.createVNode(vue.unref(quasar.QIcon), { name: "mdi-pencil" })
1795
- ]; })
1796
- ]; })
1797
- }
1798
- : undefined,
1799
- (vue.unref(showBtnDelete))
1800
- ? {
1801
- name: "right",
1802
- fn: vue.withCtx(function () { return [
1803
- vue.createVNode(vue.unref(quasar.QIcon), { name: "mdi-delete" })
1804
- ]; })
1805
- }
1806
- : undefined
1807
- ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["onLeft", "onRight"])
1808
- ]; })
1809
- }
1810
- : undefined,
1811
1486
  vue.renderList(vue.unref(customFields), function (options) {
1812
1487
  return {
1813
1488
  name: options.slotName,
@@ -1816,7 +1491,7 @@
1816
1491
  ? (vue.openBlock(), vue.createElementBlock("td", {
1817
1492
  props: props,
1818
1493
  key: options.slotName,
1819
- class: vue.normalizeClass((vue.unref(isTdClickable)(options) ? 'cursor-pointer' : '') + vue.unref(getAdditionalClassActionBtns)(props.row)),
1494
+ class: vue.normalizeClass(vue.unref(isTdClickable)(options) ? 'cursor-pointer' : ''),
1820
1495
  onClick: function ($event) { return (vue.unref(isTdClickable)(options) ? options.to(props.row) : null); }
1821
1496
  }, [
1822
1497
  (props.row[options.field])
@@ -1834,15 +1509,15 @@
1834
1509
  key: 1,
1835
1510
  data: props.row
1836
1511
  })
1837
- ], 10 /* CLASS, PROPS */, _hoisted_4$2))
1512
+ ], 10 /* CLASS, PROPS */, _hoisted_2$2))
1838
1513
  : (vue.openBlock(), vue.createElementBlock("td", {
1839
1514
  props: props,
1840
1515
  key: options.slotName + '-else',
1841
- class: vue.normalizeClass('cursor-pointer' + vue.unref(getAdditionalClassActionBtns)(props.row)),
1516
+ class: "cursor-pointer",
1842
1517
  onClick: function ($event) { return (options.to(props.row)); }
1843
1518
  }, vue.toDisplayString(options.format
1844
- ? options.format(props.row)
1845
- : props.row[options.field]), 11 /* TEXT, CLASS, PROPS */, _hoisted_5$1))
1519
+ ? options.format(props.row)
1520
+ : props.row[options.field]), 9 /* TEXT, PROPS */, _hoisted_3$2))
1846
1521
  ]; })
1847
1522
  }
1848
1523
  }),
@@ -1854,22 +1529,17 @@
1854
1529
  ]; })
1855
1530
  }
1856
1531
  }),
1857
- vue.renderList(vue.unref(getEditablesTd), function (config, index) {
1532
+ vue.renderList(vue.unref(getEditablesTd), function (config) {
1858
1533
  return {
1859
1534
  name: config.slotName,
1860
1535
  fn: vue.withCtx(function (slotProps) { return [
1861
1536
  (vue.unref(editOnTable))
1862
1537
  ? (vue.openBlock(), vue.createBlock(script$3, {
1863
- ref: function (el) { popupCells.value[getRowIndex(slotProps.row) + '_' + index] = el; },
1864
1538
  key: config.slotName,
1865
- rowIndex: getRowIndex(slotProps.row),
1866
- cellIndex: index,
1867
1539
  data: slotProps.row,
1868
1540
  props: vue.unref(props),
1869
1541
  colOptions: config.options,
1870
- onUpdate: vue.unref(onUpdateTd),
1871
- onOnEditCellHandler: onEditCellHandler,
1872
- onOnClickTabHandler: onClickTabHandler
1542
+ onUpdate: vue.unref(onUpdateTd)
1873
1543
  }, vue.createSlots({ _: 2 /* DYNAMIC */ }, [
1874
1544
  vue.renderList(vue.unref($slots), function (_, slot) {
1875
1545
  return {
@@ -1879,12 +1549,12 @@
1879
1549
  ]; })
1880
1550
  }
1881
1551
  })
1882
- ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["rowIndex", "cellIndex", "data", "props", "colOptions", "onUpdate"]))
1552
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["data", "props", "colOptions", "onUpdate"]))
1883
1553
  : vue.createCommentVNode("v-if", true)
1884
1554
  ]; })
1885
1555
  }
1886
1556
  })
1887
- ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["rows", "filter", "onRequest", "pagination", "selection", "selected"]),
1557
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["rows", "filter", "onRequest", "pagination"]),
1888
1558
  vue.createCommentVNode(" Modal de Confirmation Suppression "),
1889
1559
  vue.createVNode(script$5, {
1890
1560
  localDetail: localDetail.value,
@@ -1911,59 +1581,45 @@
1911
1581
  vue.createVNode(script$4, vue.mergeProps({ localDetail: localDetail.value }, vue.unref(props), {
1912
1582
  editModal: editModal.value,
1913
1583
  onClose: vue.unref(onCloseEditModal),
1914
- isMobile: vue.unref(isMobile),
1915
- closeModalAfterValidation: __props.closeModalAfterValidation,
1916
- propsLibelleTitle: __props.propsLibelleTitle
1584
+ isMobile: vue.unref(isMobile)
1917
1585
  }), vue.createSlots({ _: 2 /* DYNAMIC */ }, [
1918
1586
  vue.renderList(vue.unref($slots), function (_, slot) {
1919
1587
  return {
1920
1588
  name: slot,
1921
1589
  fn: vue.withCtx(function (scope) { return [
1922
1590
  (vue.openBlock(), vue.createElementBlock("div", {
1923
- class: vue.normalizeClass(vue.unref(isMobile) ? 'mobile-content modal-content' : 'modal-content'),
1591
+ class: "modal-content",
1924
1592
  key: slot
1925
1593
  }, [
1926
1594
  vue.renderSlot(_ctx.$slots, slot, vue.normalizeProps(vue.guardReactiveProps(scope)))
1927
- ], 2 /* CLASS */))
1595
+ ]))
1928
1596
  ]; })
1929
1597
  }
1930
1598
  })
1931
- ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["localDetail", "editModal", "onClose", "isMobile", "closeModalAfterValidation", "propsLibelleTitle"])
1599
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */, ["localDetail", "editModal", "onClose", "isMobile"])
1932
1600
  ]))
1933
1601
  }
1934
1602
  }
1935
1603
 
1936
1604
  };
1937
1605
 
1938
- 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";
1606
+ 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";
1939
1607
  styleInject(css_248z$2);
1940
1608
 
1941
1609
  script$2.__scopeId = "data-v-60881ef8";
1942
1610
  script$2.__file = "src/components/VlankCollectionCrud.vue";
1943
1611
 
1944
- function onClickBack(route, router) {
1945
- if(!route || !route.meta) {
1946
- router.go(-1);
1947
- return;
1948
- }
1949
- var localStorageRoute = localStorage.getItem(route.meta.goBackRoute);
1950
- if (localStorageRoute) {
1951
- router.push(localStorageRoute);
1952
- localStorage.removeItem(route.meta.goBackRoute);
1953
- } else if (route.meta.mainParentRoutePath) {
1954
- router.push(route.meta.mainParentRoutePath);
1955
- } else {
1956
- router.go(-1);
1957
- }
1958
- }
1959
-
1960
- var _hoisted_1$1 = { style: {"display":"flex","align-items":"center"} };
1961
- var _hoisted_2$1 = { key: 0 };
1962
- var _hoisted_3$1 = {
1612
+ var _hoisted_1$1 = {
1613
+ key: 0,
1614
+ class: "edit-page-header"
1615
+ };
1616
+ var _hoisted_2$1 = { style: {"display":"flex","align-items":"center"} };
1617
+ var _hoisted_3$1 = { key: 0 };
1618
+ var _hoisted_4$1 = {
1963
1619
  key: 1,
1964
1620
  class: "edit-page-body"
1965
1621
  };
1966
- var _hoisted_4$1 = {
1622
+ var _hoisted_5$1 = {
1967
1623
  key: 2,
1968
1624
  class: "edit-page-body"
1969
1625
  };
@@ -1977,17 +1633,12 @@
1977
1633
  var $emit = ref$1.emit;
1978
1634
 
1979
1635
 
1980
- var route = vueRouter.useRoute();
1981
1636
  var router = vueRouter.useRouter();
1637
+ var route = vueRouter.useRoute();
1982
1638
  var store = vuex.useStore();
1983
1639
  var collectionCrud = vue.inject('vlank-ccrud');
1984
1640
 
1985
1641
 
1986
- function onClickBackTemplate(){
1987
- onClickBack(route, router);
1988
- }
1989
-
1990
-
1991
1642
 
1992
1643
  var localDetail = vue.ref(null);
1993
1644
  var containerMode = vue.ref(route.meta.containerMode);
@@ -2015,6 +1666,13 @@
2015
1666
  : { label: "Valider", icon: "mdi-check" };
2016
1667
  });
2017
1668
 
1669
+ var onClickBack = function () {
1670
+ if (route.meta.mainParentRoutePath) {
1671
+ router.push(route.meta.mainParentRoutePath);
1672
+ } else {
1673
+ router.go(-1);
1674
+ }
1675
+ };
2018
1676
  var onCustomTitle = function (title) {
2019
1677
  customTitle.value = title;
2020
1678
  };
@@ -2031,48 +1689,20 @@
2031
1689
  var onExtraRequestParams = function (extraRequestParamsValue) {
2032
1690
  if (extraRequestParamsValue) { extraRequestParams.value = extraRequestParamsValue; }
2033
1691
  };
2034
-
2035
- var submitLoading = vue.ref(false);
2036
1692
  var onClickSubmit = function () {
2037
- submitLoading.value = true;
2038
- if (route.meta.useSendFiles) {
2039
- collectionCrud
2040
- .collectionAction({
2041
- collectionName: route.meta.collection,
2042
- action: "send-file",
2043
- params: Object.assign({}, localDetail.value, extraRequestParams.value),
2044
- axios_options: {
2045
- oniti_success_notification_message: 'Modification effectuée'
2046
- },
2047
- })
2048
- .then(function (obj) {
2049
- submitCallback(obj);
2050
- }).finally(function () {
2051
- submitLoading.value = false;
2052
- });
2053
- } else {
2054
- collectionCrud
1693
+ collectionCrud
2055
1694
  .collectionAction({
2056
1695
  collectionName: route.meta.collection,
2057
1696
  action: "update",
2058
1697
  params: Object.assign({}, localDetail.value, extraRequestParams.value),
2059
1698
  })
2060
1699
  .then(function (obj) {
2061
- submitCallback(obj);
2062
- }).finally(function () {
2063
- submitLoading.value = false;
1700
+ if (route.meta.goBackAfterValidation) {
1701
+ onClickBack();
1702
+ }
1703
+ localDetail.value = obj;
2064
1704
  });
2065
- }
2066
1705
  };
2067
-
2068
- function submitCallback(obj) {
2069
- if (route.meta.goBackAfterValidation) {
2070
- onClickBack(route, router);
2071
- }
2072
- localDetail.value = JSON.parse(JSON.stringify(obj));
2073
- previousLocalDetail.value = JSON.parse(JSON.stringify(obj));
2074
- }
2075
-
2076
1706
  var onSubscribe = function (mutation, state) {
2077
1707
 
2078
1708
  if (
@@ -2084,27 +1714,15 @@
2084
1714
  }
2085
1715
  };
2086
1716
 
2087
- var route_parameter_name = collectionCrud.getRouteParameterName(route.meta.collection);
2088
- var actual_route = route;
2089
- var actual_collection = vue.ref(route.meta.collection);
2090
- vue.watch(router.currentRoute,function (new_current_route, old_current_route ) {
2091
- if(new_current_route.meta.collection){
2092
- actual_route = new_current_route;
2093
- route_parameter_name = collectionCrud.getRouteParameterName(new_current_route.meta.collection);
2094
- propsLibelleTitle.value = new_current_route.meta.propsLibelleTitle;
2095
- actual_collection.value = new_current_route.meta.collection;
2096
- fetchDetail();
2097
- }
2098
- },{deep:true});
2099
-
2100
- function fetchDetail(){
1717
+ vue.onMounted(function () {
2101
1718
  var obj;
2102
1719
 
2103
1720
  if (!containerMode.value) {
2104
- var parameter_route_value = actual_route.params[route_parameter_name];
1721
+ var parameter_route_value = route.params[route_parameter_name];
1722
+
2105
1723
  collectionCrud
2106
1724
  .collectionAction({
2107
- collectionName: actual_route.meta.collection,
1725
+ collectionName: route.meta.collection,
2108
1726
  action: "detail",
2109
1727
  lazy: true,
2110
1728
  params: ( obj = {}, obj[route_parameter_name] = parameter_route_value, obj ),
@@ -2113,24 +1731,7 @@
2113
1731
  localDetail.value = Object.assign({}, obj);
2114
1732
  $emit("collectionCrudUpdateLocalDetail", localDetail.value);
2115
1733
  });
2116
- }else {
2117
- localDetail.value = null;
2118
- }
2119
- }
2120
-
2121
- var isLocalDetailUpdated = vue.ref(false);
2122
- var previousLocalDetail = vue.ref(null);
2123
-
2124
- vue.watch(localDetail, function (newVal) {
2125
- if (newVal && !previousLocalDetail.value) {
2126
- previousLocalDetail.value = JSON.parse(JSON.stringify(newVal));
2127
- } else {
2128
- isLocalDetailUpdated.value = JSON.stringify(newVal) !== JSON.stringify(previousLocalDetail.value);
2129
1734
  }
2130
- }, {deep:true});
2131
-
2132
- vue.onMounted(function () {
2133
- fetchDetail();
2134
1735
  unsubscribe = store.subscribe(onSubscribe);
2135
1736
  });
2136
1737
 
@@ -2140,46 +1741,41 @@
2140
1741
  }
2141
1742
  });
2142
1743
 
1744
+ var route_parameter_name = collectionCrud.getRouteParameterName(route.meta.collection);
2143
1745
 
2144
1746
  return function (_ctx, _cache) {
2145
1747
  return (vue.openBlock(), vue.createBlock(vue.unref(quasar.QPage), null, {
2146
1748
  default: vue.withCtx(function () { return [
2147
1749
  (!containerMode.value)
2148
- ? (vue.openBlock(), vue.createElementBlock("div", {
2149
- class: "edit-page-header",
2150
- key: actual_collection.value
2151
- }, [
2152
- vue.createElementVNode("div", _hoisted_1$1, [
1750
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
1751
+ vue.createElementVNode("div", _hoisted_2$1, [
2153
1752
  vue.createVNode(vue.unref(quasar.QBtn), {
2154
- onClick: onClickBackTemplate,
1753
+ onClick: onClickBack,
2155
1754
  color: "primary",
2156
1755
  icon: "arrow_back"
2157
1756
  }),
2158
1757
  vue.createElementVNode("h2", null, vue.toDisplayString(vue.unref(getTitle)), 1 /* TEXT */)
2159
1758
  ]),
2160
1759
  (!containerMode.value && editablePage.value)
2161
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
1760
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
2162
1761
  vue.createVNode(vue.unref(quasar.QBtn), {
1762
+ color: "primary",
2163
1763
  icon: vue.unref(getSubmitBtn).icon,
2164
- onClick: onClickSubmit,
2165
- disable: !isLocalDetailUpdated.value,
2166
- color: isLocalDetailUpdated.value ? 'primary' : 'grey-5',
2167
- loading: submitLoading.value
1764
+ onClick: onClickSubmit
2168
1765
  }, {
2169
1766
  default: vue.withCtx(function () { return [
2170
1767
  vue.createTextVNode(vue.toDisplayString(vue.unref(getSubmitBtn).label), 1 /* TEXT */)
2171
1768
  ]; }),
2172
1769
  _: 1 /* STABLE */
2173
- }, 8 /* PROPS */, ["icon", "disable", "color", "loading"])
1770
+ }, 8 /* PROPS */, ["icon"])
2174
1771
  ]))
2175
1772
  : vue.createCommentVNode("v-if", true)
2176
1773
  ]))
2177
1774
  : vue.createCommentVNode("v-if", true),
2178
1775
  (localDetail.value)
2179
- ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
1776
+ ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
2180
1777
  (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(Components__default["default"])[vue.unref(formComponent)]), {
2181
1778
  data: localDetail.value,
2182
- key: localDetail.value[vue.unref(route_parameter_name)],
2183
1779
  onExtraRequestParams: onExtraRequestParams,
2184
1780
  onCustomTitle: onCustomTitle,
2185
1781
  onCustomSubmitBtn: onCustomSubmitBtn,
@@ -2187,7 +1783,7 @@
2187
1783
  onEditablePage: onEditablePage
2188
1784
  }, null, 40 /* PROPS, HYDRATE_EVENTS */, ["data"]))
2189
1785
  ]))
2190
- : (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
1786
+ : (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$1, [
2191
1787
  vue.createVNode(vue.unref(quasar.QSpinner), {
2192
1788
  class: "loader",
2193
1789
  color: "accent"
@@ -2231,15 +1827,10 @@
2231
1827
  var $emit = ref$1.emit;
2232
1828
 
2233
1829
 
2234
- var route = vueRouter.useRoute();
2235
1830
  var router = vueRouter.useRouter();
1831
+ var route = vueRouter.useRoute();
2236
1832
  var collectionCrud = vue.inject('vlank-ccrud');
2237
1833
 
2238
- function onClickBackTemplate(){
2239
- onClickBack(route, router);
2240
- }
2241
-
2242
-
2243
1834
 
2244
1835
 
2245
1836
  var localDetail = vue.ref(null);
@@ -2266,6 +1857,14 @@
2266
1857
  : { label: "Valider", icon: "mdi-check" };
2267
1858
  });
2268
1859
 
1860
+ var onClickBack = function () {
1861
+ if (route.meta.mainParentRoutePath) {
1862
+ router.push(route.meta.mainParentRoutePath);
1863
+ } else {
1864
+ router.go(-1);
1865
+ }
1866
+ };
1867
+
2269
1868
  var onCustomSubmitBtn = function (button) {
2270
1869
  customSubmitBtn.value.label = button.label;
2271
1870
  customSubmitBtn.value.icon = button.icon;
@@ -2277,27 +1876,8 @@
2277
1876
  var onExtraRequestParams = function (extraRequestParamsValue) {
2278
1877
  if (extraRequestParamsValue) { extraRequestParams.value = extraRequestParamsValue; }
2279
1878
  };
2280
-
2281
- var submitLoading = vue.ref(false);
2282
1879
  var onClickSubmit = function () {
2283
- submitLoading.value = true;
2284
- if (route.meta.useSendFiles) {
2285
- collectionCrud
2286
- .collectionAction({
2287
- collectionName: route.meta.collection,
2288
- action: "send-file",
2289
- params: Object.assign({}, localDetail.value, extraRequestParams.value),
2290
- })
2291
- .then(function (obj) {
2292
- if (route.meta.goBackAfterValidation) {
2293
- onClickBack(route, router);
2294
- }
2295
- localDetail.value = obj;
2296
- }).finally(function () {
2297
- submitLoading.value = false;
2298
- });
2299
- } else {
2300
- collectionCrud
1880
+ collectionCrud
2301
1881
  .collectionAction({
2302
1882
  collectionName: route.meta.collection,
2303
1883
  action: "create",
@@ -2305,14 +1885,10 @@
2305
1885
  })
2306
1886
  .then(function (obj) {
2307
1887
  if (route.meta.goBackAfterValidation) {
2308
- onClickBack(route, router);
1888
+ onClickBack();
2309
1889
  }
2310
1890
  localDetail.value = obj;
2311
- }).finally(function () {
2312
- submitLoading.value = false;
2313
1891
  });
2314
- }
2315
-
2316
1892
  };
2317
1893
  vue.onMounted(function () {
2318
1894
  collectionCrud
@@ -2335,7 +1911,7 @@
2335
1911
  ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
2336
1912
  vue.createElementVNode("div", _hoisted_2, [
2337
1913
  vue.createVNode(vue.unref(quasar.QBtn), {
2338
- onClick: onClickBackTemplate,
1914
+ onClick: onClickBack,
2339
1915
  color: "primary",
2340
1916
  icon: "arrow_back"
2341
1917
  }),
@@ -2346,14 +1922,13 @@
2346
1922
  vue.createVNode(vue.unref(quasar.QBtn), {
2347
1923
  color: "primary",
2348
1924
  icon: vue.unref(getSubmitBtn).icon,
2349
- onClick: onClickSubmit,
2350
- loading: submitLoading.value
1925
+ onClick: onClickSubmit
2351
1926
  }, {
2352
1927
  default: vue.withCtx(function () { return [
2353
1928
  vue.createTextVNode(vue.toDisplayString(vue.unref(getSubmitBtn).label), 1 /* TEXT */)
2354
1929
  ]; }),
2355
1930
  _: 1 /* STABLE */
2356
- }, 8 /* PROPS */, ["icon", "loading"])
1931
+ }, 8 /* PROPS */, ["icon"])
2357
1932
  ]))
2358
1933
  : vue.createCommentVNode("v-if", true)
2359
1934
  ]))
@@ -2387,7 +1962,7 @@
2387
1962
  script.__scopeId = "data-v-29e3989a";
2388
1963
  script.__file = "src/components/VlankCreatePage.vue";
2389
1964
 
2390
- var version = '3.7.41';
1965
+ var version = '3.5.2';
2391
1966
 
2392
1967
  function install (app) {
2393
1968
  app.component(script$2.name, script$2);