@crystaldesign/diva-backoffice 24.2.2-beta.2 → 24.2.2-beta.21

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.
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import React, { createContext, useState, useEffect, useMemo, useCallback, useRef, useImperativeHandle, useReducer, createRef, forwardRef, useContext, memo } from 'react';
3
3
  import 'antd/dist/reset.css';
4
- import { Button, Spin, Descriptions, Select as Select$1, Alert, Modal as Modal$2, Input, Popover, Typography, Divider, Avatar, Form as Form$1, Radio, DatePicker, Checkbox, InputNumber, Card, Tooltip, Upload, Space, Row, Col, Steps, Result as Result$1, Layout, Switch, Menu as Menu$1, Collapse, Table as Table$1, Popconfirm, Tabs, Image, Progress, Slider, Breadcrumb, List as List$1, message, Cascader, Skeleton, Drawer, ConfigProvider, theme } from 'antd';
4
+ import { Button, Spin, Descriptions, Select as Select$2, Alert, Modal as Modal$2, Input, Popover, Typography, Divider, Avatar, Form as Form$1, Radio, DatePicker, Checkbox, InputNumber, Card, Tooltip, Upload, Space, Row, Col, Steps, Result as Result$1, Layout, Switch, Menu as Menu$1, Collapse, Table as Table$1, Popconfirm, Tabs, Image, Progress, Slider, Breadcrumb, List as List$1, message, Cascader, Skeleton, Drawer, ConfigProvider, theme } from 'antd';
5
5
  import { observer } from 'mobx-react-lite';
6
6
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
7
7
  import { getLogger, CoreError, useDivaCore, useTranslation, DivaUtils } from '@crystaldesign/diva-core';
@@ -96,6 +96,7 @@ import classnames from 'classnames';
96
96
  import Collapsible from 'react-collapsible';
97
97
  import QuestionOutlined from '@ant-design/icons/QuestionOutlined';
98
98
  import { TransformWrapper, TransformComponent } from 'react-zoom-pan-pinch';
99
+ import { useTranslation as useTranslation$1 } from 'react-i18next';
99
100
  import { stringify } from 'csv';
100
101
  import InfiniteScroll from 'react-infinite-scroll-component';
101
102
  import ReactCrop from 'react-image-crop';
@@ -1913,26 +1914,28 @@ function loadConfiguration(t, root, config, lang) {
1913
1914
  },
1914
1915
  select: {
1915
1916
  filterField: 'status',
1916
- search: false,
1917
- defaultValue: t('backoffice.table.applicationlogs.filter.dropdown.all'),
1918
- applyDefaultValue: false,
1919
- options: [{
1920
- lable: t('backoffice.table.applicationlogs.filter.dropdown.all'),
1921
- value: '',
1922
- data: ''
1923
- }, {
1924
- lable: 'Timeout',
1925
- value: 'Timeout',
1926
- data: 'TIMEOUT'
1927
- }, {
1928
- lable: 'Success',
1929
- value: 'Success',
1930
- data: 'SUCCESS'
1931
- }, {
1932
- lable: 'Error',
1933
- value: 'Error',
1934
- data: 'ERROR'
1935
- }]
1917
+ settings: {
1918
+ search: false,
1919
+ options: [{
1920
+ label: t('backoffice.table.applicationlogs.filter.dropdown.all'),
1921
+ value: 'ALL',
1922
+ data: 'ALL'
1923
+ }, {
1924
+ label: 'Timeout',
1925
+ value: 'Timeout',
1926
+ data: 'TIMEOUT'
1927
+ }, {
1928
+ label: 'Success',
1929
+ value: 'Success',
1930
+ data: 'SUCCESS'
1931
+ }, {
1932
+ label: 'Error',
1933
+ value: 'Error',
1934
+ data: 'ERROR'
1935
+ }]
1936
+ },
1937
+ defaultValue: 'ALL',
1938
+ applyDefaultValue: false
1936
1939
  }
1937
1940
  },
1938
1941
  mapping: {
@@ -2770,6 +2773,7 @@ function loadConfiguration(t, root, config, lang) {
2770
2773
  canRefresh: true,
2771
2774
  initialCall: false,
2772
2775
  clientRelations: true,
2776
+ dontLoadCatalogData: true,
2773
2777
  columns: [{
2774
2778
  title: t('backoffice.table.partlists.columns.ArticleCodex'),
2775
2779
  field: 'ArticleCodex',
@@ -2825,6 +2829,7 @@ function loadConfiguration(t, root, config, lang) {
2825
2829
  }, {
2826
2830
  title: t('backoffice.table.partlists.columns.RetailPrefix'),
2827
2831
  field: 'RetailPrefix',
2832
+ editable: true,
2828
2833
  sorter: 9,
2829
2834
  filter: 'advanced',
2830
2835
  width: 110
@@ -2978,21 +2983,17 @@ function loadConfiguration(t, root, config, lang) {
2978
2983
  type: 'Form',
2979
2984
  id: 'FormApplicationTranslationsEdit',
2980
2985
  title: t('backoffice.table.translation.title')
2981
- }, {
2982
- actionType: 'Detail',
2983
- type: 'Form',
2984
- id: 'FormApplicationTranslations',
2985
- title: 'Lokalisierung',
2986
- label: t('backoffice.rowAction.title.overwrite')
2987
2986
  }],
2988
2987
  filter: {
2989
2988
  select: {
2990
- search: true,
2989
+ settings: {
2990
+ search: true,
2991
+ apiInterface: {
2992
+ read: '${adminService}/locales/namespaces'
2993
+ }
2994
+ },
2991
2995
  defaultValue: 'default',
2992
- filterField: 'namespace',
2993
- apiInterface: {
2994
- read: '${adminService}/locales/namespaces'
2995
- }
2996
+ filterField: 'namespace'
2996
2997
  },
2997
2998
  search: {
2998
2999
  fields: ['key', 'locales.de.default', 'locales.fr.default', 'locales.en.default', 'locales.it.default']
@@ -3766,33 +3767,9 @@ function loadConfiguration(t, root, config, lang) {
3766
3767
  actionType: 'Modal',
3767
3768
  title: t('backoffice.table.invitations.rowAction.aktivateuser.title'),
3768
3769
  text: t('backoffice.table.invitations.rowAction.aktivateuser.text'),
3769
- label: t('backoffice.table.invitations.rowAction.aktivateuser.label'),
3770
- type: 'Form',
3771
- id: 'FormSendInvitation',
3772
- mapping: {
3773
- type: 'body',
3774
- map: [{
3775
- sourceField: '_id',
3776
- targetField: 'id'
3777
- }, {
3778
- sourceValue: window.location.origin,
3779
- targetField: 'redirectTo'
3780
- }, {
3781
- sourceField: 'organizationId',
3782
- targetField: 'organizationId'
3783
- }]
3770
+ label: function label(data) {
3771
+ return data.send == false ? t('backoffice.table.invitations.rowAction.aktivateuser.label') : t('backoffice.table.invitations.rowAction.resendMail');
3784
3772
  },
3785
- rule: [{
3786
- match: {
3787
- sourceField: 'send',
3788
- value: false
3789
- }
3790
- }]
3791
- }, {
3792
- actionType: 'Modal',
3793
- title: t('backoffice.table.invitations.rowAction.aktivateuser.title'),
3794
- text: t('backoffice.table.invitations.rowAction.aktivateuser.text'),
3795
- label: t('backoffice.table.invitations.rowAction.resendMail'),
3796
3773
  type: 'Form',
3797
3774
  id: 'FormSendInvitation',
3798
3775
  mapping: {
@@ -3807,13 +3784,7 @@ function loadConfiguration(t, root, config, lang) {
3807
3784
  sourceField: 'organizationId',
3808
3785
  targetField: 'organizationId'
3809
3786
  }]
3810
- },
3811
- rule: [{
3812
- match: {
3813
- sourceField: 'send',
3814
- value: true
3815
- }
3816
- }]
3787
+ }
3817
3788
  }]
3818
3789
  },
3819
3790
  TableSubOrganizations: {
@@ -8494,7 +8465,33 @@ function loadConfiguration(t, root, config, lang) {
8494
8465
  var _root$dataStore;
8495
8466
  root === null || root === void 0 || (_root$dataStore = root.dataStore) === null || _root$dataStore === void 0 || _root$dataStore.setSelectedOrganizationId(data._id);
8496
8467
  }
8497
- }
8468
+ },
8469
+ additionalActions: [{
8470
+ actionType: 'Callback',
8471
+ label: t('backoffice.orgtree.openAction'),
8472
+ id: 'ChangeToOrganization',
8473
+ rule: [{
8474
+ or: [{
8475
+ match: {
8476
+ sourceField: 'type',
8477
+ value: 'DEALER'
8478
+ }
8479
+ }, {
8480
+ match: {
8481
+ sourceField: 'type',
8482
+ value: 'RETAILER'
8483
+ }
8484
+ }, {
8485
+ match: {
8486
+ sourceField: 'type',
8487
+ value: 'RETAILERCHILD'
8488
+ }
8489
+ }]
8490
+ }],
8491
+ callback: function callback(data) {
8492
+ root === null || root === void 0 || root.actions.setOrganization(data.id);
8493
+ }
8494
+ }]
8498
8495
  },
8499
8496
  DescriptionCurrentOrganization: {
8500
8497
  type: 'Description',
@@ -11531,6 +11528,7 @@ function ActionButton (_ref) {
11531
11528
  danger = _ref.danger,
11532
11529
  buttonType = _ref.buttonType;
11533
11530
  var root = useStore();
11531
+ var label = typeof action.label == 'function' ? action.label(data) : action.label;
11534
11532
  var ButtonType = type == 'Button' ? Button : A;
11535
11533
  var disable = false;
11536
11534
  if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
@@ -11607,7 +11605,7 @@ function ActionButton (_ref) {
11607
11605
  width: action.width,
11608
11606
  footer: action.footer
11609
11607
  });
11610
- return _context.abrupt("break", 31);
11608
+ return _context.abrupt("break", 34);
11611
11609
  case 8:
11612
11610
  if (!(disable || shouldExecuted && !shouldExecuted())) {
11613
11611
  _context.next = 10;
@@ -11616,7 +11614,7 @@ function ActionButton (_ref) {
11616
11614
  return _context.abrupt("return");
11617
11615
  case 10:
11618
11616
  root.contentStore.setSelectedMenuItem(action.id);
11619
- return _context.abrupt("break", 31);
11617
+ return _context.abrupt("break", 34);
11620
11618
  case 12:
11621
11619
  if (!(disable || shouldExecuted && !shouldExecuted())) {
11622
11620
  _context.next = 14;
@@ -11629,7 +11627,7 @@ function ActionButton (_ref) {
11629
11627
  data: data,
11630
11628
  callback: callback !== null && callback !== void 0 ? callback : function () {}
11631
11629
  });
11632
- return _context.abrupt("break", 31);
11630
+ return _context.abrupt("break", 34);
11633
11631
  case 16:
11634
11632
  apiInterface = new _default$d({
11635
11633
  apiInterface: action.apiInterface,
@@ -11666,8 +11664,16 @@ function ActionButton (_ref) {
11666
11664
  _context.t1 = _context["catch"](17);
11667
11665
  root.error = action.errorText;
11668
11666
  case 30:
11669
- return _context.abrupt("break", 31);
11667
+ return _context.abrupt("break", 34);
11670
11668
  case 31:
11669
+ if (!(disable || shouldExecuted && !shouldExecuted())) {
11670
+ _context.next = 33;
11671
+ break;
11672
+ }
11673
+ return _context.abrupt("return");
11674
+ case 33:
11675
+ callback === null || callback === void 0 || callback(data);
11676
+ case 34:
11671
11677
  case "end":
11672
11678
  return _context.stop();
11673
11679
  }
@@ -11679,13 +11685,13 @@ function ActionButton (_ref) {
11679
11685
  }();
11680
11686
  switch (action.actionType) {
11681
11687
  case 'SwitchButton':
11682
- var lable;
11688
+ var switchLabel;
11683
11689
  var _iterator3 = _createForOfIteratorHelper$h(action.switchLable),
11684
11690
  _step3;
11685
11691
  try {
11686
11692
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
11687
11693
  var element = _step3.value;
11688
- if (element.sourceValue == data[action.switchField]) lable = element.targetValue;
11694
+ if (element.sourceValue == data[action.switchField]) switchLabel = element.targetValue;
11689
11695
  }
11690
11696
  } catch (err) {
11691
11697
  _iterator3.e(err);
@@ -11696,7 +11702,7 @@ function ActionButton (_ref) {
11696
11702
  disabled: disable,
11697
11703
  style: style,
11698
11704
  onClick: onClick,
11699
- children: lable
11705
+ children: switchLabel
11700
11706
  }, id);
11701
11707
  case 'Detail':
11702
11708
  return /*#__PURE__*/jsx(ButtonType, {
@@ -11705,7 +11711,7 @@ function ActionButton (_ref) {
11705
11711
  disabled: disable,
11706
11712
  style: style,
11707
11713
  onClick: onClick,
11708
- children: action.label || defaultLabel
11714
+ children: label || defaultLabel
11709
11715
  }, id);
11710
11716
  case 'GoTo':
11711
11717
  return /*#__PURE__*/jsx(ButtonType, {
@@ -11714,7 +11720,7 @@ function ActionButton (_ref) {
11714
11720
  disabled: disable,
11715
11721
  style: style,
11716
11722
  onClick: onClick,
11717
- children: action.label || defaultLabel
11723
+ children: label || defaultLabel
11718
11724
  }, id);
11719
11725
  case 'Modal':
11720
11726
  return /*#__PURE__*/jsx(ButtonType, {
@@ -11723,7 +11729,7 @@ function ActionButton (_ref) {
11723
11729
  disabled: disable,
11724
11730
  style: style,
11725
11731
  onClick: onClick,
11726
- children: action.label || defaultLabel
11732
+ children: label || defaultLabel
11727
11733
  }, id);
11728
11734
  case 'Download':
11729
11735
  var icon = /*#__PURE__*/jsx(FileExcelOutlined, {});
@@ -11745,7 +11751,16 @@ function ActionButton (_ref) {
11745
11751
  action: action
11746
11752
  });
11747
11753
  },
11748
- children: action.label || icon
11754
+ children: label || icon
11755
+ }, id);
11756
+ case 'Callback':
11757
+ return /*#__PURE__*/jsx(ButtonType, {
11758
+ type: buttonType,
11759
+ danger: danger,
11760
+ disabled: disable,
11761
+ style: style,
11762
+ onClick: onClick,
11763
+ children: label || defaultLabel
11749
11764
  }, id);
11750
11765
  default:
11751
11766
  throw new Error("Action type ".concat(action.actionType, " is not supported"));
@@ -12266,7 +12281,7 @@ var SelectWrapper$1 = function SelectWrapper(_ref) {
12266
12281
  var filterServerSide = _typeof(apiInterface) == 'object' && _typeof(apiInterface.read) == 'object' && apiInterface.read.filterServerSide;
12267
12282
  var selected = state.selected;
12268
12283
  return /*#__PURE__*/jsx(Fragment, {
12269
- children: /*#__PURE__*/jsx(Select$1, {
12284
+ children: /*#__PURE__*/jsx(Select$2, {
12270
12285
  labelInValue: mode === 'tags' ? false : true,
12271
12286
  style: {
12272
12287
  width: '100%',
@@ -12292,7 +12307,7 @@ var SelectWrapper$1 = function SelectWrapper(_ref) {
12292
12307
  })
12293
12308
  });
12294
12309
  };
12295
- var Select = observer(SelectWrapper$1, {
12310
+ var Select$1 = observer(SelectWrapper$1, {
12296
12311
  forwardRef: true
12297
12312
  });
12298
12313
 
@@ -12414,7 +12429,7 @@ var FileUploadWrapper = function FileUploadWrapper(_ref) {
12414
12429
  style: {
12415
12430
  marginTop: 18
12416
12431
  },
12417
- children: /*#__PURE__*/jsx(Select, {
12432
+ children: /*#__PURE__*/jsx(Select$1, {
12418
12433
  mode: "multiple",
12419
12434
  apiInterface: {
12420
12435
  read: {
@@ -13056,7 +13071,7 @@ var Presets = function Presets(_ref) {
13056
13071
  setUsedPreset = _ref.setUsedPreset,
13057
13072
  presets = _ref.presets,
13058
13073
  setPresets = _ref.setPresets;
13059
- var Option = Select$1.Option;
13074
+ var Option = Select$2.Option;
13060
13075
  var _useState = useState(false),
13061
13076
  _useState2 = _slicedToArray(_useState, 2),
13062
13077
  isModalVisible = _useState2[0],
@@ -13160,7 +13175,7 @@ var Presets = function Presets(_ref) {
13160
13175
  setValue(undefined);
13161
13176
  };
13162
13177
  return /*#__PURE__*/jsxs(Fragment, {
13163
- children: [/*#__PURE__*/jsx(Select$1, {
13178
+ children: [/*#__PURE__*/jsx(Select$2, {
13164
13179
  showSearch: true,
13165
13180
  value: value,
13166
13181
  placeholder: t('backoffice.form.presets.placeholder'),
@@ -14451,7 +14466,7 @@ var Selector = function Selector(_ref) {
14451
14466
  }
14452
14467
  }, [valueState]);
14453
14468
  return /*#__PURE__*/jsx(Fragment, {
14454
- children: /*#__PURE__*/jsx(Select$1, {
14469
+ children: /*#__PURE__*/jsx(Select$2, {
14455
14470
  className: customSelect,
14456
14471
  showSearch: true,
14457
14472
  labelInValue: true,
@@ -14470,7 +14485,7 @@ var Selector = function Selector(_ref) {
14470
14485
  return onSelect(option === null || option === void 0 ? void 0 : option.key);
14471
14486
  },
14472
14487
  children: items === null || items === void 0 ? void 0 : items.map(function (i) {
14473
- return /*#__PURE__*/jsxs(Select$1.Option, {
14488
+ return /*#__PURE__*/jsxs(Select$2.Option, {
14474
14489
  value: i.name,
14475
14490
  className: customSelectOption,
14476
14491
  children: [/*#__PURE__*/jsx("div", {
@@ -14564,7 +14579,8 @@ function useSelectSimpleData (_ref) {
14564
14579
  var apiInterface = _ref.apiInterface,
14565
14580
  selectMapping = _ref.selectMapping,
14566
14581
  onChange = _ref.onChange,
14567
- value = _ref.value;
14582
+ value = _ref.value,
14583
+ configuredOptions = _ref.options;
14568
14584
  var root = useStore();
14569
14585
  var _useMemo = useMemo(function () {
14570
14586
  return {
@@ -14575,23 +14591,18 @@ function useSelectSimpleData (_ref) {
14575
14591
  };
14576
14592
  }, []),
14577
14593
  apiHandler = _useMemo.apiHandler;
14578
- var _useState = useState(false),
14594
+ var _useState = useState(true),
14579
14595
  _useState2 = _slicedToArray(_useState, 2),
14580
14596
  loading = _useState2[0],
14581
14597
  setLoading = _useState2[1];
14582
- // used to skip the first render, because antd for some reason sets the value only on the second render
14583
- var _useState3 = useState(true),
14598
+ var _useState3 = useState(),
14584
14599
  _useState4 = _slicedToArray(_useState3, 2),
14585
- skipOnRender = _useState4[0],
14586
- setSkipOnRender = _useState4[1];
14587
- var _useState5 = useState([]),
14600
+ options = _useState4[0],
14601
+ setOptions = _useState4[1];
14602
+ var _useState5 = useState(),
14588
14603
  _useState6 = _slicedToArray(_useState5, 2),
14589
- options = _useState6[0],
14590
- setOptions = _useState6[1];
14591
- var _useState7 = useState(),
14592
- _useState8 = _slicedToArray(_useState7, 2),
14593
- selected = _useState8[0],
14594
- setSelected = _useState8[1];
14604
+ selected = _useState6[0],
14605
+ setSelected = _useState6[1];
14595
14606
  var currentValue = useMemo(function () {
14596
14607
  if (!selected) return undefined;
14597
14608
  if (Array.isArray(selected)) return selected.map(function (item) {
@@ -14600,8 +14611,10 @@ function useSelectSimpleData (_ref) {
14600
14611
  return selected.value;
14601
14612
  }, [selected]);
14602
14613
  useEffect(function () {
14603
- if (skipOnRender) {
14604
- setSkipOnRender(false);
14614
+ if (configuredOptions) {
14615
+ if (apiHandler.canReadList) LOG$8.warn('If options are provided, apiInterface will not be used');
14616
+ setOptions(configuredOptions);
14617
+ setLoading(false);
14605
14618
  return;
14606
14619
  }
14607
14620
  if (!apiHandler.canReadList) throw Error('SelectSimple: apiInterface must have readList method');
@@ -14613,13 +14626,17 @@ function useSelectSimpleData (_ref) {
14613
14626
  return parseDataEntry(item, selectMapping);
14614
14627
  });
14615
14628
  setOptions(options);
14616
- if (value) {
14617
- setSelected(findByValue(value, options, selectMapping));
14618
- }
14619
14629
  })["finally"](function () {
14620
14630
  setLoading(false);
14621
14631
  });
14622
- }, [skipOnRender]);
14632
+ }, []);
14633
+ useEffect(function () {
14634
+ // set the selected option only after the options are loaded
14635
+ if (value && options) {
14636
+ LOG$8.debug('value changed', value);
14637
+ setSelected(findByValue(value, options, selectMapping));
14638
+ }
14639
+ }, [value, options]);
14623
14640
  var onSelectionChanged = function onSelectionChanged(value, option) {
14624
14641
  setSelected(option);
14625
14642
  onChange === null || onChange === void 0 || onChange(parseReturnData(option, selectMapping));
@@ -14683,7 +14700,7 @@ function parseReturnData(options, selectMapping) {
14683
14700
  return (selectMapping === null || selectMapping === void 0 ? void 0 : selectMapping.externalValue) == 'value' ? options.value : options.data;
14684
14701
  }
14685
14702
 
14686
- var _excluded$2 = ["apiInterface", "selectMapping", "onChange", "value", "search"];
14703
+ var _excluded$2 = ["apiInterface", "selectMapping", "onChange", "value", "search", "options"];
14687
14704
  function ownKeys$t(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14688
14705
  function _objectSpread$t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$t(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14689
14706
  var SelectWrapper = function SelectWrapper(_ref) {
@@ -14692,15 +14709,17 @@ var SelectWrapper = function SelectWrapper(_ref) {
14692
14709
  onChange = _ref.onChange,
14693
14710
  value = _ref.value,
14694
14711
  search = _ref.search,
14712
+ options = _ref.options,
14695
14713
  selectProps = _objectWithoutProperties(_ref, _excluded$2);
14696
14714
  var state = useSelectSimpleData({
14697
14715
  apiInterface: apiInterface,
14698
14716
  selectMapping: selectMapping,
14699
14717
  onChange: onChange,
14700
14718
  value: value,
14701
- type: 'SelectSimple'
14719
+ type: 'SelectSimple',
14720
+ options: options
14702
14721
  });
14703
- return /*#__PURE__*/jsx(Select$1, _objectSpread$t(_objectSpread$t({}, selectProps), {}, {
14722
+ return /*#__PURE__*/jsx(Select$2, _objectSpread$t(_objectSpread$t({}, selectProps), {}, {
14704
14723
  showSearch: search,
14705
14724
  loading: state.loading,
14706
14725
  options: state.options,
@@ -14710,7 +14729,7 @@ var SelectWrapper = function SelectWrapper(_ref) {
14710
14729
  filterOption: filterOption
14711
14730
  }));
14712
14731
  };
14713
- var SelectSimple = observer(SelectWrapper, {
14732
+ var Select = observer(SelectWrapper, {
14714
14733
  forwardRef: true
14715
14734
  });
14716
14735
  var filterOption = function filterOption(input, option) {
@@ -14899,7 +14918,7 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
14899
14918
  var disabled = (_isReadonly = isReadonly(item, data)) !== null && _isReadonly !== void 0 ? _isReadonly : (_state$hiddenRequired2 = state.hiddenRequiredDisabled[typeof item.name == 'string' ? item.name : item.name.join('.')]) === null || _state$hiddenRequired2 === void 0 ? void 0 : _state$hiddenRequired2.disabled;
14900
14919
  switch (item.type) {
14901
14920
  case 'select':
14902
- return /*#__PURE__*/jsx(Select, {
14921
+ return /*#__PURE__*/jsx(Select$1, {
14903
14922
  initialValue: item.defaultValue,
14904
14923
  apiInterface: item.apiInterface,
14905
14924
  mode: item.mode,
@@ -14924,7 +14943,7 @@ var FormWrapper$1 = function FormWrapper(_ref, ref) {
14924
14943
  }
14925
14944
  }, state.selectedItemsIndex);
14926
14945
  case 'selectSimple':
14927
- return /*#__PURE__*/jsx(SelectSimple, _objectSpread$s(_objectSpread$s({}, item), {}, {
14946
+ return /*#__PURE__*/jsx(Select, _objectSpread$s(_objectSpread$s({}, item), {}, {
14928
14947
  disabled: disabled,
14929
14948
  onChange: function onChange(value) {
14930
14949
  _onChange(item.name, value);
@@ -16033,7 +16052,7 @@ var FormWrapper = function FormWrapper(_ref, ref) {
16033
16052
  span: 4
16034
16053
  }), /*#__PURE__*/jsx(Col, {
16035
16054
  span: 20,
16036
- children: /*#__PURE__*/jsx(Select$1, {
16055
+ children: /*#__PURE__*/jsx(Select$2, {
16037
16056
  style: {
16038
16057
  width: '100%'
16039
16058
  },
@@ -16744,7 +16763,7 @@ function DropdownCell (_ref) {
16744
16763
  noStyle: true,
16745
16764
  name: dataIndex,
16746
16765
  initialValue: column.translationPrefix ? t(column.translationPrefix + '.' + children[1]) : children,
16747
- children: /*#__PURE__*/jsx(Select$1, {
16766
+ children: /*#__PURE__*/jsx(Select$2, {
16748
16767
  style: {
16749
16768
  width: column.width - 20
16750
16769
  },
@@ -17727,10 +17746,10 @@ dayjs.extend(weekday);
17727
17746
  dayjs.extend(localeData);
17728
17747
  dayjs.extend(weekOfYear);
17729
17748
  dayjs.extend(weekYear);
17730
- Select$1.Option;
17749
+ Select$2.Option;
17731
17750
  var LOG$4 = getLogger('Backoffice', 'BaseTable');
17732
17751
  var TableWrapper = function TableWrapper(_ref) {
17733
- 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$configuration$12, _state$configuration$13, _state$configuration$14, _state$configuration$15, _state$configuration$18;
17752
+ 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$13;
17734
17753
  var state = _ref.state;
17735
17754
  var root = useStore();
17736
17755
  var _useState = useState(0),
@@ -17820,8 +17839,11 @@ var TableWrapper = function TableWrapper(_ref) {
17820
17839
  style: {
17821
17840
  "float": 'right'
17822
17841
  },
17823
- children: [state.configuration.clientRelations && state.configuration.variant !== 'CatalogTable' && /*#__PURE__*/jsx(SelectClientRelationCatalog, {
17824
- onSelectedCatalog: state.onSelectedCatalog
17842
+ children: [state.configuration.clientRelations && state.configuration.variant !== 'CatalogTable' && /*#__PURE__*/jsx(Fragment, {
17843
+ children: /*#__PURE__*/jsx(SelectClientRelationCatalog, {
17844
+ onSelectedCatalog: state.onSelectedCatalog,
17845
+ dontLoadCatalogData: state.configuration.dontLoadCatalogData
17846
+ })
17825
17847
  }), state.configuration.downloadAction && /*#__PURE__*/jsx(Button, {
17826
17848
  type: "primary",
17827
17849
  disabled: isDownloadActionDisabled(),
@@ -17875,34 +17897,25 @@ var TableWrapper = function TableWrapper(_ref) {
17875
17897
  // Convert to Dayjs
17876
17898
  (_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
17877
17899
  ]
17878
- }), ((_state$configuration$7 = state.configuration.filter) === null || _state$configuration$7 === void 0 ? void 0 : _state$configuration$7.select) && /*#__PURE__*/jsx(Select, _objectSpread$l(_objectSpread$l({
17879
- minWidth: "200px"
17880
- }, (_state$configuration$8 = state.configuration.filter) === null || _state$configuration$8 === void 0 ? void 0 : _state$configuration$8.select), {}, {
17881
- value: (_state$globalFilter$s = state.globalFilter.select) === null || _state$globalFilter$s === void 0 ? void 0 : _state$globalFilter$s[state.configuration.filter.select.filterField],
17882
- onChange: function onChange(option, applyDefaultValue, defaultValue) {
17883
- if (defaultValue != (Array.isArray(option) ? option[0] : option) || applyDefaultValue === true) {
17884
- var _value;
17885
- state.onGlobalFilterSelect((_value = option.value) !== null && _value !== void 0 ? _value : option);
17886
- } else {
17887
- state.onGlobalFilterSelect('');
17888
- }
17900
+ }), ((_state$configuration$7 = state.configuration.filter) === null || _state$configuration$7 === void 0 ? void 0 : _state$configuration$7.select) && /*#__PURE__*/jsx(Select, _objectSpread$l(_objectSpread$l({}, (_state$configuration$8 = state.configuration.filter) === null || _state$configuration$8 === void 0 ? void 0 : _state$configuration$8.select.settings), {}, {
17901
+ style: {
17902
+ minWidth: '200px'
17889
17903
  },
17890
- search: (_state$configuration$9 = (_state$configuration$10 = state.configuration.filter) === null || _state$configuration$10 === void 0 ? void 0 : _state$configuration$10.select.search) !== null && _state$configuration$9 !== void 0 ? _state$configuration$9 : false,
17891
- mode: "single",
17892
- options: (_state$configuration$11 = state.configuration.filter) === null || _state$configuration$11 === void 0 ? void 0 : _state$configuration$11.select.options,
17893
- initialValue: (_state$configuration$12 = state.configuration.filter) === null || _state$configuration$12 === void 0 ? void 0 : _state$configuration$12.select.defaultValue,
17894
- applyDefaultValue: (_state$configuration$13 = state.configuration.filter) === null || _state$configuration$13 === void 0 ? void 0 : _state$configuration$13.select.applyDefaultValue
17904
+ value: (_state$globalFilter$s = state.globalFilter.select) === null || _state$globalFilter$s === void 0 || (_state$globalFilter$s = _state$globalFilter$s[state.configuration.filter.select.filterField]) === null || _state$globalFilter$s === void 0 ? void 0 : _state$globalFilter$s[0],
17905
+ onChange: function onChange(selected) {
17906
+ state.onGlobalFilterSelect(selected);
17907
+ }
17895
17908
  })), /*#__PURE__*/jsx(SelectionText, {
17896
17909
  selected: state.selected
17897
17910
  }), state.canDelete && /*#__PURE__*/jsx(DeleteButton, {
17898
17911
  selected: state.selected,
17899
17912
  total: state.pagination.total,
17900
- min: (_state$configuration$14 = state.configuration.rules) === null || _state$configuration$14 === void 0 ? void 0 : _state$configuration$14.min,
17913
+ min: (_state$configuration$9 = state.configuration.rules) === null || _state$configuration$9 === void 0 ? void 0 : _state$configuration$9.min,
17901
17914
  deleting: state.deleting,
17902
17915
  onDelete: state.onDelete
17903
17916
  }), state.configuration.copyAction !== undefined && /*#__PURE__*/jsx(CopyButton, {
17904
17917
  state: state
17905
- }), (_state$configuration$15 = state.configuration.bulkActions) === null || _state$configuration$15 === void 0 ? void 0 : _state$configuration$15.map(function (action) {
17918
+ }), (_state$configuration$10 = state.configuration.bulkActions) === null || _state$configuration$10 === void 0 ? void 0 : _state$configuration$10.map(function (action) {
17906
17919
  return /*#__PURE__*/jsx(BulkAction, {
17907
17920
  action: action,
17908
17921
  state: state
@@ -17910,9 +17923,9 @@ var TableWrapper = function TableWrapper(_ref) {
17910
17923
  }), state.configuration.createAction && checkPermission(state.configuration.createAction.permission) && /*#__PURE__*/jsx(ActionButton, {
17911
17924
  action: state.configuration.createAction,
17912
17925
  callback: function callback(data) {
17913
- var _state$onUpdate, _state$configuration$16, _state$configuration$17;
17926
+ var _state$onUpdate, _state$configuration$11, _state$configuration$12;
17914
17927
  (_state$onUpdate = state.onUpdate) === null || _state$onUpdate === void 0 || _state$onUpdate.call(state, data);
17915
- (_state$configuration$16 = state.configuration.createAction) === null || _state$configuration$16 === void 0 || (_state$configuration$17 = _state$configuration$16.callback) === null || _state$configuration$17 === void 0 || _state$configuration$17.call(_state$configuration$16, data);
17928
+ (_state$configuration$11 = state.configuration.createAction) === null || _state$configuration$11 === void 0 || (_state$configuration$12 = _state$configuration$11.callback) === null || _state$configuration$12 === void 0 || _state$configuration$12.call(_state$configuration$11, data);
17916
17929
  },
17917
17930
  type: "Button",
17918
17931
  id: 'create',
@@ -17959,13 +17972,13 @@ var TableWrapper = function TableWrapper(_ref) {
17959
17972
  }), /*#__PURE__*/jsx(Table$1, {
17960
17973
  scroll: {
17961
17974
  x: '100%',
17962
- y: (_state$configuration$18 = state.configuration.height) !== null && _state$configuration$18 !== void 0 ? _state$configuration$18 : '60vh'
17975
+ y: (_state$configuration$13 = state.configuration.height) !== null && _state$configuration$13 !== void 0 ? _state$configuration$13 : '60vh'
17963
17976
  },
17964
17977
  rowClassName: editableRow,
17965
17978
  components: cellRenderer,
17966
17979
  rowKey: function rowKey(dataRow) {
17967
- var _state$configuration$19, _state$configuration$20;
17968
- return goTroughObject(dataRow, (_state$configuration$19 = (_state$configuration$20 = state.configuration.rowKey) === null || _state$configuration$20 === void 0 ? void 0 : _state$configuration$20.split('.')) !== null && _state$configuration$19 !== void 0 ? _state$configuration$19 : ['_id'], 0);
17980
+ var _state$configuration$14, _state$configuration$15;
17981
+ return goTroughObject(dataRow, (_state$configuration$14 = (_state$configuration$15 = state.configuration.rowKey) === null || _state$configuration$15 === void 0 ? void 0 : _state$configuration$15.split('.')) !== null && _state$configuration$14 !== void 0 ? _state$configuration$14 : ['_id'], 0);
17969
17982
  },
17970
17983
  dataSource: data,
17971
17984
  loading: state.loading,
@@ -18039,13 +18052,13 @@ function CopyButton(_ref3) {
18039
18052
  }, root);
18040
18053
  var onCopy = /*#__PURE__*/function () {
18041
18054
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
18042
- var _state$configuration$21;
18055
+ var _state$configuration$16;
18043
18056
  var copyAction, _iterator3, _step3, selectedRow;
18044
18057
  return _regeneratorRuntime.wrap(function _callee$(_context) {
18045
18058
  while (1) switch (_context.prev = _context.next) {
18046
18059
  case 0:
18047
18060
  copyAction = state.configuration.copyAction;
18048
- if (((_state$configuration$21 = state.configuration.copyAction) === null || _state$configuration$21 === void 0 ? void 0 : _state$configuration$21.apiInterface) != undefined) {
18061
+ if (((_state$configuration$16 = state.configuration.copyAction) === null || _state$configuration$16 === void 0 ? void 0 : _state$configuration$16.apiInterface) != undefined) {
18049
18062
  _iterator3 = _createForOfIteratorHelper$8(state.selected);
18050
18063
  try {
18051
18064
  for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
@@ -18080,13 +18093,13 @@ function CopyButton(_ref3) {
18080
18093
  }();
18081
18094
  var onCopyAction = /*#__PURE__*/function () {
18082
18095
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
18083
- var _state$configuration$22, _state$configuration$23;
18096
+ var _state$configuration$17, _state$configuration$18;
18084
18097
  var copyAction, id, filter, data;
18085
18098
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
18086
18099
  while (1) switch (_context3.prev = _context3.next) {
18087
18100
  case 0:
18088
18101
  copyAction = state.configuration.copyAction;
18089
- if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$22 = state.configuration.createAction) === null || _state$configuration$22 === void 0 ? void 0 : _state$configuration$22.actionType) != 'Detail')) {
18102
+ if (!(copyAction.id == undefined || copyAction.actionType != 'Detail' || ((_state$configuration$17 = state.configuration.createAction) === null || _state$configuration$17 === void 0 ? void 0 : _state$configuration$17.actionType) != 'Detail')) {
18090
18103
  _context3.next = 3;
18091
18104
  break;
18092
18105
  }
@@ -18116,7 +18129,7 @@ function CopyButton(_ref3) {
18116
18129
  configurationId: copyAction === null || copyAction === void 0 ? void 0 : copyAction.id,
18117
18130
  data: data.data[0],
18118
18131
  type: copyAction === null || copyAction === void 0 ? void 0 : copyAction.type,
18119
- mapping: (_state$configuration$23 = state.configuration.createAction) === null || _state$configuration$23 === void 0 ? void 0 : _state$configuration$23.mapping,
18132
+ mapping: (_state$configuration$18 = state.configuration.createAction) === null || _state$configuration$18 === void 0 ? void 0 : _state$configuration$18.mapping,
18120
18133
  mappingData: data.data[0],
18121
18134
  callback: function () {
18122
18135
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(e) {
@@ -18534,7 +18547,7 @@ var advancedProps = function advancedProps(title) {
18534
18547
  },
18535
18548
  children: /*#__PURE__*/jsxs(Space, {
18536
18549
  direction: "vertical",
18537
- children: [/*#__PURE__*/jsxs(Select$1, {
18550
+ children: [/*#__PURE__*/jsxs(Select$2, {
18538
18551
  defaultValue: "contains",
18539
18552
  style: {
18540
18553
  width: 188,
@@ -18543,28 +18556,28 @@ var advancedProps = function advancedProps(title) {
18543
18556
  onSelect: function onSelect(value) {
18544
18557
  setSelectedKeys([selectedKeys[0], value]);
18545
18558
  },
18546
- children: [/*#__PURE__*/jsx(Select$1.Option, {
18559
+ children: [/*#__PURE__*/jsx(Select$2.Option, {
18547
18560
  value: "eq",
18548
18561
  children: "Ist equivalent zu"
18549
- }), /*#__PURE__*/jsx(Select$1.Option, {
18562
+ }), /*#__PURE__*/jsx(Select$2.Option, {
18550
18563
  value: "ne",
18551
18564
  children: "Ist nicht equivalent zu"
18552
- }), /*#__PURE__*/jsx(Select$1.Option, {
18565
+ }), /*#__PURE__*/jsx(Select$2.Option, {
18553
18566
  value: "contains",
18554
18567
  children: "Enth\xE4lt"
18555
- }), /*#__PURE__*/jsx(Select$1.Option, {
18568
+ }), /*#__PURE__*/jsx(Select$2.Option, {
18556
18569
  value: "doesnotcontain",
18557
18570
  children: "Enth\xE4lt nicht"
18558
- }), /*#__PURE__*/jsx(Select$1.Option, {
18571
+ }), /*#__PURE__*/jsx(Select$2.Option, {
18559
18572
  value: "startswith",
18560
18573
  children: "Beginnt mit"
18561
- }), /*#__PURE__*/jsx(Select$1.Option, {
18574
+ }), /*#__PURE__*/jsx(Select$2.Option, {
18562
18575
  value: "endswith",
18563
18576
  children: "Endet mit"
18564
- }), /*#__PURE__*/jsx(Select$1.Option, {
18577
+ }), /*#__PURE__*/jsx(Select$2.Option, {
18565
18578
  value: "isnull",
18566
18579
  children: "Ist Null"
18567
- }), /*#__PURE__*/jsx(Select$1.Option, {
18580
+ }), /*#__PURE__*/jsx(Select$2.Option, {
18568
18581
  value: "isnotnull",
18569
18582
  children: "Ist nicht Null"
18570
18583
  })]
@@ -18711,7 +18724,7 @@ var selectProps = function selectProps(title, filter) {
18711
18724
  },
18712
18725
  children: /*#__PURE__*/jsxs(Space, {
18713
18726
  direction: "vertical",
18714
- children: [/*#__PURE__*/jsx(Select$1, {
18727
+ children: [/*#__PURE__*/jsx(Select$2, {
18715
18728
  placeholder: "Filter ".concat(title),
18716
18729
  value: selectedKeys[0],
18717
18730
  style: {
@@ -19372,7 +19385,7 @@ function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
19372
19385
  function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19373
19386
  var LOG$3 = getLogger('Backoffice', 'TableData');
19374
19387
  function useTableData (_ref) {
19375
- var _configuration$filter, _configuration$filter2, _configuration$filter3, _configuration$filter4, _configuration$bulkAc, _configuration$apiInt;
19388
+ var _configuration$filter, _configuration$filter2, _configuration$filter3, _configuration$bulkAc, _configuration$apiInt;
19376
19389
  var id = _ref.id,
19377
19390
  i18n = _ref.i18n,
19378
19391
  parentData = _ref.parentData,
@@ -19412,7 +19425,7 @@ function useTableData (_ref) {
19412
19425
  return defaultFilter[f] = [configuration.filter["default"].globalValue ? root.getGlobalValue(configuration.filter["default"].globalValue) : true, 'eq'];
19413
19426
  });
19414
19427
  var _useState9 = useState({
19415
- select: (_configuration$filter3 = configuration.filter) !== null && _configuration$filter3 !== void 0 && _configuration$filter3.select && ((_configuration$filter4 = configuration.filter) === null || _configuration$filter4 === void 0 ? void 0 : _configuration$filter4.select.applyDefaultValue) !== false ? _defineProperty({}, configuration.filter.select.filterField, [configuration.filter.select.defaultValue, 'eq']) : undefined,
19428
+ select: (_configuration$filter3 = configuration.filter) !== null && _configuration$filter3 !== void 0 && (_configuration$filter3 = _configuration$filter3.select) !== null && _configuration$filter3 !== void 0 && _configuration$filter3.defaultValue ? _defineProperty({}, configuration.filter.select.filterField, [configuration.filter.select.defaultValue, 'eq']) : undefined,
19416
19429
  toggle: toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.defaultChecked && !(toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.inverted) || !(toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.defaultChecked) && toggleConfig !== null && toggleConfig !== void 0 && toggleConfig.inverted ? toggleFilter : undefined,
19417
19430
  "default": defaultFilter ? defaultFilter : undefined
19418
19431
  }),
@@ -19498,8 +19511,8 @@ function useTableData (_ref) {
19498
19511
  for (var i = 0; i < dataArray.length; i++) {
19499
19512
  var dataRow = dataArray[i];
19500
19513
  if (filterServerSide) {
19501
- var _configuration$filter5;
19502
- if ((_configuration$filter5 = configuration.filter) !== null && _configuration$filter5 !== void 0 && (_configuration$filter5 = _configuration$filter5.select) !== null && _configuration$filter5 !== void 0 && _configuration$filter5.filterField) {
19514
+ var _configuration$filter4;
19515
+ if ((_configuration$filter4 = configuration.filter) !== null && _configuration$filter4 !== void 0 && (_configuration$filter4 = _configuration$filter4.select) !== null && _configuration$filter4 !== void 0 && _configuration$filter4.filterField) {
19503
19516
  onGlobalFilterSelect(dataRow[configuration.filter.select.filterField]);
19504
19517
  } else {
19505
19518
  var _pagination;
@@ -19515,15 +19528,15 @@ function useTableData (_ref) {
19515
19528
  });
19516
19529
  }
19517
19530
  } else {
19518
- var _configuration$filter6, _configuration$filter7;
19531
+ var _configuration$filter5, _configuration$filter6;
19519
19532
  var _updateData2 = updateData({
19520
19533
  data: newInitData,
19521
19534
  dataRow: dataRow
19522
19535
  }),
19523
19536
  nextInitData = _updateData2.data;
19524
19537
  var _aplyFilterAndSortati = aplyFilterAndSortation(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData), {}, {
19525
- filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter6 = configuration.filter) !== null && _configuration$filter6 !== void 0 && (_configuration$filter6 = _configuration$filter6.toggle) !== null && _configuration$filter6 !== void 0 && _configuration$filter6.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"])
19526
- }, configuration !== null && configuration !== void 0 && (_configuration$filter7 = configuration.filter) !== null && _configuration$filter7 !== void 0 && (_configuration$filter7 = _configuration$filter7.toggle) !== null && _configuration$filter7 !== void 0 && _configuration$filter7.inQuery ? {
19538
+ filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter5 = configuration.filter) !== null && _configuration$filter5 !== void 0 && (_configuration$filter5 = _configuration$filter5.toggle) !== null && _configuration$filter5 !== void 0 && _configuration$filter5.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"])
19539
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter6 = configuration.filter) !== null && _configuration$filter6 !== void 0 && (_configuration$filter6 = _configuration$filter6.toggle) !== null && _configuration$filter6 !== void 0 && _configuration$filter6.inQuery ? {
19527
19540
  genericProps: globalFilter.toggle
19528
19541
  } : undefined), {}, {
19529
19542
  data: nextInitData,
@@ -19610,7 +19623,7 @@ function useTableData (_ref) {
19610
19623
  }, [configuration.title, parentData]);
19611
19624
  var onChange = /*#__PURE__*/function () {
19612
19625
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(p) {
19613
- var _configuration$filter8;
19626
+ var _configuration$filter7, _configuration$filter8, _configuration$filter9, _prefilter$select, _configuration$filter10, _configuration$filter11;
19614
19627
  var prefilter,
19615
19628
  refresh,
19616
19629
  currentData,
@@ -19618,7 +19631,7 @@ function useTableData (_ref) {
19618
19631
  currentFilterHash,
19619
19632
  currentPagination,
19620
19633
  currentUrl,
19621
- _configuration$filter9,
19634
+ _configuration$filter12,
19622
19635
  ssf,
19623
19636
  data,
19624
19637
  _data3,
@@ -19635,7 +19648,7 @@ function useTableData (_ref) {
19635
19648
  loading: true
19636
19649
  }));
19637
19650
  currentData = initData;
19638
- filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter8 = configuration.filter) !== null && _configuration$filter8 !== void 0 && (_configuration$filter8 = _configuration$filter8.toggle) !== null && _configuration$filter8 !== void 0 && _configuration$filter8.inQuery) ? prefilter.toggle : undefined), prefilter.select), prefilter.timeStamp), prefilter["default"]); //remove all null values
19651
+ filterData = _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, p.filters), prefilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter7 = configuration.filter) !== null && _configuration$filter7 !== void 0 && (_configuration$filter7 = _configuration$filter7.toggle) !== null && _configuration$filter7 !== void 0 && _configuration$filter7.inQuery) ? prefilter.toggle : undefined), ((_configuration$filter8 = configuration.filter) === null || _configuration$filter8 === void 0 || (_configuration$filter8 = _configuration$filter8.select) === null || _configuration$filter8 === void 0 ? void 0 : _configuration$filter8.applyDefaultValue) !== false || ((_configuration$filter9 = configuration.filter) === null || _configuration$filter9 === void 0 || (_configuration$filter9 = _configuration$filter9.select) === null || _configuration$filter9 === void 0 ? void 0 : _configuration$filter9.defaultValue) !== ((_prefilter$select = prefilter.select) === null || _prefilter$select === void 0 || (_prefilter$select = _prefilter$select[(_configuration$filter10 = (_configuration$filter11 = configuration.filter) === null || _configuration$filter11 === void 0 || (_configuration$filter11 = _configuration$filter11.select) === null || _configuration$filter11 === void 0 ? void 0 : _configuration$filter11.filterField) !== null && _configuration$filter10 !== void 0 ? _configuration$filter10 : '']) === null || _prefilter$select === void 0 ? void 0 : _prefilter$select[0]) ? prefilter.select : undefined), prefilter.timeStamp), prefilter["default"]); //remove all null values
19639
19652
  filterData = Object.fromEntries(Object.entries(filterData).filter(function (_ref5) {
19640
19653
  var _ref6 = _slicedToArray(_ref5, 2);
19641
19654
  _ref6[0];
@@ -19656,7 +19669,7 @@ function useTableData (_ref) {
19656
19669
  columns: configuration.columns,
19657
19670
  filters: filterData,
19658
19671
  sorter: p.sorter
19659
- }, 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 ? {
19672
+ }, configuration !== null && configuration !== void 0 && (_configuration$filter12 = configuration.filter) !== null && _configuration$filter12 !== void 0 && (_configuration$filter12 = _configuration$filter12.toggle) !== null && _configuration$filter12 !== void 0 && _configuration$filter12.inQuery ? {
19660
19673
  genericProps: prefilter.toggle
19661
19674
  } : undefined);
19662
19675
  _context2.next = 13;
@@ -19722,7 +19735,7 @@ function useTableData (_ref) {
19722
19735
  var onDelete = /*#__PURE__*/function () {
19723
19736
  var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
19724
19737
  var _configuration$apiInt2;
19725
- var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$filter10, _configuration$filter11, data;
19738
+ var newData, newInitData, deleted, userPermissions, _loop, mappingData, deleteResult, _ret, index, total, pages, current, _configuration$filter13, _configuration$filter14, data;
19726
19739
  return _regeneratorRuntime.wrap(function _callee3$(_context4) {
19727
19740
  while (1) switch (_context4.prev = _context4.next) {
19728
19741
  case 0:
@@ -19737,7 +19750,7 @@ function useTableData (_ref) {
19737
19750
  case 6:
19738
19751
  userPermissions = _context4.sent;
19739
19752
  _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(index) {
19740
- var _configuration$rowKey, _configuration$filter12, _configuration$filter13;
19753
+ var _configuration$rowKey, _configuration$filter15, _configuration$filter16;
19741
19754
  var id, _newData$filter, _newData$filter2, mapToggle, _iterator, _step, _globalFilter$toggle, field, _globalFilter$toggle2, _configuration$delete, _configuration$onErro, _configuration$onErro2, deletedIndex, initDeletedIndex;
19742
19755
  return _regeneratorRuntime.wrap(function _loop$(_context3) {
19743
19756
  while (1) switch (_context3.prev = _context3.next) {
@@ -19753,7 +19766,7 @@ function useTableData (_ref) {
19753
19766
  })) === null || _newData$filter2 === void 0 ? void 0 : _newData$filter2[0];
19754
19767
  }
19755
19768
  mapToggle = {};
19756
- _iterator = _createForOfIteratorHelper$7((_configuration$filter12 = (_configuration$filter13 = configuration.filter) === null || _configuration$filter13 === void 0 || (_configuration$filter13 = _configuration$filter13.toggle) === null || _configuration$filter13 === void 0 ? void 0 : _configuration$filter13.fields) !== null && _configuration$filter12 !== void 0 ? _configuration$filter12 : []);
19769
+ _iterator = _createForOfIteratorHelper$7((_configuration$filter15 = (_configuration$filter16 = configuration.filter) === null || _configuration$filter16 === void 0 || (_configuration$filter16 = _configuration$filter16.toggle) === null || _configuration$filter16 === void 0 ? void 0 : _configuration$filter16.fields) !== null && _configuration$filter15 !== void 0 ? _configuration$filter15 : []);
19757
19770
  try {
19758
19771
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
19759
19772
  field = _step.value;
@@ -19862,9 +19875,9 @@ function useTableData (_ref) {
19862
19875
  current: current
19863
19876
  }),
19864
19877
  columns: configuration.columns,
19865
- filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.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) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"]),
19878
+ filters: _objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g(_objectSpread$g({}, filterData.filters), globalFilter.search), !(configuration !== null && configuration !== void 0 && (_configuration$filter13 = configuration.filter) !== null && _configuration$filter13 !== void 0 && (_configuration$filter13 = _configuration$filter13.toggle) !== null && _configuration$filter13 !== void 0 && _configuration$filter13.inQuery) ? globalFilter.toggle : undefined), globalFilter.select), globalFilter.timeStamp), globalFilter["default"]),
19866
19879
  sorter: filterData.sorter
19867
- }, configuration !== null && configuration !== void 0 && (_configuration$filter11 = configuration.filter) !== null && _configuration$filter11 !== void 0 && (_configuration$filter11 = _configuration$filter11.toggle) !== null && _configuration$filter11 !== void 0 && _configuration$filter11.inQuery ? {
19880
+ }, 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 ? {
19868
19881
  genericProps: globalFilter.toggle
19869
19882
  } : undefined));
19870
19883
  case 25:
@@ -19893,13 +19906,13 @@ function useTableData (_ref) {
19893
19906
  };
19894
19907
  }();
19895
19908
  var onGlobalFilterSelect = function onGlobalFilterSelect(value) {
19896
- var _configuration$filter14;
19897
- if (!((_configuration$filter14 = configuration.filter) !== null && _configuration$filter14 !== void 0 && _configuration$filter14.select)) {
19909
+ var _configuration$filter17;
19910
+ if (!((_configuration$filter17 = configuration.filter) !== null && _configuration$filter17 !== void 0 && _configuration$filter17.select)) {
19898
19911
  LOG$3.error('No global select filter defiend');
19899
19912
  return;
19900
19913
  }
19901
19914
  var newGlobalFilter = _objectSpread$g({}, globalFilter);
19902
- if (value != '') {
19915
+ if (value !== null && value !== void 0 && value.length) {
19903
19916
  newGlobalFilter.select = _defineProperty({}, configuration.filter.select.filterField, Array.isArray(value) ? value : [value]);
19904
19917
  } else {
19905
19918
  newGlobalFilter.select = {};
@@ -19910,8 +19923,8 @@ function useTableData (_ref) {
19910
19923
  }, filterData), newGlobalFilter);
19911
19924
  };
19912
19925
  var onGlobalFilterToggle = function onGlobalFilterToggle() {
19913
- var _configuration$filter15;
19914
- if (!((_configuration$filter15 = configuration.filter) !== null && _configuration$filter15 !== void 0 && _configuration$filter15.toggle)) {
19926
+ var _configuration$filter18;
19927
+ if (!((_configuration$filter18 = configuration.filter) !== null && _configuration$filter18 !== void 0 && _configuration$filter18.toggle)) {
19915
19928
  LOG$3.error('No global toggle filter defiend');
19916
19929
  return;
19917
19930
  }
@@ -19928,8 +19941,8 @@ function useTableData (_ref) {
19928
19941
  }, filterData), newGlobalFilter);
19929
19942
  };
19930
19943
  var onGlobalFilterSearch = function onGlobalFilterSearch(value) {
19931
- var _configuration$filter16;
19932
- if (!((_configuration$filter16 = configuration.filter) !== null && _configuration$filter16 !== void 0 && _configuration$filter16.search)) {
19944
+ var _configuration$filter19;
19945
+ if (!((_configuration$filter19 = configuration.filter) !== null && _configuration$filter19 !== void 0 && _configuration$filter19.search)) {
19933
19946
  LOG$3.error('No global search filter defiend');
19934
19947
  return;
19935
19948
  }
@@ -19937,8 +19950,8 @@ function useTableData (_ref) {
19937
19950
  search: {}
19938
19951
  });
19939
19952
  if (value) {
19940
- var _configuration$filter17;
19941
- (_configuration$filter17 = configuration.filter) === null || _configuration$filter17 === void 0 || _configuration$filter17.search.fields.forEach(function (f) {
19953
+ var _configuration$filter20;
19954
+ (_configuration$filter20 = configuration.filter) === null || _configuration$filter20 === void 0 || _configuration$filter20.search.fields.forEach(function (f) {
19942
19955
  if (typeof f == 'string') {
19943
19956
  newGlobalFilter.search[f] = [value, 'contains', 0];
19944
19957
  } else {
@@ -19952,8 +19965,8 @@ function useTableData (_ref) {
19952
19965
  }, filterData), newGlobalFilter);
19953
19966
  };
19954
19967
  var onGlobalFilterPeriod = function onGlobalFilterPeriod(from, to) {
19955
- var _configuration$filter18;
19956
- if (!((_configuration$filter18 = configuration.filter) !== null && _configuration$filter18 !== void 0 && _configuration$filter18.period)) {
19968
+ var _configuration$filter21;
19969
+ if (!((_configuration$filter21 = configuration.filter) !== null && _configuration$filter21 !== void 0 && _configuration$filter21.period)) {
19957
19970
  LOG$3.error('No global period filter defiend');
19958
19971
  return;
19959
19972
  }
@@ -20787,7 +20800,7 @@ var FilterBox = /*#__PURE__*/memo(function (_ref) {
20787
20800
  return /*#__PURE__*/jsxs("div", {
20788
20801
  children: [/*#__PURE__*/jsx(Typography.Text, {
20789
20802
  children: filter.title
20790
- }), /*#__PURE__*/jsx("br", {}), /*#__PURE__*/jsx(Select, {
20803
+ }), /*#__PURE__*/jsx("br", {}), /*#__PURE__*/jsx(Select$1, {
20791
20804
  mode: "single",
20792
20805
  apiInterface: filter.requestOptions,
20793
20806
  wholeData: _objectSpread$a(_objectSpread$a({}, state.filter), {}, {
@@ -21228,7 +21241,7 @@ function getColorClass(data) {
21228
21241
  }
21229
21242
  }
21230
21243
  var OrgItem = function OrgItem(_ref) {
21231
- var _data$description, _itemChain, _itemChain2, _data$children;
21244
+ var _data$description, _itemChain, _itemChain2, _data$children, _itemChain3, _configuration$additi;
21232
21245
  var data = _ref.data,
21233
21246
  itemChain = _ref.itemChain,
21234
21247
  configuration = _ref.configuration,
@@ -21259,7 +21272,7 @@ var OrgItem = function OrgItem(_ref) {
21259
21272
  }), /*#__PURE__*/jsx("div", {
21260
21273
  className: description$1,
21261
21274
  children: (_data$description = data.description) !== null && _data$description !== void 0 ? _data$description : ''
21262
- }), configuration.createAction && data.writePermission && !data.isNav && ((_itemChain = itemChain[itemChain.length - 1]) === null || _itemChain === void 0 ? void 0 : _itemChain.id) == data.id && /*#__PURE__*/jsx(ActionButton, {
21275
+ }), configuration.createAction && data.writePermission && ((_itemChain = itemChain[itemChain.length - 1]) === null || _itemChain === void 0 ? void 0 : _itemChain.id) == data.id && /*#__PURE__*/jsx(ActionButton, {
21263
21276
  action: configuration.createAction,
21264
21277
  type: "Button",
21265
21278
  buttonType: "primary",
@@ -21275,7 +21288,7 @@ var OrgItem = function OrgItem(_ref) {
21275
21288
  setUpdate(update + 1);
21276
21289
  (_configuration$create = configuration.createAction) === null || _configuration$create === void 0 || (_configuration$create2 = _configuration$create.callback) === null || _configuration$create2 === void 0 || _configuration$create2.call(_configuration$create, data);
21277
21290
  }
21278
- }, "create"), configuration.deleteAction && data.deletePermission && !data.isNav && ((_itemChain2 = itemChain[itemChain.length - 1]) === null || _itemChain2 === void 0 ? void 0 : _itemChain2.id) == data.id && !((_data$children = data.children) !== null && _data$children !== void 0 && _data$children.length) && /*#__PURE__*/jsx(ActionButton, {
21291
+ }, "create"), configuration.deleteAction && data.deletePermission && ((_itemChain2 = itemChain[itemChain.length - 1]) === null || _itemChain2 === void 0 ? void 0 : _itemChain2.id) == data.id && !((_data$children = data.children) !== null && _data$children !== void 0 && _data$children.length) && /*#__PURE__*/jsx(ActionButton, {
21279
21292
  action: configuration.deleteAction,
21280
21293
  type: "Button",
21281
21294
  buttonType: "primary",
@@ -21293,7 +21306,23 @@ var OrgItem = function OrgItem(_ref) {
21293
21306
  setUpdate(update + 1);
21294
21307
  });
21295
21308
  }
21296
- }, "delete")]
21309
+ }, "delete"), ((_itemChain3 = itemChain[itemChain.length - 1]) === null || _itemChain3 === void 0 ? void 0 : _itemChain3.id) == data.id && root.dataStore.organizationId !== data.id && ((_configuration$additi = configuration.additionalActions) === null || _configuration$additi === void 0 ? void 0 : _configuration$additi.map(function (action, i) {
21310
+ var _action$id;
21311
+ return /*#__PURE__*/jsx(ActionButton, {
21312
+ action: action,
21313
+ type: "Button",
21314
+ buttonType: "default",
21315
+ id: (_action$id = action.id) !== null && _action$id !== void 0 ? _action$id : i.toString(),
21316
+ mappingData: data,
21317
+ defaultLabel: "",
21318
+ data: data,
21319
+ callback: function callback() {
21320
+ var _action$callback;
21321
+ setUpdate(update + 1);
21322
+ action === null || action === void 0 || (_action$callback = action.callback) === null || _action$callback === void 0 || _action$callback.call(action, data);
21323
+ }
21324
+ }, action.id);
21325
+ }))]
21297
21326
  }, data.id);
21298
21327
  };
21299
21328
  var OrgItem$1 = observer(OrgItem);
@@ -21426,7 +21455,7 @@ var openClass = "open-class--gGXs";
21426
21455
  var breadcrumb = "breadcrumb-Z0VvH";
21427
21456
  var selected = "selected-w-sfW";
21428
21457
  var disabled = "disabled-0nado";
21429
- var css_248z$6 = ".trigger-wrapper-OkPRc {\n width: 100%;\n padding: 12px 0px;\n display: flex;\n gap: 32px;\n}\n\n.arrow-Rd0hp {\n background-image: url(\"data:image/svg+xml,%3Csvg width%3D%228%22 height%3D%2213%22 viewBox%3D%220 0 8 13%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M0.947266 1.14893L6.94727 6.29178L0.947266 11.9489%22 stroke%3D%22%236F6F6F%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22%2F%3E %3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n transform: rotateZ(0deg);\n transition: all 0.35s ease;\n width: 20.8px;\n height: 22.4px;\n}\n\n.open-class--gGXs {\n transform: rotateZ(90deg);\n}\n\n.breadcrumb-Z0VvH {\n transition: color 0.3s;\n}\n.breadcrumb-Z0VvH:hover:not(.selected-w-sfW) {\n cursor: pointer;\n color: #000;\n}\n\n.selected-w-sfW {\n color: #000;\n font-weight: 400;\n}\n\n.selected-w-sfW {\n color: #000;\n font-weight: 400;\n}\n\n.disabled-0nado {\n pointer-events: none;\n color: lightgray;\n}\n\n.darkmode .selected-w-sfW {\n color: #fff;\n font-weight: 400;\n}\n";
21458
+ var css_248z$6 = ".trigger-wrapper-OkPRc {\n width: 100%;\n padding: 12px 0px;\n display: flex;\n gap: 32px;\n}\n\n.arrow-Rd0hp {\n background-image: url(\"data:image/svg+xml,%3Csvg width%3D%228%22 height%3D%2213%22 viewBox%3D%220 0 8 13%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M0.947266 1.14893L6.94727 6.29178L0.947266 11.9489%22 stroke%3D%22%236F6F6F%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22%2F%3E %3C%2Fsvg%3E\");\n background-repeat: no-repeat;\n background-position: center;\n background-size: contain;\n transform: rotateZ(0deg);\n transition: all 0.35s ease;\n width: 20.8px;\n height: 22.4px;\n cursor: pointer;\n}\n\n.open-class--gGXs {\n transform: rotateZ(90deg);\n}\n\n.breadcrumb-Z0VvH {\n transition: color 0.3s;\n}\n.breadcrumb-Z0VvH:hover:not(.selected-w-sfW) {\n cursor: pointer;\n color: #000;\n}\n\n.selected-w-sfW {\n color: #000;\n font-weight: 400;\n}\n\n.selected-w-sfW {\n color: #000;\n font-weight: 400;\n}\n\n.disabled-0nado {\n pointer-events: none;\n color: lightgray;\n}\n\n.darkmode .selected-w-sfW {\n color: #fff;\n font-weight: 400;\n}\n";
21430
21459
  styleInject(css_248z$6);
21431
21460
 
21432
21461
  var BreadCrumbsTrigger = function BreadCrumbsTrigger(_ref) {
@@ -21512,33 +21541,103 @@ var Legend = function Legend(props) {
21512
21541
  };
21513
21542
 
21514
21543
  var buttonsWrapper = "buttons-wrapper-Bubkr";
21515
- var css_248z$4 = ".buttons-wrapper-Bubkr {\n display: flex;\n gap: 6px;\n}\n\n.buttons-wrapper-Bubkr button {\n min-width: 24px;\n}\n";
21544
+ var mask = "mask-ssagp";
21545
+ var transformWrapper = "transform-wrapper--8t0v";
21546
+ var css_248z$4 = ".buttons-wrapper-Bubkr {\n display: flex;\n gap: 6px;\n}\n\n.buttons-wrapper-Bubkr button {\n min-width: 24px;\n}\n\n.mask-ssagp {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 1;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.45);\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-backdrop-filter: blur(3px);\n backdrop-filter: blur(3px);\n}\n.mask-ssagp p {\n font-size: 18px;\n font-weight: bold;\n background: rgba(255, 255, 255, 0.4);\n padding: 10px;\n border-radius: 5px;\n}\n\n.transform-wrapper--8t0v .ant-modal-mask,\n.transform-wrapper--8t0v .ant-modal-wrap {\n position: absolute;\n}\n";
21516
21547
  styleInject(css_248z$4);
21517
21548
 
21518
21549
  var ZoomWrapper = function ZoomWrapper(_ref) {
21519
21550
  var _children = _ref.children,
21520
- zoomToId = _ref.zoomToId;
21551
+ zoomToId = _ref.zoomToId,
21552
+ onInitialized = _ref.onInitialized;
21521
21553
  var transformComponentRef = useRef(null);
21522
21554
  var _useState = useState(true),
21523
21555
  _useState2 = _slicedToArray(_useState, 2),
21524
21556
  isInit = _useState2[0],
21525
21557
  setIsInit = _useState2[1];
21558
+ var _useState3 = useState(false),
21559
+ _useState4 = _slicedToArray(_useState3, 2),
21560
+ isGrapping = _useState4[0],
21561
+ setIsGrapping = _useState4[1];
21562
+ var _useState5 = useState(false),
21563
+ _useState6 = _slicedToArray(_useState5, 2),
21564
+ isZooming = _useState6[0],
21565
+ setIsZooming = _useState6[1];
21566
+ var _useState7 = useState(false),
21567
+ _useState8 = _slicedToArray(_useState7, 2),
21568
+ showModal = _useState8[0],
21569
+ setShowModal = _useState8[1];
21570
+ var _useState9 = useState(false),
21571
+ _useState10 = _slicedToArray(_useState9, 2),
21572
+ focused = _useState10[0],
21573
+ setFocused = _useState10[1];
21574
+ var _useTranslation = useTranslation$1(),
21575
+ t = _useTranslation.t;
21576
+ var zoomToImage = useCallback(function (id) {
21577
+ if (transformComponentRef.current) {
21578
+ var zoomToElement = transformComponentRef.current.zoomToElement;
21579
+ zoomToElement(id, 1, 700, 'easeOut');
21580
+ }
21581
+ }, []);
21526
21582
  useEffect(function () {
21527
21583
  if (!zoomToId) return;
21528
21584
  if (isInit) {
21529
21585
  setIsInit(false);
21530
21586
  setTimeout(function () {
21531
21587
  zoomToImage(zoomToId);
21588
+ onInitialized();
21532
21589
  }, 300);
21533
21590
  }
21534
21591
  zoomToImage(zoomToId);
21535
21592
  }, [zoomToId]);
21536
- var zoomToImage = function zoomToImage(id) {
21537
- if (transformComponentRef.current) {
21538
- var zoomToElement = transformComponentRef.current.zoomToElement;
21539
- zoomToElement(id, 1, 700, 'easeOut');
21593
+ var onKeyDown = useCallback(function (e) {
21594
+ if (e.key === 'Shift') {
21595
+ setIsZooming(true);
21540
21596
  }
21541
- };
21597
+ }, []);
21598
+ var onKeyUp = useCallback(function (e) {
21599
+ if (e.key === 'Shift') {
21600
+ setIsZooming(false);
21601
+ }
21602
+ }, []);
21603
+ var wheelEventTimout;
21604
+ var onScrolling = useCallback(function () {
21605
+ if (!isZooming) {
21606
+ clearTimeout(wheelEventTimout);
21607
+ setShowModal(true);
21608
+ wheelEventTimout = setTimeout(function () {
21609
+ setShowModal(false);
21610
+ }, 2000);
21611
+ }
21612
+ }, [isZooming]);
21613
+ var onMouseEnter = useCallback(function () {
21614
+ setFocused(true);
21615
+ }, [onScrolling]);
21616
+ var onMouseLeave = useCallback(function () {
21617
+ setFocused(false);
21618
+ }, [onScrolling]);
21619
+ var onMouseDown = useCallback(function () {
21620
+ setIsGrapping(true);
21621
+ }, []);
21622
+ var onMouseUp = useCallback(function () {
21623
+ setIsGrapping(false);
21624
+ }, []);
21625
+ useEffect(function () {
21626
+ if (focused) {
21627
+ window.addEventListener('keydown', onKeyDown);
21628
+ window.addEventListener('keyup', onKeyUp);
21629
+ window.addEventListener('wheel', onScrolling);
21630
+ } else {
21631
+ window.removeEventListener('keydown', onKeyDown);
21632
+ window.removeEventListener('keyup', onKeyUp);
21633
+ window.removeEventListener('wheel', onScrolling);
21634
+ }
21635
+ return function () {
21636
+ window.removeEventListener('keydown', onKeyDown);
21637
+ window.removeEventListener('keyup', onKeyUp);
21638
+ window.removeEventListener('wheel', onScrolling);
21639
+ };
21640
+ }, [onScrolling, focused]);
21542
21641
  return /*#__PURE__*/jsx(TransformWrapper, {
21543
21642
  ref: transformComponentRef,
21544
21643
  pinch: {
@@ -21548,7 +21647,8 @@ var ZoomWrapper = function ZoomWrapper(_ref) {
21548
21647
  minScale: 0.2,
21549
21648
  wheel: {
21550
21649
  smoothStep: 0.001,
21551
- step: 0.2
21650
+ step: 0.2,
21651
+ activationKeys: ['Shift']
21552
21652
  },
21553
21653
  children: function children(_ref2) {
21554
21654
  var zoomIn = _ref2.zoomIn,
@@ -21584,11 +21684,26 @@ var ZoomWrapper = function ZoomWrapper(_ref) {
21584
21684
  }),
21585
21685
  size: 'small'
21586
21686
  })]
21687
+ }), showModal && /*#__PURE__*/jsx("div", {
21688
+ className: mask,
21689
+ children: /*#__PURE__*/jsx("p", {
21690
+ children: t('backoffice.orgtree.zoomwrapper.zoominfo')
21691
+ })
21587
21692
  }), /*#__PURE__*/jsx(TransformComponent, {
21588
21693
  wrapperStyle: {
21589
- width: '100%'
21694
+ width: '100%',
21695
+ cursor: isZooming ? 'nesw-resize' : isGrapping ? 'grabbing' : 'grab'
21590
21696
  },
21591
- children: _children
21697
+ wrapperProps: {
21698
+ onMouseEnter: onMouseEnter,
21699
+ onMouseLeave: onMouseLeave,
21700
+ onMouseDown: onMouseDown,
21701
+ onMouseUp: onMouseUp
21702
+ },
21703
+ wrapperClass: transformWrapper,
21704
+ children: /*#__PURE__*/jsx(Fragment, {
21705
+ children: _children
21706
+ })
21592
21707
  })]
21593
21708
  });
21594
21709
  }
@@ -21604,7 +21719,7 @@ var SearchSelect = function SearchSelect(_ref) {
21604
21719
  var _root$dataStore;
21605
21720
  root === null || root === void 0 || (_root$dataStore = root.dataStore) === null || _root$dataStore === void 0 || _root$dataStore.setSelectedOrganizationId(value);
21606
21721
  };
21607
- return /*#__PURE__*/jsx(Select$1, {
21722
+ return /*#__PURE__*/jsx(Select$2, {
21608
21723
  showSearch: true,
21609
21724
  placeholder: t('filter.global'),
21610
21725
  allowClear: true,
@@ -21646,12 +21761,13 @@ var OrgTreeComponent = function OrgTreeComponent(_ref) {
21646
21761
  breadcrumbs: itemChain,
21647
21762
  open: open
21648
21763
  }),
21649
- onOpen: function onOpen() {
21764
+ onTriggerOpening: function onTriggerOpening() {
21650
21765
  return setOpen(true);
21651
21766
  },
21652
- onClose: function onClose() {
21767
+ onTriggerClosing: function onTriggerClosing() {
21653
21768
  return setOpen(false);
21654
21769
  },
21770
+ open: open,
21655
21771
  children: [/*#__PURE__*/jsxs("div", {
21656
21772
  className: toolbarLeft,
21657
21773
  children: [/*#__PURE__*/jsx(SearchSelect, {
@@ -21669,6 +21785,9 @@ var OrgTreeComponent = function OrgTreeComponent(_ref) {
21669
21785
  })]
21670
21786
  }), /*#__PURE__*/jsx(ZoomWrapper, {
21671
21787
  zoomToId: zoomToId,
21788
+ onInitialized: function onInitialized() {
21789
+ return setOpen(true);
21790
+ },
21672
21791
  children: /*#__PURE__*/jsx(OrgTree, {
21673
21792
  data: data,
21674
21793
  horizontal: !!configuration.horizontal,
@@ -24120,7 +24239,7 @@ var DropDown = function DropDown(_ref) {
24120
24239
  }, item.item._id);
24121
24240
  };
24122
24241
 
24123
- var Option = Select$1.Option;
24242
+ var Option = Select$2.Option;
24124
24243
  var RelationSelector = function RelationSelector(_ref, ref) {
24125
24244
  var _relationState$config, _relationState$config2, _relationState$config3, _searchPlaceholder;
24126
24245
  var id = _ref.id,
@@ -24146,7 +24265,7 @@ var RelationSelector = function RelationSelector(_ref, ref) {
24146
24265
  relationState.searchItems('');
24147
24266
  }, []);
24148
24267
  return /*#__PURE__*/jsxs(Fragment, {
24149
- children: [relationState.configuration.search != undefined && (((_relationState$config = relationState.configuration.filter) === null || _relationState$config === void 0 ? void 0 : _relationState$config.type) === 'default' ? /*#__PURE__*/jsxs(Select$1, {
24268
+ children: [relationState.configuration.search != undefined && (((_relationState$config = relationState.configuration.filter) === null || _relationState$config === void 0 ? void 0 : _relationState$config.type) === 'default' ? /*#__PURE__*/jsxs(Select$2, {
24150
24269
  className: select,
24151
24270
  showSearch: true,
24152
24271
  suffixIcon: /*#__PURE__*/jsx(PlusSquareOutlined, {}),