awing-library 2.1.2-dev.94 → 2.1.2-dev.96
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/esm/Helpers/query.d.ts +20 -0
- package/dist/esm/index.js +38 -16
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ export declare enum FilterOperationType {
|
|
|
15
15
|
NE = "ne",// Not equal
|
|
16
16
|
NOTCONTAINS = "notcontains",// Does not contain substring
|
|
17
17
|
NOTIN = "notin",// Not in array
|
|
18
|
+
ISEMPTY = "isempty",// Check if the field is empty (null, undefined or empty string)
|
|
18
19
|
CUSTOM = "custom"
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
@@ -158,4 +159,23 @@ export declare function convertFilterExpressionToCondition(filterExpression: Fil
|
|
|
158
159
|
* // params: ["1,2", "name1,name2"]
|
|
159
160
|
* // }
|
|
160
161
|
* ```
|
|
162
|
+
*
|
|
163
|
+
* Example with ISEMPTY check:
|
|
164
|
+
* ```typescript
|
|
165
|
+
* const complexFilter: FilterGroup = {
|
|
166
|
+
* operator: LogicalOperatorType.AND,
|
|
167
|
+
* filters: [
|
|
168
|
+
* {
|
|
169
|
+
* operator: LogicalOperatorType.OR,
|
|
170
|
+
* filters: [
|
|
171
|
+
* { key: 'apControllerCode', value: 'aerohive', type: FilterOperationType.CONTAINS },
|
|
172
|
+
* { key: 'apControllerCode', type: FilterOperationType.ISEMPTY }
|
|
173
|
+
* ]
|
|
174
|
+
* },
|
|
175
|
+
* { key: 'authenticationMethodCode', value: 'standard', type: FilterOperationType.CONTAINS }
|
|
176
|
+
* ]
|
|
177
|
+
* };
|
|
178
|
+
* const result = convertFilterExpressionToCondition(complexFilter);
|
|
179
|
+
* // Returns: { condition: '(apControllerCode.Contains("aerohive") || apControllerCode == string.Empty) && authenticationMethodCode.Contains("standard")' }
|
|
180
|
+
* ```
|
|
161
181
|
*/
|
package/dist/esm/index.js
CHANGED
|
@@ -44801,6 +44801,7 @@ var FilterOperationType;
|
|
|
44801
44801
|
FilterOperationType["NE"] = "ne";
|
|
44802
44802
|
FilterOperationType["NOTCONTAINS"] = "notcontains";
|
|
44803
44803
|
FilterOperationType["NOTIN"] = "notin";
|
|
44804
|
+
FilterOperationType["ISEMPTY"] = "isempty";
|
|
44804
44805
|
FilterOperationType["CUSTOM"] = "custom";
|
|
44805
44806
|
})(FilterOperationType || (FilterOperationType = {}));
|
|
44806
44807
|
/**
|
|
@@ -44833,12 +44834,12 @@ function convertArrayFiltersToCondition(filters) {
|
|
|
44833
44834
|
type,
|
|
44834
44835
|
isArray
|
|
44835
44836
|
} = _ref;
|
|
44836
|
-
// Skip this filter if value is empty or undefined
|
|
44837
|
-
|
|
44837
|
+
// Skip this filter if value is empty or undefined, except for ISEMPTY type which doesn't need a value
|
|
44838
|
+
const typeStr = typeof type === 'string' ? type.toLowerCase() : type;
|
|
44839
|
+
if (typeStr !== FilterOperationType.ISEMPTY && (value === undefined || value === '' || value === null)) {
|
|
44838
44840
|
return;
|
|
44839
44841
|
}
|
|
44840
44842
|
let condition;
|
|
44841
|
-
const typeStr = typeof type === 'string' ? type.toLowerCase() : type;
|
|
44842
44843
|
// Handle isArray flag - if true, use Contains with parameter reference
|
|
44843
44844
|
if (isArray === true) {
|
|
44844
44845
|
// Format the value as a comma-separated string if it's an array
|
|
@@ -44874,6 +44875,10 @@ function convertArrayFiltersToCondition(filters) {
|
|
|
44874
44875
|
case FilterOperationType.LTE:
|
|
44875
44876
|
condition = "".concat(key, "<=").concat(value);
|
|
44876
44877
|
break;
|
|
44878
|
+
case FilterOperationType.ISEMPTY:
|
|
44879
|
+
// Special handling for empty string/null checking
|
|
44880
|
+
condition = "".concat(key, " == string.Empty");
|
|
44881
|
+
break;
|
|
44877
44882
|
case FilterOperationType.IN:
|
|
44878
44883
|
// For array values
|
|
44879
44884
|
if (Array.isArray(value)) {
|
|
@@ -44972,16 +44977,17 @@ function processFilterExpression(expression) {
|
|
|
44972
44977
|
}
|
|
44973
44978
|
// It's a simple filter item
|
|
44974
44979
|
const item = expression;
|
|
44975
|
-
// Skip this filter if value is empty or undefined
|
|
44976
|
-
if (item.value === undefined || item.value === '' || item.value === null) {
|
|
44977
|
-
return '';
|
|
44978
|
-
}
|
|
44979
44980
|
const {
|
|
44980
44981
|
key,
|
|
44981
44982
|
value,
|
|
44982
44983
|
type,
|
|
44983
44984
|
isArray
|
|
44984
44985
|
} = item;
|
|
44986
|
+
// Skip this filter if value is empty or undefined, except for ISEMPTY type which doesn't need a value
|
|
44987
|
+
const typeStr = typeof type === 'string' ? type.toLowerCase() : type;
|
|
44988
|
+
if (typeStr !== FilterOperationType.ISEMPTY && (value === undefined || value === '' || value === null)) {
|
|
44989
|
+
return '';
|
|
44990
|
+
}
|
|
44985
44991
|
// Handle isArray flag - if true, use Contains with parameter reference
|
|
44986
44992
|
if (isArray === true) {
|
|
44987
44993
|
// Format the value as a comma-separated string if it's an array
|
|
@@ -44990,7 +44996,6 @@ function processFilterExpression(expression) {
|
|
|
44990
44996
|
params.push(paramValue);
|
|
44991
44997
|
return "@".concat(params.length - 1, ".Contains(").concat(key, ")");
|
|
44992
44998
|
}
|
|
44993
|
-
const typeStr = typeof type === 'string' ? type.toLowerCase() : type;
|
|
44994
44999
|
switch (typeStr) {
|
|
44995
45000
|
case FilterOperationType.EQ:
|
|
44996
45001
|
return "".concat(key, "=\"").concat(value, "\"");
|
|
@@ -45008,6 +45013,8 @@ function processFilterExpression(expression) {
|
|
|
45008
45013
|
return "".concat(key, "<").concat(value);
|
|
45009
45014
|
case FilterOperationType.LTE:
|
|
45010
45015
|
return "".concat(key, "<=").concat(value);
|
|
45016
|
+
case FilterOperationType.ISEMPTY:
|
|
45017
|
+
return "".concat(key, " == string.Empty");
|
|
45011
45018
|
case FilterOperationType.IN:
|
|
45012
45019
|
if (Array.isArray(value)) {
|
|
45013
45020
|
return "".concat(key, " IN (").concat(value.map(v => typeof v === 'string' ? "\"".concat(v, "\"") : v).join(', '), ")");
|
|
@@ -45150,6 +45157,25 @@ function convertFilterExpressionToCondition(filterExpression) {
|
|
|
45150
45157
|
* // params: ["1,2", "name1,name2"]
|
|
45151
45158
|
* // }
|
|
45152
45159
|
* ```
|
|
45160
|
+
*
|
|
45161
|
+
* Example with ISEMPTY check:
|
|
45162
|
+
* ```typescript
|
|
45163
|
+
* const complexFilter: FilterGroup = {
|
|
45164
|
+
* operator: LogicalOperatorType.AND,
|
|
45165
|
+
* filters: [
|
|
45166
|
+
* {
|
|
45167
|
+
* operator: LogicalOperatorType.OR,
|
|
45168
|
+
* filters: [
|
|
45169
|
+
* { key: 'apControllerCode', value: 'aerohive', type: FilterOperationType.CONTAINS },
|
|
45170
|
+
* { key: 'apControllerCode', type: FilterOperationType.ISEMPTY }
|
|
45171
|
+
* ]
|
|
45172
|
+
* },
|
|
45173
|
+
* { key: 'authenticationMethodCode', value: 'standard', type: FilterOperationType.CONTAINS }
|
|
45174
|
+
* ]
|
|
45175
|
+
* };
|
|
45176
|
+
* const result = convertFilterExpressionToCondition(complexFilter);
|
|
45177
|
+
* // Returns: { condition: '(apControllerCode.Contains("aerohive") || apControllerCode == string.Empty) && authenticationMethodCode.Contains("standard")' }
|
|
45178
|
+
* ```
|
|
45153
45179
|
*/
|
|
45154
45180
|
|
|
45155
45181
|
const HeaderBar = styled('header')({
|
|
@@ -177860,8 +177886,7 @@ function TableRowEditable(props) {
|
|
|
177860
177886
|
width: '15%'
|
|
177861
177887
|
}), jsxRuntimeExports.jsx(TableCell, {
|
|
177862
177888
|
style: {
|
|
177863
|
-
|
|
177864
|
-
paddingTop: 0
|
|
177889
|
+
padding: 0
|
|
177865
177890
|
},
|
|
177866
177891
|
colSpan: columnDefinitions.length - 1,
|
|
177867
177892
|
children: jsxRuntimeExports.jsx(Collapse$1, {
|
|
@@ -177869,12 +177894,9 @@ function TableRowEditable(props) {
|
|
|
177869
177894
|
timeout: "auto",
|
|
177870
177895
|
unmountOnExit: true,
|
|
177871
177896
|
children: jsxRuntimeExports.jsx(Box$1, {
|
|
177872
|
-
sx: {
|
|
177873
|
-
margin: 1
|
|
177874
|
-
},
|
|
177875
177897
|
display: "flex",
|
|
177876
177898
|
flexWrap: "wrap",
|
|
177877
|
-
gap:
|
|
177899
|
+
gap: 0,
|
|
177878
177900
|
children: fieldDefinitions === null || fieldDefinitions === void 0 ? void 0 : fieldDefinitions.map((colDef, idx) => {
|
|
177879
177901
|
var _a, _b, _c, _d;
|
|
177880
177902
|
if (colDef.contentGetter) {
|
|
@@ -177885,7 +177907,7 @@ function TableRowEditable(props) {
|
|
|
177885
177907
|
return isDisplay && jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
177886
177908
|
children: jsxRuntimeExports.jsx(Box$1, {
|
|
177887
177909
|
sx: {
|
|
177888
|
-
flex: '0 1
|
|
177910
|
+
flex: '0 1 33.3%',
|
|
177889
177911
|
boxSizing: 'border-box',
|
|
177890
177912
|
p: 2
|
|
177891
177913
|
},
|
|
@@ -177928,7 +177950,7 @@ function TableRowEditable(props) {
|
|
|
177928
177950
|
const error = ((_c = dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation[rowIdx]) === null || _c === void 0 ? void 0 : _c[fieldName]) !== undefined && !((_d = dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation[rowIdx]) === null || _d === void 0 ? void 0 : _d[fieldName]);
|
|
177929
177951
|
return isDisplay && jsxRuntimeExports.jsx(Box$1, {
|
|
177930
177952
|
sx: {
|
|
177931
|
-
flex: '0 1
|
|
177953
|
+
flex: '0 1 33.3%',
|
|
177932
177954
|
boxSizing: 'border-box',
|
|
177933
177955
|
p: 2,
|
|
177934
177956
|
'& .MuiFormControl-root': {
|
package/dist/index.d.ts
CHANGED
|
@@ -3385,6 +3385,7 @@ declare enum FilterOperationType {
|
|
|
3385
3385
|
NE = "ne",// Not equal
|
|
3386
3386
|
NOTCONTAINS = "notcontains",// Does not contain substring
|
|
3387
3387
|
NOTIN = "notin",// Not in array
|
|
3388
|
+
ISEMPTY = "isempty",// Check if the field is empty (null, undefined or empty string)
|
|
3388
3389
|
CUSTOM = "custom"
|
|
3389
3390
|
}
|
|
3390
3391
|
/**
|