@j2inn/resolvable-ui-elements 1.0.4-beta.0 → 1.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/README.md +14 -0
- package/dist/resolvableElements/resolveTemplatedExpression.d.ts +6 -3
- package/dist/resolvableElements/resolveTemplatedExpression.js +6 -3
- package/dist/resolvableElements/resolveTemplatedExpression.js.map +1 -1
- package/dist_es/resolvableElements/resolveTemplatedExpression.d.ts +6 -3
- package/dist_es/resolvableElements/resolveTemplatedExpression.js +6 -3
- package/dist_es/resolvableElements/resolveTemplatedExpression.js.map +1 -1
- package/package.json +52 -52
package/README.md
CHANGED
|
@@ -20,3 +20,17 @@ See: https://finproducts.atlassian.net/wiki/spaces/ECO/pages/32881311778/Element
|
|
|
20
20
|
│ └── ...
|
|
21
21
|
└── ...
|
|
22
22
|
|
|
23
|
+
## BE libraries dependencies ##
|
|
24
|
+
If you decide to use the Resolver's `evalFuncName` feature, this library should be used in combination with [finOemAuthzExt](https://bitbucket.org/finproducts/finoemauthzext). The pod allows the usage of the wrapper function.
|
|
25
|
+
```typescript
|
|
26
|
+
/**
|
|
27
|
+
* Function name to be used for expressions eval,
|
|
28
|
+
* used to enable custom backend permission check using elements path
|
|
29
|
+
* @example
|
|
30
|
+
* customEval(\`page/section/elementName\`, parametersDict)
|
|
31
|
+
*/
|
|
32
|
+
evalFuncName?: string
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### v1.0.4 ###
|
|
36
|
+
Version 1.0.4 of this library introduces the usage of optional parameters in function evaluation. To be able to use them, [finOemAuthzExt](https://bitbucket.org/finproducts/finoemauthzext) 1.0.2+ should be used for the BE.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { HDict } from 'haystack-core';
|
|
2
2
|
export declare const REG_EXPR_MATCHING_TEMPLATE: RegExp;
|
|
3
3
|
/**
|
|
4
|
-
* Replaces variables (defined as
|
|
5
|
-
* The HVal.toAxon function is used for conversion to a string.
|
|
4
|
+
* Replaces variables (defined as {{parameterName}}) in an expression with the values given in the parameters dict.
|
|
5
|
+
* The HVal.toAxon function is used for conversion to a string. Optional parameters can be marked using a '?'
|
|
6
|
+
* after the parameter name. They can safely be omitted in the parameters Dict.
|
|
6
7
|
* @example
|
|
7
|
-
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(
|
|
8
|
+
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(22)})) => "func(22)"
|
|
9
|
+
* @example
|
|
10
|
+
* resolveTemplatedExpression("func({{num}}, {{unit?}})", HDict.make({num: HNum.make(22)})) => "func(22, null)"
|
|
8
11
|
* @param expr the axon expression
|
|
9
12
|
* @param params the parameters expressed as dict
|
|
10
13
|
* @returns the axon expression resolved with the specified params
|
|
@@ -7,10 +7,13 @@ exports.replaceTemplateVariables = exports.resolveTemplateExpression = exports.R
|
|
|
7
7
|
const haystack_core_1 = require("haystack-core");
|
|
8
8
|
exports.REG_EXPR_MATCHING_TEMPLATE = new RegExp(/{{([^{}?]*)(\??)}}/, 'g');
|
|
9
9
|
/**
|
|
10
|
-
* Replaces variables (defined as
|
|
11
|
-
* The HVal.toAxon function is used for conversion to a string.
|
|
10
|
+
* Replaces variables (defined as {{parameterName}}) in an expression with the values given in the parameters dict.
|
|
11
|
+
* The HVal.toAxon function is used for conversion to a string. Optional parameters can be marked using a '?'
|
|
12
|
+
* after the parameter name. They can safely be omitted in the parameters Dict.
|
|
12
13
|
* @example
|
|
13
|
-
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(
|
|
14
|
+
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(22)})) => "func(22)"
|
|
15
|
+
* @example
|
|
16
|
+
* resolveTemplatedExpression("func({{num}}, {{unit?}})", HDict.make({num: HNum.make(22)})) => "func(22, null)"
|
|
14
17
|
* @param expr the axon expression
|
|
15
18
|
* @param params the parameters expressed as dict
|
|
16
19
|
* @returns the axon expression resolved with the specified params
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTemplatedExpression.js","sourceRoot":"","sources":["../../src/resolvableElements/resolveTemplatedExpression.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iDAAgD;AAEnC,QAAA,0BAA0B,GAAG,IAAI,MAAM,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAA;AAE/E
|
|
1
|
+
{"version":3,"file":"resolveTemplatedExpression.js","sourceRoot":"","sources":["../../src/resolvableElements/resolveTemplatedExpression.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iDAAgD;AAEnC,QAAA,0BAA0B,GAAG,IAAI,MAAM,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAA;AAE/E;;;;;;;;;;;GAWG;AACI,MAAM,yBAAyB,GAAG,CACxC,IAAY,EACZ,UAAkB,EACT,EAAE;IACX,MAAM,SAAS,GAAG,UAAU,CAAA;IAE5B,OAAO,IAAA,gCAAwB,EAC9B,IAAI,EACJ,CAAC,UAAkB,EAAE,KAAa,EAAE,QAAgB,EAAE,EAAE;QACvD,MAAM,UAAU,GAAG,QAAQ,KAAK,GAAG,CAAA;QACnC,MAAM,SAAS,GAAG,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;QACjD,IAAI,SAAS,IAAI,IAAI,EAAE;YACtB,OAAO,SAAS,CAAA;SAChB;aAAM,IAAI,UAAU,EAAE;YACtB,OAAO,yBAAS,CAAA;SAChB;QACD,MAAM,IAAI,KAAK,CACd,6BAA6B,KAAK,OAAO,SAAS,EAAE,MAAM,EAAE,EAAE,CAC9D,CAAA;IACF,CAAC,CACD,CAAA;AACF,CAAC,CAAA;AArBY,QAAA,yBAAyB,6BAqBrC;AAED;;;;;GAKG;AACI,MAAM,wBAAwB,GAAG,CACvC,cAAsB,EACtB,QAAwE,EAC/D,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,kCAA0B,EAAE,QAAQ,CAAC,CAAA;AAH5D,QAAA,wBAAwB,4BAGoC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { HDict } from 'haystack-core';
|
|
2
2
|
export declare const REG_EXPR_MATCHING_TEMPLATE: RegExp;
|
|
3
3
|
/**
|
|
4
|
-
* Replaces variables (defined as
|
|
5
|
-
* The HVal.toAxon function is used for conversion to a string.
|
|
4
|
+
* Replaces variables (defined as {{parameterName}}) in an expression with the values given in the parameters dict.
|
|
5
|
+
* The HVal.toAxon function is used for conversion to a string. Optional parameters can be marked using a '?'
|
|
6
|
+
* after the parameter name. They can safely be omitted in the parameters Dict.
|
|
6
7
|
* @example
|
|
7
|
-
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(
|
|
8
|
+
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(22)})) => "func(22)"
|
|
9
|
+
* @example
|
|
10
|
+
* resolveTemplatedExpression("func({{num}}, {{unit?}})", HDict.make({num: HNum.make(22)})) => "func(22, null)"
|
|
8
11
|
* @param expr the axon expression
|
|
9
12
|
* @param params the parameters expressed as dict
|
|
10
13
|
* @returns the axon expression resolved with the specified params
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
import { AXON_NULL } from 'haystack-core';
|
|
5
5
|
export const REG_EXPR_MATCHING_TEMPLATE = new RegExp(/{{([^{}?]*)(\??)}}/, 'g');
|
|
6
6
|
/**
|
|
7
|
-
* Replaces variables (defined as
|
|
8
|
-
* The HVal.toAxon function is used for conversion to a string.
|
|
7
|
+
* Replaces variables (defined as {{parameterName}}) in an expression with the values given in the parameters dict.
|
|
8
|
+
* The HVal.toAxon function is used for conversion to a string. Optional parameters can be marked using a '?'
|
|
9
|
+
* after the parameter name. They can safely be omitted in the parameters Dict.
|
|
9
10
|
* @example
|
|
10
|
-
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(
|
|
11
|
+
* resolveTemplatedExpression("func({{num}})", HDict.make({num: HNum.make(22)})) => "func(22)"
|
|
12
|
+
* @example
|
|
13
|
+
* resolveTemplatedExpression("func({{num}}, {{unit?}})", HDict.make({num: HNum.make(22)})) => "func(22, null)"
|
|
11
14
|
* @param expr the axon expression
|
|
12
15
|
* @param params the parameters expressed as dict
|
|
13
16
|
* @returns the axon expression resolved with the specified params
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTemplatedExpression.js","sourceRoot":"","sources":["../../src/resolvableElements/resolveTemplatedExpression.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAS,MAAM,eAAe,CAAA;AAEhD,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,MAAM,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAA;AAE/E
|
|
1
|
+
{"version":3,"file":"resolveTemplatedExpression.js","sourceRoot":"","sources":["../../src/resolvableElements/resolveTemplatedExpression.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAS,MAAM,eAAe,CAAA;AAEhD,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,MAAM,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAA;AAE/E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,IAAY,EACZ,UAAkB,EACT,EAAE;IACX,MAAM,SAAS,GAAG,UAAU,CAAA;IAE5B,OAAO,wBAAwB,CAC9B,IAAI,EACJ,CAAC,UAAkB,EAAE,KAAa,EAAE,QAAgB,EAAE,EAAE;QACvD,MAAM,UAAU,GAAG,QAAQ,KAAK,GAAG,CAAA;QACnC,MAAM,SAAS,GAAG,SAAS,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;QACjD,IAAI,SAAS,IAAI,IAAI,EAAE;YACtB,OAAO,SAAS,CAAA;SAChB;aAAM,IAAI,UAAU,EAAE;YACtB,OAAO,SAAS,CAAA;SAChB;QACD,MAAM,IAAI,KAAK,CACd,6BAA6B,KAAK,OAAO,SAAS,EAAE,MAAM,EAAE,EAAE,CAC9D,CAAA;IACF,CAAC,CACD,CAAA;AACF,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,cAAsB,EACtB,QAAwE,EAC/D,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,0BAA0B,EAAE,QAAQ,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@j2inn/resolvable-ui-elements",
|
|
3
|
-
"version": "1.0.4
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"module": "dist_es/index.js",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"clean": "rimraf ./dist && rimraf ./dist_es",
|
|
10
|
-
"prebuild": "npm run clean && npm run lint && npm run test",
|
|
11
|
-
"build": "tsc && npm run-script build:es",
|
|
12
|
-
"build:es": "tsc --module ESNext --outDir dist_es",
|
|
13
|
-
"checktypes": "tsc --noEmit",
|
|
14
|
-
"format": "prettier-eslint --list-different --write \"$(pwd)/src/**/*.{ts,tsx,js,jsx}\"",
|
|
15
|
-
"lint": "eslint --fix --ext ts,tsx,js,jsx src/",
|
|
16
|
-
"test": "jest --passWithNoTests",
|
|
17
|
-
"prepack": "npm run lint && npm run test && npm run build"
|
|
18
|
-
},
|
|
19
|
-
"author": "",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"files": [
|
|
22
|
-
"dist/**/*",
|
|
23
|
-
"dist_es/**/*"
|
|
24
|
-
],
|
|
25
|
-
"peerDependencies": {
|
|
26
|
-
"haystack-core": "^2.0.45",
|
|
27
|
-
"haystack-nclient": "^3.0.32",
|
|
28
|
-
"haystack-react": "^3.0.17",
|
|
29
|
-
"haystack-units": "^1.0.22",
|
|
30
|
-
"react": "^18.2.0",
|
|
31
|
-
"react-dom": "^18.2.0"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@types/jest": "^27.4.0",
|
|
35
|
-
"@types/node": "^15.0.2",
|
|
36
|
-
"@types/react": "^18.0.18",
|
|
37
|
-
"@types/react-dom": "^18.0.6",
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
39
|
-
"@typescript-eslint/parser": "^5.28.0",
|
|
40
|
-
"eslint": "^7.32.0",
|
|
41
|
-
"eslint-config-prettier": "^8.3.0",
|
|
42
|
-
"eslint-plugin-jest": "^26.1.3",
|
|
43
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
44
|
-
"eslint-plugin-react": "^7.29.4",
|
|
45
|
-
"prettier": "^2.6.1",
|
|
46
|
-
"prettier-eslint": "^13.0.0",
|
|
47
|
-
"prettier-eslint-cli": "^5.0.1",
|
|
48
|
-
"rimraf": "^3.0.2",
|
|
49
|
-
"ts-jest": "^28.0.8",
|
|
50
|
-
"typescript": "^4.8.2"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@j2inn/resolvable-ui-elements",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"module": "dist_es/index.js",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"clean": "rimraf ./dist && rimraf ./dist_es",
|
|
10
|
+
"prebuild": "npm run clean && npm run lint && npm run test",
|
|
11
|
+
"build": "tsc && npm run-script build:es",
|
|
12
|
+
"build:es": "tsc --module ESNext --outDir dist_es",
|
|
13
|
+
"checktypes": "tsc --noEmit",
|
|
14
|
+
"format": "prettier-eslint --list-different --write \"$(pwd)/src/**/*.{ts,tsx,js,jsx}\"",
|
|
15
|
+
"lint": "eslint --fix --ext ts,tsx,js,jsx src/",
|
|
16
|
+
"test": "jest --passWithNoTests",
|
|
17
|
+
"prepack": "npm run lint && npm run test && npm run build"
|
|
18
|
+
},
|
|
19
|
+
"author": "",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/**/*",
|
|
23
|
+
"dist_es/**/*"
|
|
24
|
+
],
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"haystack-core": "^2.0.45",
|
|
27
|
+
"haystack-nclient": "^3.0.32",
|
|
28
|
+
"haystack-react": "^3.0.17",
|
|
29
|
+
"haystack-units": "^1.0.22",
|
|
30
|
+
"react": "^18.2.0",
|
|
31
|
+
"react-dom": "^18.2.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/jest": "^27.4.0",
|
|
35
|
+
"@types/node": "^15.0.2",
|
|
36
|
+
"@types/react": "^18.0.18",
|
|
37
|
+
"@types/react-dom": "^18.0.6",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
39
|
+
"@typescript-eslint/parser": "^5.28.0",
|
|
40
|
+
"eslint": "^7.32.0",
|
|
41
|
+
"eslint-config-prettier": "^8.3.0",
|
|
42
|
+
"eslint-plugin-jest": "^26.1.3",
|
|
43
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
44
|
+
"eslint-plugin-react": "^7.29.4",
|
|
45
|
+
"prettier": "^2.6.1",
|
|
46
|
+
"prettier-eslint": "^13.0.0",
|
|
47
|
+
"prettier-eslint-cli": "^5.0.1",
|
|
48
|
+
"rimraf": "^3.0.2",
|
|
49
|
+
"ts-jest": "^28.0.8",
|
|
50
|
+
"typescript": "^4.8.2"
|
|
51
|
+
}
|
|
52
|
+
}
|