@player-ui/common-expressions-plugin 0.4.0-next.7 → 0.4.0-next.9
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/common-expressions-plugin.dev.js +626 -326
- package/dist/common-expressions-plugin.prod.js +1 -1
- package/dist/index.cjs.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +3 -0
- package/dist/xlr/ceil.json +1 -1
- package/dist/xlr/concat.json +1 -1
- package/dist/xlr/containsAny.json +1 -1
- package/dist/xlr/findProperty.json +1 -1
- package/dist/xlr/findPropertyIndex.json +6 -2
- package/dist/xlr/floor.json +1 -1
- package/dist/xlr/isEmpty.json +1 -1
- package/dist/xlr/isNotEmpty.json +1 -1
- package/dist/xlr/length.json +1 -1
- package/dist/xlr/lowerCase.json +1 -1
- package/dist/xlr/number.json +1 -1
- package/dist/xlr/replace.json +1 -1
- package/dist/xlr/round.json +1 -1
- package/dist/xlr/sentenceCase.json +1 -1
- package/dist/xlr/size.json +1 -1
- package/dist/xlr/sum.json +1 -1
- package/dist/xlr/titleCase.json +1 -1
- package/dist/xlr/trim.json +1 -1
- package/dist/xlr/upperCase.json +1 -1
- package/package.json +11 -3
- package/src/expressions/index.ts +6 -2
package/dist/index.cjs.js
CHANGED
|
@@ -88,6 +88,9 @@ const sum = player.withoutContext((...args) => {
|
|
|
88
88
|
}, 0);
|
|
89
89
|
});
|
|
90
90
|
const findPropertyIndex = (context, bindingOrModel, propToCheck, valueToCheck) => {
|
|
91
|
+
if (bindingOrModel === void 0) {
|
|
92
|
+
return -1;
|
|
93
|
+
}
|
|
91
94
|
const searchArray = Array.isArray(bindingOrModel) ? bindingOrModel : context.model.get(bindingOrModel);
|
|
92
95
|
if (!Array.isArray(searchArray)) {
|
|
93
96
|
return -1;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ declare const sum: ExpressionHandler<(string | number)[], number>;
|
|
|
25
25
|
/** Array Operations */
|
|
26
26
|
/** Finds the property in an array of objects */
|
|
27
27
|
declare const findPropertyIndex: ExpressionHandler<[
|
|
28
|
-
Array<any> | Binding,
|
|
28
|
+
Array<any> | Binding | undefined,
|
|
29
29
|
string | undefined,
|
|
30
30
|
any
|
|
31
31
|
], number>;
|
package/dist/index.esm.js
CHANGED
|
@@ -84,6 +84,9 @@ const sum = withoutContext((...args) => {
|
|
|
84
84
|
}, 0);
|
|
85
85
|
});
|
|
86
86
|
const findPropertyIndex = (context, bindingOrModel, propToCheck, valueToCheck) => {
|
|
87
|
+
if (bindingOrModel === void 0) {
|
|
88
|
+
return -1;
|
|
89
|
+
}
|
|
87
90
|
const searchArray = Array.isArray(bindingOrModel) ? bindingOrModel : context.model.get(bindingOrModel);
|
|
88
91
|
if (!Array.isArray(searchArray)) {
|
|
89
92
|
return -1;
|
package/dist/xlr/ceil.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "ceil",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/concat.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "concat",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "containsAny",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "findProperty",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler<\n [Array<any> | Binding, string | undefined, any, string | undefined, any],\n any\n>",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "findPropertyIndex",
|
|
4
4
|
"type": "ref",
|
|
5
|
-
"ref": "ExpressionHandler<\n [Array<any> | Binding, string | undefined, any],\n number\n>",
|
|
5
|
+
"ref": "ExpressionHandler<\n [Array<any> | Binding | undefined, string | undefined, any],\n number\n>",
|
|
6
6
|
"genericArguments": [
|
|
7
7
|
{
|
|
8
8
|
"type": "tuple",
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"type": "ref",
|
|
23
23
|
"ref": "Binding",
|
|
24
24
|
"title": "0"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "undefined",
|
|
28
|
+
"title": "0"
|
|
25
29
|
}
|
|
26
30
|
],
|
|
27
31
|
"title": "0"
|
package/dist/xlr/floor.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "floor",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/isEmpty.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "isEmpty",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler<[unknown], boolean>",
|
package/dist/xlr/isNotEmpty.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "isNotEmpty",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler<[unknown], boolean>",
|
package/dist/xlr/length.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "length",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/lowerCase.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "lowerCase",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/number.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "number",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/replace.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "replace",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/round.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "round",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "sentenceCase",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/size.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "size",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/sum.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "sum",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/titleCase.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "titleCase",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/trim.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "trim",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/dist/xlr/upperCase.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/
|
|
2
|
+
"source": "/home/circleci/.cache/bazel/_bazel_circleci/e8362d362e14c7d23506d1dfa3aea8b8/sandbox/processwrapper-sandbox/2253/execroot/player/plugins/common-expressions/core/src/expressions/index.ts",
|
|
3
3
|
"name": "upperCase",
|
|
4
4
|
"type": "ref",
|
|
5
5
|
"ref": "ExpressionHandler",
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-ui/common-expressions-plugin",
|
|
3
|
-
"version": "0.4.0-next.
|
|
3
|
+
"version": "0.4.0-next.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@player-ui/player": "0.4.0-next.
|
|
9
|
+
"@player-ui/player": "0.4.0-next.9"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@player-ui/expression-plugin": "0.4.0-next.
|
|
12
|
+
"@player-ui/expression-plugin": "0.4.0-next.9",
|
|
13
13
|
"@babel/runtime": "7.15.4"
|
|
14
14
|
},
|
|
15
15
|
"main": "dist/index.cjs.js",
|
|
@@ -53,6 +53,14 @@
|
|
|
53
53
|
{
|
|
54
54
|
"name": "Kelly Harrop",
|
|
55
55
|
"url": "https://github.com/kharrop"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "Alejandro Fimbres",
|
|
59
|
+
"url": "https://github.com/lexfm"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "Rafael Campos",
|
|
63
|
+
"url": "https://github.com/rafbcampos"
|
|
56
64
|
}
|
|
57
65
|
],
|
|
58
66
|
"bundle": "./dist/common-expressions-plugin.prod.js"
|
package/src/expressions/index.ts
CHANGED
|
@@ -115,14 +115,18 @@ export const sum = withoutContext<Array<number | string>, number>((...args) => {
|
|
|
115
115
|
|
|
116
116
|
/** Finds the property in an array of objects */
|
|
117
117
|
export const findPropertyIndex: ExpressionHandler<
|
|
118
|
-
[Array<any> | Binding, string | undefined, any],
|
|
118
|
+
[Array<any> | Binding | undefined, string | undefined, any],
|
|
119
119
|
number
|
|
120
120
|
> = <T = unknown>(
|
|
121
121
|
context: ExpressionContext,
|
|
122
|
-
bindingOrModel: Binding | Array<Record<string, T
|
|
122
|
+
bindingOrModel: Binding | Array<Record<string, T>> | undefined,
|
|
123
123
|
propToCheck: string | undefined,
|
|
124
124
|
valueToCheck: T
|
|
125
125
|
) => {
|
|
126
|
+
if (bindingOrModel === undefined) {
|
|
127
|
+
return -1;
|
|
128
|
+
}
|
|
129
|
+
|
|
126
130
|
const searchArray: Array<Record<string, T>> = Array.isArray(bindingOrModel)
|
|
127
131
|
? bindingOrModel
|
|
128
132
|
: context.model.get(bindingOrModel);
|