@pega/cosmos-react-condition-builder 7.5.4 → 7.5.6

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.
@@ -1,7 +1,7 @@
1
1
  import type { FieldType, Comparator, ComparatorsByType } from './types';
2
2
  interface ComparatorOption {
3
3
  id: Comparator;
4
- label: 'is_true' | 'is_false' | 'is_equal_to' | 'is_not_equal_to' | 'is_in_list' | 'is_not_in_list' | 'between' | 'not_between' | 'greater_than' | 'greater_than_or_equals' | 'lower_than' | 'lower_than_or_equals' | 'starts_with' | 'not_starts_with' | 'ends_with' | 'not_ends_with' | 'contains' | 'not_contains' | 'is_null' | 'is_not_null';
4
+ label: 'is_true' | 'is_false' | 'is_equal_to' | 'is_not_equal_to' | 'is_in_list' | 'is_not_in_list' | 'between' | 'not_between' | 'greater_than' | 'greater_than_or_equals' | 'lower_than' | 'lower_than_or_equals' | 'starts_with' | 'not_starts_with' | 'ends_with' | 'not_ends_with' | 'contains' | 'not_contains' | 'is_null' | 'is_not_null' | 'after' | 'on_or_after' | 'before' | 'on_or_before';
5
5
  }
6
6
  /**
7
7
  * Returns Comparator-options applicable to the input fieldType
@@ -1 +1 @@
1
- {"version":3,"file":"comparators.d.ts","sourceRoot":"","sources":["../../../../src/components/ConditionBuilder/core/comparators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAExE,UAAU,gBAAgB;IACxB,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EACD,SAAS,GACT,UAAU,GACV,aAAa,GACb,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,SAAS,GACT,aAAa,GACb,cAAc,GACd,wBAAwB,GACxB,YAAY,GACZ,sBAAsB,GACtB,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,eAAe,GACf,UAAU,GACV,cAAc,GACd,SAAS,GACT,aAAa,CAAC;CACnB;AAgED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAS,EAAE,SAAS,EACpB,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,GACrC,gBAAgB,EAAE,CAapB"}
1
+ {"version":3,"file":"comparators.d.ts","sourceRoot":"","sources":["../../../../src/components/ConditionBuilder/core/comparators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAExE,UAAU,gBAAgB;IACxB,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,EACD,SAAS,GACT,UAAU,GACV,aAAa,GACb,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,SAAS,GACT,aAAa,GACb,cAAc,GACd,wBAAwB,GACxB,YAAY,GACZ,sBAAsB,GACtB,aAAa,GACb,iBAAiB,GACjB,WAAW,GACX,eAAe,GACf,UAAU,GACV,cAAc,GACd,SAAS,GACT,aAAa,GACb,OAAO,GACP,aAAa,GACb,QAAQ,GACR,cAAc,CAAC;CACpB;AAgED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAS,EAAE,SAAS,EACpB,gBAAgB,CAAC,EAAE,iBAAiB,EAAE,GACrC,gBAAgB,EAAE,CAapB"}
@@ -39,10 +39,10 @@ const dateTimeFieldOptions = [
39
39
  { id: 'NOT_BTW', label: 'not_between' },
40
40
  { id: 'EQ', label: 'is_equal_to' },
41
41
  { id: 'NEQ', label: 'is_not_equal_to' },
42
- { id: 'GT', label: 'greater_than' },
43
- { id: 'GTE', label: 'greater_than_or_equals' },
44
- { id: 'LT', label: 'lower_than' },
45
- { id: 'LTE', label: 'lower_than_or_equals' },
42
+ { id: 'GT', label: 'after' },
43
+ { id: 'GTE', label: 'on_or_after' },
44
+ { id: 'LT', label: 'before' },
45
+ { id: 'LTE', label: 'on_or_before' },
46
46
  { id: 'IS_NULL', label: 'is_null' },
47
47
  { id: 'IS_NOT_NULL', label: 'is_not_null' }
48
48
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"comparators.js","sourceRoot":"","sources":["../../../../src/components/ConditionBuilder/core/comparators.ts"],"names":[],"mappings":"AA2BA,MAAM,gBAAgB,GAAuB;IAC3C,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE;IAClC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACvC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;CAC5C,CAAC;AAEF,MAAM,gBAAgB,GAAuB;IAC3C,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE;IAClC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACvC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;IACjC,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACzC,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;IAC3C,EAAE,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACnD,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACvC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;IAC/C,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;IAC7C,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAA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AK,EAAE,wBAAwB,EAAE;IAC9C,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;IACjC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE;IAC5C,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;CAC5C,CAAC;AAEF,MAAM,mBAAmB,GAA0C;IACjE,OAAO,EAAE,gBAAgB;IACzB,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,mBAAmB;IAC5B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAoB,EACpB,gBAAsC;IAEtC,oCAAoC;IACpC,MAAM,OAAO,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAE/C,mFAAmF;IACnF,IAAI,gBAAgB,KAAK,SAAS,EAAE;QAClC,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACjF,IAAI,eAAe,KAAK,SAAS,EAAE;YACjC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;YACzD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACnD;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { FieldType, Comparator, ComparatorsByType } from './types';\n\ninterface ComparatorOption {\n id: Comparator;\n label:\n | 'is_true'\n | 'is_false'\n | 'is_equal_to'\n | 'is_not_equal_to'\n | 'is_in_list'\n | 'is_not_in_list'\n | 'between'\n | 'not_between'\n | 'greater_than'\n | 'greater_than_or_equals'\n | 'lower_than'\n | 'lower_than_or_equals'\n | 'starts_with'\n | 'not_starts_with'\n | 'ends_with'\n | 'not_ends_with'\n | 'contains'\n | 'not_contains'\n | 'is_null'\n | 'is_not_null';\n}\n\nconst boolFieldOptions: ComparatorOption[] = [\n { id: 'IS_TRUE', label: 'is_true' },\n { id: 'IS_FALSE', label: 'is_false' },\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst textFieldOptions: ComparatorOption[] = [\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'IN', label: 'is_in_list' },\n { id: 'NOT_IN', label: 'is_not_in_list' },\n { id: 'STARTS_WITH', label: 'starts_with' },\n { id: 'NOT_STARTS_WITH', label: 'not_starts_with' },\n { id: 'ENDS_WITH', label: 'ends_with' },\n { id: 'NOT_ENDS_WITH', label: 'not_ends_with' },\n { id: 'CONTAINS', label: 'contains' },\n { id: 'NOT_CONTAINS', label: 'not_contains' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst numericFieldOptions: ComparatorOption[] = [\n { id: 'BTW', label: 'between' },\n { id: 'NOT_BTW', label: 'not_between' },\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'IN', label: 'is_in_list' },\n { id: 'NOT_IN', label: 'is_not_in_list' },\n { id: 'GT', label: 'greater_than' },\n { id: 'GTE', label: 'greater_than_or_equals' },\n { id: 'LT', label: 'lower_than' },\n { id: 'LTE', label: 'lower_than_or_equals' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst dateTimeFieldOptions: ComparatorOption[] = [\n { id: 'BTW', label: 'between' },\n { id: 'NOT_BTW', label: 'not_between' },\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'GT', label: 'greater_than' },\n { id: 'GTE', label: 'greater_than_or_equals' },\n { id: 'LT', label: 'lower_than' },\n { id: 'LTE', label: 'lower_than_or_equals' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst typeWiseComparators: Record<FieldType, ComparatorOption[]> = {\n BOOLEAN: boolFieldOptions,\n TEXT: textFieldOptions,\n DECIMAL: numericFieldOptions,\n INTEGER: numericFieldOptions,\n DATE_TIME: dateTimeFieldOptions,\n DATE_ONLY: dateTimeFieldOptions,\n TIME_ONLY: dateTimeFieldOptions\n};\n\n/**\n * Returns Comparator-options applicable to the input fieldType\n * If `validComparators` is passed, limits the options based on that\n */\nexport default function getComparatorOptions(\n fieldType: FieldType,\n validComparators?: ComparatorsByType[]\n): ComparatorOption[] {\n // Identify the options by fieldType\n const options = typeWiseComparators[fieldType];\n\n // If a limited set of comparators is provided for the current fieldType, use those\n if (validComparators !== undefined) {\n const applicableGroup = validComparators.find(group => group.type === fieldType);\n if (applicableGroup !== undefined) {\n const comparators = new Set(applicableGroup.comparators);\n return options.filter(o => comparators.has(o.id));\n }\n }\n return options;\n}\n"]}
1
+ {"version":3,"file":"comparators.js","sourceRoot":"","sources":["../../../../src/components/ConditionBuilder/core/comparators.ts"],"names":[],"mappings":"AA+BA,MAAM,gBAAgB,GAAuB;IAC3C,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACrC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE;IAClC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE;IACvC,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AAmB;IAC5B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAE,oBAAoB;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,SAAoB,EACpB,gBAAsC;IAEtC,oCAAoC;IACpC,MAAM,OAAO,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAE/C,mFAAmF;IACnF,IAAI,gBAAgB,KAAK,SAAS,EAAE;QAClC,MAAM,eAAe,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;QACjF,IAAI,eAAe,KAAK,SAAS,EAAE;YACjC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC;YACzD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACnD;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import type { FieldType, Comparator, ComparatorsByType } from './types';\n\ninterface ComparatorOption {\n id: Comparator;\n label:\n | 'is_true'\n | 'is_false'\n | 'is_equal_to'\n | 'is_not_equal_to'\n | 'is_in_list'\n | 'is_not_in_list'\n | 'between'\n | 'not_between'\n | 'greater_than'\n | 'greater_than_or_equals'\n | 'lower_than'\n | 'lower_than_or_equals'\n | 'starts_with'\n | 'not_starts_with'\n | 'ends_with'\n | 'not_ends_with'\n | 'contains'\n | 'not_contains'\n | 'is_null'\n | 'is_not_null'\n | 'after'\n | 'on_or_after'\n | 'before'\n | 'on_or_before';\n}\n\nconst boolFieldOptions: ComparatorOption[] = [\n { id: 'IS_TRUE', label: 'is_true' },\n { id: 'IS_FALSE', label: 'is_false' },\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst textFieldOptions: ComparatorOption[] = [\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'IN', label: 'is_in_list' },\n { id: 'NOT_IN', label: 'is_not_in_list' },\n { id: 'STARTS_WITH', label: 'starts_with' },\n { id: 'NOT_STARTS_WITH', label: 'not_starts_with' },\n { id: 'ENDS_WITH', label: 'ends_with' },\n { id: 'NOT_ENDS_WITH', label: 'not_ends_with' },\n { id: 'CONTAINS', label: 'contains' },\n { id: 'NOT_CONTAINS', label: 'not_contains' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst numericFieldOptions: ComparatorOption[] = [\n { id: 'BTW', label: 'between' },\n { id: 'NOT_BTW', label: 'not_between' },\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'IN', label: 'is_in_list' },\n { id: 'NOT_IN', label: 'is_not_in_list' },\n { id: 'GT', label: 'greater_than' },\n { id: 'GTE', label: 'greater_than_or_equals' },\n { id: 'LT', label: 'lower_than' },\n { id: 'LTE', label: 'lower_than_or_equals' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst dateTimeFieldOptions: ComparatorOption[] = [\n { id: 'BTW', label: 'between' },\n { id: 'NOT_BTW', label: 'not_between' },\n { id: 'EQ', label: 'is_equal_to' },\n { id: 'NEQ', label: 'is_not_equal_to' },\n { id: 'GT', label: 'after' },\n { id: 'GTE', label: 'on_or_after' },\n { id: 'LT', label: 'before' },\n { id: 'LTE', label: 'on_or_before' },\n { id: 'IS_NULL', label: 'is_null' },\n { id: 'IS_NOT_NULL', label: 'is_not_null' }\n];\n\nconst typeWiseComparators: Record<FieldType, ComparatorOption[]> = {\n BOOLEAN: boolFieldOptions,\n TEXT: textFieldOptions,\n DECIMAL: numericFieldOptions,\n INTEGER: numericFieldOptions,\n DATE_TIME: dateTimeFieldOptions,\n DATE_ONLY: dateTimeFieldOptions,\n TIME_ONLY: dateTimeFieldOptions\n};\n\n/**\n * Returns Comparator-options applicable to the input fieldType\n * If `validComparators` is passed, limits the options based on that\n */\nexport default function getComparatorOptions(\n fieldType: FieldType,\n validComparators?: ComparatorsByType[]\n): ComparatorOption[] {\n // Identify the options by fieldType\n const options = typeWiseComparators[fieldType];\n\n // If a limited set of comparators is provided for the current fieldType, use those\n if (validComparators !== undefined) {\n const applicableGroup = validComparators.find(group => group.type === fieldType);\n if (applicableGroup !== undefined) {\n const comparators = new Set(applicableGroup.comparators);\n return options.filter(o => comparators.has(o.id));\n }\n }\n return options;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-condition-builder",
3
- "version": "7.5.4",
3
+ "version": "7.5.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pegasystems/cosmos-react.git",
@@ -22,7 +22,7 @@
22
22
  "build": "tsc -b tsconfig.build.json"
23
23
  },
24
24
  "dependencies": {
25
- "@pega/cosmos-react-core": "7.5.4",
25
+ "@pega/cosmos-react-core": "7.5.6",
26
26
  "@types/react": "^17.0.62",
27
27
  "@types/react-dom": "^17.0.20",
28
28
  "@types/styled-components": "^5.1.26",