@crystaldesign/diva-backoffice 24.12.0-beta.1 → 24.12.0-beta.10

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.
Files changed (23) hide show
  1. package/build/esm/index.js +346 -324
  2. package/build/types/backoffice/src/Configuration.d.ts +1 -0
  3. package/build/types/backoffice/src/Configuration.d.ts.map +1 -1
  4. package/build/types/backoffice/src/layout/Navigation/types.d.ts +1 -0
  5. package/build/types/backoffice/src/layout/Navigation/types.d.ts.map +1 -1
  6. package/build/types/backoffice/src/layout/Toolbar/Tools/WYSIWYG_Configurator/ArticleSelection/index.d.ts.map +1 -1
  7. package/build/types/backoffice/src/layout/Toolbar/index.d.ts.map +1 -1
  8. package/build/types/backoffice/src/store/ContentStore.d.ts.map +1 -1
  9. package/build/types/backoffice/src/ui/AssetMananger/MediaItem.d.ts +1 -0
  10. package/build/types/backoffice/src/ui/AssetMananger/MediaItem.d.ts.map +1 -1
  11. package/build/types/backoffice/src/ui/AssetMananger/Upload/index.d.ts.map +1 -1
  12. package/build/types/backoffice/src/ui/Form/elements.d.ts.map +1 -1
  13. package/build/types/backoffice/src/ui/Form/types.d.ts +1 -0
  14. package/build/types/backoffice/src/ui/Form/types.d.ts.map +1 -1
  15. package/build/types/backoffice/src/ui/Form/useFormData.d.ts.map +1 -1
  16. package/build/types/backoffice/src/ui/IDMEnricherEditor/useModule.d.ts.map +1 -1
  17. package/build/types/backoffice/src/ui/Table/BaseTable/cellRenderer/MediaItemViewerCell/index.d.ts.map +1 -1
  18. package/build/types/backoffice/src/ui/Table/BaseTable/cellRenderer/MediaViewerCell/index.d.ts.map +1 -1
  19. package/build/types/backoffice/src/ui/Table/CatalogTable/useTableData.d.ts.map +1 -1
  20. package/build/types/backoffice/src/ui/Table/StandardTable/useTableData.d.ts.map +1 -1
  21. package/build/types/backoffice/src/ui/Table/types.d.ts +2 -0
  22. package/build/types/backoffice/src/ui/Table/types.d.ts.map +1 -1
  23. package/package.json +3 -3
@@ -3144,17 +3144,6 @@ function loadConfiguration(t, root, config, lang) {
3144
3144
  }]
3145
3145
  }
3146
3146
  },
3147
- GroupContentItems: {
3148
- type: 'Group',
3149
- items: [{
3150
- id: 'ContentItems',
3151
- type: 'Table'
3152
- }, {
3153
- id: 'ContentItemsTemplate',
3154
- type: 'Table'
3155
- }],
3156
- setSelectedOrganization: true
3157
- },
3158
3147
  ContentItems: {
3159
3148
  title: t('backoffice.table.contentitems.title'),
3160
3149
  type: 'Table',
@@ -3162,18 +3151,33 @@ function loadConfiguration(t, root, config, lang) {
3162
3151
  pagination: {
3163
3152
  pageSize: 50
3164
3153
  },
3154
+ filter: {
3155
+ toggle: {
3156
+ fields: ['onlyTemplates'],
3157
+ label: t('backoffice.table.contentitemstemplate.title'),
3158
+ labelOff: t('backoffice.table.contentitems.toggleOff'),
3159
+ inQuery: true
3160
+ }
3161
+ },
3165
3162
  copyAction: {
3166
3163
  actionType: 'Detail',
3167
3164
  type: 'Form',
3168
3165
  id: 'FormEditContentItem',
3166
+ disableOnMultiselect: true,
3167
+ resetToggleAfter: true,
3169
3168
  title: t('backoffice.table.contentItem.copyAction.title'),
3170
3169
  label: t('backoffice.table.services.copyAction.label'),
3171
- disableOnMultiselect: true,
3172
3170
  mapping: {
3173
3171
  type: 'body',
3174
3172
  map: [{
3175
3173
  targetField: 'content',
3176
3174
  sourceField: 'content'
3175
+ }, {
3176
+ targetField: 'catalogName',
3177
+ sourceField: 'catalogName'
3178
+ }, {
3179
+ targetField: 'supplierName',
3180
+ sourceField: 'supplierName'
3177
3181
  }, {
3178
3182
  targetField: 'description',
3179
3183
  sourceField: 'description'
@@ -3183,10 +3187,18 @@ function loadConfiguration(t, root, config, lang) {
3183
3187
  }]
3184
3188
  }
3185
3189
  },
3190
+ createAction: {
3191
+ actionType: 'Detail',
3192
+ type: 'JsonEditor',
3193
+ id: 'JsonEditorCreateContentItem',
3194
+ title: t('backoffice.table.contentItem.label.create'),
3195
+ label: t('backoffice.table.contentItem.label.create'),
3196
+ permission: 'backoffice_create_contentitem_template'
3197
+ },
3186
3198
  deleteAction: {
3187
3199
  disabled: function disabled(datas) {
3188
3200
  return (datas === null || datas === void 0 ? void 0 : datas.find(function (d) {
3189
- return !d.organizationId;
3201
+ return !(d !== null && d !== void 0 && d.organizationId);
3190
3202
  })) && !root.actions.userHasPermission('backoffice_delete_contentitem_template');
3191
3203
  }
3192
3204
  },
@@ -3217,6 +3229,7 @@ function loadConfiguration(t, root, config, lang) {
3217
3229
  }, {
3218
3230
  title: t('backoffice.table.views.lastUpdated'),
3219
3231
  field: 'lastUpdated',
3232
+ defaultSortOrder: 'descend',
3220
3233
  type: 'unixTimeStamp',
3221
3234
  sorter: 1,
3222
3235
  filter: 'advanced',
@@ -3238,106 +3251,6 @@ function loadConfiguration(t, root, config, lang) {
3238
3251
  filter: 'advanced',
3239
3252
  width: 150
3240
3253
  }],
3241
- rowAction: [{
3242
- actionType: 'Detail',
3243
- disabled: function disabled(data) {
3244
- return !(data !== null && data !== void 0 && data.organizationId) && !root.actions.userHasPermission('backoffice_edit_contentitem_template');
3245
- },
3246
- disableOnMultiselect: true,
3247
- type: 'Form',
3248
- id: 'FormEditContentItem',
3249
- title: t('backoffice.table.contentItem.edit'),
3250
- label: t('backoffice.edit')
3251
- }, {
3252
- disableOnMultiselect: true,
3253
- actionType: 'Detail',
3254
- permission: 'backoffice_edit_contentitem_template',
3255
- type: 'JsonEditor',
3256
- label: t('backoffice.table.contentItem.editjson'),
3257
- id: 'JsonEditorEditContentItem',
3258
- title: t('backoffice.table.contentItem.edit')
3259
- }],
3260
- apiInterface: {
3261
- read: {
3262
- list: '${catalogService}/contentItems',
3263
- filterServerSide: true
3264
- },
3265
- "delete": '${catalogService}/contentItems/${id}'
3266
- }
3267
- },
3268
- ContentItemsTemplate: {
3269
- title: t('backoffice.table.contentitemstemplate.title'),
3270
- type: 'Table',
3271
- canRefresh: true,
3272
- pagination: {
3273
- pageSize: 50
3274
- },
3275
- copyAction: {
3276
- actionType: 'Detail',
3277
- type: 'Form',
3278
- id: 'FormEditContentItem',
3279
- disableOnMultiselect: true,
3280
- title: t('backoffice.table.contentItem.copyAction.title'),
3281
- label: t('backoffice.table.services.copyAction.label'),
3282
- mapping: {
3283
- type: 'body',
3284
- map: [{
3285
- targetField: 'content',
3286
- sourceField: 'content'
3287
- }, {
3288
- targetField: 'description',
3289
- sourceField: 'description'
3290
- }, {
3291
- targetField: 'organizationId',
3292
- globalValue: 'organizationId'
3293
- }]
3294
- }
3295
- },
3296
- createAction: {
3297
- actionType: 'Detail',
3298
- type: 'JsonEditor',
3299
- id: 'JsonEditorCreateContentItem',
3300
- title: t('backoffice.table.contentItem.label.create'),
3301
- label: t('backoffice.table.contentItem.label.create'),
3302
- permission: 'backoffice_create_contentitem_template'
3303
- },
3304
- deleteAction: {
3305
- disabled: function disabled(datas) {
3306
- return (datas === null || datas === void 0 ? void 0 : datas.find(function (d) {
3307
- return !d.organizationId;
3308
- })) && !root.actions.userHasPermission('backoffice_delete_contentitem_template');
3309
- }
3310
- },
3311
- columns: [{
3312
- title: t('backoffice.table.roles.columns.description'),
3313
- field: 'description',
3314
- sorter: 1,
3315
- filter: 'advanced',
3316
- width: 500
3317
- }, {
3318
- title: t('backoffice.table.views.lastUpdatedBy'),
3319
- field: 'lastUpdatedBy_displayText',
3320
- sorter: 1,
3321
- filter: 'advanced',
3322
- width: 150
3323
- }, {
3324
- title: t('backoffice.table.views.lastUpdated'),
3325
- field: 'lastUpdated',
3326
- type: 'unixTimeStamp',
3327
- sorter: 1,
3328
- filter: 'advanced',
3329
- width: 200
3330
- }, {
3331
- title: 'backoffice.content',
3332
- field: 'content',
3333
- hidden: true
3334
- }, {
3335
- title: t('backoffice._id'),
3336
- field: '_id',
3337
- sorter: 1,
3338
- filter: 'advanced',
3339
- width: 100
3340
- }],
3341
3254
  rowAction: [{
3342
3255
  actionType: 'Detail',
3343
3256
  disabled: function disabled(data) {
@@ -3369,7 +3282,7 @@ function loadConfiguration(t, root, config, lang) {
3369
3282
  }],
3370
3283
  apiInterface: {
3371
3284
  read: {
3372
- list: '${catalogService}/contentItems?onlyTemplates=true',
3285
+ list: '${catalogService}/contentItems',
3373
3286
  filterServerSide: true
3374
3287
  },
3375
3288
  "delete": '${catalogService}/contentItems/${id}'
@@ -7624,6 +7537,7 @@ function loadConfiguration(t, root, config, lang) {
7624
7537
  }, {
7625
7538
  name: 'mediaItemImage',
7626
7539
  type: 'media',
7540
+ hideTrash: true,
7627
7541
  allowedTypes: ['image/*'],
7628
7542
  mediaItemRefField: 'mediaItemRefImage',
7629
7543
  urlField: 'image',
@@ -7644,6 +7558,7 @@ function loadConfiguration(t, root, config, lang) {
7644
7558
  }, {
7645
7559
  name: 'mediaItemVideo',
7646
7560
  type: 'media',
7561
+ hideTrash: true,
7647
7562
  allowedTypes: ['video/*'],
7648
7563
  mediaItemRefField: 'mediaItemRefVideo',
7649
7564
  urlField: 'video',
@@ -12250,16 +12165,10 @@ var menu = [{
12250
12165
  }
12251
12166
  }]
12252
12167
  }, {
12253
- id: 'GroupContentItems',
12168
+ id: 'ContentItems',
12254
12169
  path: 'contentitems',
12255
12170
  label: 'backoffice.menu.items.label.ContentItems',
12256
- icon: 'OrderedListOutlined',
12257
- rules: [{
12258
- match: {
12259
- value: ['RETAILER', 'ASSOCIATION'],
12260
- globalValue: 'organization.parentType'
12261
- }
12262
- }]
12171
+ icon: 'OrderedListOutlined'
12263
12172
  }, {
12264
12173
  id: 'idmTables',
12265
12174
  path: 'idm',
@@ -13879,6 +13788,7 @@ function useFormData (_ref) {
13879
13788
  removedMedias = _useState12[0],
13880
13789
  setRemovedMedias = _useState12[1];
13881
13790
  var _useMemo = useMemo(function () {
13791
+ setCanSave === null || setCanSave === void 0 || setCanSave(true);
13882
13792
  var c = {
13883
13793
  apiHandler: root.getApiHandler(id, apiInterface),
13884
13794
  configuration: root.configurationStore.getConfiguration(id, 'Form')
@@ -13894,7 +13804,7 @@ function useFormData (_ref) {
13894
13804
  if (configuration.disableSave) setCanSave === null || setCanSave === void 0 || setCanSave(false);
13895
13805
  }, [configuration]);
13896
13806
  var _onLoadFields = function onLoadFields(data) {
13897
- var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : selectedItems !== null && selectedItems !== void 0 ? selectedItems : configuration.items;
13807
+ var items = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (selectedItems !== null && selectedItems !== void 0 ? selectedItems : configuration.itemSelector && Array.isArray(configuration.items[0])) ? configuration.items[0] : configuration.items;
13898
13808
  var _iterator = _createForOfIteratorHelper$j(items),
13899
13809
  _step;
13900
13810
  try {
@@ -14015,21 +13925,25 @@ function useFormData (_ref) {
14015
13925
  _context.next = 17;
14016
13926
  break;
14017
13927
  }
13928
+ if (configuration.showProgressBar) setProgressBarPercentage(i > 0 ? Math.floor(i / multipleEditingData.length * 100) : 1);
14018
13929
  original = multipleEditingData[i];
14019
13930
  _newData = setNewData(newData, JSON.parse(JSON.stringify(original)));
14020
13931
  _context.t0 = response;
14021
- _context.next = 11;
13932
+ _context.next = 12;
14022
13933
  return apiHandler.update(_newData, original, configuration.mapping);
14023
- case 11:
13934
+ case 12:
14024
13935
  _context.t1 = _context.sent;
14025
13936
  _context.t0.push.call(_context.t0, _context.t1);
14026
- if (configuration.showProgressBar) setProgressBarPercentage(Math.abs((i + 1 / multipleEditingData.length) * 100));
14027
13937
  case 14:
14028
13938
  i++;
14029
13939
  _context.next = 5;
14030
13940
  break;
14031
13941
  case 17:
14032
- if (configuration.showProgressBar) setProgressBarOpen(false);
13942
+ if (configuration.showProgressBar) {
13943
+ if (configuration.showProgressBar) setProgressBarPercentage(100);
13944
+ setProgressBarOpen(false);
13945
+ setProgressBarPercentage(0);
13946
+ }
14033
13947
  _context.next = 23;
14034
13948
  break;
14035
13949
  case 20:
@@ -14091,27 +14005,37 @@ function useFormData (_ref) {
14091
14005
  }
14092
14006
  return _context2.abrupt("return", newData);
14093
14007
  case 3:
14094
- _context2.next = 5;
14008
+ root.actions.toggleLoading('saving_form');
14009
+ _context2.prev = 4;
14010
+ _context2.next = 7;
14095
14011
  return setDynamicFields(_objectSpread$I({}, state.data), newData);
14096
- case 5:
14012
+ case 7:
14097
14013
  newData = _context2.sent;
14098
- _context2.next = 8;
14014
+ _context2.next = 10;
14099
14015
  return preSaveProcess(newData, selectedItems !== null && selectedItems !== void 0 ? selectedItems : configuration.items);
14100
- case 8:
14016
+ case 10:
14101
14017
  newData = removeEmpty(newData);
14018
+ _context2.next = 17;
14019
+ break;
14020
+ case 13:
14021
+ _context2.prev = 13;
14022
+ _context2.t0 = _context2["catch"](4);
14023
+ root.actions.toggleLoading('saving_form');
14024
+ throw _context2.t0;
14025
+ case 17:
14102
14026
  setState(_objectSpread$I(_objectSpread$I({}, state), {}, {
14103
14027
  loading: true
14104
14028
  }));
14105
14029
  finalData = state.data;
14106
- _context2.prev = 11;
14107
- _context2.next = 14;
14030
+ _context2.prev = 19;
14031
+ _context2.next = 22;
14108
14032
  return apiCall(newData);
14109
- case 14:
14033
+ case 22:
14110
14034
  response = _context2.sent;
14111
14035
  i = 0;
14112
- case 16:
14036
+ case 24:
14113
14037
  if (!(i < (((_configuration$additi = configuration.additionals) === null || _configuration$additi === void 0 ? void 0 : _configuration$additi.length) || 0))) {
14114
- _context2.next = 26;
14038
+ _context2.next = 34;
14115
14039
  break;
14116
14040
  }
14117
14041
  // perform additional server actions before returning the data
@@ -14123,47 +14047,52 @@ function useFormData (_ref) {
14123
14047
  if (additional.addBaseUrl) {
14124
14048
  data[additional.addBaseUrl] = window.location.origin;
14125
14049
  }
14126
- _context2.next = 23;
14050
+ _context2.next = 31;
14127
14051
  return additionalApi.create(data, additional.mapping, response);
14128
- case 23:
14052
+ case 31:
14129
14053
  i++;
14130
- _context2.next = 16;
14054
+ _context2.next = 24;
14131
14055
  break;
14132
- case 26:
14056
+ case 34:
14133
14057
  finalData = response;
14134
14058
  return _context2.abrupt("return", response);
14135
- case 30:
14136
- _context2.prev = 30;
14137
- _context2.t0 = _context2["catch"](11);
14138
- if (!(_context2.t0 instanceof DivaError && _context2.t0.name)) {
14139
- _context2.next = 38;
14059
+ case 38:
14060
+ _context2.prev = 38;
14061
+ _context2.t1 = _context2["catch"](19);
14062
+ if (configuration.showProgressBar) {
14063
+ setProgressBarOpen(false);
14064
+ setProgressBarPercentage(0);
14065
+ }
14066
+ if (!(_context2.t1 instanceof DivaError && _context2.t1.name)) {
14067
+ _context2.next = 47;
14140
14068
  break;
14141
14069
  }
14142
- errorCode = _context2.t0.name;
14070
+ errorCode = _context2.t1.name;
14143
14071
  item = selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.find(function (item) {
14144
14072
  var _item$onError;
14145
14073
  return (_item$onError = item.onError) === null || _item$onError === void 0 ? void 0 : _item$onError[errorCode];
14146
14074
  });
14147
14075
  if (!item) {
14148
- _context2.next = 38;
14076
+ _context2.next = 47;
14149
14077
  break;
14150
14078
  }
14151
14079
  setFieldErrors(_objectSpread$I(_objectSpread$I({}, fieldErrors), {}, _defineProperty({}, item.name.toString(), item.onError[errorCode])));
14152
14080
  return _context2.abrupt("return", undefined);
14153
- case 38:
14154
- throw _context2.t0;
14155
- case 39:
14156
- _context2.prev = 39;
14081
+ case 47:
14082
+ throw _context2.t1;
14083
+ case 48:
14084
+ _context2.prev = 48;
14085
+ root.actions.toggleLoading('saving_form');
14157
14086
  setState(_objectSpread$I(_objectSpread$I({}, state), {}, {
14158
14087
  data: finalData,
14159
14088
  loading: false
14160
14089
  }));
14161
- return _context2.finish(39);
14162
- case 42:
14090
+ return _context2.finish(48);
14091
+ case 52:
14163
14092
  case "end":
14164
14093
  return _context2.stop();
14165
14094
  }
14166
- }, _callee2, null, [[11, 30, 39, 42]]);
14095
+ }, _callee2, null, [[4, 13], [19, 38, 48, 52]]);
14167
14096
  }));
14168
14097
  return function onSave(_x2) {
14169
14098
  return _ref3.apply(this, arguments);
@@ -17277,6 +17206,9 @@ function Upload (_ref) {
17277
17206
  beforeUpload: beforeUpload,
17278
17207
  onRemove: onRemoveMedia,
17279
17208
  accept: allowedTypes === null || allowedTypes === void 0 ? void 0 : allowedTypes.join(','),
17209
+ showUploadList: {
17210
+ showRemoveIcon: !config.hideTrash
17211
+ },
17280
17212
  children: /*#__PURE__*/jsxs(Space$1, {
17281
17213
  direction: "horizontal",
17282
17214
  children: [/*#__PURE__*/jsx(Button$1, {
@@ -17339,7 +17271,8 @@ function Media (_ref) {
17339
17271
  onError: onError,
17340
17272
  config: {
17341
17273
  baseUrl: state.root.configurationStore.apiConfig.mediaService,
17342
- jwt: state.root.dataStore.jwt
17274
+ jwt: state.root.dataStore.jwt,
17275
+ hideTrash: item.hideTrash
17343
17276
  }
17344
17277
  });
17345
17278
  }
@@ -17569,6 +17502,7 @@ function getElement(item, setCanSave, state, absoluteName, _onChange, _onError,
17569
17502
  });
17570
17503
  case 'radio':
17571
17504
  return /*#__PURE__*/jsx(Radio.Group, {
17505
+ defaultValue: item.defaultValue,
17572
17506
  value: item.value,
17573
17507
  options: item.options.map(function (o) {
17574
17508
  var _o$disabled;
@@ -22405,7 +22339,7 @@ var useMediaUpload = function useMediaUpload(_ref) {
22405
22339
  var small = "small-NY1-k";
22406
22340
  var medium = "medium---QcO";
22407
22341
  var big = "big--E39S";
22408
- var css_248z$d = ".diva-component-DIVA_BACKOFFICE_NEW .ant-upload-wrapper {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-nested-loading {\n width: 100%;\n height: 100%;\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-table-wrapper, .diva-component-DIVA_BACKOFFICE_NEW .ant-table {\n height: inherit;\n overflow: auto;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-container {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-spin-container {\n display: flex;\n flex-direction: column;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-space-item .andt-table .ant-spin-container {\n height: calc(60vh - 90px);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-table-container {\n height: calc(100% - 80px);\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list-item-container {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-select {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .small-NY1-k {\n width: 104px;\n height: 104px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .medium---QcO {\n width: 200px;\n height: 200px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .big--E39S {\n width: 400px;\n height: 400px;\n}\n";
22342
+ var css_248z$d = ".diva-component-DIVA_BACKOFFICE_NEW .ant-upload-wrapper {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-nested-loading {\n width: 100%;\n height: 100%;\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-table-wrapper, .diva-component-DIVA_BACKOFFICE_NEW .ant-table {\n height: inherit;\n overflow: auto;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-drawer-body .ant-spin-nested-loading {\n width: 100%;\n height: 80%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-spin-container {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-spin-container {\n display: flex;\n flex-direction: column;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-space-item .andt-table .ant-spin-container {\n height: calc(60vh - 90px);\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .andt-table .ant-table-container {\n height: calc(100% - 80px);\n}\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list {\n width: 100%;\n height: 100%;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-list-item-container {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .ant-upload-select {\n width: 100% !important;\n height: 100% !important;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .small-NY1-k {\n width: 104px;\n height: 104px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .medium---QcO {\n width: 200px;\n height: 200px;\n}\n\n.diva-component-DIVA_BACKOFFICE_NEW .big--E39S {\n width: 400px;\n height: 400px;\n}\n";
22409
22343
  styleInject(css_248z$d);
22410
22344
 
22411
22345
  var MediaUpload = observer(function (_ref) {
@@ -22804,6 +22738,8 @@ if (!window.customElements.get('model-viewer')) {
22804
22738
  function MediaViewerCell (_ref) {
22805
22739
  var children = _ref.children,
22806
22740
  column = _ref.column;
22741
+ var _useDivaCore = useDivaCore(),
22742
+ isFirefox = _useDivaCore.state.isFirefox;
22807
22743
  if (!(children !== null && children !== void 0 && children[1])) {
22808
22744
  return /*#__PURE__*/jsx(Fragment, {});
22809
22745
  }
@@ -22849,7 +22785,7 @@ function MediaViewerCell (_ref) {
22849
22785
  src: children[1],
22850
22786
  ar: true,
22851
22787
  "ar-scale": 'fixed',
22852
- "ar-modes": 'webxr quick-look',
22788
+ "ar-modes": !isFirefox ? 'webxr quick-look' : '',
22853
22789
  "shadow-intensity": "1",
22854
22790
  "camera-controls": true,
22855
22791
  "touch-action": "pan-y",
@@ -22989,6 +22925,8 @@ function MediaItemViewerCell (_ref) {
22989
22925
  timeStamp = _useState4[0],
22990
22926
  setTimeStamp = _useState4[1];
22991
22927
  var id;
22928
+ var _useDivaCore = useDivaCore(),
22929
+ isFirefox = _useDivaCore.state.isFirefox;
22992
22930
 
22993
22931
  //! for renderjob table mediaItems because can't filter mediaItems.0
22994
22932
  if (Array.isArray(children[1])) {
@@ -23020,9 +22958,9 @@ function MediaItemViewerCell (_ref) {
23020
22958
  });
23021
22959
  }, [timeStamp, id]);
23022
22960
  if (!id) return /*#__PURE__*/jsx(FileUnknownOutlined, {});
23023
- var _useDivaCore = useDivaCore(),
23024
- handler = _useDivaCore.handler,
23025
- actions = _useDivaCore.actions;
22961
+ var _useDivaCore2 = useDivaCore(),
22962
+ handler = _useDivaCore2.handler,
22963
+ actions = _useDivaCore2.actions;
23026
22964
  var openModelViewer = function openModelViewer() {
23027
22965
  actions.openFullscreen({
23028
22966
  content: /*#__PURE__*/jsx("model-viewer", {
@@ -23030,7 +22968,7 @@ function MediaItemViewerCell (_ref) {
23030
22968
  src: children[1],
23031
22969
  ar: true,
23032
22970
  "ar-scale": 'fixed',
23033
- "ar-modes": 'webxr quick-look',
22971
+ "ar-modes": !isFirefox ? 'webxr quick-look' : '',
23034
22972
  "shadow-intensity": "1",
23035
22973
  "camera-controls": true,
23036
22974
  "touch-action": "pan-y",
@@ -23587,7 +23525,7 @@ dayjs.extend(weekYear);
23587
23525
  Select$1.Option;
23588
23526
  var LOG$3 = getLogger('Backoffice', 'BaseTable');
23589
23527
  var TableWrapper = function TableWrapper(_ref) {
23590
- var _state$configuration$, _state$configuration$2, _state$configuration$3, _state$configuration$4, _state$configuration$5, _state$configuration$6, _state$globalFilter, _state$globalFilter2, _state$globalFilter3, _state$globalFilter4, _state$configuration$7, _state$configuration$8, _state$globalFilter$s, _state$configuration$9, _state$configuration$10, _state$configuration$11, _state$selected2, _state$configuration$12, _state$configuration$13, _state$configuration$14, _state$configuration$17, _state$configuration$18, _state$configuration$19;
23528
+ var _state$configuration$, _toggleConfig$label, _toggleConfig$labelOf, _state$globalFilter, _state$configuration$2, _state$configuration$3, _state$globalFilter2, _state$globalFilter3, _state$globalFilter4, _state$globalFilter5, _state$configuration$4, _state$configuration$5, _state$globalFilter$s, _state$configuration$6, _state$configuration$7, _state$configuration$8, _state$selected2, _state$configuration$9, _state$configuration$10, _state$configuration$11, _state$configuration$14, _state$configuration$15, _state$configuration$16;
23591
23529
  var state = _ref.state;
23592
23530
  var root = useStore();
23593
23531
  var _useState = useState(0),
@@ -23681,6 +23619,7 @@ var TableWrapper = function TableWrapper(_ref) {
23681
23619
  if (!permission) return true;
23682
23620
  return root.actions.userHasPermission(permission);
23683
23621
  }
23622
+ var toggleConfig = (_state$configuration$ = state.configuration.filter) === null || _state$configuration$ === void 0 ? void 0 : _state$configuration$.toggle;
23684
23623
  return /*#__PURE__*/jsxs(Fragment, {
23685
23624
  children: [(state.canDelete || state.configuration.createAction || state.title || state.configuration.canRefresh || state.configuration.clientRelations) && /*#__PURE__*/jsx(Fragment, {
23686
23625
  children: /*#__PURE__*/jsx(Descriptions, {
@@ -23739,16 +23678,17 @@ var TableWrapper = function TableWrapper(_ref) {
23739
23678
  state.triggerRefresh();
23740
23679
  },
23741
23680
  children: /*#__PURE__*/jsx(ReloadOutlined, {})
23742
- }), ((_state$configuration$ = state.configuration.filter) === null || _state$configuration$ === void 0 ? void 0 : _state$configuration$.toggle) && (!state.configuration.filter.toggle.permission || root.actions.userHasPermission(state.configuration.filter.toggle.permission)) && /*#__PURE__*/jsx("div", {
23681
+ }), toggleConfig && (!toggleConfig.permission || root.actions.userHasPermission(toggleConfig.permission)) && /*#__PURE__*/jsx("div", {
23743
23682
  children: /*#__PURE__*/jsx(Switch, {
23744
- defaultChecked: (_state$configuration$2 = state.configuration.filter) === null || _state$configuration$2 === void 0 ? void 0 : _state$configuration$2.toggle.defaultChecked,
23745
- checkedChildren: (_state$configuration$3 = state.configuration.filter.toggle.label) !== null && _state$configuration$3 !== void 0 ? _state$configuration$3 : 'unfiltered',
23746
- unCheckedChildren: (_state$configuration$4 = state.configuration.filter.toggle.labelOff) !== null && _state$configuration$4 !== void 0 ? _state$configuration$4 : 'filtered',
23683
+ defaultChecked: toggleConfig.defaultChecked,
23684
+ checkedChildren: (_toggleConfig$label = toggleConfig.label) !== null && _toggleConfig$label !== void 0 ? _toggleConfig$label : 'unfiltered',
23685
+ unCheckedChildren: (_toggleConfig$labelOf = toggleConfig.labelOff) !== null && _toggleConfig$labelOf !== void 0 ? _toggleConfig$labelOf : 'filtered',
23747
23686
  onChange: function onChange() {
23748
23687
  return state.onGlobalFilterToggle();
23749
- }
23688
+ },
23689
+ checked: !!((_state$globalFilter = state.globalFilter) !== null && _state$globalFilter !== void 0 && _state$globalFilter.toggle) != !!toggleConfig.inverted
23750
23690
  })
23751
- }), ((_state$configuration$5 = state.configuration.filter) === null || _state$configuration$5 === void 0 ? void 0 : _state$configuration$5.search) && /*#__PURE__*/jsx(Input.Search, {
23691
+ }), ((_state$configuration$2 = state.configuration.filter) === null || _state$configuration$2 === void 0 ? void 0 : _state$configuration$2.search) && /*#__PURE__*/jsx(Input.Search, {
23752
23692
  placeholder: t('filter.global'),
23753
23693
  onSearch: function onSearch(v) {
23754
23694
  return state.onGlobalFilterSearch(v);
@@ -23757,17 +23697,17 @@ var TableWrapper = function TableWrapper(_ref) {
23757
23697
  style: {
23758
23698
  width: 200
23759
23699
  }
23760
- }), ((_state$configuration$6 = state.configuration.filter) === null || _state$configuration$6 === void 0 ? void 0 : _state$configuration$6.period) && /*#__PURE__*/jsx(DatePicker.RangePicker, {
23700
+ }), ((_state$configuration$3 = state.configuration.filter) === null || _state$configuration$3 === void 0 ? void 0 : _state$configuration$3.period) && /*#__PURE__*/jsx(DatePicker.RangePicker, {
23761
23701
  onCalendarChange: function onCalendarChange(values) {
23762
23702
  if (values && values[0] && values[1]) {
23763
23703
  state.onGlobalFilterPeriod(values[0].valueOf(), values[1].valueOf());
23764
23704
  }
23765
23705
  },
23766
- value: [(_state$globalFilter = state.globalFilter) !== null && _state$globalFilter !== void 0 && (_state$globalFilter = _state$globalFilter.timeStamp) !== null && _state$globalFilter !== void 0 && (_state$globalFilter = _state$globalFilter['fromTimeStamp']) !== null && _state$globalFilter !== void 0 && _state$globalFilter[0] ? dayjs((_state$globalFilter2 = state.globalFilter) === null || _state$globalFilter2 === void 0 || (_state$globalFilter2 = _state$globalFilter2.timeStamp) === null || _state$globalFilter2 === void 0 || (_state$globalFilter2 = _state$globalFilter2['fromTimeStamp']) === null || _state$globalFilter2 === void 0 ? void 0 : _state$globalFilter2[0]) : dayjs(new Date(Date.now() - 30 * 24 * 60 * 60 * 1000)),
23706
+ value: [(_state$globalFilter2 = state.globalFilter) !== null && _state$globalFilter2 !== void 0 && (_state$globalFilter2 = _state$globalFilter2.timeStamp) !== null && _state$globalFilter2 !== void 0 && (_state$globalFilter2 = _state$globalFilter2['fromTimeStamp']) !== null && _state$globalFilter2 !== void 0 && _state$globalFilter2[0] ? dayjs((_state$globalFilter3 = state.globalFilter) === null || _state$globalFilter3 === void 0 || (_state$globalFilter3 = _state$globalFilter3.timeStamp) === null || _state$globalFilter3 === void 0 || (_state$globalFilter3 = _state$globalFilter3['fromTimeStamp']) === null || _state$globalFilter3 === void 0 ? void 0 : _state$globalFilter3[0]) : dayjs(new Date(Date.now() - 30 * 24 * 60 * 60 * 1000)),
23767
23707
  // Convert to Dayjs
23768
- (_state$globalFilter3 = state.globalFilter) !== null && _state$globalFilter3 !== void 0 && (_state$globalFilter3 = _state$globalFilter3.timeStamp) !== null && _state$globalFilter3 !== void 0 && (_state$globalFilter3 = _state$globalFilter3['toTimeStamp']) !== null && _state$globalFilter3 !== void 0 && _state$globalFilter3[0] ? dayjs((_state$globalFilter4 = state.globalFilter) === null || _state$globalFilter4 === void 0 || (_state$globalFilter4 = _state$globalFilter4.timeStamp) === null || _state$globalFilter4 === void 0 || (_state$globalFilter4 = _state$globalFilter4['toTimeStamp']) === null || _state$globalFilter4 === void 0 ? void 0 : _state$globalFilter4[0]) : dayjs(new Date()) // Convert to Dayjs
23708
+ (_state$globalFilter4 = state.globalFilter) !== null && _state$globalFilter4 !== void 0 && (_state$globalFilter4 = _state$globalFilter4.timeStamp) !== null && _state$globalFilter4 !== void 0 && (_state$globalFilter4 = _state$globalFilter4['toTimeStamp']) !== null && _state$globalFilter4 !== void 0 && _state$globalFilter4[0] ? dayjs((_state$globalFilter5 = state.globalFilter) === null || _state$globalFilter5 === void 0 || (_state$globalFilter5 = _state$globalFilter5.timeStamp) === null || _state$globalFilter5 === void 0 || (_state$globalFilter5 = _state$globalFilter5['toTimeStamp']) === null || _state$globalFilter5 === void 0 ? void 0 : _state$globalFilter5[0]) : dayjs(new Date()) // Convert to Dayjs
23769
23709
  ]
23770
- }), ((_state$configuration$7 = state.configuration.filter) === null || _state$configuration$7 === void 0 ? void 0 : _state$configuration$7.select) && /*#__PURE__*/jsx(SimpleSelect, _objectSpread$l(_objectSpread$l({}, (_state$configuration$8 = state.configuration.filter) === null || _state$configuration$8 === void 0 ? void 0 : _state$configuration$8.select.settings), {}, {
23710
+ }), ((_state$configuration$4 = state.configuration.filter) === null || _state$configuration$4 === void 0 ? void 0 : _state$configuration$4.select) && /*#__PURE__*/jsx(SimpleSelect, _objectSpread$l(_objectSpread$l({}, (_state$configuration$5 = state.configuration.filter) === null || _state$configuration$5 === void 0 ? void 0 : _state$configuration$5.select.settings), {}, {
23771
23711
  style: {
23772
23712
  minWidth: '200px'
23773
23713
  },
@@ -23780,17 +23720,17 @@ var TableWrapper = function TableWrapper(_ref) {
23780
23720
  }), state.canDelete && /*#__PURE__*/jsx(DeleteButton, {
23781
23721
  selected: state.selected,
23782
23722
  total: state.pagination.total,
23783
- min: (_state$configuration$9 = state.configuration.rules) === null || _state$configuration$9 === void 0 ? void 0 : _state$configuration$9.min,
23723
+ min: (_state$configuration$6 = state.configuration.rules) === null || _state$configuration$6 === void 0 ? void 0 : _state$configuration$6.min,
23784
23724
  deleting: state.deleting,
23785
23725
  onDelete: state.onDelete,
23786
- disabled: !!((_state$configuration$10 = state.configuration.deleteAction) !== null && _state$configuration$10 !== void 0 && (_state$configuration$11 = _state$configuration$10.disabled) !== null && _state$configuration$11 !== void 0 && _state$configuration$11.call(_state$configuration$10, ((_state$selected2 = state.selected) !== null && _state$selected2 !== void 0 ? _state$selected2 : []).map(function (id) {
23726
+ disabled: !!((_state$configuration$7 = state.configuration.deleteAction) !== null && _state$configuration$7 !== void 0 && (_state$configuration$8 = _state$configuration$7.disabled) !== null && _state$configuration$8 !== void 0 && _state$configuration$8.call(_state$configuration$7, ((_state$selected2 = state.selected) !== null && _state$selected2 !== void 0 ? _state$selected2 : []).map(function (id) {
23787
23727
  return state.data.find(function (d) {
23788
23728
  return d._id == id;
23789
23729
  });
23790
23730
  })))
23791
23731
  }), state.configuration.copyAction !== undefined && /*#__PURE__*/jsx(CopyButton, {
23792
23732
  state: state
23793
- }), (_state$configuration$12 = state.configuration.bulkActions) === null || _state$configuration$12 === void 0 ? void 0 : _state$configuration$12.map(function (action) {
23733
+ }), (_state$configuration$9 = state.configuration.bulkActions) === null || _state$configuration$9 === void 0 ? void 0 : _state$configuration$9.map(function (action) {
23794
23734
  return /*#__PURE__*/jsx(BulkAction, {
23795
23735
  action: action,
23796
23736
  state: state,
@@ -23801,18 +23741,18 @@ var TableWrapper = function TableWrapper(_ref) {
23801
23741
  setProgressBarPercentage: setProgressBarPercentage
23802
23742
  } : undefined
23803
23743
  }, action.id);
23804
- }), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && !((_state$configuration$13 = (_state$configuration$14 = state.configuration.createAction).hidden) !== null && _state$configuration$13 !== void 0 && _state$configuration$13.call(_state$configuration$14, data)) && /*#__PURE__*/jsx(ActionButton, {
23744
+ }), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && !((_state$configuration$10 = (_state$configuration$11 = state.configuration.createAction).hidden) !== null && _state$configuration$10 !== void 0 && _state$configuration$10.call(_state$configuration$11, data)) && /*#__PURE__*/jsx(ActionButton, {
23805
23745
  action: state.configuration.createAction,
23806
23746
  callback: function callback(data) {
23807
- var _state$onUpdate, _state$configuration$15, _state$configuration$16;
23747
+ var _state$onUpdate, _state$configuration$12, _state$configuration$13;
23808
23748
  (_state$onUpdate = state.onUpdate) === null || _state$onUpdate === void 0 || _state$onUpdate.call(state, data);
23809
- (_state$configuration$15 = state.configuration.createAction) === null || _state$configuration$15 === void 0 || (_state$configuration$16 = _state$configuration$15.callback) === null || _state$configuration$16 === void 0 || _state$configuration$16.call(_state$configuration$15, data);
23749
+ (_state$configuration$12 = state.configuration.createAction) === null || _state$configuration$12 === void 0 || (_state$configuration$13 = _state$configuration$12.callback) === null || _state$configuration$13 === void 0 || _state$configuration$13.call(_state$configuration$12, data);
23810
23750
  },
23811
23751
  type: "Button",
23812
23752
  id: 'create',
23813
23753
  defaultLabel: t('backoffice.table.emailtemplates.createAction.title'),
23814
23754
  isCreateButton: true,
23815
- disabled: state.configuration.createAction.disableOnToggle === !!state.globalFilter.toggle || ((_state$configuration$17 = (_state$configuration$18 = state.configuration.createAction).disabled) === null || _state$configuration$17 === void 0 ? void 0 : _state$configuration$17.call(_state$configuration$18, data)),
23755
+ disabled: state.configuration.createAction.disableOnToggle === !!state.globalFilter.toggle || ((_state$configuration$14 = (_state$configuration$15 = state.configuration.createAction).disabled) === null || _state$configuration$14 === void 0 ? void 0 : _state$configuration$14.call(_state$configuration$15, data)),
23816
23756
  data: state.configuration.createActionMapping ? aplyMapping({
23817
23757
  mapable: {},
23818
23758
  mapping: state.configuration.createActionMapping,
@@ -23860,13 +23800,13 @@ var TableWrapper = function TableWrapper(_ref) {
23860
23800
  className: "andt-table",
23861
23801
  scroll: {
23862
23802
  x: '100%',
23863
- y: (_state$configuration$19 = state.configuration.height) !== null && _state$configuration$19 !== void 0 ? _state$configuration$19 : '100%'
23803
+ y: (_state$configuration$16 = state.configuration.height) !== null && _state$configuration$16 !== void 0 ? _state$configuration$16 : '100%'
23864
23804
  },
23865
23805
  rowClassName: editableRow,
23866
23806
  components: cellRenderer,
23867
23807
  rowKey: function rowKey(dataRow) {
23868
- var _state$configuration$20, _state$configuration$21;
23869
- return goTroughObject(dataRow, (_state$configuration$20 = (_state$configuration$21 = state.configuration.rowKey) === null || _state$configuration$21 === void 0 ? void 0 : _state$configuration$21.split('.')) !== null && _state$configuration$20 !== void 0 ? _state$configuration$20 : ['_id'], 0);
23808
+ var _state$configuration$17, _state$configuration$18;
23809
+ return goTroughObject(dataRow, (_state$configuration$17 = (_state$configuration$18 = state.configuration.rowKey) === null || _state$configuration$18 === void 0 ? void 0 : _state$configuration$18.split('.')) !== null && _state$configuration$17 !== void 0 ? _state$configuration$17 : ['_id'], 0);
23870
23810
  },
23871
23811
  dataSource: data,
23872
23812
  loading: state.loading,
@@ -23936,22 +23876,22 @@ function DeleteButton(_ref2) {
23936
23876
  });
23937
23877
  }
23938
23878
  function CopyButton(_ref3) {
23939
- var _state$configuration$25;
23879
+ var _state$configuration$22;
23940
23880
  var state = _ref3.state;
23941
23881
  var root = useStore();
23942
- var apiHandler = new _default$d({
23882
+ new _default$d({
23943
23883
  apiInterface: state.configuration.apiInterface,
23944
23884
  type: 'Table'
23945
23885
  }, root);
23946
23886
  var onCopy = /*#__PURE__*/function () {
23947
23887
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
23948
- var _state$configuration$22;
23888
+ var _state$configuration$19;
23949
23889
  var copyAction, _iterator3, _step3, selectedRow;
23950
23890
  return _regeneratorRuntime.wrap(function _callee$(_context) {
23951
23891
  while (1) switch (_context.prev = _context.next) {
23952
23892
  case 0:
23953
23893
  copyAction = state.configuration.copyAction;
23954
- if (((_state$configuration$22 = state.configuration.copyAction) === null || _state$configuration$22 === void 0 ? void 0 : _state$configuration$22.apiInterface) != undefined) {
23894
+ if (((_state$configuration$19 = state.configuration.copyAction) === null || _state$configuration$19 === void 0 ? void 0 : _state$configuration$19.apiInterface) != undefined) {
23955
23895
  _iterator3 = _createForOfIteratorHelper$4(state.selected);
23956
23896
  try {
23957
23897
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -23986,28 +23926,22 @@ function CopyButton(_ref3) {
23986
23926
  }();
23987
23927
  var onCopyAction = /*#__PURE__*/function () {
23988
23928
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
23989
- var _state$configuration$23, _state$configuration$24;
23990
- var copyAction, id, filter, data;
23929
+ var _state$configuration$20, _state$configuration$21;
23930
+ var copyAction, id, data;
23991
23931
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
23992
23932
  while (1) switch (_context3.prev = _context3.next) {
23993
23933
  case 0:
23994
23934
  copyAction = state.configuration.copyAction;
23995
- if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$23 = state.configuration.createAction) === null || _state$configuration$23 === void 0 ? void 0 : _state$configuration$23.actionType) != 'Detail')) {
23935
+ if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$20 = state.configuration.createAction) === null || _state$configuration$20 === void 0 ? void 0 : _state$configuration$20.actionType) != 'Detail')) {
23996
23936
  _context3.next = 3;
23997
23937
  break;
23998
23938
  }
23999
23939
  throw new Error('configuration needs to be of type Detail');
24000
23940
  case 3:
24001
23941
  id = state.selected[0];
24002
- filter = {};
24003
- filter['_id'] = [id, 'eq', false];
24004
- _context3.next = 8;
24005
- return apiHandler.readList(undefined, undefined, {
24006
- pagination: {},
24007
- columns: [],
24008
- filters: filter
24009
- });
24010
- case 8:
23942
+ _context3.next = 6;
23943
+ return state.getDataById(id);
23944
+ case 6:
24011
23945
  data = _context3.sent;
24012
23946
  data.data[0] = aplyMapping({
24013
23947
  mapable: {},
@@ -24022,7 +23956,7 @@ function CopyButton(_ref3) {
24022
23956
  configurationId: copyAction === null || copyAction === void 0 ? void 0 : copyAction.id,
24023
23957
  data: data.data[0],
24024
23958
  type: copyAction === null || copyAction === void 0 ? void 0 : copyAction.type,
24025
- mapping: (_state$configuration$24 = state.configuration.createAction) === null || _state$configuration$24 === void 0 ? void 0 : _state$configuration$24.mapping,
23959
+ mapping: (_state$configuration$21 = state.configuration.createAction) === null || _state$configuration$21 === void 0 ? void 0 : _state$configuration$21.mapping,
24026
23960
  mappingData: data.data[0],
24027
23961
  callback: function () {
24028
23962
  var _callback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
@@ -24032,6 +23966,8 @@ function CopyButton(_ref3) {
24032
23966
  _context2.next = 2;
24033
23967
  return state.onUpdate(e);
24034
23968
  case 2:
23969
+ if (copyAction.resetToggleAfter) state.resetToggle();
23970
+ case 3:
24035
23971
  case "end":
24036
23972
  return _context2.stop();
24037
23973
  }
@@ -24043,7 +23979,7 @@ function CopyButton(_ref3) {
24043
23979
  return callback;
24044
23980
  }()
24045
23981
  });
24046
- case 11:
23982
+ case 9:
24047
23983
  case "end":
24048
23984
  return _context3.stop();
24049
23985
  }
@@ -24058,7 +23994,7 @@ function CopyButton(_ref3) {
24058
23994
  return /*#__PURE__*/jsx(Button, {
24059
23995
  type: "primary",
24060
23996
  onClick: onCopy,
24061
- disabled: state.selected.length == 0 || state.selected.length > 1 && ((_state$configuration$25 = state.configuration.copyAction) === null || _state$configuration$25 === void 0 ? void 0 : _state$configuration$25.disableOnMultiselect),
23997
+ disabled: state.selected.length == 0 || state.selected.length > 1 && ((_state$configuration$22 = state.configuration.copyAction) === null || _state$configuration$22 === void 0 ? void 0 : _state$configuration$22.disableOnMultiselect),
24062
23998
  children: t('backoffice.basetable.copy')
24063
23999
  });
24064
24000
  }
@@ -24210,7 +24146,7 @@ function BulkAction(_ref6) {
24210
24146
  _context4.t5 = _context4.sent;
24211
24147
  _context4.t4.push.call(_context4.t4, _context4.t5);
24212
24148
  case 29:
24213
- if (progressBar) progressBar.setProgressBarPercentage(Math.floor((i + 1 / selectedData.length) * 100));
24149
+ if (progressBar) progressBar.setProgressBarPercentage(Math.floor(i / selectedData.length * 100));
24214
24150
  case 30:
24215
24151
  i++;
24216
24152
  _context4.next = 4;
@@ -24218,22 +24154,27 @@ function BulkAction(_ref6) {
24218
24154
  case 33:
24219
24155
  state.onUpdate(data);
24220
24156
  if (progressBar) {
24157
+ progressBar.setProgressBarPercentage(100);
24221
24158
  progressBar.setProgressBarOpen(false);
24222
24159
  progressBar.setProgressBarPercentage(0);
24223
24160
  }
24224
- _context4.next = 41;
24161
+ _context4.next = 42;
24225
24162
  break;
24226
24163
  case 37:
24227
24164
  _context4.prev = 37;
24228
24165
  _context4.t6 = _context4["catch"](2);
24166
+ if (progressBar) {
24167
+ progressBar.setProgressBarOpen(false);
24168
+ progressBar.setProgressBarPercentage(0);
24169
+ }
24229
24170
  LOG$3.error(new DivaError('Error changing data', {
24230
24171
  cause: _context4.t6,
24231
24172
  code: 'BACKO_0002'
24232
24173
  }));
24233
24174
  setShowPopover(t('errorcodes._source.labels.error.BACKO_0002'));
24234
- case 41:
24235
- (_action$callback = action.callback) === null || _action$callback === void 0 || _action$callback.call(action, updatedData);
24236
24175
  case 42:
24176
+ (_action$callback = action.callback) === null || _action$callback === void 0 || _action$callback.call(action, updatedData);
24177
+ case 43:
24237
24178
  case "end":
24238
24179
  return _context4.stop();
24239
24180
  }
@@ -24272,6 +24213,8 @@ function BulkAction(_ref6) {
24272
24213
  }
24273
24214
  function SelectionText(_ref8) {
24274
24215
  var selected = _ref8.selected;
24216
+ var _useTranslation5 = useTranslation(),
24217
+ t = _useTranslation5.t;
24275
24218
  if (!(selected !== null && selected !== void 0 && selected.length)) {
24276
24219
  return /*#__PURE__*/jsx(Fragment, {});
24277
24220
  }
@@ -24281,7 +24224,7 @@ function SelectionText(_ref8) {
24281
24224
  fontWeight: 'normal',
24282
24225
  fontSize: 'small'
24283
24226
  },
24284
- children: "".concat(selected.length, " Eintr\xE4ge ausgew\xE4hlt")
24227
+ children: "".concat(selected.length, " ") + t('backoffice.table.selected_entries')
24285
24228
  });
24286
24229
  }
24287
24230
 
@@ -25165,16 +25108,44 @@ function useTableData$1 (_ref) {
25165
25108
  });
25166
25109
  }
25167
25110
  };
25111
+ var getDataById = /*#__PURE__*/function () {
25112
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(id) {
25113
+ var filters, data;
25114
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
25115
+ while (1) switch (_context.prev = _context.next) {
25116
+ case 0:
25117
+ filters = {};
25118
+ filters['_id'] = [id, 'eq', false];
25119
+ _context.next = 4;
25120
+ return apiHandler.readList(configuration.mapping, {
25121
+ pagination: _objectSpread$h({}, state.pagination),
25122
+ columns: configuration.columns,
25123
+ filters: filters,
25124
+ sorter: filterData.sorter
25125
+ });
25126
+ case 4:
25127
+ data = _context.sent;
25128
+ return _context.abrupt("return", data);
25129
+ case 6:
25130
+ case "end":
25131
+ return _context.stop();
25132
+ }
25133
+ }, _callee);
25134
+ }));
25135
+ return function getDataById(_x) {
25136
+ return _ref2.apply(this, arguments);
25137
+ };
25138
+ }();
25168
25139
  var onSelect = function onSelect(keys) {
25169
25140
  setState(_objectSpread$h(_objectSpread$h({}, state), {}, {
25170
25141
  selected: keys
25171
25142
  }));
25172
25143
  };
25173
25144
  var onDelete = /*#__PURE__*/function () {
25174
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
25145
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
25175
25146
  var newData, deleted, _loop, mappingData, index, total, pages, current, data;
25176
- return _regeneratorRuntime.wrap(function _callee$(_context2) {
25177
- while (1) switch (_context2.prev = _context2.next) {
25147
+ return _regeneratorRuntime.wrap(function _callee2$(_context3) {
25148
+ while (1) switch (_context3.prev = _context3.next) {
25178
25149
  case 0:
25179
25150
  setState(_objectSpread$h(_objectSpread$h({}, state), {}, {
25180
25151
  deleting: true
@@ -25184,24 +25155,24 @@ function useTableData$1 (_ref) {
25184
25155
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(index) {
25185
25156
  var _newData$filter, _configuration$delete;
25186
25157
  var id, deleteResult, deletedIndex;
25187
- return _regeneratorRuntime.wrap(function _loop$(_context) {
25188
- while (1) switch (_context.prev = _context.next) {
25158
+ return _regeneratorRuntime.wrap(function _loop$(_context2) {
25159
+ while (1) switch (_context2.prev = _context2.next) {
25189
25160
  case 0:
25190
25161
  id = state.selected[index];
25191
25162
  mappingData = (_newData$filter = newData.filter(function (nd) {
25192
25163
  return nd._id === state.selected[index];
25193
25164
  })) === null || _newData$filter === void 0 ? void 0 : _newData$filter[0];
25194
25165
  mappingData = _objectSpread$h(_objectSpread$h({}, mappingData), state.mappingData);
25195
- _context.next = 5;
25166
+ _context2.next = 5;
25196
25167
  return apiHandler["delete"](id, (_configuration$delete = configuration.deleteMapping) !== null && _configuration$delete !== void 0 ? _configuration$delete : configuration.mapping, mappingData, true);
25197
25168
  case 5:
25198
- deleteResult = _context.sent;
25169
+ deleteResult = _context2.sent;
25199
25170
  if (deleteResult) {
25200
- _context.next = 9;
25171
+ _context2.next = 9;
25201
25172
  break;
25202
25173
  }
25203
25174
  setError('Fehler beim löschen eines Elementes.');
25204
- return _context.abrupt("return", 1);
25175
+ return _context2.abrupt("return", 1);
25205
25176
  case 9:
25206
25177
  deletedIndex = newData.findIndex(function (d) {
25207
25178
  return (d === null || d === void 0 ? void 0 : d._id) == id;
@@ -25210,36 +25181,36 @@ function useTableData$1 (_ref) {
25210
25181
  deleted++;
25211
25182
  case 12:
25212
25183
  case "end":
25213
- return _context.stop();
25184
+ return _context2.stop();
25214
25185
  }
25215
25186
  }, _loop);
25216
25187
  });
25217
25188
  index = 0;
25218
25189
  case 5:
25219
25190
  if (!(index < state.selected.length)) {
25220
- _context2.next = 12;
25191
+ _context3.next = 12;
25221
25192
  break;
25222
25193
  }
25223
- return _context2.delegateYield(_loop(index), "t0", 7);
25194
+ return _context3.delegateYield(_loop(index), "t0", 7);
25224
25195
  case 7:
25225
- if (!_context2.t0) {
25226
- _context2.next = 9;
25196
+ if (!_context3.t0) {
25197
+ _context3.next = 9;
25227
25198
  break;
25228
25199
  }
25229
- return _context2.abrupt("continue", 9);
25200
+ return _context3.abrupt("continue", 9);
25230
25201
  case 9:
25231
25202
  index++;
25232
- _context2.next = 5;
25203
+ _context3.next = 5;
25233
25204
  break;
25234
25205
  case 12:
25235
25206
  total = state.pagination.total - deleted;
25236
25207
  pages = Math.ceil(total / state.pagination.pageSize);
25237
25208
  current = state.pagination.current > pages ? pages || 1 : state.pagination.current;
25238
25209
  if (!(pages > 0 && state.pagination.current > pages && filterServerSide || state.selected.length === 0)) {
25239
- _context2.next = 21;
25210
+ _context3.next = 21;
25240
25211
  break;
25241
25212
  }
25242
- _context2.next = 18;
25213
+ _context3.next = 18;
25243
25214
  return apiHandler.readList(configuration.mapping, {
25244
25215
  pagination: _objectSpread$h(_objectSpread$h({}, state.pagination), {}, {
25245
25216
  current: current
@@ -25249,7 +25220,7 @@ function useTableData$1 (_ref) {
25249
25220
  sorter: filterData.sorter
25250
25221
  });
25251
25222
  case 18:
25252
- data = _context2.sent;
25223
+ data = _context3.sent;
25253
25224
  newData = data.data;
25254
25225
  total = data.total;
25255
25226
  case 21:
@@ -25264,12 +25235,12 @@ function useTableData$1 (_ref) {
25264
25235
  }));
25265
25236
  case 22:
25266
25237
  case "end":
25267
- return _context2.stop();
25238
+ return _context3.stop();
25268
25239
  }
25269
- }, _callee);
25240
+ }, _callee2);
25270
25241
  }));
25271
25242
  return function onDelete() {
25272
- return _ref2.apply(this, arguments);
25243
+ return _ref3.apply(this, arguments);
25273
25244
  };
25274
25245
  }();
25275
25246
  function setLoading() {
@@ -25289,6 +25260,10 @@ function useTableData$1 (_ref) {
25289
25260
  onChange: onChange,
25290
25261
  onUpdate: onUpdate,
25291
25262
  onDelete: onDelete,
25263
+ getDataById: getDataById,
25264
+ resetToggle: function resetToggle() {
25265
+ throw new Error('not implemented for CatalogTable');
25266
+ },
25292
25267
  triggerRefresh: function triggerRefresh() {
25293
25268
  throw new Error('not implemented for CatalogTable');
25294
25269
  },
@@ -25638,38 +25613,74 @@ function useTableData (_ref) {
25638
25613
  }
25639
25614
  return title;
25640
25615
  }, [configuration.title, parentData]);
25616
+ var getDataById = /*#__PURE__*/function () {
25617
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id) {
25618
+ var _configuration$filter9;
25619
+ var filters, ssf, data;
25620
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
25621
+ while (1) switch (_context2.prev = _context2.next) {
25622
+ case 0:
25623
+ filters = {};
25624
+ filters['_id'] = [id, 'eq', false];
25625
+ ssf = _objectSpread$g({
25626
+ pagination: {
25627
+ current: 1,
25628
+ pageSize: 1
25629
+ },
25630
+ columns: configuration.columns,
25631
+ filters: filters
25632
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter9 = configuration.filter) !== null && _configuration$filter9 !== void 0 && (_configuration$filter9 = _configuration$filter9.toggle) !== null && _configuration$filter9 !== void 0 && _configuration$filter9.inQuery ? {
25633
+ genericProps: globalFilter.toggle
25634
+ } : undefined);
25635
+ _context2.next = 5;
25636
+ return apiHandler.readList(parentMapping || configuration.mapping, mapping, ssf);
25637
+ case 5:
25638
+ data = _context2.sent;
25639
+ return _context2.abrupt("return", data);
25640
+ case 7:
25641
+ case "end":
25642
+ return _context2.stop();
25643
+ }
25644
+ }, _callee2);
25645
+ }));
25646
+ return function getDataById(_x2) {
25647
+ return _ref4.apply(this, arguments);
25648
+ };
25649
+ }();
25641
25650
  var onChange = /*#__PURE__*/function () {
25642
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(p) {
25643
- var _configuration$filter9, _configuration$filter10, _configuration$filter11, _prefilter$select, _configuration$filter12, _configuration$filter13;
25651
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(p) {
25652
+ var _configuration$filter10, _configuration$filter11, _configuration$filter12, _prefilter$select, _configuration$filter13, _configuration$filter14;
25644
25653
  var prefilter,
25645
25654
  refresh,
25655
+ clearSelection,
25646
25656
  currentData,
25647
25657
  filterData,
25648
25658
  currentFilterHash,
25649
25659
  currentPagination,
25650
25660
  currentUrl,
25651
- _configuration$filter14,
25661
+ _configuration$filter15,
25652
25662
  ssf,
25653
25663
  data,
25654
25664
  _data3,
25655
25665
  _aplyFilterAndSortati2,
25656
25666
  _data4,
25657
25667
  pagination,
25658
- _args2 = arguments;
25659
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
25660
- while (1) switch (_context2.prev = _context2.next) {
25668
+ _args3 = arguments;
25669
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
25670
+ while (1) switch (_context3.prev = _context3.next) {
25661
25671
  case 0:
25662
- prefilter = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : globalFilter;
25663
- refresh = _args2.length > 2 ? _args2[2] : undefined;
25672
+ prefilter = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : globalFilter;
25673
+ refresh = _args3.length > 2 ? _args3[2] : undefined;
25674
+ clearSelection = _args3.length > 3 ? _args3[3] : undefined;
25664
25675
  setState(_objectSpread$g(_objectSpread$g({}, state), {}, {
25665
25676
  loading: true
25666
25677
  }));
25667
25678
  currentData = initData;
25668
- filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter9 = configuration.filter) !== null && _configuration$filter9 !== void 0 && (_configuration$filter9 = _configuration$filter9.toggle) !== null && _configuration$filter9 !== void 0 && _configuration$filter9.inQuery) ? prefilter.toggle : undefined), ((_configuration$filter10 = configuration.filter) === null || _configuration$filter10 === void 0 || (_configuration$filter10 = _configuration$filter10.select) === null || _configuration$filter10 === void 0 ? void 0 : _configuration$filter10.applyDefaultValue) !== false || ((_configuration$filter11 = configuration.filter) === null || _configuration$filter11 === void 0 || (_configuration$filter11 = _configuration$filter11.select) === null || _configuration$filter11 === void 0 ? void 0 : _configuration$filter11.defaultValue) !== ((_prefilter$select = prefilter.select) === null || _prefilter$select === void 0 || (_prefilter$select = _prefilter$select[(_configuration$filter12 = (_configuration$filter13 = configuration.filter) === null || _configuration$filter13 === void 0 || (_configuration$filter13 = _configuration$filter13.select) === null || _configuration$filter13 === void 0 ? void 0 : _configuration$filter13.filterField) !== null && _configuration$filter12 !== void 0 ? _configuration$filter12 : '']) === null || _prefilter$select === void 0 ? void 0 : _prefilter$select[0]) ? prefilter.select : undefined), prefilter.timeStamp), prefilter["default"]); //remove all null values
25669
- filterData = Object.fromEntries(Object.entries(filterData).filter(function (_ref5) {
25670
- var _ref6 = _slicedToArray(_ref5, 2);
25671
- _ref6[0];
25672
- var v = _ref6[1];
25679
+ filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter10 = configuration.filter) !== null && _configuration$filter10 !== void 0 && (_configuration$filter10 = _configuration$filter10.toggle) !== null && _configuration$filter10 !== void 0 && _configuration$filter10.inQuery) ? prefilter.toggle : undefined), ((_configuration$filter11 = configuration.filter) === null || _configuration$filter11 === void 0 || (_configuration$filter11 = _configuration$filter11.select) === null || _configuration$filter11 === void 0 ? void 0 : _configuration$filter11.applyDefaultValue) !== false || ((_configuration$filter12 = configuration.filter) === null || _configuration$filter12 === void 0 || (_configuration$filter12 = _configuration$filter12.select) === null || _configuration$filter12 === void 0 ? void 0 : _configuration$filter12.defaultValue) !== ((_prefilter$select = prefilter.select) === null || _prefilter$select === void 0 || (_prefilter$select = _prefilter$select[(_configuration$filter13 = (_configuration$filter14 = configuration.filter) === null || _configuration$filter14 === void 0 || (_configuration$filter14 = _configuration$filter14.select) === null || _configuration$filter14 === void 0 ? void 0 : _configuration$filter14.filterField) !== null && _configuration$filter13 !== void 0 ? _configuration$filter13 : '']) === null || _prefilter$select === void 0 ? void 0 : _prefilter$select[0]) ? prefilter.select : undefined), prefilter.timeStamp), prefilter["default"]); //remove all null values
25680
+ filterData = Object.fromEntries(Object.entries(filterData).filter(function (_ref6) {
25681
+ var _ref7 = _slicedToArray(_ref6, 2);
25682
+ _ref7[0];
25683
+ var v = _ref7[1];
25673
25684
  return v != null;
25674
25685
  }));
25675
25686
  currentFilterHash = objectHash(filterData);
@@ -25678,7 +25689,7 @@ function useTableData (_ref) {
25678
25689
  });
25679
25690
  filterHash.current = currentFilterHash;
25680
25691
  if (!filterServerSide) {
25681
- _context2.next = 19;
25692
+ _context3.next = 20;
25682
25693
  break;
25683
25694
  }
25684
25695
  ssf = _objectSpread$g({
@@ -25686,32 +25697,32 @@ function useTableData (_ref) {
25686
25697
  columns: configuration.columns,
25687
25698
  filters: filterData,
25688
25699
  sorter: p.sorter
25689
- }, configuration !== null && configuration !== void 0 && (_configuration$filter14 = configuration.filter) !== null && _configuration$filter14 !== void 0 && (_configuration$filter14 = _configuration$filter14.toggle) !== null && _configuration$filter14 !== void 0 && _configuration$filter14.inQuery ? {
25700
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter15 = configuration.filter) !== null && _configuration$filter15 !== void 0 && (_configuration$filter15 = _configuration$filter15.toggle) !== null && _configuration$filter15 !== void 0 && _configuration$filter15.inQuery ? {
25690
25701
  genericProps: prefilter.toggle
25691
25702
  } : undefined);
25692
- _context2.next = 13;
25703
+ _context3.next = 14;
25693
25704
  return apiHandler.readList(parentMapping || configuration.mapping, mapping, ssf);
25694
- case 13:
25695
- data = _context2.sent;
25705
+ case 14:
25706
+ data = _context3.sent;
25696
25707
  currentUrl = apiHandler.getReadListUrl(parentMapping || configuration.mapping, mapping, ssf);
25697
25708
  currentData = data.data;
25698
25709
  currentPagination = _objectSpread$g(_objectSpread$g({}, currentPagination), {}, {
25699
25710
  total: data.total
25700
25711
  });
25701
- _context2.next = 28;
25712
+ _context3.next = 29;
25702
25713
  break;
25703
- case 19:
25714
+ case 20:
25704
25715
  if (!(!currentData || currentData.length === 0 || refresh)) {
25705
- _context2.next = 25;
25716
+ _context3.next = 26;
25706
25717
  break;
25707
25718
  }
25708
- _context2.next = 22;
25719
+ _context3.next = 23;
25709
25720
  return apiHandler.readList(parentMapping || configuration.mapping, mapping, undefined);
25710
- case 22:
25711
- _data3 = _context2.sent;
25721
+ case 23:
25722
+ _data3 = _context3.sent;
25712
25723
  currentData = _data3.data;
25713
25724
  setInitData(currentData);
25714
- case 25:
25725
+ case 26:
25715
25726
  _aplyFilterAndSortati2 = aplyFilterAndSortation(_objectSpread$g(_objectSpread$g({}, p), {}, {
25716
25727
  pagination: currentPagination,
25717
25728
  filters: filterData,
@@ -25720,7 +25731,7 @@ function useTableData (_ref) {
25720
25731
  })), _data4 = _aplyFilterAndSortati2.data, pagination = _aplyFilterAndSortati2.pagination;
25721
25732
  currentData = _data4;
25722
25733
  currentPagination = pagination;
25723
- case 28:
25734
+ case 29:
25724
25735
  setState(_objectSpread$g(_objectSpread$g({}, state), {}, {
25725
25736
  loading: false,
25726
25737
  data: currentData,
@@ -25729,19 +25740,21 @@ function useTableData (_ref) {
25729
25740
  prefilter: prefilter
25730
25741
  }),
25731
25742
  currentFetchUrl: currentUrl
25732
- }));
25743
+ }, clearSelection ? {
25744
+ selected: []
25745
+ } : {}));
25733
25746
  setFilter({
25734
25747
  filters: p.filters,
25735
25748
  sorter: p.sorter
25736
25749
  });
25737
- case 30:
25750
+ case 31:
25738
25751
  case "end":
25739
- return _context2.stop();
25752
+ return _context3.stop();
25740
25753
  }
25741
- }, _callee2);
25754
+ }, _callee3);
25742
25755
  }));
25743
- return function onChange(_x2) {
25744
- return _ref4.apply(this, arguments);
25756
+ return function onChange(_x3) {
25757
+ return _ref5.apply(this, arguments);
25745
25758
  };
25746
25759
  }();
25747
25760
  var onSelect = function onSelect(keys) {
@@ -25750,11 +25763,11 @@ function useTableData (_ref) {
25750
25763
  }));
25751
25764
  };
25752
25765
  var onDelete = /*#__PURE__*/function () {
25753
- var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
25766
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
25754
25767
  var _configuration$apiInt2;
25755
- var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$filter15, _configuration$filter16, data;
25756
- return _regeneratorRuntime.wrap(function _callee3$(_context4) {
25757
- while (1) switch (_context4.prev = _context4.next) {
25768
+ var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$filter16, _configuration$filter17, data;
25769
+ return _regeneratorRuntime.wrap(function _callee4$(_context5) {
25770
+ while (1) switch (_context5.prev = _context5.next) {
25758
25771
  case 0:
25759
25772
  setState(_objectSpread$g(_objectSpread$g({}, state), {}, {
25760
25773
  deleting: true
@@ -25762,15 +25775,15 @@ function useTableData (_ref) {
25762
25775
  newData = _toConsumableArray(state.data);
25763
25776
  newInitData = initData ? _toConsumableArray(initData) : undefined;
25764
25777
  deleted = 0;
25765
- _context4.next = 6;
25778
+ _context5.next = 6;
25766
25779
  return _typeof(configuration.apiInterface) == 'object' && _typeof(configuration.apiInterface["delete"]) == 'object' ? (_configuration$apiInt2 = configuration.apiInterface["delete"]) === null || _configuration$apiInt2 === void 0 ? void 0 : _configuration$apiInt2.permission : undefined;
25767
25780
  case 6:
25768
- userPermissions = _context4.sent;
25781
+ userPermissions = _context5.sent;
25769
25782
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(index) {
25770
- var _configuration$rowKey, _configuration$filter17, _configuration$filter18;
25783
+ var _configuration$filter18, _configuration$filter19;
25771
25784
  var id, _newData$filter, _newData$filter2, mapToggle, _iterator, _step, _globalFilter$toggle, field, _globalFilter$toggle2, _configuration$delete, _configuration$onErro, _configuration$onErro2, deletedIndex, initDeletedIndex;
25772
- return _regeneratorRuntime.wrap(function _loop$(_context3) {
25773
- while (1) switch (_context3.prev = _context3.next) {
25785
+ return _regeneratorRuntime.wrap(function _loop$(_context4) {
25786
+ while (1) switch (_context4.prev = _context4.next) {
25774
25787
  case 0:
25775
25788
  id = state.selected[index];
25776
25789
  if (configuration.rowKey) {
@@ -25783,7 +25796,7 @@ function useTableData (_ref) {
25783
25796
  })) === null || _newData$filter2 === void 0 ? void 0 : _newData$filter2[0];
25784
25797
  }
25785
25798
  mapToggle = {};
25786
- _iterator = _createForOfIteratorHelper$3((_configuration$filter17 = (_configuration$filter18 = configuration.filter) === null || _configuration$filter18 === void 0 || (_configuration$filter18 = _configuration$filter18.toggle) === null || _configuration$filter18 === void 0 ? void 0 : _configuration$filter18.fields) !== null && _configuration$filter17 !== void 0 ? _configuration$filter17 : []);
25799
+ _iterator = _createForOfIteratorHelper$3((_configuration$filter18 = (_configuration$filter19 = configuration.filter) === null || _configuration$filter19 === void 0 || (_configuration$filter19 = _configuration$filter19.toggle) === null || _configuration$filter19 === void 0 ? void 0 : _configuration$filter19.fields) !== null && _configuration$filter18 !== void 0 ? _configuration$filter18 : []);
25787
25800
  try {
25788
25801
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
25789
25802
  field = _step.value;
@@ -25798,107 +25811,106 @@ function useTableData (_ref) {
25798
25811
  }
25799
25812
  mappingData = _objectSpread$g(_objectSpread$g(_objectSpread$g({}, mappingData), state.mappingData), mapToggle);
25800
25813
  deleteResult = undefined;
25801
- _context3.prev = 7;
25814
+ _context4.prev = 7;
25802
25815
  if (!(userPermissions && !root.actions.userHasPermission(userPermissions))) {
25803
- _context3.next = 11;
25816
+ _context4.next = 11;
25804
25817
  break;
25805
25818
  }
25806
25819
  setError('Sie haben keine Berechtigung ein Mediaitem zu löschen.');
25807
- return _context3.abrupt("return", 0);
25820
+ return _context4.abrupt("return", 0);
25808
25821
  case 11:
25809
- _context3.next = 13;
25822
+ _context4.next = 13;
25810
25823
  return apiHandler["delete"](id, (_configuration$delete = configuration.deleteMapping) !== null && _configuration$delete !== void 0 ? _configuration$delete : configuration.mapping, mappingData);
25811
25824
  case 13:
25812
- deleteResult = _context3.sent;
25813
- _context3.next = 24;
25825
+ deleteResult = _context4.sent;
25826
+ _context4.next = 24;
25814
25827
  break;
25815
25828
  case 16:
25816
- _context3.prev = 16;
25817
- _context3.t0 = _context3["catch"](7);
25818
- if (!(_context3.t0 instanceof DivaError && _context3.t0.name)) {
25819
- _context3.next = 22;
25829
+ _context4.prev = 16;
25830
+ _context4.t0 = _context4["catch"](7);
25831
+ if (!(_context4.t0 instanceof DivaError && _context4.t0.name)) {
25832
+ _context4.next = 22;
25820
25833
  break;
25821
25834
  }
25822
- if (!((_configuration$onErro = configuration.onError) !== null && _configuration$onErro !== void 0 && _configuration$onErro[_context3.t0.name])) {
25823
- _context3.next = 22;
25835
+ if (!((_configuration$onErro = configuration.onError) !== null && _configuration$onErro !== void 0 && _configuration$onErro[_context4.t0.name])) {
25836
+ _context4.next = 22;
25824
25837
  break;
25825
25838
  }
25826
- setError((_configuration$onErro2 = configuration.onError) === null || _configuration$onErro2 === void 0 ? void 0 : _configuration$onErro2[_context3.t0.name]);
25827
- return _context3.abrupt("return", 0);
25839
+ setError((_configuration$onErro2 = configuration.onError) === null || _configuration$onErro2 === void 0 ? void 0 : _configuration$onErro2[_context4.t0.name]);
25840
+ return _context4.abrupt("return", 0);
25828
25841
  case 22:
25829
- setError(_context3.t0.message);
25830
- return _context3.abrupt("return", 0);
25842
+ setError(_context4.t0.message);
25843
+ return _context4.abrupt("return", 0);
25831
25844
  case 24:
25832
25845
  if (deleteResult) {
25833
- _context3.next = 27;
25846
+ _context4.next = 27;
25834
25847
  break;
25835
25848
  }
25836
25849
  setError('Fehler beim löschen eines Elementes.');
25837
- return _context3.abrupt("return", 1);
25850
+ return _context4.abrupt("return", 1);
25838
25851
  case 27:
25839
- (_configuration$rowKey = configuration.rowKey) !== null && _configuration$rowKey !== void 0 ? _configuration$rowKey : '_id';
25840
25852
  deletedIndex = newData.findIndex(function (d) {
25841
- var _configuration$rowKey2, _configuration$rowKey3;
25842
- return goTroughObject(d, (_configuration$rowKey2 = (_configuration$rowKey3 = configuration.rowKey) === null || _configuration$rowKey3 === void 0 ? void 0 : _configuration$rowKey3.split('.')) !== null && _configuration$rowKey2 !== void 0 ? _configuration$rowKey2 : ['_id']) == id;
25853
+ var _configuration$rowKey, _configuration$rowKey2;
25854
+ return goTroughObject(d, (_configuration$rowKey = (_configuration$rowKey2 = configuration.rowKey) === null || _configuration$rowKey2 === void 0 ? void 0 : _configuration$rowKey2.split('.')) !== null && _configuration$rowKey !== void 0 ? _configuration$rowKey : ['_id']) == id;
25843
25855
  });
25844
25856
  newData.splice(deletedIndex, 1);
25845
25857
  initDeletedIndex = newInitData === null || newInitData === void 0 ? void 0 : newInitData.findIndex(function (d) {
25846
- var _configuration$rowKey4, _configuration$rowKey5;
25847
- return goTroughObject(d, (_configuration$rowKey4 = (_configuration$rowKey5 = configuration.rowKey) === null || _configuration$rowKey5 === void 0 ? void 0 : _configuration$rowKey5.split('.')) !== null && _configuration$rowKey4 !== void 0 ? _configuration$rowKey4 : ['_id']) == id;
25858
+ var _configuration$rowKey3, _configuration$rowKey4;
25859
+ return goTroughObject(d, (_configuration$rowKey3 = (_configuration$rowKey4 = configuration.rowKey) === null || _configuration$rowKey4 === void 0 ? void 0 : _configuration$rowKey4.split('.')) !== null && _configuration$rowKey3 !== void 0 ? _configuration$rowKey3 : ['_id']) == id;
25848
25860
  });
25849
25861
  newInitData === null || newInitData === void 0 || newInitData.splice(initDeletedIndex, 1);
25850
25862
  deleted++;
25851
- case 33:
25863
+ case 32:
25852
25864
  case "end":
25853
- return _context3.stop();
25865
+ return _context4.stop();
25854
25866
  }
25855
25867
  }, _loop, null, [[7, 16]]);
25856
25868
  });
25857
25869
  index = 0;
25858
25870
  case 9:
25859
25871
  if (!(index < state.selected.length)) {
25860
- _context4.next = 19;
25872
+ _context5.next = 19;
25861
25873
  break;
25862
25874
  }
25863
- return _context4.delegateYield(_loop(index), "t0", 11);
25875
+ return _context5.delegateYield(_loop(index), "t0", 11);
25864
25876
  case 11:
25865
- _ret = _context4.t0;
25877
+ _ret = _context5.t0;
25866
25878
  if (!(_ret === 0)) {
25867
- _context4.next = 14;
25879
+ _context5.next = 14;
25868
25880
  break;
25869
25881
  }
25870
- return _context4.abrupt("break", 19);
25882
+ return _context5.abrupt("break", 19);
25871
25883
  case 14:
25872
25884
  if (!(_ret === 1)) {
25873
- _context4.next = 16;
25885
+ _context5.next = 16;
25874
25886
  break;
25875
25887
  }
25876
- return _context4.abrupt("continue", 16);
25888
+ return _context5.abrupt("continue", 16);
25877
25889
  case 16:
25878
25890
  index++;
25879
- _context4.next = 9;
25891
+ _context5.next = 9;
25880
25892
  break;
25881
25893
  case 19:
25882
25894
  total = state.pagination.total - deleted;
25883
25895
  pages = Math.ceil(total / state.pagination.pageSize);
25884
25896
  current = state.pagination.current > pages ? pages : state.pagination.current;
25885
25897
  if (!(state.pagination.current > pages && filterServerSide || state.selected.length === 0)) {
25886
- _context4.next = 28;
25898
+ _context5.next = 28;
25887
25899
  break;
25888
25900
  }
25889
- _context4.next = 25;
25901
+ _context5.next = 25;
25890
25902
  return apiHandler.readList(parentMapping || configuration.mapping, mapping, _objectSpread$g({
25891
25903
  pagination: _objectSpread$g(_objectSpread$g({}, state.pagination), {}, {
25892
25904
  current: current
25893
25905
  }),
25894
25906
  columns: configuration.columns,
25895
- filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter15 = configuration.filter) !== null && _configuration$filter15 !== void 0 && (_configuration$filter15 = _configuration$filter15.toggle) !== null && _configuration$filter15 !== void 0 && _configuration$filter15.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"]),
25907
+ filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter16 = configuration.filter) !== null && _configuration$filter16 !== void 0 && (_configuration$filter16 = _configuration$filter16.toggle) !== null && _configuration$filter16 !== void 0 && _configuration$filter16.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"]),
25896
25908
  sorter: filterData.sorter
25897
- }, configuration !== null && configuration !== void 0 && (_configuration$filter16 = configuration.filter) !== null && _configuration$filter16 !== void 0 && (_configuration$filter16 = _configuration$filter16.toggle) !== null && _configuration$filter16 !== void 0 && _configuration$filter16.inQuery ? {
25909
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter17 = configuration.filter) !== null && _configuration$filter17 !== void 0 && (_configuration$filter17 = _configuration$filter17.toggle) !== null && _configuration$filter17 !== void 0 && _configuration$filter17.inQuery ? {
25898
25910
  genericProps: globalFilter.toggle
25899
25911
  } : undefined));
25900
25912
  case 25:
25901
- data = _context4.sent;
25913
+ data = _context5.sent;
25902
25914
  newData = data.data;
25903
25915
  total = data.total;
25904
25916
  case 28:
@@ -25914,17 +25926,17 @@ function useTableData (_ref) {
25914
25926
  }));
25915
25927
  case 30:
25916
25928
  case "end":
25917
- return _context4.stop();
25929
+ return _context5.stop();
25918
25930
  }
25919
- }, _callee3);
25931
+ }, _callee4);
25920
25932
  }));
25921
25933
  return function onDelete() {
25922
- return _ref7.apply(this, arguments);
25934
+ return _ref8.apply(this, arguments);
25923
25935
  };
25924
25936
  }();
25925
25937
  var onGlobalFilterSelect = function onGlobalFilterSelect(value) {
25926
- var _configuration$filter19;
25927
- if (!((_configuration$filter19 = configuration.filter) !== null && _configuration$filter19 !== void 0 && _configuration$filter19.select)) {
25938
+ var _configuration$filter20;
25939
+ if (!((_configuration$filter20 = configuration.filter) !== null && _configuration$filter20 !== void 0 && _configuration$filter20.select)) {
25928
25940
  LOG$2.error(new DivaError('No global select filter defiend'));
25929
25941
  return;
25930
25942
  }
@@ -25940,8 +25952,8 @@ function useTableData (_ref) {
25940
25952
  }, filterData), newGlobalFilter);
25941
25953
  };
25942
25954
  var onGlobalFilterToggle = function onGlobalFilterToggle() {
25943
- var _configuration$filter20;
25944
- if (!((_configuration$filter20 = configuration.filter) !== null && _configuration$filter20 !== void 0 && _configuration$filter20.toggle)) {
25955
+ var _configuration$filter21;
25956
+ if (!((_configuration$filter21 = configuration.filter) !== null && _configuration$filter21 !== void 0 && _configuration$filter21.toggle)) {
25945
25957
  LOG$2.error(new DivaError('No global toggle filter defined'));
25946
25958
  return;
25947
25959
  }
@@ -25955,11 +25967,14 @@ function useTableData (_ref) {
25955
25967
  setGlobaFilter(newGlobalFilter);
25956
25968
  onChange(_objectSpread$g({
25957
25969
  pagination: state.pagination
25958
- }, filterData), newGlobalFilter);
25970
+ }, filterData), newGlobalFilter, undefined, true);
25971
+ };
25972
+ var resetToggle = function resetToggle() {
25973
+ if (globalFilter !== null && globalFilter !== void 0 && globalFilter.toggle) onGlobalFilterToggle();
25959
25974
  };
25960
25975
  var onGlobalFilterSearch = function onGlobalFilterSearch(value) {
25961
- var _configuration$filter21;
25962
- if (!((_configuration$filter21 = configuration.filter) !== null && _configuration$filter21 !== void 0 && _configuration$filter21.search)) {
25976
+ var _configuration$filter22;
25977
+ if (!((_configuration$filter22 = configuration.filter) !== null && _configuration$filter22 !== void 0 && _configuration$filter22.search)) {
25963
25978
  LOG$2.error(new DivaError('No global search filter defiend'));
25964
25979
  return;
25965
25980
  }
@@ -25967,8 +25982,8 @@ function useTableData (_ref) {
25967
25982
  search: {}
25968
25983
  });
25969
25984
  if (value) {
25970
- var _configuration$filter22;
25971
- (_configuration$filter22 = configuration.filter) === null || _configuration$filter22 === void 0 || _configuration$filter22.search.fields.forEach(function (f) {
25985
+ var _configuration$filter23;
25986
+ (_configuration$filter23 = configuration.filter) === null || _configuration$filter23 === void 0 || _configuration$filter23.search.fields.forEach(function (f) {
25972
25987
  if (typeof f == 'string') {
25973
25988
  newGlobalFilter.search[f] = [value, 'contains', 0];
25974
25989
  } else {
@@ -25982,8 +25997,8 @@ function useTableData (_ref) {
25982
25997
  }, filterData), newGlobalFilter);
25983
25998
  };
25984
25999
  var onGlobalFilterPeriod = function onGlobalFilterPeriod(from, to) {
25985
- var _configuration$filter23;
25986
- if (!((_configuration$filter23 = configuration.filter) !== null && _configuration$filter23 !== void 0 && _configuration$filter23.period)) {
26000
+ var _configuration$filter24;
26001
+ if (!((_configuration$filter24 = configuration.filter) !== null && _configuration$filter24 !== void 0 && _configuration$filter24.period)) {
25987
26002
  LOG$2.error(new DivaError('No global period filter defiend'));
25988
26003
  return;
25989
26004
  }
@@ -26005,7 +26020,9 @@ function useTableData (_ref) {
26005
26020
  onUpdate: onUpdate,
26006
26021
  onDelete: onDelete,
26007
26022
  onSelect: onSelect,
26023
+ getDataById: getDataById,
26008
26024
  triggerRefresh: triggerRefresh,
26025
+ resetToggle: resetToggle,
26009
26026
  onSelectedCatalog: onSelectedCatalog,
26010
26027
  error: error,
26011
26028
  catalogItem: catalogItem,
@@ -28835,7 +28852,8 @@ function useModule (currentModules) {
28835
28852
  },
28836
28853
  type: 'Configurator',
28837
28854
  id: 'WYSIWYG',
28838
- startWidth: 600
28855
+ startWidth: 600,
28856
+ defaultPinned: true
28839
28857
  });
28840
28858
  root.contentStore.tools = tools;
28841
28859
  return function () {
@@ -30898,7 +30916,8 @@ var ArticleSelection = function ArticleSelection(_ref) {
30898
30916
  }), root.contentStore.toolPinned && /*#__PURE__*/jsx(PushpinFilled, {
30899
30917
  onClick: function onClick() {
30900
30918
  return root.contentStore.toolPinned = !root.contentStore.toolPinned;
30901
- }
30919
+ },
30920
+ className: button
30902
30921
  }), /*#__PURE__*/jsx(Select$2, {
30903
30922
  value: articleList.find(function (a) {
30904
30923
  return a.value == articleCodex;
@@ -31085,6 +31104,7 @@ function useWysiwyg$1(_ref) {
31085
31104
  hideMobileFolder: true,
31086
31105
  showSettingsFolder: true,
31087
31106
  hideRalColorFilter: false,
31107
+ showOptionCodexInOptionHeader: true,
31088
31108
  hideSearchBar: false,
31089
31109
  alwaysShowSearchBar: true,
31090
31110
  displayMetaDatas: ['codex'],
@@ -31445,6 +31465,7 @@ var Toolbar = function Toolbar(_ref) {
31445
31465
  });
31446
31466
  if (_tool) {
31447
31467
  root.contentStore.openedToolId = _tool.id;
31468
+ root.contentStore.toolPinned = !!_tool.defaultPinned;
31448
31469
  root.contentStore.hideTools = false;
31449
31470
  }
31450
31471
  }
@@ -31474,6 +31495,7 @@ var Toolbar = function Toolbar(_ref) {
31474
31495
  onClick: function onClick() {
31475
31496
  if (root.contentStore.openedToolId != t.id) {
31476
31497
  root.contentStore.openedToolId = t.id;
31498
+ root.contentStore.toolPinned = !!t.defaultPinned;
31477
31499
  root.contentStore.hideTools = false;
31478
31500
  } else {
31479
31501
  root.contentStore.hideTools = !root.contentStore.hideTools;