gridify-client 2.0.0-preview.4 → 2.0.1
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 +20 -13
- package/dist/GridifyOperator.d.ts +1 -1
- package/dist/IGridifyQuery.d.ts +10 -4
- package/dist/IPaging.d.ts +4 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
# Gridify (A Modern Dynamic LINQ library)
|
|
2
2
|
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-

|
|
6
|
-

|
|
7
|
-
[](https://www.nuget.org/packages/Gridify/)
|
|
8
|
-

|
|
9
|
-
[](https://www.fuget.org/packages/Gridify)
|
|
3
|
+
[](https://github.com/alirezanet/Gridify/blob/master/LICENSE)
|
|
4
|
+
[](https://www.nuget.org/packages/Gridify/)
|
|
10
5
|
[](https://alirezanet.github.io/Gridify/)
|
|
11
|
-
[](https://www.fuget.org/packages/Gridify)
|
|
7
|
+
[](https://www.nuget.org/packages/Gridify/)
|
|
8
|
+
[](https://www.npmjs.com/package/gridify-client)
|
|
9
|
+
|
|
15
10
|
|
|
16
|
-
[](https://alirezanet.github.io/Gridify/)
|
|
17
12
|
|
|
18
13
|
## Introduction
|
|
14
|
+
|
|
19
15
|
Gridify is a dynamic LINQ library that simplifies the process of converting strings to LINQ queries. With exceptional performance and ease-of-use, Gridify makes it effortless to apply filtering, sorting, and pagination using text-based data.
|
|
20
16
|
|
|
17
|
+
Consider Gridify 𝖺 𝗌𝗂𝗆𝗉𝗅𝖾𝗋/faster 𝖺𝗅𝗍𝖾𝗋𝗇𝖺𝗍𝗂𝗏𝖾 𝗍𝗈 𝗚𝗿𝗮𝗽𝗵𝗤𝗟/𝗢𝗗𝗮𝘁𝗮. 𝖨𝗍 𝖺𝗅𝗅𝗈𝗐𝗌 𝗍𝗁𝖾 𝖿𝗋𝗈𝗇𝗍-𝖾𝗇𝖽 𝗍𝗈 𝗌𝖾𝗅𝖾𝖼𝗍𝗂𝗏𝖾𝗅𝗒 𝖿𝗂𝗅𝗍𝖾𝗋 𝗋𝖾𝗌𝗈𝗎𝗋𝖼𝖾𝗌 𝖺𝗇𝖽 𝗋𝖾𝗊𝗎𝖾𝗌𝗍 𝗈𝗇𝗅𝗒 𝗍𝗁𝖾 𝗇𝖾𝖼𝖾𝗌𝗌𝖺𝗋𝗒 𝗋𝖾𝖼𝗈𝗋𝖽𝗌.
|
|
18
|
+
|
|
21
19
|
## Features
|
|
22
20
|
|
|
23
21
|
- Fast and easy to use
|
|
@@ -31,7 +29,8 @@ Gridify is a dynamic LINQ library that simplifies the process of converting stri
|
|
|
31
29
|
- Compatible with ORMs, especially Entity Framework
|
|
32
30
|
- Can be used on every collection that LINQ supports
|
|
33
31
|
- Compatible with object-mappers like AutoMapper
|
|
34
|
-
- Compatible with Elasticsearch
|
|
32
|
+
- Compatible with Elasticsearch
|
|
33
|
+
- Javascript/Typescript client
|
|
35
34
|
|
|
36
35
|
## Documentation
|
|
37
36
|
|
|
@@ -54,6 +53,14 @@ Check out our docs at [https://alirezanet.github.io/Gridify/](https://alirezanet
|
|
|
54
53
|
|
|
55
54
|
We welcome contributions! Feel free to send us a pull request. Check out our [Contribution Page](https://alirezanet.github.io/Gridify/contribution) for more information.
|
|
56
55
|
|
|
56
|
+
## Contributors
|
|
57
|
+
|
|
58
|
+
Thank you to everyone who has contributed to the Gridify codebase. We appreciate you!
|
|
59
|
+
|
|
60
|
+
<a href="https://github.com/alirezanet/gridify/graphs/contributors">
|
|
61
|
+
<img src="https://contrib.rocks/image?repo=alirezanet/gridify" />
|
|
62
|
+
</a>
|
|
63
|
+
|
|
57
64
|
## License
|
|
58
65
|
|
|
59
66
|
This project is licensed under the [MIT License](https://github.com/alirezanet/gridify/blob/master/LICENSE).
|
package/dist/IGridifyQuery.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
export interface IGridifyQuery {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
orderBy?: string;
|
|
1
|
+
export interface IGridifyQuery extends IGridifyPagination, IGridifyFiltering, IGridifyOrdering {
|
|
2
|
+
}
|
|
3
|
+
export interface IGridifyFiltering {
|
|
5
4
|
filter?: string;
|
|
6
5
|
}
|
|
6
|
+
export interface IGridifyOrdering {
|
|
7
|
+
orderBy?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IGridifyPagination {
|
|
10
|
+
page: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var r,t;exports.ConditionalOperator=void 0,(r=exports.ConditionalOperator||(exports.ConditionalOperator={})).Equal="=",r.NotEqual="!=",r.LessThan="<",r.GreaterThan=">",r.GreaterThanOrEqual=">=",r.LessThanOrEqual="<=",r.Contains="
|
|
1
|
+
"use strict";var r,t;exports.ConditionalOperator=void 0,(r=exports.ConditionalOperator||(exports.ConditionalOperator={})).Equal="=",r.NotEqual="!=",r.LessThan="<",r.GreaterThan=">",r.GreaterThanOrEqual=">=",r.LessThanOrEqual="<=",r.Contains="=*",r.NotContains="!*",r.StartsWith="^",r.NotStartsWith="!^",r.EndsWith="$",r.NotEndsWith="!$",exports.LogicalOperator=void 0,(t=exports.LogicalOperator||(exports.LogicalOperator={})).And=",",t.Or="|";var o=function(){function r(){this.query={page:1,pageSize:20,orderBy:"",filter:""},this.filteringExpressions=[]}return r.prototype.setPage=function(r){return this.query.page=r,this},r.prototype.setPageSize=function(r){return this.query.pageSize=r,this},r.prototype.addOrderBy=function(r,t){void 0===t&&(t=!1);var o="".concat(r.trim()," ").concat(t?"desc":"").trim();return this.query.orderBy=this.query.orderBy?"".concat(this.query.orderBy,", ").concat(o):o,this},r.prototype.addCondition=function(r,t,o,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0);var n=o;i&&"string"==typeof o&&(n=o.replace(/([(),|]|\/i)/g,"\\$1")),!e&&o&&(n="".concat(n.toString(),"/i"));var p="".concat(r.trim()).concat(t).concat(n);return this.filteringExpressions.push({value:p,type:"filter"}),this},r.prototype.startGroup=function(){return this.filteringExpressions.push({value:"(",type:"startGroup"}),this},r.prototype.endGroup=function(){return this.filteringExpressions.push({value:")",type:"endGroup"}),this},r.prototype.and=function(){return this.filteringExpressions.push({value:exports.LogicalOperator.And,type:"op"}),this},r.prototype.or=function(){return this.filteringExpressions.push({value:exports.LogicalOperator.Or,type:"op"}),this},r.prototype.build=function(){var r=this,t=null,o=0;if(this.filteringExpressions.forEach((function(e){if("startGroup"===e.type&&o++,"endGroup"===e.type&&o--,null===t&&"op"===e.type)throw new Error("expression cannot start with a logical operator");if("filter"===t&&"filter"===e.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===t&&"op"===e.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===t&&"op"===e.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===t&&"filter"===e.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===t&&"endGroup"===e.type)throw new Error("Empty groups are not allowed");if("endGroup"===t&&"startGroup"===e.type)throw new Error("Missing a logical operator between groups");t=e.type,r.query.filter+=e.value})),0!=o)throw new Error("Group not properly closed");return this.query},r}();exports.GridifyQueryBuilder=o;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/GridifyOperator.ts","../src/GridifyQueryBuilder.ts"],"sourcesContent":[null,null],"names":["ConditionalOperator","LogicalOperator","GridifyQueryBuilder","this","query","page","pageSize","orderBy","filter","filteringExpressions","prototype","setPage","setPageSize","addOrderBy","field","descending","concat","trim","addCondition","operator","value","caseSensitive","escapeValue","filterValue","replace","toString","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp","Error"],"mappings":"aAAA,IAAYA,EAeAC,EAfAD,QAaXA,yBAAA,GAbWA,EAAAA,8BAAAA,QAAAA,oBAaX,CAAA,IAZE,MAAA,IACAA,EAAA,SAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,IACAA,EAAA,mBAAA,KACAA,EAAA,gBAAA,KACAA,EAAA,SAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/GridifyOperator.ts","../src/GridifyQueryBuilder.ts"],"sourcesContent":[null,null],"names":["ConditionalOperator","LogicalOperator","GridifyQueryBuilder","this","query","page","pageSize","orderBy","filter","filteringExpressions","prototype","setPage","setPageSize","addOrderBy","field","descending","concat","trim","addCondition","operator","value","caseSensitive","escapeValue","filterValue","replace","toString","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp","Error"],"mappings":"aAAA,IAAYA,EAeAC,EAfAD,QAaXA,yBAAA,GAbWA,EAAAA,8BAAAA,QAAAA,oBAaX,CAAA,IAZE,MAAA,IACAA,EAAA,SAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,IACAA,EAAA,mBAAA,KACAA,EAAA,gBAAA,KACAA,EAAA,SAAA,KACAA,EAAA,YAAA,KACAA,EAAA,WAAA,IACAA,EAAA,cAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,KAGSC,QAGXA,qBAAA,GAHWA,EAAAA,QAAeA,kBAAfA,wBAGX,CAAA,IAFE,IAAA,IACAA,EAAA,GAAA,ICdH,IAAAC,EAAA,WAAA,SAAAA,IACWC,KAAAC,MAAuB,CAC5BC,KAAM,EACNC,SAAU,GACVC,QAAS,GACTC,OAAQ,IAGHL,KAAoBM,qBAAkB,EAkIhD,CAAD,OAhIGP,EAAOQ,UAAAC,QAAP,SAAQN,GAEL,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,UAAAyB,MAAA,WAAA,IA8DCC,EAAAjC,KA7DMkC,EACD,KACCC,EAAe,EAsDnB,GArDAnC,KAAKM,qBAAqB8B,SAAQ,SAACC,GAShC,GARiB,eAAbA,EAAIZ,MACLU,IAEc,aAAbE,EAAIZ,MACLU,IAIkB,OAAjBD,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIa,MAAM,mDAInB,GAAqB,WAAjBJ,GAA0C,WAAbG,EAAIZ,KAClC,MAAM,IAAIa,MACP,8EAKN,GAAqB,OAAjBJ,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIa,MACP,mEAKN,GAAqB,eAAjBJ,GAA8C,OAAbG,EAAIZ,KACtC,MAAM,IAAIa,MACP,gEAKN,GAAqB,aAAjBJ,GAA4C,WAAbG,EAAIZ,KACpC,MAAM,IAAIa,MAAM,2CAInB,GAAqB,eAAjBJ,GAA8C,aAAbG,EAAIZ,KACtC,MAAM,IAAIa,MAAM,gCAInB,GAAqB,aAAjBJ,GAA4C,eAAbG,EAAIZ,KACpC,MAAM,IAAIa,MAAM,6CAGnBJ,EAAeG,EAAIZ,KACnBQ,EAAKhC,MAAMI,QAAUgC,EAAIpB,KAC5B,IAEoB,GAAhBkB,EACD,MAAM,IAAIG,MAAM,6BAGnB,OAAOtC,KAAKC,OAEjBF,CAAD"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t,r;!function(t){t.Equal="=",t.NotEqual="!=",t.LessThan="<",t.GreaterThan=">",t.GreaterThanOrEqual=">=",t.LessThanOrEqual="<=",t.Contains="
|
|
1
|
+
var t,r;!function(t){t.Equal="=",t.NotEqual="!=",t.LessThan="<",t.GreaterThan=">",t.GreaterThanOrEqual=">=",t.LessThanOrEqual="<=",t.Contains="=*",t.NotContains="!*",t.StartsWith="^",t.NotStartsWith="!^",t.EndsWith="$",t.NotEndsWith="!$"}(t||(t={})),function(t){t.And=",",t.Or="|"}(r||(r={}));var o=function(){function t(){this.query={page:1,pageSize:20,orderBy:"",filter:""},this.filteringExpressions=[]}return t.prototype.setPage=function(t){return this.query.page=t,this},t.prototype.setPageSize=function(t){return this.query.pageSize=t,this},t.prototype.addOrderBy=function(t,r){void 0===r&&(r=!1);var o="".concat(t.trim()," ").concat(r?"desc":"").trim();return this.query.orderBy=this.query.orderBy?"".concat(this.query.orderBy,", ").concat(o):o,this},t.prototype.addCondition=function(t,r,o,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0);var n=o;i&&"string"==typeof o&&(n=o.replace(/([(),|]|\/i)/g,"\\$1")),!e&&o&&(n="".concat(n.toString(),"/i"));var s="".concat(t.trim()).concat(r).concat(n);return this.filteringExpressions.push({value:s,type:"filter"}),this},t.prototype.startGroup=function(){return this.filteringExpressions.push({value:"(",type:"startGroup"}),this},t.prototype.endGroup=function(){return this.filteringExpressions.push({value:")",type:"endGroup"}),this},t.prototype.and=function(){return this.filteringExpressions.push({value:r.And,type:"op"}),this},t.prototype.or=function(){return this.filteringExpressions.push({value:r.Or,type:"op"}),this},t.prototype.build=function(){var t=this,r=null,o=0;if(this.filteringExpressions.forEach((function(e){if("startGroup"===e.type&&o++,"endGroup"===e.type&&o--,null===r&&"op"===e.type)throw new Error("expression cannot start with a logical operator");if("filter"===r&&"filter"===e.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===r&&"op"===e.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===r&&"op"===e.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===r&&"filter"===e.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===r&&"endGroup"===e.type)throw new Error("Empty groups are not allowed");if("endGroup"===r&&"startGroup"===e.type)throw new Error("Missing a logical operator between groups");r=e.type,t.query.filter+=e.value})),0!=o)throw new Error("Group not properly closed");return this.query},t}();export{t as ConditionalOperator,o as GridifyQueryBuilder,r as LogicalOperator};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/GridifyOperator.ts","../src/GridifyQueryBuilder.ts"],"sourcesContent":[null,null],"names":["ConditionalOperator","LogicalOperator","GridifyQueryBuilder","this","query","page","pageSize","orderBy","filter","filteringExpressions","prototype","setPage","setPageSize","addOrderBy","field","descending","concat","trim","addCondition","operator","value","caseSensitive","escapeValue","filterValue","replace","toString","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp","Error"],"mappings":"IAAYA,EAeAC,GAfZ,SAAYD,GACTA,EAAA,MAAA,IACAA,EAAA,SAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,IACAA,EAAA,mBAAA,KACAA,EAAA,gBAAA,KACAA,EAAA,SAAA,
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/GridifyOperator.ts","../src/GridifyQueryBuilder.ts"],"sourcesContent":[null,null],"names":["ConditionalOperator","LogicalOperator","GridifyQueryBuilder","this","query","page","pageSize","orderBy","filter","filteringExpressions","prototype","setPage","setPageSize","addOrderBy","field","descending","concat","trim","addCondition","operator","value","caseSensitive","escapeValue","filterValue","replace","toString","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp","Error"],"mappings":"IAAYA,EAeAC,GAfZ,SAAYD,GACTA,EAAA,MAAA,IACAA,EAAA,SAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,IACAA,EAAA,mBAAA,KACAA,EAAA,gBAAA,KACAA,EAAA,SAAA,KACAA,EAAA,YAAA,KACAA,EAAA,WAAA,IACAA,EAAA,cAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,IACF,CAbD,CAAYA,IAAAA,EAaX,CAAA,IAED,SAAYC,GACTA,EAAA,IAAA,IACAA,EAAA,GAAA,GACF,CAHD,CAAYA,IAAAA,EAGX,CAAA,ICfD,IAAAC,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AAgB+B,IACvBJ,KAAM,OAEFzB,MAGVD,EAAAQ,UAAAuB,GAAA,WAEG,OADA9B,KAAKM,qBAAqBkB,KAAK,CAAEP,MAAOnB,EAAgBiC,GAAIN,KAAM,OAC3DzB,MAGVD,EAAAQ,UAAAyB,MAAA,WAAA,IA8DCC,EAAAjC,KA7DMkC,EACD,KACCC,EAAe,EAsDnB,GArDAnC,KAAKM,qBAAqB8B,SAAQ,SAACC,GAShC,GARiB,eAAbA,EAAIZ,MACLU,IAEc,aAAbE,EAAIZ,MACLU,IAIkB,OAAjBD,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIa,MAAM,mDAInB,GAAqB,WAAjBJ,GAA0C,WAAbG,EAAIZ,KAClC,MAAM,IAAIa,MACP,8EAKN,GAAqB,OAAjBJ,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIa,MACP,mEAKN,GAAqB,eAAjBJ,GAA8C,OAAbG,EAAIZ,KACtC,MAAM,IAAIa,MACP,gEAKN,GAAqB,aAAjBJ,GAA4C,WAAbG,EAAIZ,KACpC,MAAM,IAAIa,MAAM,2CAInB,GAAqB,eAAjBJ,GAA8C,aAAbG,EAAIZ,KACtC,MAAM,IAAIa,MAAM,gCAInB,GAAqB,aAAjBJ,GAA4C,eAAbG,EAAIZ,KACpC,MAAM,IAAIa,MAAM,6CAGnBJ,EAAeG,EAAIZ,KACnBQ,EAAKhC,MAAMI,QAAUgC,EAAIpB,KAC5B,IAEoB,GAAhBkB,EACD,MAAM,IAAIG,MAAM,6BAGnB,OAAOtC,KAAKC,OAEjBF,CAAD"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).GridifyClient={})}(this,(function(t){"use strict";var r,o;t.ConditionalOperator=void 0,(r=t.ConditionalOperator||(t.ConditionalOperator={})).Equal="=",r.NotEqual="!=",r.LessThan="<",r.GreaterThan=">",r.GreaterThanOrEqual=">=",r.LessThanOrEqual="<=",r.Contains="
|
|
1
|
+
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((t="undefined"!=typeof globalThis?globalThis:t||self).GridifyClient={})}(this,(function(t){"use strict";var r,o;t.ConditionalOperator=void 0,(r=t.ConditionalOperator||(t.ConditionalOperator={})).Equal="=",r.NotEqual="!=",r.LessThan="<",r.GreaterThan=">",r.GreaterThanOrEqual=">=",r.LessThanOrEqual="<=",r.Contains="=*",r.NotContains="!*",r.StartsWith="^",r.NotStartsWith="!^",r.EndsWith="$",r.NotEndsWith="!$",t.LogicalOperator=void 0,(o=t.LogicalOperator||(t.LogicalOperator={})).And=",",o.Or="|";var e=function(){function r(){this.query={page:1,pageSize:20,orderBy:"",filter:""},this.filteringExpressions=[]}return r.prototype.setPage=function(t){return this.query.page=t,this},r.prototype.setPageSize=function(t){return this.query.pageSize=t,this},r.prototype.addOrderBy=function(t,r){void 0===r&&(r=!1);var o="".concat(t.trim()," ").concat(r?"desc":"").trim();return this.query.orderBy=this.query.orderBy?"".concat(this.query.orderBy,", ").concat(o):o,this},r.prototype.addCondition=function(t,r,o,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0);var n=o;i&&"string"==typeof o&&(n=o.replace(/([(),|]|\/i)/g,"\\$1")),!e&&o&&(n="".concat(n.toString(),"/i"));var a="".concat(t.trim()).concat(r).concat(n);return this.filteringExpressions.push({value:a,type:"filter"}),this},r.prototype.startGroup=function(){return this.filteringExpressions.push({value:"(",type:"startGroup"}),this},r.prototype.endGroup=function(){return this.filteringExpressions.push({value:")",type:"endGroup"}),this},r.prototype.and=function(){return this.filteringExpressions.push({value:t.LogicalOperator.And,type:"op"}),this},r.prototype.or=function(){return this.filteringExpressions.push({value:t.LogicalOperator.Or,type:"op"}),this},r.prototype.build=function(){var t=this,r=null,o=0;if(this.filteringExpressions.forEach((function(e){if("startGroup"===e.type&&o++,"endGroup"===e.type&&o--,null===r&&"op"===e.type)throw new Error("expression cannot start with a logical operator");if("filter"===r&&"filter"===e.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===r&&"op"===e.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===r&&"op"===e.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===r&&"filter"===e.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===r&&"endGroup"===e.type)throw new Error("Empty groups are not allowed");if("endGroup"===r&&"startGroup"===e.type)throw new Error("Missing a logical operator between groups");r=e.type,t.query.filter+=e.value})),0!=o)throw new Error("Group not properly closed");return this.query},r}();t.GridifyQueryBuilder=e}));
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/GridifyOperator.ts","../src/GridifyQueryBuilder.ts"],"sourcesContent":[null,null],"names":["ConditionalOperator","LogicalOperator","exports","GridifyQueryBuilder","this","query","page","pageSize","orderBy","filter","filteringExpressions","prototype","setPage","setPageSize","addOrderBy","field","descending","concat","trim","addCondition","operator","value","caseSensitive","escapeValue","filterValue","replace","toString","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp","Error"],"mappings":"qPAAA,IAAYA,EAeAC,EAFXC,EAAAF,yBAAA,GAbWA,EAAAA,wBAAAA,EAAAA,oBAaX,CAAA,IAZE,MAAA,IACAA,EAAA,SAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,IACAA,EAAA,mBAAA,KACAA,EAAA,gBAAA,KACAA,EAAA,SAAA,
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/GridifyOperator.ts","../src/GridifyQueryBuilder.ts"],"sourcesContent":[null,null],"names":["ConditionalOperator","LogicalOperator","exports","GridifyQueryBuilder","this","query","page","pageSize","orderBy","filter","filteringExpressions","prototype","setPage","setPageSize","addOrderBy","field","descending","concat","trim","addCondition","operator","value","caseSensitive","escapeValue","filterValue","replace","toString","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp","Error"],"mappings":"qPAAA,IAAYA,EAeAC,EAFXC,EAAAF,yBAAA,GAbWA,EAAAA,wBAAAA,EAAAA,oBAaX,CAAA,IAZE,MAAA,IACAA,EAAA,SAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,IACAA,EAAA,mBAAA,KACAA,EAAA,gBAAA,KACAA,EAAA,SAAA,KACAA,EAAA,YAAA,KACAA,EAAA,WAAA,IACAA,EAAA,cAAA,KACAA,EAAA,SAAA,IACAA,EAAA,YAAA,KAMFE,EAAAD,qBAAA,GAHWA,EAAAA,EAAeA,kBAAfA,kBAGX,CAAA,IAFE,IAAA,IACAA,EAAA,GAAA,ICdH,IAAAE,EAAA,WAAA,SAAAA,IACWC,KAAAC,MAAuB,CAC5BC,KAAM,EACNC,SAAU,GACVC,QAAS,GACTC,OAAQ,IAGHL,KAAoBM,qBAAkB,EAkIhD,CAAD,OAhIGP,EAAOQ,UAAAC,QAAP,SAAQN,GAEL,OADAF,KAAKC,MAAMC,KAAOA,EACXF,MAGVD,EAAWQ,UAAAE,YAAX,SAAYN,GAET,OADAH,KAAKC,MAAME,SAAWA,EACfH,MAGVD,EAAAQ,UAAAG,WAAA,SAAWC,EAAeC,QAAA,IAAAA,IAAAA,GAA2B,GAClD,IAAMR,EAAU,GAAGS,OAAAF,EAAMG,mBAAUF,EAAa,OAAS,IAAKE,OAI9D,OAHAd,KAAKC,MAAMG,QAAUJ,KAAKC,MAAMG,QAC3B,UAAGJ,KAAKC,MAAMG,QAAY,MAAAS,OAAAT,GAC1BA,EACEJ,MAGVD,EAAYQ,UAAAQ,aAAZ,SACGJ,EACAK,EACAC,EACAC,EACAC,QADA,IAAAD,IAAAA,GAA6B,QAC7B,IAAAC,IAAAA,G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