@jsonui/react 0.1.1 → 0.3.0
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.
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
import React, { ReactNode } from 'react';
|
|
3
3
|
import { Store, AnyAction } from 'redux';
|
|
4
4
|
import { Persistor } from 'redux-persist/es/types';
|
|
5
|
+
export declare type JSONPrimitive = string | number | boolean | null;
|
|
6
|
+
export declare type JSONValue = JSONPrimitive | JSONObject | JSONArray;
|
|
7
|
+
export declare type JSONObject = {
|
|
8
|
+
[member: string]: JSONValue;
|
|
9
|
+
};
|
|
10
|
+
export declare type JSONArray = Array<JSONValue>;
|
|
5
11
|
export interface DefaultValues {
|
|
6
|
-
[key: string]:
|
|
12
|
+
[key: string]: JSONValue;
|
|
7
13
|
}
|
|
8
14
|
declare type MyProps = {
|
|
9
15
|
children: ReactNode;
|
package/dist/esm/index.js
CHANGED
|
@@ -8122,7 +8122,16 @@ var collectObjToArray = function (refConst, json) {
|
|
|
8122
8122
|
return refs_2;
|
|
8123
8123
|
}
|
|
8124
8124
|
return [];
|
|
8125
|
-
};
|
|
8125
|
+
};
|
|
8126
|
+
var isCircular = function (d) {
|
|
8127
|
+
try {
|
|
8128
|
+
JSON.stringify(d);
|
|
8129
|
+
}
|
|
8130
|
+
catch (e) {
|
|
8131
|
+
return true;
|
|
8132
|
+
}
|
|
8133
|
+
return false;
|
|
8134
|
+
};var util$1=/*#__PURE__*/Object.freeze({__proto__:null,findLastIndex:findLastIndex,drop:drop,isNumber:isNumber,jsonPointerGet:jsonPointerGet,jsonPointerSet:jsonPointerSet,pathArrayToPathString:pathArrayToPathString,pathArrayToJsonPointer:pathArrayToJsonPointer,isOnlyObject:isOnlyObject,mergePath:mergePath,changeRelativePath:changeRelativePath,mergeDeep:mergeDeep,collectObjMerge:collectObjMerge,collectObjToArray:collectObjToArray,isCircular:isCircular});var actionBuilder = function (props, stock) {
|
|
8126
8135
|
var paths = [];
|
|
8127
8136
|
props.parentComp; var propsNew = __rest(props
|
|
8128
8137
|
// eslint-disable-next-line func-names
|
|
@@ -15919,7 +15928,7 @@ var reducer = function (state, action) {
|
|
|
15919
15928
|
switch (action === null || action === void 0 ? void 0 : action.type) {
|
|
15920
15929
|
case DATA_UPDATE: {
|
|
15921
15930
|
var _a = (action === null || action === void 0 ? void 0 : action.payload) || {}, _b = _a.store, store_1 = _b === void 0 ? undefined : _b, _c = _a.path, path = _c === void 0 ? undefined : _c, _d = _a.value, value_1 = _d === void 0 ? undefined : _d, _e = _a.jsonataDef, jsonataDef_1 = _e === void 0 ? undefined : _e, _f = _a.currentPaths, currentPaths = _f === void 0 ? undefined : _f, _g = _a.stock, stock_1 = _g === void 0 ? undefined : _g;
|
|
15922
|
-
if (store_1 && path) {
|
|
15931
|
+
if (store_1 && path && !isCircular(value_1)) {
|
|
15923
15932
|
var storekey = "".concat(store_1);
|
|
15924
15933
|
var convertedPath_1 = currentPaths && currentPaths[storekey] && currentPaths[storekey].path
|
|
15925
15934
|
? changeRelativePath("".concat(currentPaths[storekey].path).concat(SEPARATOR).concat(path))
|