@fixefy/fixefy-ui-utils 0.2.58 → 0.2.60

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.
@@ -85,7 +85,7 @@ _export(exports, {
85
85
  return useStatePromisify;
86
86
  }
87
87
  });
88
- const _ = require("../");
88
+ const _constants = require("../constants");
89
89
  const _datefns = require("date-fns");
90
90
  const _react = require("react");
91
91
  const _fixefynumeric = /*#__PURE__*/ _interop_require_default(require("@fixefy/fixefy-numeric"));
@@ -208,17 +208,17 @@ const formatNumberWithCommas = (number)=>{
208
208
  const getNormalizationKeyForEntity = (entity_type)=>{
209
209
  let rv;
210
210
  switch(entity_type.toLowerCase()){
211
- case _.EntityTypes.User:
211
+ case _constants.EntityTypes.User:
212
212
  rv = 'username';
213
213
  break;
214
- case _.EntityTypes.Pricing:
214
+ case _constants.EntityTypes.Pricing:
215
215
  rv = 'value';
216
216
  break;
217
- case _.EntityTypes.Metadata:
217
+ case _constants.EntityTypes.Metadata:
218
218
  rv = 'title';
219
219
  break;
220
- case _.EntityTypes.Transaction:
221
- case _.EntityTypes.Transmission:
220
+ case _constants.EntityTypes.Transaction:
221
+ case _constants.EntityTypes.Transmission:
222
222
  rv = 'readable_id';
223
223
  break;
224
224
  default:
@@ -31,10 +31,10 @@ _export(exports, {
31
31
  return setJToken;
32
32
  }
33
33
  });
34
- const _ = require("..");
34
+ const _validate = require("../validate");
35
35
  const getJToken = (jToken, jsonPath, defaultValue)=>{
36
36
  // input check - if key is invalid - return error
37
- if ((0, _.is_object_valid)(jToken) === false) return defaultValue;
37
+ if ((0, _validate.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
@@ -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, _.is_string_valid)(j);
81
- _isArrayValid = (0, _.is_array_valid)(j);
80
+ _isStringValid = (0, _validate.is_string_valid)(j);
81
+ _isArrayValid = (0, _validate.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, _.is_array_valid)(innerJ)) {
88
+ if ((0, _validate.is_array_valid)(innerJ)) {
89
89
  acc.push(...innerJ);
90
90
  } else {
91
91
  acc.push(innerJ);
@@ -126,7 +126,7 @@ const isJson = (obj)=>{
126
126
  } catch (_e) {
127
127
  objAsString = null;
128
128
  }
129
- if ((0, _.is_string_valid)(objAsString) == false) return false;
129
+ if ((0, _validate.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, _.is_object_valid)(jResult) === false) return false;
140
+ if ((0, _validate.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, _.is_string_valid)(currentPath)) {
148
+ if ((0, _validate.is_string_valid)(currentPath)) {
149
149
  fieldName = currentPath;
150
150
  pathParts = currentPath.split('.');
151
- if ((0, _.is_array_valid)(pathParts)) {
151
+ if ((0, _validate.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, _.is_array_valid)(pathParts)) {
154
+ if ((0, _validate.is_array_valid)(pathParts)) {
155
155
  currentPath = pathParts.join('.');
156
156
  }
157
157
  }
158
158
  jCurrentToken = getJPart(jEntity, currentPath, null);
159
- if ((0, _.is_object_valid)(jCurrentToken) || isJson(jCurrentToken) === false) {
159
+ if ((0, _validate.is_object_valid)(jCurrentToken) || isJson(jCurrentToken) === false) {
160
160
  jCurrentToken = jEntity;
161
161
  }
162
162
  jCurrentToken[fieldName] = fieldPathsAndValues[i]['value'];
@@ -1,13 +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/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"]) => {
4
+ } | undefined) => <RuleName extends string>(cssObjectByRuleNameOrGetCssObjectByRuleName: Record<RuleName, import("tss-react").CSSObject> | ((theme: import("@mui/material/styles").Theme, params: Params, classes: Record<RuleNameSubsetReferencableInNestedSelectors, string>) => Record<RuleNameSubsetReferencableInNestedSelectors | RuleName, import("tss-react").CSSObject>)) => (params: Params, muiStyleOverridesParams?: import("tss-react/mui/themeStyleOverridesPlugin").MuiThemeStyleOverridesPluginParams["muiStyleOverridesParams"]) => {
5
5
  classes: Record<RuleName, string>;
6
- theme: import("@mui/material").Theme;
6
+ theme: import("@mui/material/styles").Theme;
7
7
  css: import("tss-react").Css;
8
8
  cx: import("tss-react").Cx;
9
9
  }, useStyles: () => {
10
- theme: import("@mui/material").Theme;
10
+ theme: import("@mui/material/styles").Theme;
11
11
  css: import("tss-react").Css;
12
12
  cx: import("tss-react").Cx;
13
13
  };
@@ -17,12 +17,7 @@ _export(exports, {
17
17
  }
18
18
  });
19
19
  const _tssreact = require("tss-react");
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
- }
20
+ const _styles = require("@mui/material/styles");
26
21
  const { makeStyles, useStyles } = (0, _tssreact.createMakeStyles)({
27
- useTheme: _useTheme.default
22
+ useTheme: _styles.useTheme
28
23
  });
@@ -1,3 +1,10 @@
1
+ import { Theme } from '@mui/material/styles';
2
+ import _DefaultTheme from '@mui/styles/DefaultTheme';
3
+ declare module '@mui/styles/DefaultTheme' {
4
+ const none: _DefaultTheme.DefaultTheme | undefined;
5
+ interface DefaultTheme extends Theme {
6
+ }
7
+ }
1
8
  declare module '@mui/material/styles' {
2
9
  interface Theme {
3
10
  sizes: Sizes;
package/package.json CHANGED
@@ -4,15 +4,24 @@
4
4
  "fs": false
5
5
  },
6
6
  "peerDependencies": {
7
+ "@fixefy/fixefy-entities": ">=0.1.20",
8
+ "@fixefy/fixefy-numeric": ">=0.1.3",
7
9
  "@mui/material": ">=5.16.12",
8
10
  "@mui/styles": ">=5.16.12",
11
+ "convert-excel-to-json": ">=1.7.0",
12
+ "csvtojson": ">=2.0.10",
13
+ "date-fns": ">=3.6.0",
14
+ "graphql-tag": ">=2.12.6",
15
+ "jss": ">=10.11.1",
16
+ "next": ">=14.2.26",
17
+ "nookies": ">=2.5.2",
18
+ "pluralize": ">=8.0.0",
9
19
  "react": ">=18.3.1",
10
- "react-dom": ">=18.3.1"
11
- },
12
- "dependencies": {
13
- "convert-excel-to-json": "1.7.0",
14
- "nookies": "2.5.2"
20
+ "react-dom": ">=18.3.1",
21
+ "regenerator-runtime": ">=0.13.11",
22
+ "tss-react": ">=4.8.6"
15
23
  },
24
+ "dependencies": {},
16
25
  "devDependencies": {
17
26
  "@types/convert-excel-to-json": "1.7.4",
18
27
  "@types/node": "20.14.0",
@@ -56,5 +65,5 @@
56
65
  "require": "./dist/index.js"
57
66
  }
58
67
  },
59
- "version": "0.2.58"
68
+ "version": "0.2.60"
60
69
  }