@crystaldesign/diva-backoffice 25.15.0-beta.5 → 25.15.0-beta.6

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.
@@ -18520,16 +18520,27 @@ function useSelectSimpleData (_ref) {
18520
18520
  return selected.value;
18521
18521
  }, [selected]);
18522
18522
 
18523
- //initialize the selected value if it is not set yet and handle race condition between value and options
18523
+ // Sync selection when external value changes
18524
18524
  useEffect(function () {
18525
- if (value && options && selected == undefined) {
18526
- var sel = findByValue(value, options, selectMapping);
18527
- if (sel) {
18528
- var selectedValues = Array.isArray(sel) ? sel.map(function (item) {
18529
- return item.value;
18530
- }) : sel.value;
18531
- onSelectionChanged(selectedValues, sel);
18525
+ if (!options) return;
18526
+ if (value === undefined) {
18527
+ if (selected !== undefined) {
18528
+ setSelected(undefined);
18532
18529
  }
18530
+ return;
18531
+ }
18532
+ var sel = findByValue(value, options, selectMapping);
18533
+ if (!sel) return;
18534
+
18535
+ // Compare found option's value with current value
18536
+ var foundValue = Array.isArray(sel) ? sel.map(function (item) {
18537
+ return item.value;
18538
+ }) : sel.value;
18539
+ var valuesMatch = Array.isArray(foundValue) ? Array.isArray(currentValue) && foundValue.length === currentValue.length && foundValue.every(function (v, i) {
18540
+ return v === currentValue[i];
18541
+ }) : foundValue === currentValue;
18542
+ if (!valuesMatch) {
18543
+ onSelectionChanged(foundValue, sel);
18533
18544
  }
18534
18545
  }, [value, options]);
18535
18546
  var setLoadedOptions = function setLoadedOptions(options) {
@@ -39520,6 +39531,9 @@ var useSeriesSelector = function useSeriesSelector(modules) {
39520
39531
  label: "${seriesName.".concat(i18n.language.toLocaleUpperCase(), "} (${serieNo})"),
39521
39532
  value: '${_id}'
39522
39533
  };
39534
+ useEffect(function () {
39535
+ setSelected(selectedSerie);
39536
+ }, [selectedSerie]);
39523
39537
  var fetchSerie = /*#__PURE__*/function () {
39524
39538
  var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(newSerie) {
39525
39539
  var _seriesSelectorState$, _seriesSelectorState$2;
@@ -40217,7 +40231,7 @@ var TableItems = observer(function () {
40217
40231
  serie: selectedSerie,
40218
40232
  setSerie: setSelectedSerie,
40219
40233
  setArticle: setSelectedItem,
40220
- item: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.typeNo
40234
+ item: selectedItem
40221
40235
  });
40222
40236
  var hooks = useMemo(function () {
40223
40237
  return {
@@ -40766,38 +40780,24 @@ var TableFeatures$2 = observer(function () {
40766
40780
  apiConfig = _useModule.apiConfig,
40767
40781
  setSelectedSerie = _useModule.setSelectedSerie,
40768
40782
  setSelectedItem = _useModule.setSelectedItem;
40769
- var _useTools = useTools({
40770
- catalog: selectedCatalog,
40771
- setSerie: setSelectedSerie,
40772
- setArticle: setSelectedItem,
40773
- conditionalTools: [{
40774
- id: 'globalfeatures',
40775
- name: t('backoffice.menu.features.label.IDMGlobalFeatures'),
40776
- elementComponent: Features$1,
40777
- elementProps: {
40778
- readOnly: true
40779
- },
40780
- where: 'right',
40781
- condition: function condition() {
40782
- return selectedCatalog !== undefined;
40783
- }
40784
- }]
40785
- }),
40786
- updateConfigurator = _useTools.updateConfigurator;
40787
- var ref = useRef(null);
40788
- var hooks = useMemo(function () {
40789
- return {
40790
- onCellSelectionChanged: function onCellSelectionChanged(event) {
40791
- // Check if all selections are from the same node
40792
- if (event.selection.length == 1) {
40793
- var _event$selection$;
40794
- updateConfigurator({
40795
- opt: (_event$selection$ = event.selection[0]) === null || _event$selection$ === void 0 || (_event$selection$ = _event$selection$.node) === null || _event$selection$ === void 0 || (_event$selection$ = _event$selection$.data) === null || _event$selection$ === void 0 ? void 0 : _event$selection$.featureNo
40796
- });
40797
- }
40783
+ useTools({
40784
+ catalog: selectedCatalog,
40785
+ setSerie: setSelectedSerie,
40786
+ setArticle: setSelectedItem,
40787
+ conditionalTools: [{
40788
+ id: 'globalfeatures',
40789
+ name: t('backoffice.menu.features.label.IDMGlobalFeatures'),
40790
+ elementComponent: Features$1,
40791
+ elementProps: {
40792
+ readOnly: true
40793
+ },
40794
+ where: 'right',
40795
+ condition: function condition() {
40796
+ return selectedCatalog !== undefined;
40798
40797
  }
40799
- };
40800
- }, [updateConfigurator]);
40798
+ }]
40799
+ });
40800
+ var ref = useRef(null);
40801
40801
  return /*#__PURE__*/jsxs(Fragment, {
40802
40802
  children: [/*#__PURE__*/jsx(Descriptions$1, {
40803
40803
  title: /*#__PURE__*/jsxs("div", {
@@ -40857,7 +40857,6 @@ var TableFeatures$2 = observer(function () {
40857
40857
  }), selectedCatalog && /*#__PURE__*/jsx(Features$2, {
40858
40858
  organizationId: organizationId,
40859
40859
  selectedCatalog: selectedCatalog,
40860
- hooks: hooks,
40861
40860
  apiConfig: apiConfig,
40862
40861
  ref: ref
40863
40862
  })]
@@ -41040,27 +41039,15 @@ var TableOptions$1 = observer(function () {
41040
41039
  apiConfig = _useModule.apiConfig,
41041
41040
  organizationId = _useModule.organizationId,
41042
41041
  setSelectedSerie = _useModule.setSelectedSerie,
41043
- setSelectedItem = _useModule.setSelectedItem;
41044
- var _useTools = useTools({
41045
- catalog: selectedCatalog,
41046
- setSerie: setSelectedSerie,
41047
- setArticle: setSelectedItem
41048
- }),
41049
- updateConfigurator = _useTools.updateConfigurator;
41042
+ setSelectedItem = _useModule.setSelectedItem,
41043
+ selectedSerie = _useModule.selectedSerie;
41044
+ useTools({
41045
+ catalog: selectedCatalog,
41046
+ serie: selectedSerie,
41047
+ setSerie: setSelectedSerie,
41048
+ setArticle: setSelectedItem
41049
+ });
41050
41050
  var ref = useRef(null);
41051
- var hooks = useMemo(function () {
41052
- return {
41053
- onCellSelectionChanged: function onCellSelectionChanged(event) {
41054
- // Check if all selections are from the same node
41055
- if (event.selection.length == 1) {
41056
- var _event$selection$;
41057
- updateConfigurator({
41058
- opv: (_event$selection$ = event.selection[0]) === null || _event$selection$ === void 0 || (_event$selection$ = _event$selection$.node) === null || _event$selection$ === void 0 || (_event$selection$ = _event$selection$.data) === null || _event$selection$ === void 0 ? void 0 : _event$selection$.optionKey
41059
- });
41060
- }
41061
- }
41062
- };
41063
- }, [updateConfigurator]);
41064
41051
  return /*#__PURE__*/jsxs(Fragment, {
41065
41052
  children: [/*#__PURE__*/jsx(Descriptions$1, {
41066
41053
  title: /*#__PURE__*/jsxs("div", {
@@ -41102,7 +41089,6 @@ var TableOptions$1 = observer(function () {
41102
41089
  }), selectedCatalog && /*#__PURE__*/jsx(Options$1, {
41103
41090
  organizationId: organizationId,
41104
41091
  selectedCatalog: selectedCatalog,
41105
- hooks: hooks,
41106
41092
  apiConfig: apiConfig,
41107
41093
  ref: ref
41108
41094
  })]
@@ -46059,6 +46045,11 @@ var CatalogSelection = function CatalogSelection(_ref) {
46059
46045
  setArticleCodex(undefined);
46060
46046
  setSerieProp === null || setSerieProp === void 0 || setSerieProp(cat);
46061
46047
  };
46048
+ useEffect(function () {
46049
+ if (options.length > 0 && !serie) {
46050
+ onChange(options[0].value);
46051
+ }
46052
+ }, [options]);
46062
46053
  return /*#__PURE__*/jsx("div", {
46063
46054
  className: wrapper,
46064
46055
  children: /*#__PURE__*/jsx(Select$1, {
@@ -46075,7 +46066,7 @@ var CatalogSelection$1 = observer(CatalogSelection);
46075
46066
  function ownKeys$3(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; }
46076
46067
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
46077
46068
  var Wsyiwyg = function Wsyiwyg(_ref) {
46078
- var _state$serie, _state$serie2, _state$serie3, _state$serie4, _tool$parameters, _state$articleCodex, _state$serie$catalogC, _state$serie5, _state$mask2, _state$serie6, _state$serie$accountI, _state$serie7, _state$mask3;
46069
+ var _tool$elementProps$in, _state$serie, _state$serie2, _state$serie3, _state$serie4, _tool$parameters, _state$articleCodex, _state$serie$catalogC, _state$serie5, _state$mask2, _state$serie6, _state$serie$accountI, _state$serie7, _state$mask3;
46079
46070
  var tool = _ref.tool,
46080
46071
  toolbar = _ref.toolbar;
46081
46072
  var _useDivaCore = useDivaCore(),
@@ -46116,10 +46107,12 @@ var Wsyiwyg = function Wsyiwyg(_ref) {
46116
46107
  state.setArticleCodex(undefined);
46117
46108
  }
46118
46109
  }
46110
+ }, [(_tool$elementProps$in = tool.elementProps.initSerie) === null || _tool$elementProps$in === void 0 ? void 0 : _tool$elementProps$in.serieNo, state.serieList]);
46111
+ useEffect(function () {
46119
46112
  if (tool.elementProps.initItem) {
46120
46113
  state.setArticleCodex(tool.elementProps.initItem);
46121
46114
  }
46122
- }, [tool.elementProps.initItem, tool.elementProps.initSerie, state.serieList]);
46115
+ }, [tool.elementProps.initItem]);
46123
46116
  if (tool.elementProps.onlyPlaceholder) {
46124
46117
  return /*#__PURE__*/jsx("div", {});
46125
46118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/layout/Toolbar/Tools/WYSIWYG_Configurator/CatalogSelection/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,CAAC;8GACwC,KAAK;;;AAoCnH,wBAA0C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/layout/Toolbar/Tools/WYSIWYG_Configurator/CatalogSelection/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAIzD,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,CAAC;8GACwC,KAAK;;;AA0CnH,wBAA0C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/layout/Toolbar/Tools/WYSIWYG_Configurator/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMtD,QAAA,MAAM,OAAO,sBAAuB,SAAS,sBAuG5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/layout/Toolbar/Tools/WYSIWYG_Configurator/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAMtD,QAAA,MAAM,OAAO,sBAAuB,SAAS,sBA0G5C,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SeriesSelector.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/PrefilterSelectors/SeriesSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;uCASH;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE;;;AAqB1D,wBAAwC"}
1
+ {"version":3,"file":"SeriesSelector.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/PrefilterSelectors/SeriesSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;uCASd;IAAE,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE;;;AAqB1D,wBAAwC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableFeatures/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAgB1D,eAAO,MAAM,aAAa;;CAgFxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableFeatures/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAgBtC,eAAO,MAAM,aAAa;;CAiExB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableOptions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAa/C,eAAO,MAAM,YAAY;;CAmEvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableOptions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAatC,eAAO,MAAM,YAAY;;CA0DvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectSimpleData.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/SelectSimple/useSelectSimpleData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAiB,MAAM,SAAS,CAAC;AAOvE,MAAM,CAAC,OAAO,WAAW,EACvB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EACf,WAAW,GACZ,EAAE,qBAAqB;;;;sBAkFa,GAAG,UAAU,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;;EAiB9E"}
1
+ {"version":3,"file":"useSelectSimpleData.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/SelectSimple/useSelectSimpleData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAiB,MAAM,SAAS,CAAC;AAOvE,MAAM,CAAC,OAAO,WAAW,EACvB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EACf,WAAW,GACZ,EAAE,qBAAqB;;;;sBAgGa,GAAG,UAAU,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS;;EAiB9E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-backoffice",
3
- "version": "25.15.0-beta.5",
3
+ "version": "25.15.0-beta.6",
4
4
  "license": "COMMERCIAL",
5
5
  "devDependencies": {
6
6
  "@testing-library/jest-dom": "^6.5.0",
@@ -15,13 +15,13 @@
15
15
  "dependencies": {
16
16
  "@ant-design/icons": "5.4.0",
17
17
  "@babel/runtime": "7.24.7",
18
- "@crystaldesign/content-box": "25.15.0-beta.5",
19
- "@crystaldesign/content-item": "25.15.0-beta.5",
20
- "@crystaldesign/diva-core": "25.15.0-beta.5",
21
- "@crystaldesign/diva-utils": "25.15.0-beta.5",
22
- "@crystaldesign/media-upload": "25.15.0-beta.5",
23
- "@crystaldesign/rtf-editor": "25.15.0-beta.5",
24
- "@crystaldesign/spreadsheet": "25.15.0-beta.5",
18
+ "@crystaldesign/content-box": "25.15.0-beta.6",
19
+ "@crystaldesign/content-item": "25.15.0-beta.6",
20
+ "@crystaldesign/diva-core": "25.15.0-beta.6",
21
+ "@crystaldesign/diva-utils": "25.15.0-beta.6",
22
+ "@crystaldesign/media-upload": "25.15.0-beta.6",
23
+ "@crystaldesign/rtf-editor": "25.15.0-beta.6",
24
+ "@crystaldesign/spreadsheet": "25.15.0-beta.6",
25
25
  "@google/model-viewer": "3.5.0",
26
26
  "ag-charts-community": "^10.1.0",
27
27
  "ag-charts-react": "^10.1.0",
@@ -51,5 +51,5 @@
51
51
  },
52
52
  "module": "build/esm/index.js",
53
53
  "types": "./build/types/backoffice/src/index.d.ts",
54
- "gitHead": "3d00a0b451b05b9bb8c06a06778fcca56d1ccd18"
54
+ "gitHead": "e04ac62e2e9d1cce3ed314ed39afae13387a19ca"
55
55
  }