gridify-client 2.0.1 → 2.0.2
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 +9 -3
- package/dist/GridifyQueryBuilder.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- 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
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
[](https://www.nuget.org/packages/Gridify/)
|
|
5
5
|
[](https://alirezanet.github.io/Gridify/)
|
|
6
6
|
[](https://www.fuget.org/packages/Gridify)
|
|
7
|
-
[](https://www.nuget.org/packages/Gridify/)
|
|
8
|
-
[](https://www.nuget.org/packages/Gridify/)
|
|
8
|
+
[](https://www.nuget.org/packages/Gridify/)
|
|
9
|
+
[](https://www.npmjs.com/package/gridify-client)
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
[](https://alirezanet.github.io/Gridify/)
|
|
@@ -38,8 +39,12 @@ Check out our docs at [https://alirezanet.github.io/Gridify/](https://alirezanet
|
|
|
38
39
|
|
|
39
40
|
## Articles / Examples
|
|
40
41
|
- [Using Gridify in the api controllers](https://alirezanet.github.io/Gridify/example/api-controller.html#using-gridify-in-api-controllers)
|
|
41
|
-
- [
|
|
42
|
+
- [The best dynamic LINQ with Gridify in .NET with Examples](https://medium.com/@valentin.osidach/the-best-dynamic-linq-library-with-gridify-in-net-ac3cb875b5b0) by Valentyn Osidach
|
|
43
|
+
- [Working with Dynamic Filters Using Gridify in .NET](https://levelup.gitconnected.com/working-with-dynamic-filters-using-gridify-in-net-6bba618dd9f8) by Abnoan Muniz
|
|
44
|
+
- [Building an ASP.NET Core Web API with Gridify](https://www.c-sharpcorner.com/article/building-an-asp-net-core-web-api-with-gridify) by Ajay Jumar
|
|
42
45
|
- [<span dir="rtl" align="right">آشنایی با Gridify</span>](https://www.dntips.ir/post/3345/%d8%a2%d8%b4%d9%86%d8%a7%db%8c%db%8c-%d8%a8%d8%a7-gridify) (Persian)
|
|
46
|
+
- [ASP.NET Core Web API with Gridify](https://medium.com/codenx/asp-net-core-web-api-with-gridify-d27627c81169) by Merwan Chinta
|
|
47
|
+
- [Trabajando con filtros dinámicos usando Gridify en .NET](https://henriquemauri.net/trabalhando-com-filtros-dinamicos-utilizando-o-gridify-no-net/) by [@Henrique Mauri](https://github.com/hgmauri) (Spanish)
|
|
43
48
|
- Comming soon
|
|
44
49
|
|
|
45
50
|
## Want to support us?
|
|
@@ -48,6 +53,7 @@ Check out our docs at [https://alirezanet.github.io/Gridify/](https://alirezanet
|
|
|
48
53
|
- Share your feedback and ideas to improve the library!
|
|
49
54
|
- Share the library on your favorite social media and with your friends!
|
|
50
55
|
- Help us to improve the documentation!
|
|
56
|
+
- Become a sponsor to help us sustain and expand our work! Your support makes a huge difference!
|
|
51
57
|
|
|
52
58
|
## Contribution
|
|
53
59
|
|
|
@@ -6,7 +6,7 @@ export declare class GridifyQueryBuilder {
|
|
|
6
6
|
setPage(page: number): GridifyQueryBuilder;
|
|
7
7
|
setPageSize(pageSize: number): GridifyQueryBuilder;
|
|
8
8
|
addOrderBy(field: string, descending?: boolean): GridifyQueryBuilder;
|
|
9
|
-
addCondition(field: string, operator: ConditionalOperator, value: string | number | boolean, caseSensitive?: boolean, escapeValue?: boolean): GridifyQueryBuilder;
|
|
9
|
+
addCondition(field: string, operator: ConditionalOperator | string, value: string | number | boolean, caseSensitive?: boolean, escapeValue?: boolean): GridifyQueryBuilder;
|
|
10
10
|
startGroup(): GridifyQueryBuilder;
|
|
11
11
|
endGroup(): GridifyQueryBuilder;
|
|
12
12
|
and(): GridifyQueryBuilder;
|
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="=*",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
|
|
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;if(i&&"string"==typeof o&&(n=o.replace(/([(),|]|\/i)/g,"\\$1")),!e&&o&&(n="".concat(n.toString(),"/i")),"string"==typeof t&&!Object.values(exports.ConditionalOperator).includes(t)&&!t.startsWith("#"))throw new Error("Custom operators must start with the '#' character. Received: ".concat(t));var s="".concat(r.trim()).concat(t).concat(n);return this.filteringExpressions.push({value:s,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"
|
|
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","Object","values","includes","startsWith","Error","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp"],"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,EAwIhD,CAAD,OAtIGP,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,G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KACCC,EAAe,EAsDnB,GArDAxC,KAAKM,qBAAqBmC,SAAQ,SAACC,GAShC,GARiB,eAAbA,EAAIZ,MACLU,IAEc,aAAbE,EAAIZ,MACLU,IAIkB,OAAjBD,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIH,MAAM,mDAInB,GAAqB,WAAjBY,GAA0C,WAAbG,EAAIZ,KAClC,MAAM,IAAIH,MACP,8EAKN,GAAqB,OAAjBY,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIH,MACP,mEAKN,GAAqB,eAAjBY,GAA8C,OAAbG,EAAIZ,KACtC,MAAM,IAAIH,MACP,gEAKN,GAAqB,aAAjBY,GAA4C,WAAbG,EAAIZ,KACpC,MAAM,IAAIH,MAAM,2CAInB,GAAqB,eAAjBY,GAA8C,aAAbG,EAAIZ,KACtC,MAAM,IAAIH,MAAM,gCAInB,GAAqB,aAAjBY,GAA4C,eAAbG,EAAIZ,KACpC,MAAM,IAAIH,MAAM,6CAGnBY,EAAeG,EAAIZ,KACnBQ,EAAKrC,MAAMI,QAAUqC,EAAIzB,KAC5B,IAEoB,GAAhBuB,EACD,MAAM,IAAIb,MAAM,6BAGnB,OAAO3B,KAAKC,OAEjBF,CAAD"}
|
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="=*",t.NotContains="!*",t.StartsWith="^",t.NotStartsWith="!^",t.EndsWith="$",t.NotEndsWith="!$"}(t||(t={})),function(t){t.And=",",t.Or="|"}(r||(r={}));var
|
|
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 e=function(){function e(){this.query={page:1,pageSize:20,orderBy:"",filter:""},this.filteringExpressions=[]}return e.prototype.setPage=function(t){return this.query.page=t,this},e.prototype.setPageSize=function(t){return this.query.pageSize=t,this},e.prototype.addOrderBy=function(t,r){void 0===r&&(r=!1);var e="".concat(t.trim()," ").concat(r?"desc":"").trim();return this.query.orderBy=this.query.orderBy?"".concat(this.query.orderBy,", ").concat(e):e,this},e.prototype.addCondition=function(r,e,o,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0);var s=o;if(n&&"string"==typeof o&&(s=o.replace(/([(),|]|\/i)/g,"\\$1")),!i&&o&&(s="".concat(s.toString(),"/i")),"string"==typeof e&&!Object.values(t).includes(e)&&!e.startsWith("#"))throw new Error("Custom operators must start with the '#' character. Received: ".concat(e));var a="".concat(r.trim()).concat(e).concat(s);return this.filteringExpressions.push({value:a,type:"filter"}),this},e.prototype.startGroup=function(){return this.filteringExpressions.push({value:"(",type:"startGroup"}),this},e.prototype.endGroup=function(){return this.filteringExpressions.push({value:")",type:"endGroup"}),this},e.prototype.and=function(){return this.filteringExpressions.push({value:r.And,type:"op"}),this},e.prototype.or=function(){return this.filteringExpressions.push({value:r.Or,type:"op"}),this},e.prototype.build=function(){var t=this,r=null,e=0;if(this.filteringExpressions.forEach((function(o){if("startGroup"===o.type&&e++,"endGroup"===o.type&&e--,null===r&&"op"===o.type)throw new Error("expression cannot start with a logical operator");if("filter"===r&&"filter"===o.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===r&&"op"===o.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===r&&"op"===o.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===r&&"filter"===o.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===r&&"endGroup"===o.type)throw new Error("Empty groups are not allowed");if("endGroup"===r&&"startGroup"===o.type)throw new Error("Missing a logical operator between groups");r=o.type,t.query.filter+=o.value})),0!=e)throw new Error("Group not properly closed");return this.query},e}();export{t as ConditionalOperator,e 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"
|
|
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","Object","values","includes","startsWith","Error","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp"],"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,EAAA,WAAA,SAAAA,IACWC,KAAAC,MAAuB,CA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,UAAA0B,IAAA,WAKG,OAJAjC,KAAKM,qBAAqBuB,KAAK,CAC5BZ,MAAOnB,EAAgBoC,IACvBJ,KAAM,OAEF9B,MAGVD,EAAAQ,UAAA4B,GAAA,WAEG,OADAnC,KAAKM,qBAAqBuB,KAAK,CAAEZ,MAAOnB,EAAgBsC,GAAIN,KAAM,OAC3D9B,MAGVD,EAAAQ,UAAA8B,MAAA,WAAA,IA8DCC,EAAAtC,KA7DMuC,EACD,KACCC,EAAe,EAsDnB,GArDAxC,KAAKM,qBAAqBmC,SAAQ,SAACC,GAShC,GARiB,eAAbA,EAAIZ,MACLU,IAEc,aAAbE,EAAIZ,MACLU,IAIkB,OAAjBD,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIH,MAAM,mDAInB,GAAqB,WAAjBY,GAA0C,WAAbG,EAAIZ,KAClC,MAAM,IAAIH,MACP,8EAKN,GAAqB,OAAjBY,GAAsC,OAAbG,EAAIZ,KAC9B,MAAM,IAAIH,MACP,mEAKN,GAAqB,eAAjBY,GAA8C,OAAbG,EAAIZ,KACtC,MAAM,IAAIH,MACP,gEAKN,GAAqB,aAAjBY,GAA4C,WAAbG,EAAIZ,KACpC,MAAM,IAAIH,MAAM,2CAInB,GAAqB,eAAjBY,GAA8C,aAAbG,EAAIZ,KACtC,MAAM,IAAIH,MAAM,gCAInB,GAAqB,aAAjBY,GAA4C,eAAbG,EAAIZ,KACpC,MAAM,IAAIH,MAAM,6CAGnBY,EAAeG,EAAIZ,KACnBQ,EAAKrC,MAAMI,QAAUqC,EAAIzB,KAC5B,IAEoB,GAAhBuB,EACD,MAAM,IAAIb,MAAM,6BAGnB,OAAO3B,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,
|
|
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,e;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,(e=t.LogicalOperator||(t.LogicalOperator={})).And=",",e.Or="|";var o=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 e="".concat(t.trim()," ").concat(r?"desc":"").trim();return this.query.orderBy=this.query.orderBy?"".concat(this.query.orderBy,", ").concat(e):e,this},r.prototype.addCondition=function(r,e,o,i,n){void 0===i&&(i=!0),void 0===n&&(n=!0);var a=o;if(n&&"string"==typeof o&&(a=o.replace(/([(),|]|\/i)/g,"\\$1")),!i&&o&&(a="".concat(a.toString(),"/i")),"string"==typeof e&&!Object.values(t.ConditionalOperator).includes(e)&&!e.startsWith("#"))throw new Error("Custom operators must start with the '#' character. Received: ".concat(e));var s="".concat(r.trim()).concat(e).concat(a);return this.filteringExpressions.push({value:s,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,e=0;if(this.filteringExpressions.forEach((function(o){if("startGroup"===o.type&&e++,"endGroup"===o.type&&e--,null===r&&"op"===o.type)throw new Error("expression cannot start with a logical operator");if("filter"===r&&"filter"===o.type)throw new Error("consecutive conditions are not allowed, consider adding a logical operator");if("op"===r&&"op"===o.type)throw new Error("consecutive operators are not allowed, consider adding a filter");if("startGroup"===r&&"op"===o.type)throw new Error("logical operator immediately after startGroup is not allowed");if("endGroup"===r&&"filter"===o.type)throw new Error("Missing logical operator after endGroup");if("startGroup"===r&&"endGroup"===o.type)throw new Error("Empty groups are not allowed");if("endGroup"===r&&"startGroup"===o.type)throw new Error("Missing a logical operator between groups");r=o.type,t.query.filter+=o.value})),0!=e)throw new Error("Group not properly closed");return this.query},r}();t.GridifyQueryBuilder=o}));
|
|
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"
|
|
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","Object","values","includes","startsWith","Error","filterExpression","push","type","startGroup","endGroup","and","And","or","Or","build","_this","previousType","groupCounter","forEach","exp"],"mappings":"qPAAA,IAAYA,E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