@fixefy/fixefy-ui-utils 0.2.60 → 0.2.62

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.
@@ -77,13 +77,4 @@ const attachAuth = (ctx, headers)=>{
77
77
  };
78
78
  const getToken = (ctx)=>{
79
79
  return (0, _nookies.parseCookies)(ctx)['token'];
80
- } // export const checkLoggedIn = async ({ client }) => {
81
- // const rv = await client
82
- // .query({ query: gql(ME_QUERY) })
83
- // .then(({ data }) => ({ loggedInUser: data }))
84
- // .catch(() => ({
85
- // loggedInUser: null,
86
- // })); // Fail gracefully
87
- // return rv;
88
- // };
89
- ;
80
+ };
package/dist/index.d.ts CHANGED
@@ -11,6 +11,5 @@ export * from './page_context';
11
11
  export * from './redirect';
12
12
  export * from './transform';
13
13
  export * from './types';
14
- export * from './validate';
15
14
  import getPageContext from './page_context';
16
15
  export { getPageContext };
package/dist/index.js CHANGED
@@ -21,7 +21,6 @@ const _page_context = /*#__PURE__*/ _interop_require_default(_export_star(requir
21
21
  _export_star(require("./redirect"), exports);
22
22
  _export_star(require("./transform"), exports);
23
23
  _export_star(require("./types"), exports);
24
- _export_star(require("./validate"), exports);
25
24
  function _export_star(from, to) {
26
25
  Object.keys(from).forEach(function(k) {
27
26
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -31,10 +31,15 @@ _export(exports, {
31
31
  return setJToken;
32
32
  }
33
33
  });
34
- const _validate = require("../validate");
34
+ const _fixefyvalidate = /*#__PURE__*/ _interop_require_default(require("@fixefy/fixefy-validate"));
35
+ function _interop_require_default(obj) {
36
+ return obj && obj.__esModule ? obj : {
37
+ default: obj
38
+ };
39
+ }
35
40
  const getJToken = (jToken, jsonPath, defaultValue)=>{
36
41
  // input check - if key is invalid - return error
37
- if ((0, _validate.is_object_valid)(jToken) === false) return defaultValue;
42
+ if (_fixefyvalidate.default.is_object_valid(jToken) === false) return defaultValue;
38
43
  // convert indexes to properties
39
44
  jsonPath = jsonPath.replace(/\[(\w+)\]/g, '.$1');
40
45
  // strip a leading dot
@@ -77,15 +82,15 @@ const getJPart = (j, jsonPath, defaultValue)=>{
77
82
  const pathParts = jsonPath.split('.');
78
83
  for(let i = 0, n = pathParts.length; isLoop && i < n; ++i){
79
84
  currentPathPart = pathParts[i];
80
- _isStringValid = (0, _validate.is_string_valid)(j);
81
- _isArrayValid = (0, _validate.is_array_valid)(j);
85
+ _isStringValid = _fixefyvalidate.default.is_string_valid(j);
86
+ _isArrayValid = _fixefyvalidate.default.is_array_valid(j);
82
87
  if (_isStringValid === true || _isArrayValid === true) {
83
88
  if (_isStringValid === true) {
84
89
  j = JSON.parse(j);
85
90
  } else {
86
91
  j = j.reduce((acc, cur)=>{
87
92
  const innerJ = getJPart(cur, pathParts.slice(i).join('.'), defaultValue);
88
- if ((0, _validate.is_array_valid)(innerJ)) {
93
+ if (_fixefyvalidate.default.is_array_valid(innerJ)) {
89
94
  acc.push(...innerJ);
90
95
  } else {
91
96
  acc.push(innerJ);
@@ -126,7 +131,7 @@ const isJson = (obj)=>{
126
131
  } catch (_e) {
127
132
  objAsString = null;
128
133
  }
129
- if ((0, _validate.is_string_valid)(objAsString) == false) return false;
134
+ if (_fixefyvalidate.default.is_string_valid(objAsString) == false) return false;
130
135
  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
136
  return rv;
132
137
  };
@@ -137,7 +142,7 @@ const isNested = (obj)=>{
137
142
  return rv;
138
143
  };
139
144
  const isResultValid = (jResult)=>{
140
- if ((0, _validate.is_object_valid)(jResult) === false) return false;
145
+ if (_fixefyvalidate.default.is_object_valid(jResult) === false) return false;
141
146
  const rv = getJPart(jResult, 'ok', 0);
142
147
  return !!rv;
143
148
  };
@@ -145,18 +150,18 @@ const setJToken = (jEntity, fieldPathsAndValues)=>{
145
150
  let jCurrentToken, currentPath, pathParts, fieldName;
146
151
  for(let i = 0; i < fieldPathsAndValues.length; ++i){
147
152
  currentPath = fieldPathsAndValues[i]['json_path'];
148
- if ((0, _validate.is_string_valid)(currentPath)) {
153
+ if (_fixefyvalidate.default.is_string_valid(currentPath)) {
149
154
  fieldName = currentPath;
150
155
  pathParts = currentPath.split('.');
151
- if ((0, _validate.is_array_valid)(pathParts)) {
156
+ if (_fixefyvalidate.default.is_array_valid(pathParts)) {
152
157
  fieldName = pathParts[pathParts.length - 1];
153
158
  pathParts = pathParts.splice(0, Math.max(0, pathParts.length - 1));
154
- if ((0, _validate.is_array_valid)(pathParts)) {
159
+ if (_fixefyvalidate.default.is_array_valid(pathParts)) {
155
160
  currentPath = pathParts.join('.');
156
161
  }
157
162
  }
158
163
  jCurrentToken = getJPart(jEntity, currentPath, null);
159
- if ((0, _validate.is_object_valid)(jCurrentToken) || isJson(jCurrentToken) === false) {
164
+ if (_fixefyvalidate.default.is_object_valid(jCurrentToken) || isJson(jCurrentToken) === false) {
160
165
  jCurrentToken = jEntity;
161
166
  }
162
167
  jCurrentToken[fieldName] = fieldPathsAndValues[i]['value'];
@@ -251,6 +251,7 @@ declare module '@mui/material/styles' {
251
251
  in_review: StatusColorOption;
252
252
  no_pricing: StatusColorOption;
253
253
  pending: StatusColorOption;
254
+ pending_review: StatusColorOption;
254
255
  pending_refund: StatusColorOption;
255
256
  resolved: StatusColorOption;
256
257
  submitted_for_billing: StatusColorOption;
@@ -266,6 +267,7 @@ declare module '@mui/material/styles' {
266
267
  paid: StatusColorOption;
267
268
  paid_and_refunded: StatusColorOption;
268
269
  pending: StatusColorOption;
270
+ pending_review: StatusColorOption;
269
271
  pending_refund: StatusColorOption;
270
272
  closed: StatusColorOption;
271
273
  refunded: StatusColorOption;
@@ -283,6 +285,7 @@ declare module '@mui/material/styles' {
283
285
  paid: StatusColorOption;
284
286
  paid_and_refunded: StatusColorOption;
285
287
  pending: StatusColorOption;
288
+ pending_review: StatusColorOption;
286
289
  pending_refund: StatusColorOption;
287
290
  closed: StatusColorOption;
288
291
  submitted_for_billing: StatusColorOption;
@@ -364,6 +364,10 @@ const palette = {
364
364
  border: '#ECC631',
365
365
  background: '#FEFDF3'
366
366
  },
367
+ pending_review: {
368
+ border: '#2D9CDB',
369
+ background: '#F1FBFE'
370
+ },
367
371
  pending_refund: {
368
372
  border: '#2D9CDB',
369
373
  background: '#F1FBFE',
@@ -391,6 +395,10 @@ const palette = {
391
395
  border: '#ECC631',
392
396
  background: '#ECC631'
393
397
  },
398
+ pending_review: {
399
+ border: '#2D9CDB',
400
+ background: '#2D9CDB'
401
+ },
394
402
  credited: {
395
403
  border: '#BB6BD9',
396
404
  background: '#BB6BD9'
@@ -491,6 +499,11 @@ const palette = {
491
499
  background: '#ECC631',
492
500
  light: '#FEFCEE'
493
501
  },
502
+ pending_review: {
503
+ border: '#2D9CDB',
504
+ background: '#2D9CDB',
505
+ light: '#F1FBFE'
506
+ },
494
507
  pending_refund: {
495
508
  border: '#88C00D',
496
509
  background: '#88C00D',
package/package.json CHANGED
@@ -6,13 +6,14 @@
6
6
  "peerDependencies": {
7
7
  "@fixefy/fixefy-entities": ">=0.1.20",
8
8
  "@fixefy/fixefy-numeric": ">=0.1.3",
9
+ "@fixefy/fixefy-validate": ">=0.1.25",
9
10
  "@mui/material": ">=5.16.12",
10
11
  "@mui/styles": ">=5.16.12",
11
12
  "convert-excel-to-json": ">=1.7.0",
12
13
  "csvtojson": ">=2.0.10",
13
14
  "date-fns": ">=3.6.0",
14
15
  "graphql-tag": ">=2.12.6",
15
- "jss": ">=10.11.1",
16
+ "jss": ">=10.10.0",
16
17
  "next": ">=14.2.26",
17
18
  "nookies": ">=2.5.2",
18
19
  "pluralize": ">=8.0.0",
@@ -65,5 +66,5 @@
65
66
  "require": "./dist/index.js"
66
67
  }
67
68
  },
68
- "version": "0.2.60"
69
+ "version": "0.2.62"
69
70
  }