@crystaldesign/diva-seller 24.12.0-rc.7 → 24.12.0-rc.9

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.
@@ -99,7 +99,6 @@ import ListItemText from '@material-ui/core/ListItemText';
99
99
  import SearchField from '@crystaldesign/searchfield';
100
100
  import Drawer from '@material-ui/core/Drawer';
101
101
  import AssetEditor, { DivaFile } from '@crystaldesign/media-upload';
102
- import { flatten, unflatten } from 'flat';
103
102
  import AddIcon$1 from '@material-ui/icons/NoteAdd';
104
103
  import DeleteIcon from '@material-ui/icons/Delete';
105
104
  import debounce from 'lodash/debounce';
@@ -5159,6 +5158,7 @@ function DiscountField (_ref) {
5159
5158
  decimalScale: 1,
5160
5159
  value: discount.percentageDiscount ? discount.percentageDiscount : '',
5161
5160
  id: "discount-percent",
5161
+ customInput: StyledTextFiled$1,
5162
5162
  isAllowed: function isAllowed(v) {
5163
5163
  return !v.floatValue || v.floatValue <= 100 && v.floatValue >= 0;
5164
5164
  },
@@ -6521,8 +6521,8 @@ function useRenderjobDetail (_ref) {
6521
6521
  return atob(d3dps);
6522
6522
  };
6523
6523
  var getHqRenderScript = function getHqRenderScript(product) {
6524
- var _product$hqRenderScri, _product$configuratio6;
6525
- var hqRenderScript = (_product$hqRenderScri = product.hqRenderScript) !== null && _product$hqRenderScri !== void 0 ? _product$hqRenderScri : (_product$configuratio6 = product.configuration) === null || _product$configuratio6 === void 0 || (_product$configuratio6 = _product$configuratio6.OrderSets[0]) === null || _product$configuratio6 === void 0 ? void 0 : _product$configuratio6.HQRenderScript;
6524
+ var _product$configuratio6;
6525
+ var hqRenderScript = (_product$configuratio6 = product.configuration) === null || _product$configuratio6 === void 0 || (_product$configuratio6 = _product$configuratio6.OrderSets[0]) === null || _product$configuratio6 === void 0 ? void 0 : _product$configuratio6.HQRenderScript;
6526
6526
  if (!hqRenderScript) throw new Error('cant order renderjob without hqrenderscript');
6527
6527
  return hqRenderScript;
6528
6528
  };
@@ -14114,15 +14114,12 @@ function updateVariants(prevState, currentState, configurationData, baseDataFiel
14114
14114
  } else if (field.includes('.')) {
14115
14115
  var _currentState$modifie2;
14116
14116
  //handle nested fields
14117
- var flatVarinat = flatten(variant);
14118
- var flatNewVarinat = newVariant ? flatten(newVariant) : {};
14119
- var flatFinalVariant = flatten(finalVariant);
14120
- var flatBase = flatten(currentState.baseData);
14121
- var _ProductHandler$calcu2 = ProductHandler.calculateComputedValue(flatVarinat[field], flatNewVarinat[field], flatBase[field], (_currentState$modifie2 = currentState.modified.variantData[_i]) === null || _currentState$modifie2 === void 0 ? void 0 : _currentState$modifie2[field]),
14117
+
14118
+ var path = field.split('.');
14119
+ var _ProductHandler$calcu2 = ProductHandler.calculateComputedValue(getData(path, variant), newVariant ? getData(path, newVariant) : undefined, getData(path, currentState.baseData), (_currentState$modifie2 = currentState.modified.variantData[_i]) === null || _currentState$modifie2 === void 0 ? void 0 : _currentState$modifie2[field]),
14122
14120
  _value2 = _ProductHandler$calcu2.value,
14123
14121
  _modified2 = _ProductHandler$calcu2.modified;
14124
- flatFinalVariant[field] = _value2;
14125
- finalVariant = unflatten(flatFinalVariant);
14122
+ setData(path, _value2, finalVariant);
14126
14123
  finalVariant.media = variant.media;
14127
14124
  newModified[field] = _modified2;
14128
14125
  } else if (custom) {
@@ -14461,6 +14458,36 @@ function getMediaObjectbyDivaFile(logofile) {
14461
14458
  name: logofile.fileName
14462
14459
  };
14463
14460
  }
14461
+ function getData(id, data) {
14462
+ if (typeof id === 'string') {
14463
+ return data[id];
14464
+ } else {
14465
+ var names = _toConsumableArray(id);
14466
+ var obj = data;
14467
+ while (names.length > 1) {
14468
+ if (!obj[names[0]]) return undefined;
14469
+ obj = obj[names[0]];
14470
+ names.shift();
14471
+ }
14472
+ return obj[names[0]];
14473
+ }
14474
+ }
14475
+ function setData(id, value, data) {
14476
+ if (typeof id === 'string') {
14477
+ data[id] = value;
14478
+ } else {
14479
+ var names = _toConsumableArray(id);
14480
+ var obj = data;
14481
+ while (names.length > 1) {
14482
+ if (!obj[names[0]]) {
14483
+ obj[names[0]] = {};
14484
+ }
14485
+ obj = obj[names[0]];
14486
+ names.shift();
14487
+ }
14488
+ obj[names[0]] = value;
14489
+ }
14490
+ }
14464
14491
 
14465
14492
  var _excluded$1 = ["value", "onChange"];
14466
14493
  function ownKeys$4(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; }
@@ -1 +1 @@
1
- {"version":3,"file":"DiscountField.d.ts","sourceRoot":"","sources":["../../../../../src/ui/DiscountField.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,cAAc,EAA0B,MAAM,mBAAmB,CAAC;AACtF,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAExE,MAAM,CAAC,OAAO,WAAW,EACvB,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,KAAS,EACT,uBAAuB,GACxB,EAAE;IACD,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjF,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACxD,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,qBAwCA;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,KAAK,EAAE,SAAS,EAChB,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,GAAG,cAAc,GAAG;IAAE,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,qBA2BtG"}
1
+ {"version":3,"file":"DiscountField.d.ts","sourceRoot":"","sources":["../../../../../src/ui/DiscountField.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,cAAc,EAA0B,MAAM,mBAAmB,CAAC;AACtF,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAExE,MAAM,CAAC,OAAO,WAAW,EACvB,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,KAAS,EACT,uBAAuB,GACxB,EAAE;IACD,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjF,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACxD,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,qBAyCA;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,KAAK,EAAE,SAAS,EAChB,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,kBAAkB,EAAE,eAAe,CAAC,GAAG,cAAc,GAAG;IAAE,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;CAAE,qBA2BtG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crystaldesign/diva-seller",
3
- "version": "24.12.0-rc.7",
3
+ "version": "24.12.0-rc.9",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -29,9 +29,9 @@
29
29
  "react-dom": "^18.3.1"
30
30
  },
31
31
  "dependencies": {
32
- "@crystaldesign/analytics": "24.12.0-rc.7",
33
- "@crystaldesign/products-component": "24.12.0-rc.7",
34
- "@crystaldesign/real-time-viewer": "24.12.0-rc.7",
32
+ "@crystaldesign/analytics": "24.12.0-rc.9",
33
+ "@crystaldesign/products-component": "24.12.0-rc.9",
34
+ "@crystaldesign/real-time-viewer": "24.12.0-rc.9",
35
35
  "@material-ui/core": "^4.12.4",
36
36
  "@material-ui/icons": "^4.11.2",
37
37
  "react-error-boundary": "^4.0.13",
@@ -41,5 +41,5 @@
41
41
  },
42
42
  "types": "./build/types/seller/src/index.d.ts",
43
43
  "module": "build/esm/index.js",
44
- "gitHead": "a4c7151630eec15f6bdca8b558a6ecc548f2077c"
44
+ "gitHead": "4f6977c9b6a78576cd6d8041773a17957bfc5fa9"
45
45
  }