@pega/cosmos-react-condition-builder 8.0.0-build.6.1 → 8.0.0-build.60.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/lib/components/ConditionBuilder/AtomicCondition.d.ts +3 -3
- package/lib/components/ConditionBuilder/AtomicCondition.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/AtomicCondition.js +4 -1
- package/lib/components/ConditionBuilder/AtomicCondition.js.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.js +42 -60
- package/lib/components/ConditionBuilder/ConditionBuilder.js.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.styles.d.ts +4 -4
- package/lib/components/ConditionBuilder/ConditionBuilder.styles.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.styles.js +18 -6
- package/lib/components/ConditionBuilder/ConditionBuilder.styles.js.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +11 -5
- package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilder.types.js.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/DateFunctionMenu.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/DateFunctionMenu.js.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/RelativeDateMenu.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/RelativeDateMenu.js.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/ValueSelector.d.ts +2 -4
- package/lib/components/ConditionBuilder/RhsControls/ValueSelector.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/ValueSelector.js +166 -130
- package/lib/components/ConditionBuilder/RhsControls/ValueSelector.js.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/index.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/RhsControls/index.js +12 -14
- package/lib/components/ConditionBuilder/RhsControls/index.js.map +1 -1
- package/lib/components/ConditionBuilder/core/comparators.d.ts +1 -1
- package/lib/components/ConditionBuilder/core/comparators.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/core/comparators.js +35 -39
- package/lib/components/ConditionBuilder/core/comparators.js.map +1 -1
- package/lib/components/ConditionBuilder/core/evaluator.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/core/evaluator.js +11 -1
- package/lib/components/ConditionBuilder/core/evaluator.js.map +1 -1
- package/lib/components/ConditionBuilder/core/extendDayJs.js +4 -0
- package/lib/components/ConditionBuilder/core/extendDayJs.js.map +1 -1
- package/lib/components/ConditionBuilder/core/formatter.js +1 -1
- package/lib/components/ConditionBuilder/core/formatter.js.map +1 -1
- package/lib/components/ConditionBuilder/core/transformer.d.ts +18 -1
- package/lib/components/ConditionBuilder/core/transformer.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/core/transformer.js +120 -30
- package/lib/components/ConditionBuilder/core/transformer.js.map +1 -1
- package/lib/components/ConditionBuilder/core/utils.d.ts +6 -0
- package/lib/components/ConditionBuilder/core/utils.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/core/utils.js +11 -0
- package/lib/components/ConditionBuilder/core/utils.js.map +1 -1
- package/lib/components/ConditionBuilder/index.d.ts +1 -1
- package/lib/components/ConditionBuilder/index.d.ts.map +1 -1
- package/lib/components/ConditionBuilder/index.js.map +1 -1
- package/lib/components/ConditionInput/ConditionInput.d.ts +2 -3
- package/lib/components/ConditionInput/ConditionInput.d.ts.map +1 -1
- package/lib/components/ConditionInput/ConditionInput.js +40 -28
- package/lib/components/ConditionInput/ConditionInput.js.map +1 -1
- package/lib/components/ConditionInput/ConditionInput.styles.d.ts +2 -2
- package/lib/components/ConditionInput/ConditionInput.styles.d.ts.map +1 -1
- package/lib/components/ConditionInput/ConditionInput.types.d.ts +3 -1
- package/lib/components/ConditionInput/ConditionInput.types.d.ts.map +1 -1
- package/lib/components/ConditionInput/ConditionInput.types.js.map +1 -1
- package/lib/components/ConditionInput/utils.d.ts.map +1 -1
- package/lib/components/ConditionInput/utils.js +5 -2
- package/lib/components/ConditionInput/utils.js.map +1 -1
- package/lib/components/PromotedFilters/ConditionSelector.d.ts +0 -2
- package/lib/components/PromotedFilters/ConditionSelector.d.ts.map +1 -1
- package/lib/components/PromotedFilters/ConditionSelector.js +13 -12
- package/lib/components/PromotedFilters/ConditionSelector.js.map +1 -1
- package/lib/components/PromotedFilters/PromotedFilters.d.ts +2 -3
- package/lib/components/PromotedFilters/PromotedFilters.d.ts.map +1 -1
- package/lib/components/PromotedFilters/PromotedFilters.js +55 -46
- package/lib/components/PromotedFilters/PromotedFilters.js.map +1 -1
- package/lib/components/PromotedFilters/PromotedFilters.styles.d.ts +2 -2
- package/lib/components/PromotedFilters/PromotedFilters.styles.d.ts.map +1 -1
- package/lib/components/PromotedFilters/PromotedFilters.styles.js +1 -1
- package/lib/components/PromotedFilters/PromotedFilters.styles.js.map +1 -1
- package/lib/components/PromotedFilters/PromotedFilters.types.d.ts +35 -6
- package/lib/components/PromotedFilters/PromotedFilters.types.d.ts.map +1 -1
- package/lib/components/PromotedFilters/PromotedFilters.types.js.map +1 -1
- package/package.json +9 -9
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
2
|
import type { BaseProps, NoChildrenProp, SimpleStore } from '@pega/cosmos-react-core';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Field, LeafCondition } from '../ConditionBuilder/ConditionBuilder.types';
|
|
4
4
|
import type { ConditionInputMode, ConditionField } from '../ConditionInput/ConditionInput.types';
|
|
5
5
|
export interface PromotedFilter {
|
|
6
|
+
/** Optional for multiple filters on the same field. */
|
|
7
|
+
id?: string;
|
|
6
8
|
/** Definition of the field to be filtered. */
|
|
7
9
|
field: ConditionField;
|
|
8
10
|
/** Display mode. */
|
|
@@ -16,20 +18,43 @@ export interface PromotedFilter {
|
|
|
16
18
|
label?: string;
|
|
17
19
|
}[];
|
|
18
20
|
}
|
|
21
|
+
export interface HandleValue {
|
|
22
|
+
/** Returns currently visible condition in the PromotedFilters */
|
|
23
|
+
getCondition: () => PromotedFiltersProps['condition'];
|
|
24
|
+
}
|
|
19
25
|
export interface PromotedFiltersProps extends BaseProps, NoChildrenProp {
|
|
20
26
|
/** Configuration of filters for every field that has been defined as promoted. */
|
|
21
27
|
filters: PromotedFilter[];
|
|
22
|
-
/** A value representing the current condition state. */
|
|
23
|
-
condition?:
|
|
28
|
+
/** A value representing the current condition state. Optional filterId for multiple filters per field support. */
|
|
29
|
+
condition?: {
|
|
30
|
+
AND: {
|
|
31
|
+
condition: LeafCondition & {
|
|
32
|
+
filterId?: string;
|
|
33
|
+
};
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
24
36
|
/**
|
|
25
37
|
* Orientation mode.
|
|
26
38
|
* @default 'horizontal'
|
|
27
39
|
*/
|
|
28
40
|
orientation?: 'vertical' | 'horizontal';
|
|
29
|
-
/**
|
|
30
|
-
|
|
41
|
+
/** Metadata (data-model) for the Fields to use in the RHS field-selector */
|
|
42
|
+
fields?: Field[];
|
|
43
|
+
/** Callback fired on apply click. */
|
|
44
|
+
onChange: (condition?: {
|
|
45
|
+
AND: {
|
|
46
|
+
condition: LeafCondition & {
|
|
47
|
+
filterId?: string;
|
|
48
|
+
};
|
|
49
|
+
}[];
|
|
50
|
+
}) => void;
|
|
31
51
|
/** Ref for the wrapping element. */
|
|
32
52
|
ref?: Ref<HTMLDivElement>;
|
|
53
|
+
/**
|
|
54
|
+
* Imperative handle.
|
|
55
|
+
* Used to fetch the currently visible condition, regardless of the `Apply` click
|
|
56
|
+
*/
|
|
57
|
+
handle?: Ref<HandleValue>;
|
|
33
58
|
}
|
|
34
59
|
export interface PromotedFiltersContentProps extends BaseProps, NoChildrenProp {
|
|
35
60
|
/** Configuration of filters for every field that has been defined as promoted. */
|
|
@@ -38,15 +63,19 @@ export interface PromotedFiltersContentProps extends BaseProps, NoChildrenProp {
|
|
|
38
63
|
conditionStore: SimpleStore<{
|
|
39
64
|
[key: string]: LeafCondition | undefined;
|
|
40
65
|
}>;
|
|
66
|
+
/** Callback fired on apply */
|
|
67
|
+
onApply?: () => void;
|
|
41
68
|
/**
|
|
42
69
|
* Orientation mode.
|
|
43
70
|
* @default 'horizontal'
|
|
44
71
|
*/
|
|
45
72
|
orientation?: 'vertical' | 'horizontal';
|
|
73
|
+
/** Metadata (data-model) for the Fields to use in the RHS field-selector */
|
|
74
|
+
fields?: Field[];
|
|
46
75
|
/** Ref for the wrapping element. */
|
|
47
76
|
ref?: Ref<HTMLDivElement>;
|
|
48
77
|
}
|
|
49
|
-
export interface FilterModalProps extends Pick<PromotedFiltersContentProps, 'filters' | 'conditionStore'> {
|
|
78
|
+
export interface FilterModalProps extends Pick<PromotedFiltersContentProps, 'filters' | 'conditionStore' | 'fields'> {
|
|
50
79
|
/** Callback fired on apply */
|
|
51
80
|
onApply: () => void;
|
|
52
81
|
/** Callback fired on cancel */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromotedFilters.types.d.ts","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtF,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"PromotedFilters.types.d.ts","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtF,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,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,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,2BAA4B,SAAQ,SAAS,EAAE,cAAc;IAC5E,kFAAkF;IAClF,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,gDAAgD;IAChD,cAAc,EAAE,WAAW,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAC1E,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IACjB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,2BAA2B,EAAE,SAAS,GAAG,gBAAgB,GAAG,QAAQ,CAAC;IAClF,8BAA8B;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromotedFilters.types.js","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type { BaseProps, NoChildrenProp, SimpleStore } from '@pega/cosmos-react-core';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"PromotedFilters.types.js","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type { BaseProps, NoChildrenProp, SimpleStore } from '@pega/cosmos-react-core';\n\nimport type { Field, LeafCondition } from '../ConditionBuilder/ConditionBuilder.types';\nimport type { ConditionInputMode, ConditionField } from '../ConditionInput/ConditionInput.types';\n\nexport interface PromotedFilter {\n /** Optional for multiple filters on the same field. */\n id?: string;\n /** Definition of the field to be filtered. */\n field: ConditionField;\n /** Display mode. */\n mode: ConditionInputMode;\n /** Label for the filter. */\n label?: string;\n /** List of possible predefined Conditions */\n predefinedConditions?: { id: string; value: LeafCondition; label?: string }[];\n}\n\nexport interface HandleValue {\n /** Returns currently visible condition in the PromotedFilters */\n getCondition: () => PromotedFiltersProps['condition'];\n}\n\nexport interface PromotedFiltersProps extends BaseProps, NoChildrenProp {\n /** Configuration of filters for every field that has been defined as promoted. */\n filters: PromotedFilter[];\n /** A value representing the current condition state. Optional filterId for multiple filters per field support. */\n condition?: { AND: { condition: LeafCondition & { filterId?: string } }[] };\n /**\n * Orientation mode.\n * @default 'horizontal'\n */\n orientation?: 'vertical' | 'horizontal';\n /** Metadata (data-model) for the Fields to use in the RHS field-selector */\n fields?: Field[];\n /** Callback fired on apply click. */\n onChange: (condition?: { AND: { condition: LeafCondition & { filterId?: string } }[] }) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n /**\n * Imperative handle.\n * Used to fetch the currently visible condition, regardless of the `Apply` click\n */\n handle?: Ref<HandleValue>;\n}\n\nexport interface PromotedFiltersContentProps extends BaseProps, NoChildrenProp {\n /** Configuration of filters for every field that has been defined as promoted. */\n filters: PromotedFilter[];\n /** A value representing the condition store. */\n conditionStore: SimpleStore<{ [key: string]: LeafCondition | undefined }>;\n /** Callback fired on apply */\n onApply?: () => void;\n /**\n * Orientation mode.\n * @default 'horizontal'\n */\n orientation?: 'vertical' | 'horizontal';\n /** Metadata (data-model) for the Fields to use in the RHS field-selector */\n fields?: Field[];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface FilterModalProps\n extends Pick<PromotedFiltersContentProps, 'filters' | 'conditionStore' | 'fields'> {\n /** Callback fired on apply */\n onApply: () => void;\n /** Callback fired on cancel */\n onCancel: () => void;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-condition-builder",
|
|
3
|
-
"version": "8.0.0-build.
|
|
3
|
+
"version": "8.0.0-build.60.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pegasystems/cosmos-react.git",
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
"build": "tsc -b tsconfig.build.json"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@pega/cosmos-react-core": "8.0.0-build.
|
|
26
|
-
"@types/react": "^17.0.62",
|
|
27
|
-
"@types/react-dom": "^17.0.20",
|
|
25
|
+
"@pega/cosmos-react-core": "8.0.0-build.60.1",
|
|
26
|
+
"@types/react": "^17.0.62 || ^18.3.3",
|
|
27
|
+
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
28
28
|
"@types/styled-components": "^5.1.26",
|
|
29
|
-
"dayjs": "^1.11.
|
|
29
|
+
"dayjs": "^1.11.13",
|
|
30
30
|
"polished": "^4.1.0",
|
|
31
|
-
"react": "^17.0.0",
|
|
32
|
-
"react-dom": "^17.0.0",
|
|
31
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
32
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
33
33
|
"styled-components": "^5.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@storybook/react": "~8.2.9",
|
|
37
|
-
"@testing-library/react": "^
|
|
38
|
-
"@testing-library/user-event": "^14.
|
|
37
|
+
"@testing-library/react": "^16.0.0",
|
|
38
|
+
"@testing-library/user-event": "^14.6.1",
|
|
39
39
|
"typescript": "~5.5.4"
|
|
40
40
|
}
|
|
41
41
|
}
|