@k-int/stripes-kint-components 3.0.2 → 3.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 3.0.4 2022-10-07
2
+ * Fixed bug in intlKeyStore where multiple keys being added would break the structure
3
+
4
+ ## 3.0.3 2022-10-04
5
+ * Fixed issue where custom property ctx is not removable
6
+
1
7
  ## 3.0.2 2022-09-29
2
8
  * Fixed inconsistency between CustomPropertiesEditCtx and CustomPropertiesViewCtx labelOverrides
3
9
 
@@ -197,10 +197,10 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
197
197
  deleteCustProp = _useMutateCustomPrope.delete;
198
198
 
199
199
  var handeContextSubmit = function handeContextSubmit(submitData) {
200
- var _submitData$ctx, _submitData$ctx$;
200
+ var _submitData$ctx$0$val, _submitData$ctx, _submitData$ctx$;
201
201
 
202
202
  return _objectSpread(_objectSpread({}, submitData), {}, {
203
- ctx: submitData === null || submitData === void 0 ? void 0 : (_submitData$ctx = submitData.ctx) === null || _submitData$ctx === void 0 ? void 0 : (_submitData$ctx$ = _submitData$ctx[0]) === null || _submitData$ctx$ === void 0 ? void 0 : _submitData$ctx$.value
203
+ ctx: (_submitData$ctx$0$val = submitData === null || submitData === void 0 ? void 0 : (_submitData$ctx = submitData.ctx) === null || _submitData$ctx === void 0 ? void 0 : (_submitData$ctx$ = _submitData$ctx[0]) === null || _submitData$ctx$ === void 0 ? void 0 : _submitData$ctx$.value) !== null && _submitData$ctx$0$val !== void 0 ? _submitData$ctx$0$val : ''
204
204
  });
205
205
  }; // When POSTing a custom property, the backend expects a shorthand "Integer" or "LocalDate"
206
206
  // When PUTing a custom property, the backend needs the full class name
@@ -41,9 +41,9 @@ var useIntlKeyStore = (0, _zustand.default)(function (set, get) {
41
41
  ns = folioNS;
42
42
  }
43
43
 
44
- return {
45
- intlKeys: _objectSpread(_defineProperty({}, ns, key), state)
46
- };
44
+ return _objectSpread(_objectSpread({}, state), {}, {
45
+ intlKeys: _objectSpread(_defineProperty({}, ns, key), state.intlKeys)
46
+ });
47
47
  });
48
48
  },
49
49
  removeKey: function removeKey(namespace) {
@@ -61,9 +61,9 @@ var useIntlKeyStore = (0, _zustand.default)(function (set, get) {
61
61
  _valueToRemove = _state$intlKeys[ns],
62
62
  newKeys = _objectWithoutProperties(_state$intlKeys, [ns].map(_toPropertyKey));
63
63
 
64
- return {
64
+ return _objectSpread(_objectSpread({}, state), {}, {
65
65
  intlKeys: newKeys
66
- };
66
+ });
67
67
  });
68
68
  },
69
69
  getKey: function getKey(namespace) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -126,7 +126,7 @@ const CustomPropertiesSettings = ({
126
126
  const handeContextSubmit = (submitData) => {
127
127
  return {
128
128
  ...submitData,
129
- ctx: submitData?.ctx?.[0]?.value
129
+ ctx: submitData?.ctx?.[0]?.value ?? ''
130
130
  };
131
131
  };
132
132
 
@@ -12,7 +12,7 @@ const useIntlKeyStore = create((set, get) => ({
12
12
  ns = folioNS;
13
13
  }
14
14
 
15
- return { intlKeys: { [ns]: key, ...state } };
15
+ return { ...state, intlKeys: { [ns]: key, ...state.intlKeys } };
16
16
  }),
17
17
  removeKey: (namespace) => set((state) => {
18
18
  let ns = namespace;
@@ -22,7 +22,7 @@ const useIntlKeyStore = create((set, get) => ({
22
22
  }
23
23
 
24
24
  const { [ns]: _valueToRemove, ...newKeys } = state.intlKeys;
25
- return { intlKeys: newKeys };
25
+ return { ...state, intlKeys: newKeys };
26
26
  }),
27
27
  getKey: (namespace) => {
28
28
  let ns = namespace;