@fixefy/fixefy-ui-utils 0.2.57 → 0.2.58
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/dist/commander/index.js +3 -2
- package/dist/graphql/index.js +3 -1
- package/dist/headers/index.js +3 -2
- package/dist/json/index.js +12 -12
- package/dist/makeStyles/index.d.ts +3 -6
- package/dist/makeStyles/index.js +7 -2
- package/dist/page_context/index.d.ts +0 -6
- package/dist/page_context/index.js +538 -535
- package/dist/validate/index.d.ts +6 -5
- package/dist/validate/index.js +42 -34
- package/package.json +20 -20
package/dist/commander/index.js
CHANGED
|
@@ -295,8 +295,9 @@ const nest = ({ items })=>{
|
|
|
295
295
|
const nestedArray = [];
|
|
296
296
|
items.forEach((item)=>{
|
|
297
297
|
if (item) {
|
|
298
|
-
if (item.parent)
|
|
299
|
-
|
|
298
|
+
if (item.parent) {
|
|
299
|
+
if (mappedArray[item.parent]) mappedArray[item.parent].children.push(mappedArray[item.id]);
|
|
300
|
+
} else nestedArray.push(mappedArray[item.id]);
|
|
300
301
|
}
|
|
301
302
|
});
|
|
302
303
|
return nestedArray;
|
package/dist/graphql/index.js
CHANGED
|
@@ -301,7 +301,7 @@ const parseArgs = ({ raw, _variables, upper_key, key, action, value })=>{
|
|
|
301
301
|
});
|
|
302
302
|
} else {
|
|
303
303
|
// throw `Schema Object/Action Does Not Have Any Fields - '${operationName} - ${getFlower()}'`;
|
|
304
|
-
throw
|
|
304
|
+
throw 'Schema Object/Action Does Not Have Any Fields';
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
// if (_exists && raw.args.length > 0 && _exists === false) throw `Schema Object/Action Does Not Support - '${key}'`;
|
|
@@ -346,6 +346,7 @@ const parseFields = ({ fields, fields_obj, key, _variables, upper_key, value, ac
|
|
|
346
346
|
throw `Schema Object/Action Does Not Support - '${key}'`;
|
|
347
347
|
};
|
|
348
348
|
const setMutationEntityVariables = ({ field, kind, _variables, upper_key, value })=>{
|
|
349
|
+
// why to make such tricky code??? better to remove any and set types
|
|
349
350
|
Array.isArray(_variables[upper_key]) ? _variables[upper_key] = _variables[upper_key].map((item)=>_object_spread_props(_object_spread({}, item), {
|
|
350
351
|
[field.toLowerCase()]: buildValue({
|
|
351
352
|
name: kind,
|
|
@@ -359,6 +360,7 @@ const setMutationEntityVariables = ({ field, kind, _variables, upper_key, value
|
|
|
359
360
|
});
|
|
360
361
|
};
|
|
361
362
|
const setQueryEntityVariables = ({ field, _variables, upper_key, value })=>{
|
|
363
|
+
// why to make such tricky code??? better to remove 'any' and set types
|
|
362
364
|
field.includes('some') ? _variables[upper_key] = _object_spread_props(_object_spread({}, _variables[upper_key]), {
|
|
363
365
|
[field]: {
|
|
364
366
|
id_in: [
|
package/dist/headers/index.js
CHANGED
|
@@ -114,10 +114,11 @@ const getHeaders = (ctx)=>{
|
|
|
114
114
|
return headers;
|
|
115
115
|
};
|
|
116
116
|
const setHeaders = (ctx, _headers)=>{
|
|
117
|
-
typeof _headers
|
|
117
|
+
if (typeof _headers == 'string') (0, _nookies.setCookie)(ctx, 'fixefy:headers', _object_spread({}, JSON.parse(_headers)), {
|
|
118
118
|
maxAge: 7 * 24 * 60 * 60,
|
|
119
119
|
path: '/'
|
|
120
|
-
})
|
|
120
|
+
});
|
|
121
|
+
else (0, _nookies.setCookie)(ctx, 'fixefy:headers', _object_spread({}, _headers), {
|
|
121
122
|
maxAge: 7 * 24 * 60 * 60,
|
|
122
123
|
path: '/'
|
|
123
124
|
});
|
package/dist/json/index.js
CHANGED
|
@@ -34,7 +34,7 @@ _export(exports, {
|
|
|
34
34
|
const _ = require("..");
|
|
35
35
|
const getJToken = (jToken, jsonPath, defaultValue)=>{
|
|
36
36
|
// input check - if key is invalid - return error
|
|
37
|
-
if ((0, _.
|
|
37
|
+
if ((0, _.is_object_valid)(jToken) === false) return defaultValue;
|
|
38
38
|
// convert indexes to properties
|
|
39
39
|
jsonPath = jsonPath.replace(/\[(\w+)\]/g, '.$1');
|
|
40
40
|
// strip a leading dot
|
|
@@ -60,7 +60,7 @@ const getJToken = (jToken, jsonPath, defaultValue)=>{
|
|
|
60
60
|
isContinueLoop = false;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
} catch (
|
|
63
|
+
} catch (_e) {
|
|
64
64
|
jToken = 'No Value Found';
|
|
65
65
|
}
|
|
66
66
|
return jToken;
|
|
@@ -77,15 +77,15 @@ const getJPart = (j, jsonPath, defaultValue)=>{
|
|
|
77
77
|
const pathParts = jsonPath.split('.');
|
|
78
78
|
for(let i = 0, n = pathParts.length; isLoop && i < n; ++i){
|
|
79
79
|
currentPathPart = pathParts[i];
|
|
80
|
-
_isStringValid = (0, _.
|
|
81
|
-
_isArrayValid = (0, _.
|
|
80
|
+
_isStringValid = (0, _.is_string_valid)(j);
|
|
81
|
+
_isArrayValid = (0, _.is_array_valid)(j);
|
|
82
82
|
if (_isStringValid === true || _isArrayValid === true) {
|
|
83
83
|
if (_isStringValid === true) {
|
|
84
84
|
j = JSON.parse(j);
|
|
85
85
|
} else {
|
|
86
86
|
j = j.reduce((acc, cur)=>{
|
|
87
87
|
const innerJ = getJPart(cur, pathParts.slice(i).join('.'), defaultValue);
|
|
88
|
-
if ((0, _.
|
|
88
|
+
if ((0, _.is_array_valid)(innerJ)) {
|
|
89
89
|
acc.push(...innerJ);
|
|
90
90
|
} else {
|
|
91
91
|
acc.push(innerJ);
|
|
@@ -123,10 +123,10 @@ const isJson = (obj)=>{
|
|
|
123
123
|
let objAsString;
|
|
124
124
|
try {
|
|
125
125
|
objAsString = JSON.stringify(obj);
|
|
126
|
-
} catch (
|
|
126
|
+
} catch (_e) {
|
|
127
127
|
objAsString = null;
|
|
128
128
|
}
|
|
129
|
-
if (
|
|
129
|
+
if ((0, _.is_string_valid)(objAsString) == false) return false;
|
|
130
130
|
const rv = (objAsString === null || objAsString === void 0 ? void 0 : objAsString.indexOf('{')) === 0 && (objAsString === null || objAsString === void 0 ? void 0 : objAsString.indexOf('}')) === (objAsString === null || objAsString === void 0 ? void 0 : objAsString.length) - 1;
|
|
131
131
|
return rv;
|
|
132
132
|
};
|
|
@@ -137,7 +137,7 @@ const isNested = (obj)=>{
|
|
|
137
137
|
return rv;
|
|
138
138
|
};
|
|
139
139
|
const isResultValid = (jResult)=>{
|
|
140
|
-
if ((0, _.
|
|
140
|
+
if ((0, _.is_object_valid)(jResult) === false) return false;
|
|
141
141
|
const rv = getJPart(jResult, 'ok', 0);
|
|
142
142
|
return !!rv;
|
|
143
143
|
};
|
|
@@ -145,18 +145,18 @@ const setJToken = (jEntity, fieldPathsAndValues)=>{
|
|
|
145
145
|
let jCurrentToken, currentPath, pathParts, fieldName;
|
|
146
146
|
for(let i = 0; i < fieldPathsAndValues.length; ++i){
|
|
147
147
|
currentPath = fieldPathsAndValues[i]['json_path'];
|
|
148
|
-
if ((0, _.
|
|
148
|
+
if ((0, _.is_string_valid)(currentPath)) {
|
|
149
149
|
fieldName = currentPath;
|
|
150
150
|
pathParts = currentPath.split('.');
|
|
151
|
-
if ((0, _.
|
|
151
|
+
if ((0, _.is_array_valid)(pathParts)) {
|
|
152
152
|
fieldName = pathParts[pathParts.length - 1];
|
|
153
153
|
pathParts = pathParts.splice(0, Math.max(0, pathParts.length - 1));
|
|
154
|
-
if ((0, _.
|
|
154
|
+
if ((0, _.is_array_valid)(pathParts)) {
|
|
155
155
|
currentPath = pathParts.join('.');
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
jCurrentToken = getJPart(jEntity, currentPath, null);
|
|
159
|
-
if ((0, _.
|
|
159
|
+
if ((0, _.is_object_valid)(jCurrentToken) || isJson(jCurrentToken) === false) {
|
|
160
160
|
jCurrentToken = jEntity;
|
|
161
161
|
}
|
|
162
162
|
jCurrentToken[fieldName] = fieldPathsAndValues[i]['value'];
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
export declare const makeStyles: <Params = void, RuleNameSubsetReferencableInNestedSelectors extends string = never>(params?: {
|
|
2
2
|
name?: string | Record<string, unknown> | undefined;
|
|
3
3
|
uniqId?: string | undefined;
|
|
4
|
-
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: import("@mui/
|
|
5
|
-
props: Record<string, unknown>;
|
|
6
|
-
ownerState?: Record<string, unknown> | undefined;
|
|
7
|
-
} | undefined) => {
|
|
4
|
+
} | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: import("@mui/material").Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, muiStyleOverridesParams?: import("tss-react/mui/themeStyleOverridesPlugin").MuiThemeStyleOverridesPluginParams["muiStyleOverridesParams"]) => {
|
|
8
5
|
classes: Record<RuleName, string>;
|
|
9
|
-
theme: import("@mui/
|
|
6
|
+
theme: import("@mui/material").Theme;
|
|
10
7
|
css: import("tss-react").Css;
|
|
11
8
|
cx: import("tss-react").Cx;
|
|
12
9
|
}, useStyles: () => {
|
|
13
|
-
theme: import("@mui/
|
|
10
|
+
theme: import("@mui/material").Theme;
|
|
14
11
|
css: import("tss-react").Css;
|
|
15
12
|
cx: import("tss-react").Cx;
|
|
16
13
|
};
|
package/dist/makeStyles/index.js
CHANGED
|
@@ -17,7 +17,12 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _tssreact = require("tss-react");
|
|
20
|
-
const
|
|
20
|
+
const _useTheme = /*#__PURE__*/ _interop_require_default(require("@mui/material/styles/useTheme"));
|
|
21
|
+
function _interop_require_default(obj) {
|
|
22
|
+
return obj && obj.__esModule ? obj : {
|
|
23
|
+
default: obj
|
|
24
|
+
};
|
|
25
|
+
}
|
|
21
26
|
const { makeStyles, useStyles } = (0, _tssreact.createMakeStyles)({
|
|
22
|
-
useTheme:
|
|
27
|
+
useTheme: _useTheme.default
|
|
23
28
|
});
|