@pega/cosmos-react-condition-builder 5.0.0-dev.4.7 → 5.0.0-dev.4.8

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.
Files changed (145) hide show
  1. package/package.json +2 -2
  2. package/lib/components/ConditionBuilder/AtomicCondition.d.ts +0 -57
  3. package/lib/components/ConditionBuilder/AtomicCondition.d.ts.map +0 -1
  4. package/lib/components/ConditionBuilder/AtomicCondition.js +0 -164
  5. package/lib/components/ConditionBuilder/AtomicCondition.js.map +0 -1
  6. package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +0 -6
  7. package/lib/components/ConditionBuilder/ConditionBuilder.d.ts.map +0 -1
  8. package/lib/components/ConditionBuilder/ConditionBuilder.js +0 -271
  9. package/lib/components/ConditionBuilder/ConditionBuilder.js.map +0 -1
  10. package/lib/components/ConditionBuilder/ConditionBuilder.styles.d.ts +0 -7
  11. package/lib/components/ConditionBuilder/ConditionBuilder.styles.d.ts.map +0 -1
  12. package/lib/components/ConditionBuilder/ConditionBuilder.styles.js +0 -59
  13. package/lib/components/ConditionBuilder/ConditionBuilder.styles.js.map +0 -1
  14. package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts +0 -136
  15. package/lib/components/ConditionBuilder/ConditionBuilder.types.d.ts.map +0 -1
  16. package/lib/components/ConditionBuilder/ConditionBuilder.types.js +0 -2
  17. package/lib/components/ConditionBuilder/ConditionBuilder.types.js.map +0 -1
  18. package/lib/components/ConditionBuilder/FieldCondition.d.ts +0 -7
  19. package/lib/components/ConditionBuilder/FieldCondition.d.ts.map +0 -1
  20. package/lib/components/ConditionBuilder/FieldCondition.js +0 -26
  21. package/lib/components/ConditionBuilder/FieldCondition.js.map +0 -1
  22. package/lib/components/ConditionBuilder/FieldCondition.types.d.ts +0 -30
  23. package/lib/components/ConditionBuilder/FieldCondition.types.d.ts.map +0 -1
  24. package/lib/components/ConditionBuilder/FieldCondition.types.js +0 -2
  25. package/lib/components/ConditionBuilder/FieldCondition.types.js.map +0 -1
  26. package/lib/components/ConditionBuilder/RhsControls/DateFunctionMenu.d.ts +0 -18
  27. package/lib/components/ConditionBuilder/RhsControls/DateFunctionMenu.d.ts.map +0 -1
  28. package/lib/components/ConditionBuilder/RhsControls/DateFunctionMenu.js +0 -155
  29. package/lib/components/ConditionBuilder/RhsControls/DateFunctionMenu.js.map +0 -1
  30. package/lib/components/ConditionBuilder/RhsControls/FieldSelector.d.ts +0 -21
  31. package/lib/components/ConditionBuilder/RhsControls/FieldSelector.d.ts.map +0 -1
  32. package/lib/components/ConditionBuilder/RhsControls/FieldSelector.js +0 -60
  33. package/lib/components/ConditionBuilder/RhsControls/FieldSelector.js.map +0 -1
  34. package/lib/components/ConditionBuilder/RhsControls/NumericInput.d.ts +0 -18
  35. package/lib/components/ConditionBuilder/RhsControls/NumericInput.d.ts.map +0 -1
  36. package/lib/components/ConditionBuilder/RhsControls/NumericInput.js +0 -22
  37. package/lib/components/ConditionBuilder/RhsControls/NumericInput.js.map +0 -1
  38. package/lib/components/ConditionBuilder/RhsControls/RelativeDateMenu.d.ts +0 -18
  39. package/lib/components/ConditionBuilder/RhsControls/RelativeDateMenu.d.ts.map +0 -1
  40. package/lib/components/ConditionBuilder/RhsControls/RelativeDateMenu.js +0 -119
  41. package/lib/components/ConditionBuilder/RhsControls/RelativeDateMenu.js.map +0 -1
  42. package/lib/components/ConditionBuilder/RhsControls/RhsModeSwitch.d.ts +0 -26
  43. package/lib/components/ConditionBuilder/RhsControls/RhsModeSwitch.d.ts.map +0 -1
  44. package/lib/components/ConditionBuilder/RhsControls/RhsModeSwitch.js +0 -156
  45. package/lib/components/ConditionBuilder/RhsControls/RhsModeSwitch.js.map +0 -1
  46. package/lib/components/ConditionBuilder/RhsControls/TimePeriodInput.d.ts +0 -6
  47. package/lib/components/ConditionBuilder/RhsControls/TimePeriodInput.d.ts.map +0 -1
  48. package/lib/components/ConditionBuilder/RhsControls/TimePeriodInput.js +0 -112
  49. package/lib/components/ConditionBuilder/RhsControls/TimePeriodInput.js.map +0 -1
  50. package/lib/components/ConditionBuilder/RhsControls/TimePeriodMenu.d.ts +0 -20
  51. package/lib/components/ConditionBuilder/RhsControls/TimePeriodMenu.d.ts.map +0 -1
  52. package/lib/components/ConditionBuilder/RhsControls/TimePeriodMenu.js +0 -12
  53. package/lib/components/ConditionBuilder/RhsControls/TimePeriodMenu.js.map +0 -1
  54. package/lib/components/ConditionBuilder/RhsControls/ValueSelector.d.ts +0 -45
  55. package/lib/components/ConditionBuilder/RhsControls/ValueSelector.d.ts.map +0 -1
  56. package/lib/components/ConditionBuilder/RhsControls/ValueSelector.js +0 -196
  57. package/lib/components/ConditionBuilder/RhsControls/ValueSelector.js.map +0 -1
  58. package/lib/components/ConditionBuilder/RhsControls/index.d.ts +0 -42
  59. package/lib/components/ConditionBuilder/RhsControls/index.d.ts.map +0 -1
  60. package/lib/components/ConditionBuilder/RhsControls/index.js +0 -321
  61. package/lib/components/ConditionBuilder/RhsControls/index.js.map +0 -1
  62. package/lib/components/ConditionBuilder/core/comparators.d.ts +0 -12
  63. package/lib/components/ConditionBuilder/core/comparators.d.ts.map +0 -1
  64. package/lib/components/ConditionBuilder/core/comparators.js +0 -78
  65. package/lib/components/ConditionBuilder/core/comparators.js.map +0 -1
  66. package/lib/components/ConditionBuilder/core/evaluator.d.ts +0 -17
  67. package/lib/components/ConditionBuilder/core/evaluator.d.ts.map +0 -1
  68. package/lib/components/ConditionBuilder/core/evaluator.js +0 -314
  69. package/lib/components/ConditionBuilder/core/evaluator.js.map +0 -1
  70. package/lib/components/ConditionBuilder/core/extendDayJs.d.ts +0 -2
  71. package/lib/components/ConditionBuilder/core/extendDayJs.d.ts.map +0 -1
  72. package/lib/components/ConditionBuilder/core/extendDayJs.js +0 -4
  73. package/lib/components/ConditionBuilder/core/extendDayJs.js.map +0 -1
  74. package/lib/components/ConditionBuilder/core/formatter.d.ts +0 -17
  75. package/lib/components/ConditionBuilder/core/formatter.d.ts.map +0 -1
  76. package/lib/components/ConditionBuilder/core/formatter.js +0 -262
  77. package/lib/components/ConditionBuilder/core/formatter.js.map +0 -1
  78. package/lib/components/ConditionBuilder/core/rows-reducer.d.ts +0 -27
  79. package/lib/components/ConditionBuilder/core/rows-reducer.d.ts.map +0 -1
  80. package/lib/components/ConditionBuilder/core/rows-reducer.js +0 -50
  81. package/lib/components/ConditionBuilder/core/rows-reducer.js.map +0 -1
  82. package/lib/components/ConditionBuilder/core/time-utils.d.ts +0 -5
  83. package/lib/components/ConditionBuilder/core/time-utils.d.ts.map +0 -1
  84. package/lib/components/ConditionBuilder/core/time-utils.js +0 -23
  85. package/lib/components/ConditionBuilder/core/time-utils.js.map +0 -1
  86. package/lib/components/ConditionBuilder/core/transformer.d.ts +0 -7
  87. package/lib/components/ConditionBuilder/core/transformer.d.ts.map +0 -1
  88. package/lib/components/ConditionBuilder/core/transformer.js +0 -210
  89. package/lib/components/ConditionBuilder/core/transformer.js.map +0 -1
  90. package/lib/components/ConditionBuilder/core/types.d.ts +0 -47
  91. package/lib/components/ConditionBuilder/core/types.d.ts.map +0 -1
  92. package/lib/components/ConditionBuilder/core/types.js +0 -2
  93. package/lib/components/ConditionBuilder/core/types.js.map +0 -1
  94. package/lib/components/ConditionBuilder/core/utils.d.ts +0 -37
  95. package/lib/components/ConditionBuilder/core/utils.d.ts.map +0 -1
  96. package/lib/components/ConditionBuilder/core/utils.js +0 -454
  97. package/lib/components/ConditionBuilder/core/utils.js.map +0 -1
  98. package/lib/components/ConditionBuilder/index.d.ts +0 -11
  99. package/lib/components/ConditionBuilder/index.d.ts.map +0 -1
  100. package/lib/components/ConditionBuilder/index.js +0 -8
  101. package/lib/components/ConditionBuilder/index.js.map +0 -1
  102. package/lib/components/ConditionInput/ConditionInput.d.ts +0 -6
  103. package/lib/components/ConditionInput/ConditionInput.d.ts.map +0 -1
  104. package/lib/components/ConditionInput/ConditionInput.js +0 -302
  105. package/lib/components/ConditionInput/ConditionInput.js.map +0 -1
  106. package/lib/components/ConditionInput/ConditionInput.styles.d.ts +0 -5
  107. package/lib/components/ConditionInput/ConditionInput.styles.d.ts.map +0 -1
  108. package/lib/components/ConditionInput/ConditionInput.styles.js +0 -27
  109. package/lib/components/ConditionInput/ConditionInput.styles.js.map +0 -1
  110. package/lib/components/ConditionInput/ConditionInput.types.d.ts +0 -32
  111. package/lib/components/ConditionInput/ConditionInput.types.d.ts.map +0 -1
  112. package/lib/components/ConditionInput/ConditionInput.types.js +0 -2
  113. package/lib/components/ConditionInput/ConditionInput.types.js.map +0 -1
  114. package/lib/components/ConditionInput/index.d.ts +0 -3
  115. package/lib/components/ConditionInput/index.d.ts.map +0 -1
  116. package/lib/components/ConditionInput/index.js +0 -2
  117. package/lib/components/ConditionInput/index.js.map +0 -1
  118. package/lib/components/ConditionInput/utils.d.ts +0 -17
  119. package/lib/components/ConditionInput/utils.d.ts.map +0 -1
  120. package/lib/components/ConditionInput/utils.js +0 -121
  121. package/lib/components/ConditionInput/utils.js.map +0 -1
  122. package/lib/components/PromotedFilters/ConditionSelector.d.ts +0 -31
  123. package/lib/components/PromotedFilters/ConditionSelector.d.ts.map +0 -1
  124. package/lib/components/PromotedFilters/ConditionSelector.js +0 -44
  125. package/lib/components/PromotedFilters/ConditionSelector.js.map +0 -1
  126. package/lib/components/PromotedFilters/PromotedFilters.d.ts +0 -11
  127. package/lib/components/PromotedFilters/PromotedFilters.d.ts.map +0 -1
  128. package/lib/components/PromotedFilters/PromotedFilters.js +0 -153
  129. package/lib/components/PromotedFilters/PromotedFilters.js.map +0 -1
  130. package/lib/components/PromotedFilters/PromotedFilters.styles.d.ts +0 -4
  131. package/lib/components/PromotedFilters/PromotedFilters.styles.d.ts.map +0 -1
  132. package/lib/components/PromotedFilters/PromotedFilters.styles.js +0 -38
  133. package/lib/components/PromotedFilters/PromotedFilters.styles.js.map +0 -1
  134. package/lib/components/PromotedFilters/PromotedFilters.types.d.ts +0 -33
  135. package/lib/components/PromotedFilters/PromotedFilters.types.d.ts.map +0 -1
  136. package/lib/components/PromotedFilters/PromotedFilters.types.js +0 -2
  137. package/lib/components/PromotedFilters/PromotedFilters.types.js.map +0 -1
  138. package/lib/components/PromotedFilters/index.d.ts +0 -3
  139. package/lib/components/PromotedFilters/index.d.ts.map +0 -1
  140. package/lib/components/PromotedFilters/index.js +0 -2
  141. package/lib/components/PromotedFilters/index.js.map +0 -1
  142. package/lib/index.d.ts +0 -7
  143. package/lib/index.d.ts.map +0 -1
  144. package/lib/index.js +0 -8
  145. package/lib/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/ConditionInput/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAOlD,MAAM,CAAC,MAAM,kBAAkB,GAA2C;IACxE,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,IAAI;CACN,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAA0C;IAClE,KAAK,EAAE,MAAM;IACb,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,MAAM;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,G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,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,aAAa,CAAC,EAAE;YACpF,OAAO,UAAU,CAAC,GAAG,CAAC,WAAW,KAAK,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC;SAClE;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAW,EAAE,EAAE;IAC1D,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;QAChC,CAAC,CAAE;YACC,IAAI,EAAE,GAAG,CAAC,EAAE;YACZ,IAAI,EAAE,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI;SAChC;QACtB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yCAAyC,GAAG,CACvD,cAAgD,EACb,EAAE;IACrC,IAAI,cAAc,KAAK,SAAS,IAAI,OAAO,cAAc,KAAK,UAAU;QAAE,OAAO,cAAc,CAAC;IAEhG,OAAO,CAAC,EACN,YAAY,EACZ,UAAU,EACV,GAAG,EAKJ,EAAE,EAAE;QACH,OAAO,cAAc,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,4BAA4B,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9F,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { hasProp } from '@pega/cosmos-react-core';\n\nimport { Field, LeafCondition, ValueSelection } from '../ConditionBuilder';\nimport type { Comparator, FieldType } from '../ConditionBuilder/core/types';\n\nimport type { ConditionField, ConditionFieldType } from './ConditionInput.types';\n\nexport const defaultComparators: Record<ConditionFieldType, Comparator> = {\n TEXT: 'CONTAINS',\n EMAIL: 'CONTAINS',\n URL: 'CONTAINS',\n PHONE: 'CONTAINS',\n INTEGER: 'BTW',\n DECIMAL: 'BTW',\n PERCENTAGE: 'BTW',\n CURRENCY: 'BTW',\n BOOLEAN: 'IS_TRUE',\n DATE_ONLY: 'BTW',\n TIME_ONLY: 'BTW',\n DATE_TIME: 'BTW',\n PICKLIST: 'IN'\n} as const;\n\nexport const basicFieldMap: Record<ConditionFieldType, FieldType> = {\n EMAIL: 'TEXT',\n URL: 'TEXT',\n PHONE: 'TEXT',\n INTEGER: 'NUMBER',\n DECIMAL: 'NUMBER',\n PERCENTAGE: 'NUMBER',\n CURRENCY: 'NUMBER',\n TEXT: 'TEXT',\n BOOLEAN: 'BOOLEAN',\n DATE_ONLY: 'DATE_ONLY',\n TIME_ONLY: 'TIME_ONLY',\n DATE_TIME: 'DATE_TIME',\n PICKLIST: 'TEXT'\n} as const;\n\nexport const valuesEqual = (\n value1: string | string[] | undefined,\n value2: string | string[] | undefined\n) => {\n // both values are undefined\n if (!value1 && !value2) return true;\n\n // only one value is undefined\n if (!value1 || !value2) return false;\n\n // for strings compare only value\n if (typeof value1 === 'string') {\n return value1 === value2;\n }\n\n // for arrays compare length and every value\n if (value1.length !== value2.length) return false;\n\n return value1.every((value, index) => value === value2[index]);\n};\n\nexport const rangeValuesEqual = (\n value1: { start: string | number | undefined; end: string | number | undefined } | undefined,\n value2: { start: string | number | undefined; end: string | number | undefined } | undefined\n) => {\n // both values are undefined\n if (!value1 && !value2) return true;\n\n // only one value is undefined\n if (!value1 || !value2) return false;\n\n return value1.start === value2.start && value1.end === value2.end;\n};\n\nexport const conditionsEqual = (\n condition1: LeafCondition | undefined,\n condition2: LeafCondition | undefined\n) => {\n // both values are undefined\n if (!condition1 && !condition2) return true;\n\n // only one value is undefined\n if (!condition1 || !condition2) return false;\n\n // conditions are for different fields\n if (condition1.lhs?.field !== condition2.lhs?.field) return false;\n\n // comparators are different\n if (condition1.comparator !== condition2.comparator) return false;\n\n // comparators are unary\n if (!condition1.rhs && !condition2.rhs) return true;\n\n if (condition1.rhs && condition2.rhs) {\n // datefunction is first, cause it contains also 'value' prop, so it would fall into next condition block\n if (hasProp(condition1.rhs, 'dateFunction') && hasProp(condition2.rhs, 'dateFunction')) {\n return (\n condition1.rhs.dateFunction === condition2.rhs.dateFunction &&\n valuesEqual(condition1.rhs.value.toString(), condition2.rhs.value.toString())\n );\n }\n if (hasProp(condition1.rhs, 'value') && hasProp(condition2.rhs, 'value')) {\n if (typeof condition1.rhs.value !== typeof condition2.rhs.value) return false;\n return valuesEqual(condition1.rhs.value.toString(), condition2.rhs.value.toString());\n }\n if (hasProp(condition1.rhs, 'values') && hasProp(condition2.rhs, 'values')) {\n if (typeof condition1.rhs.values[0] !== typeof condition2.rhs.values[0]) return false;\n return valuesEqual(\n condition1.rhs.values.map(p => p.toString()),\n condition2.rhs.values.map(p => p.toString())\n );\n }\n if (hasProp(condition1.rhs, 'start') && hasProp(condition2.rhs, 'start')) {\n return rangeValuesEqual(condition1.rhs, condition2.rhs);\n }\n if (hasProp(condition1.rhs, 'relativeDate') && hasProp(condition2.rhs, 'relativeDate')) {\n return (\n condition1.rhs.relativeDate.datePart === condition2.rhs.relativeDate.datePart &&\n condition1.rhs.relativeDate.interval === condition2.rhs.relativeDate.interval &&\n condition1.rhs.relativeDate.timePeriod === condition2.rhs.relativeDate.timePeriod\n );\n }\n if (hasProp(condition1.rhs, 'field') && hasProp(condition2.rhs, 'field')) {\n return condition1.rhs.field === condition2.rhs.field;\n }\n if (hasProp(condition1.rhs, 'parameterId') && hasProp(condition2.rhs, 'parameterId')) {\n return condition1.rhs.parameterId === condition2.rhs.parameterId;\n }\n }\n\n return false;\n};\n\nexport const convertFieldToConditionField = (lhs?: Field) => {\n return lhs && hasProp(lhs, 'type')\n ? ({\n name: lhs.id,\n type: lhs.type === 'NUMBER' ? 'INTEGER' : lhs.type\n } as ConditionField)\n : undefined;\n};\n\nexport const possibleFieldValuesToConditionFieldValues = (\n possibleValues: ConditionField['possibleValues']\n): ValueSelection<Field> | undefined => {\n if (possibleValues === undefined || typeof possibleValues !== 'function') return possibleValues;\n\n return ({\n searchString,\n comparator,\n lhs\n }: {\n searchString?: string;\n comparator?: string;\n lhs?: Field;\n }) => {\n return possibleValues({ searchString, comparator, lhs: convertFieldToConditionField(lhs) });\n };\n};\n"]}
@@ -1,31 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { BaseProps, NoChildrenProp, ComboBoxProps, ForwardProps } from '@pega/cosmos-react-core';
3
- import { AtomicConditionProps } from '../ConditionBuilder/AtomicCondition';
4
- import { LeafCondition } from '../ConditionBuilder';
5
- interface ConditionSelectorProps extends BaseProps, NoChildrenProp {
6
- /** Callback for onChange */
7
- onChange: (condition?: LeafCondition) => void;
8
- /** Callback for clear */
9
- onClear?: () => void;
10
- /** Used to indicate any errors on the control */
11
- status?: 'error';
12
- /** Custom label for input. Makes label visible if provided. */
13
- label?: ComboBoxProps['label'];
14
- /** Visually hides the label region. */
15
- labelHidden?: ComboBoxProps['labelHidden'];
16
- /** Guidance text that apppears below the input. */
17
- info?: ComboBoxProps['info'];
18
- /** Definition of the field the condition is created for. */
19
- fields: AtomicConditionProps['fields'];
20
- /** List of possible predefined Conditions */
21
- conditions: {
22
- id: string;
23
- value: LeafCondition;
24
- label?: string;
25
- }[];
26
- /** Currently selected condition. */
27
- condition?: LeafCondition;
28
- }
29
- declare const ConditionSelector: FunctionComponent<ConditionSelectorProps & ForwardProps>;
30
- export default ConditionSelector;
31
- //# sourceMappingURL=ConditionSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConditionSelector.d.ts","sourceRoot":"","sources":["../../../src/components/PromotedFilters/ConditionSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAEL,SAAS,EAET,cAAc,EACd,aAAa,EAKb,YAAY,EAEb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,UAAU,sBAAuB,SAAQ,SAAS,EAAE,cAAc;IAChE,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,yBAAyB;IACzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iDAAiD;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,uCAAuC;IACvC,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC3C,mDAAmD;IACnD,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,4DAA4D;IAC5D,MAAM,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACvC,6CAA6C;IAC7C,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,aAAa,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnE,oCAAoC;IACpC,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAkF/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,44 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo, useRef } from 'react';
3
- import { useI18n, ComboBox, Button, Icon, useConfiguration, menuHelpers } from '@pega/cosmos-react-core';
4
- import formatCondition from '../ConditionBuilder/core/formatter';
5
- import { conditionsEqual } from '../ConditionInput/utils';
6
- const ConditionSelector = ({ onChange, onClear, status, label, info, fields, labelHidden, conditions, condition, ...restProps }) => {
7
- const t = useI18n();
8
- const { locale } = useConfiguration();
9
- const inputRef = useRef(null);
10
- const itemsToRender = useMemo(() => {
11
- return conditions.map(({ id, label: conditionLabel, value }) => {
12
- return {
13
- id,
14
- primary: conditionLabel ??
15
- formatCondition({ condition: value }, fields, t, {
16
- locale,
17
- omitLhs: true
18
- }),
19
- selected: !!value && !!condition && conditionsEqual(value, condition)
20
- };
21
- });
22
- }, [conditions, condition]);
23
- const selected = useMemo(() => menuHelpers.getSelected(itemsToRender)[0], [itemsToRender]);
24
- return (_jsx(ComboBox, { ...restProps, ref: inputRef, mode: 'single-select', label: label ?? t('condition_builder_possible_values_label'), labelHidden: labelHidden, placeholder: t('all'), selected: selected
25
- ? {
26
- items: {
27
- id: selected.id,
28
- text: selected.primary
29
- }
30
- }
31
- : undefined, menu: {
32
- items: itemsToRender,
33
- onItemClick: (id) => onChange(conditions.find(cnd => cnd.id === id)?.value)
34
- }, status: status, info: status === 'error' ? t('condition_builder_empty_selection_error_text') : info, actions: onClear &&
35
- condition !== undefined && (_jsx(Button, { icon: true, variant: 'simple', label: t('clear'), onClick: () => {
36
- onClear();
37
- if (inputRef.current) {
38
- const inputEl = inputRef.current.querySelector('input');
39
- inputEl?.focus();
40
- }
41
- }, children: _jsx(Icon, { name: 'times' }) })) }));
42
- };
43
- export default ConditionSelector;
44
- //# sourceMappingURL=ConditionSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConditionSelector.js","sourceRoot":"","sources":["../../../src/components/PromotedFilters/ConditionSelector.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAqB,MAAM,OAAO,CAAC;AAE3D,OAAO,EACL,OAAO,EAEP,QAAQ,EAGR,MAAM,EACN,IAAI,EACJ,gBAAgB,EAGhB,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAuB1D,MAAM,iBAAiB,GAA6D,CAAC,EACnF,QAAQ,EACR,OAAO,EACP,MAAM,EACN,KAAK,EACL,IAAI,EACJ,MAAM,EACN,WAAW,EAC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,OAAO;iBACvB;aACF;YACH,CAAC,CAAC,SAAS,EAEf,IAAI,EAAE;YACJ,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,CAAC,EAAuB,EAAE,EAAE,CACvC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC;SACzD,EACD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,8CAA8C,CAAC,CAAC,CAAC,CAAC,IAAI,EACnF,OAAO,EACL,OAAO;YACP,SAAS,KAAK,SAAS,IAAI,CACzB,KAAC,MAAM,IACL,IAAI,QACJ,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,EACjB,OAAO,EAAE,GAAG,EAAE;gBACZ,OAAO,EAAE,CAAC;gBACV,IAAI,QAAQ,CAAC,OAAO,EAAE;oBACpB,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;oBACxD,OAAO,EAAE,KAAK,EAAE,CAAC;iBAClB;YACH,CAAC,YAED,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GACd,CACV,GAEH,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { useMemo, useRef, FunctionComponent } from 'react';\n\nimport {\n useI18n,\n BaseProps,\n ComboBox,\n NoChildrenProp,\n ComboBoxProps,\n Button,\n Icon,\n useConfiguration,\n MenuItemProps,\n ForwardProps,\n menuHelpers\n} from '@pega/cosmos-react-core';\n\nimport { AtomicConditionProps } from '../ConditionBuilder/AtomicCondition';\nimport formatCondition from '../ConditionBuilder/core/formatter';\nimport { LeafCondition } from '../ConditionBuilder';\nimport { conditionsEqual } from '../ConditionInput/utils';\n\ninterface ConditionSelectorProps extends BaseProps, NoChildrenProp {\n /** Callback for onChange */\n onChange: (condition?: LeafCondition) => void;\n /** Callback for clear */\n onClear?: () => void;\n /** Used to indicate any errors on the control */\n status?: 'error';\n /** Custom label for input. Makes label visible if provided. */\n label?: ComboBoxProps['label'];\n /** Visually hides the label region. */\n labelHidden?: ComboBoxProps['labelHidden'];\n /** Guidance text that apppears below the input. */\n info?: ComboBoxProps['info'];\n /** Definition of the field the condition is created for. */\n fields: AtomicConditionProps['fields'];\n /** List of possible predefined Conditions */\n conditions: { id: string; value: LeafCondition; label?: string }[];\n /** Currently selected condition. */\n condition?: LeafCondition;\n}\n\nconst ConditionSelector: FunctionComponent<ConditionSelectorProps & ForwardProps> = ({\n onChange,\n onClear,\n status,\n label,\n info,\n fields,\n labelHidden,\n conditions,\n condition,\n ...restProps\n}: ConditionSelectorProps) => {\n const t = useI18n();\n const { locale } = useConfiguration();\n\n const inputRef = useRef<HTMLDivElement>(null);\n const itemsToRender = useMemo(() => {\n return conditions.map(({ id, label: conditionLabel, value }) => {\n return {\n id,\n primary:\n conditionLabel ??\n formatCondition({ condition: value }, fields, t, {\n locale,\n omitLhs: true\n }),\n selected: !!value && !!condition && conditionsEqual(value, condition)\n };\n });\n }, [conditions, condition]);\n\n const selected = useMemo<MenuItemProps | undefined>(\n () => menuHelpers.getSelected(itemsToRender)[0],\n [itemsToRender]\n );\n\n return (\n <ComboBox\n {...restProps}\n ref={inputRef}\n mode='single-select'\n label={label ?? t('condition_builder_possible_values_label')}\n labelHidden={labelHidden}\n placeholder={t('all')}\n selected={\n selected\n ? {\n items: {\n id: selected.id,\n text: selected.primary\n }\n }\n : undefined\n }\n menu={{\n items: itemsToRender,\n onItemClick: (id: MenuItemProps['id']) =>\n onChange(conditions.find(cnd => cnd.id === id)?.value)\n }}\n status={status}\n info={status === 'error' ? t('condition_builder_empty_selection_error_text') : info}\n actions={\n onClear &&\n condition !== undefined && (\n <Button\n icon\n variant='simple'\n label={t('clear')}\n onClick={() => {\n onClear();\n if (inputRef.current) {\n const inputEl = inputRef.current.querySelector('input');\n inputEl?.focus();\n }\n }}\n >\n <Icon name='times' />\n </Button>\n )\n }\n />\n );\n};\n\nexport default ConditionSelector;\n"]}
@@ -1,11 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- import { ForwardProps } from '@pega/cosmos-react-core';
3
- import { Condition } from '../ConditionBuilder/ConditionBuilder.types';
4
- import { PromotedFiltersProps } from './PromotedFilters.types';
5
- export interface FilterModalProps extends Pick<PromotedFiltersProps, 'filters' | 'condition'> {
6
- /** Callback fired on apply of any of the filters */
7
- onApply?: (condition: Condition | undefined) => void;
8
- }
9
- export declare const PromotedFilters: FunctionComponent<PromotedFiltersProps & ForwardProps>;
10
- export default PromotedFilters;
11
- //# sourceMappingURL=PromotedFilters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromotedFilters.d.ts","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAOlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAGL,YAAY,EASb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAiB,MAAM,4CAA4C,CAAC;AAOtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAO/D,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,WAAW,CAAC;IAC3F,oDAAoD;IACpD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;CACtD;AAyND,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAqHlF,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,153 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useEffect, useRef, useState, useImperativeHandle } from 'react';
3
- import { Button, Flex, Icon, Modal, useModalManager, useBreakpoint, useI18n, useModalContext } from '@pega/cosmos-react-core';
4
- import { splitConditionForBuilder } from '../ConditionBuilder/core/utils';
5
- import ConditionInput from '../ConditionInput';
6
- import { StyledVerticalFieldGroup } from '../ConditionInput/ConditionInput.styles';
7
- import { basicFieldMap } from '../ConditionInput/utils';
8
- import ConditionSelector from './ConditionSelector';
9
- import { StyledPromotedFilters, StyledClearAllButton, StyledTextWithEllipsis } from './PromotedFilters.styles';
10
- const PromotedFiltersContent = forwardRef(function PromotedFiltersContent({ filters, condition, onChange, orientation: orientationProp = 'horizontal', handle }, ref) {
11
- const t = useI18n();
12
- const isSmallOrAbove = useBreakpoint('sm');
13
- const orientation = isSmallOrAbove && orientationProp === 'horizontal' ? 'horizontal' : 'vertical';
14
- const [collapsed, setCollapsed] = useState(false);
15
- // map of Conditions indexed by field name
16
- const conditionsMap = condition
17
- ? splitConditionForBuilder(condition).rows.reduce((result, item) => {
18
- const { id, label, ...leaf } = item;
19
- result[item.lhs.field] = leaf;
20
- return result;
21
- }, {})
22
- : {};
23
- const createUpdatedCondition = (key, newCondition) => {
24
- if (newCondition) {
25
- conditionsMap[key] = newCondition;
26
- }
27
- else {
28
- delete conditionsMap[key];
29
- }
30
- return Object.values(conditionsMap).length === 0
31
- ? undefined
32
- : {
33
- AND: Object.values(conditionsMap).map(c => {
34
- return { condition: c };
35
- })
36
- };
37
- };
38
- // list of fields names used to count down onChange callbacks when Clear All action is invoked
39
- // if undefined - Clear All was not triggered
40
- // if stores any values - Clear All is in progress, waiting for all onChange callbacks to be invoked
41
- const fieldsToClear = useRef(undefined);
42
- const handleOnChange = (fieldName, newCondition) => {
43
- // single onChange was invoked
44
- if (fieldsToClear.current === undefined) {
45
- onChange(createUpdatedCondition(fieldName, newCondition));
46
- }
47
- // prevent main onChange from being called for every onChange invoked from ConditionInput, when Clear All action was run
48
- // counting down onChange callbacks, to wait when all are done
49
- else {
50
- fieldsToClear.current.delete(fieldName);
51
- if (fieldsToClear.current.size === 0)
52
- fieldsToClear.current = undefined;
53
- }
54
- };
55
- // ref to store clear handles for all filters
56
- const handlesRef = useRef([]);
57
- useImperativeHandle(handle, () => ({
58
- clear: () => {
59
- // initialize array with all fields, which trigger onChange callbacks
60
- fieldsToClear.current = new Set(handlesRef.current.filter(Boolean).map(c => {
61
- return c.id;
62
- }));
63
- handlesRef.current.forEach(item => item.handle.clear());
64
- onChange();
65
- }
66
- }), [onChange]);
67
- return (_jsx(Flex, { container: {
68
- rowGap: 1,
69
- colGap: 2,
70
- direction: orientation === 'vertical' ? 'column' : 'row',
71
- wrap: 'wrap',
72
- alignItems: orientation === 'vertical' ? 'stretch' : 'start'
73
- }, ref: ref, children: filters.map(({ field, mode, label, predefinedConditions }, i) => {
74
- if (mode !== 'predefined')
75
- return (_jsx(ConditionInput, { field: field, mode: mode, label: label ?? field.name, condition: conditionsMap[field.name], flat: orientation === 'vertical', onChange: newCondition => handleOnChange(field.name, newCondition), handle: (handleItem) => {
76
- handlesRef.current[i] = { id: field.name, handle: handleItem };
77
- } }, field.name));
78
- const selector = (_jsx(ConditionSelector, { label: label ?? field.name, labelHidden: orientation === 'vertical', fields: [
79
- {
80
- id: field.name,
81
- type: basicFieldMap[field.type],
82
- primary: label || field.name
83
- }
84
- ], condition: conditionsMap[field.name], conditions: predefinedConditions ?? [], onChange: (newCondition) => {
85
- onChange(createUpdatedCondition(field.name, newCondition));
86
- }, onClear: orientation === 'horizontal'
87
- ? () => onChange(createUpdatedCondition(field.name, undefined))
88
- : undefined }, field.name));
89
- return orientation === 'vertical' ? (_jsx(StyledVerticalFieldGroup, { name: label ?? field.name, collapsed: collapsed, onToggleCollapsed: () => setCollapsed(cur => !cur), actions: [
90
- {
91
- id: 'clear',
92
- text: t('clear'),
93
- onClick: () => onChange(createUpdatedCondition(field.name, undefined))
94
- }
95
- ], children: selector }, field.name)) : (selector);
96
- }) }));
97
- });
98
- const FilterModal = ({ filters, condition, onApply }) => {
99
- const t = useI18n();
100
- const { dismiss } = useModalContext();
101
- const [newCondition, setNewCondition] = useState(condition);
102
- const onApplyClick = useCallback(() => {
103
- onApply?.(newCondition);
104
- dismiss();
105
- }, [newCondition, onApply]);
106
- const clearHandle = useRef(null);
107
- const actions = (_jsxs(_Fragment, { children: [_jsx(Button, { onClick: dismiss, children: t('cancel') }), _jsx(Button, { variant: 'primary', onClick: onApplyClick, children: t('apply') })] }));
108
- return (_jsxs(Modal, { heading: t('filters'), actions: actions, stretch: true, children: [_jsx(Flex, { container: { justify: 'end' }, children: _jsx(StyledClearAllButton, { variant: 'simple', onClick: () => {
109
- setNewCondition(undefined);
110
- clearHandle.current?.clear();
111
- }, children: t('clear_all') }) }), _jsx(PromotedFiltersContent, { filters: filters, condition: newCondition, onChange: setNewCondition, orientation: 'vertical', handle: clearHandle })] }));
112
- };
113
- export const PromotedFilters = forwardRef(function PromotedFilters({ filters, condition, onChange, orientation = 'horizontal' }, ref) {
114
- const t = useI18n();
115
- const isSmallOrAbove = useBreakpoint('sm');
116
- const { create } = useModalManager();
117
- const modalMethods = useRef();
118
- // map of Conditions indexed by field name
119
- const conditionsCount = condition ? splitConditionForBuilder(condition).rows.length : undefined;
120
- useEffect(() => {
121
- modalMethods.current?.update({
122
- filters,
123
- condition
124
- });
125
- }, [filters, condition]);
126
- const openFiltersModal = () => {
127
- modalMethods.current = create(FilterModal, {
128
- filters,
129
- condition,
130
- onApply: onChange
131
- });
132
- };
133
- const clearHandle = useRef(null);
134
- return (_jsx(Flex, { as: StyledPromotedFilters, container: {
135
- alignItems: orientation === 'horizontal' && isSmallOrAbove ? 'start' : undefined,
136
- justify: 'between',
137
- direction: !isSmallOrAbove || orientation === 'horizontal' ? 'row' : 'column',
138
- pad: 2,
139
- gap: 2
140
- }, ref: ref, children: isSmallOrAbove ? (_jsxs(_Fragment, { children: [orientation === 'vertical' && (_jsxs(Flex, { container: {
141
- justify: 'between',
142
- alignItems: 'center',
143
- pad: [0, 0, 1, 0]
144
- }, children: [_jsx(StyledTextWithEllipsis, { variant: 'h3', children: t('filters') }), _jsx(Button, { variant: 'simple', onClick: () => {
145
- clearHandle.current?.clear();
146
- }, children: t('clear_all') })] })), _jsx(PromotedFiltersContent, { filters: filters, onChange: onChange, condition: condition, orientation: orientation, ref: ref, handle: clearHandle }), orientation === 'horizontal' && (_jsx("div", { children: _jsx(StyledClearAllButton, { variant: 'simple', onClick: () => {
147
- clearHandle.current?.clear();
148
- }, children: t('promoted_filters_clear_all_button_label') }) }))] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { type: 'button', variant: 'text', onClick: openFiltersModal, children: _jsxs(Flex, { container: { alignItems: 'center', gap: 0.5 }, forwardedAs: 'span', children: [_jsx(Icon, { name: 'filter' }), _jsxs("span", { children: [t('filters'), conditionsCount && `\u00a0(${conditionsCount})`] })] }) }), _jsx(Button, { variant: 'simple', onClick: () => {
149
- onChange();
150
- }, children: t('clear_all') })] })) }));
151
- });
152
- export default PromotedFilters;
153
- //# sourceMappingURL=PromotedFilters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromotedFilters.js","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAGV,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,EACR,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,MAAM,EACN,IAAI,EAEJ,IAAI,EACJ,KAAK,EAEL,eAAe,EACf,aAAa,EACb,OAAO,EACP,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EACL,qBAAqB,EAC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GAAG,IAC3C,IACF,GACA,EACT,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,OAAO,EAAE,GAAG,EAAE;wBACZ,QAAQ,EAAE,CAAC;oBACb,CAAC,YAEA,CAAC,CAAC,WAAW,CAAC,GACR,IACR,CACJ,GACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useCallback,\n useEffect,\n useRef,\n useState,\n useImperativeHandle\n} from 'react';\n\nimport {\n Button,\n Flex,\n ForwardProps,\n Icon,\n Modal,\n ModalMethods,\n useModalManager,\n useBreakpoint,\n useI18n,\n useModalContext,\n HandleValue\n} from '@pega/cosmos-react-core';\n\nimport { Condition, LeafCondition } from '../ConditionBuilder/ConditionBuilder.types';\nimport { splitConditionForBuilder } from '../ConditionBuilder/core/utils';\nimport ConditionInput from '../ConditionInput';\nimport { StyledVerticalFieldGroup } from '../ConditionInput/ConditionInput.styles';\nimport { basicFieldMap } from '../ConditionInput/utils';\n\nimport ConditionSelector from './ConditionSelector';\nimport { PromotedFiltersProps } from './PromotedFilters.types';\nimport {\n StyledPromotedFilters,\n StyledClearAllButton,\n StyledTextWithEllipsis\n} from './PromotedFilters.styles';\n\nexport interface FilterModalProps extends Pick<PromotedFiltersProps, 'filters' | 'condition'> {\n /** Callback fired on apply of any of the filters */\n onApply?: (condition: Condition | undefined) => void;\n}\n\ninterface HandleValueObj {\n /** Identifier for the corresponding field */\n id: string;\n /** Handle value for clear action */\n handle: HandleValue;\n}\n\nconst PromotedFiltersContent: FunctionComponent<PromotedFiltersProps & ForwardProps> = forwardRef(\n function PromotedFiltersContent(\n {\n filters,\n condition,\n onChange,\n orientation: orientationProp = 'horizontal',\n handle\n }: PropsWithoutRef<PromotedFiltersProps>,\n ref: PromotedFiltersProps['ref']\n ) {\n const t = useI18n();\n const isSmallOrAbove = useBreakpoint('sm');\n const orientation =\n isSmallOrAbove && orientationProp === 'horizontal' ? 'horizontal' : 'vertical';\n const [collapsed, setCollapsed] = useState(false);\n\n // map of Conditions indexed by field name\n const conditionsMap = condition\n ? splitConditionForBuilder(condition).rows.reduce(\n (result: { [key: string]: LeafCondition }, item) => {\n const { id, label, ...leaf } = item;\n result[item.lhs.field] = leaf;\n return result;\n },\n {}\n )\n : {};\n\n const createUpdatedCondition = (key: string, newCondition?: LeafCondition) => {\n if (newCondition) {\n conditionsMap[key] = newCondition;\n } else {\n delete conditionsMap[key];\n }\n\n return Object.values(conditionsMap).length === 0\n ? undefined\n : {\n AND: Object.values(conditionsMap).map(c => {\n return { condition: c } as Condition;\n })\n };\n };\n\n // list of fields names used to count down onChange callbacks when Clear All action is invoked\n // if undefined - Clear All was not triggered\n // if stores any values - Clear All is in progress, waiting for all onChange callbacks to be invoked\n const fieldsToClear = useRef<Set<string> | undefined>(undefined);\n\n const handleOnChange = (fieldName: string, newCondition?: LeafCondition) => {\n // single onChange was invoked\n if (fieldsToClear.current === undefined) {\n onChange(createUpdatedCondition(fieldName, newCondition));\n }\n // prevent main onChange from being called for every onChange invoked from ConditionInput, when Clear All action was run\n // counting down onChange callbacks, to wait when all are done\n else {\n fieldsToClear.current.delete(fieldName);\n if (fieldsToClear.current.size === 0) fieldsToClear.current = undefined;\n }\n };\n\n // ref to store clear handles for all filters\n const handlesRef = useRef<HandleValueObj[]>([]);\n\n useImperativeHandle(\n handle,\n () => ({\n clear: () => {\n // initialize array with all fields, which trigger onChange callbacks\n fieldsToClear.current = new Set(\n handlesRef.current.filter(Boolean).map(c => {\n return c.id;\n })\n );\n handlesRef.current.forEach(item => item.handle.clear());\n onChange();\n }\n }),\n [onChange]\n );\n\n return (\n <Flex\n container={{\n rowGap: 1,\n colGap: 2,\n direction: orientation === 'vertical' ? 'column' : 'row',\n wrap: 'wrap',\n alignItems: orientation === 'vertical' ? 'stretch' : 'start'\n }}\n ref={ref}\n >\n {filters.map(({ field, mode, label, predefinedConditions }, i) => {\n if (mode !== 'predefined')\n return (\n <ConditionInput\n key={field.name}\n field={field}\n mode={mode}\n label={label ?? field.name}\n condition={conditionsMap[field.name]}\n flat={orientation === 'vertical'}\n onChange={newCondition => handleOnChange(field.name, newCondition)}\n handle={(handleItem: HandleValue) => {\n handlesRef.current[i] = { id: field.name, handle: handleItem };\n }}\n />\n );\n\n const selector = (\n <ConditionSelector\n key={field.name}\n label={label ?? field.name}\n labelHidden={orientation === 'vertical'}\n fields={[\n {\n id: field.name,\n type: basicFieldMap[field.type],\n primary: label || field.name\n }\n ]}\n condition={conditionsMap[field.name]}\n conditions={predefinedConditions ?? []}\n onChange={(newCondition?: LeafCondition) => {\n onChange(createUpdatedCondition(field.name, newCondition));\n }}\n onClear={\n orientation === 'horizontal'\n ? () => onChange(createUpdatedCondition(field.name, undefined))\n : undefined\n }\n />\n );\n\n return orientation === 'vertical' ? (\n <StyledVerticalFieldGroup\n key={field.name}\n name={label ?? field.name}\n collapsed={collapsed}\n onToggleCollapsed={() => setCollapsed(cur => !cur)}\n actions={[\n {\n id: 'clear',\n text: t('clear'),\n onClick: () => onChange(createUpdatedCondition(field.name, undefined))\n }\n ]}\n >\n {selector}\n </StyledVerticalFieldGroup>\n ) : (\n selector\n );\n })}\n </Flex>\n );\n }\n);\n\nconst FilterModal = ({ filters, condition, onApply }: FilterModalProps) => {\n const t = useI18n();\n\n const { dismiss } = useModalContext();\n const [newCondition, setNewCondition] = useState<Condition | undefined>(condition);\n\n const onApplyClick = useCallback(() => {\n onApply?.(newCondition);\n dismiss();\n }, [newCondition, onApply]);\n\n const clearHandle = useRef<HandleValue>(null);\n\n const actions = (\n <>\n <Button onClick={dismiss}>{t('cancel')}</Button>\n <Button variant='primary' onClick={onApplyClick}>\n {t('apply')}\n </Button>\n </>\n );\n\n return (\n <Modal heading={t('filters')} actions={actions} stretch>\n <Flex container={{ justify: 'end' }}>\n <StyledClearAllButton\n variant='simple'\n onClick={() => {\n setNewCondition(undefined);\n clearHandle.current?.clear();\n }}\n >\n {t('clear_all')}\n </StyledClearAllButton>\n </Flex>\n\n <PromotedFiltersContent\n filters={filters}\n condition={newCondition}\n onChange={setNewCondition}\n orientation='vertical'\n handle={clearHandle}\n />\n </Modal>\n );\n};\n\nexport const PromotedFilters: FunctionComponent<PromotedFiltersProps & ForwardProps> = forwardRef(\n function PromotedFilters(\n {\n filters,\n condition,\n onChange,\n orientation = 'horizontal'\n }: PropsWithoutRef<PromotedFiltersProps>,\n ref: PromotedFiltersProps['ref']\n ) {\n const t = useI18n();\n\n const isSmallOrAbove = useBreakpoint('sm');\n\n const { create } = useModalManager();\n const modalMethods = useRef<ModalMethods<FilterModalProps>>();\n\n // map of Conditions indexed by field name\n const conditionsCount = condition ? splitConditionForBuilder(condition).rows.length : undefined;\n\n useEffect(() => {\n modalMethods.current?.update({\n filters,\n condition\n });\n }, [filters, condition]);\n\n const openFiltersModal = () => {\n modalMethods.current = create(FilterModal, {\n filters,\n condition,\n onApply: onChange\n });\n };\n\n const clearHandle = useRef<HandleValue>(null);\n\n return (\n <Flex\n as={StyledPromotedFilters}\n container={{\n alignItems: orientation === 'horizontal' && isSmallOrAbove ? 'start' : undefined,\n justify: 'between',\n direction: !isSmallOrAbove || orientation === 'horizontal' ? 'row' : 'column',\n pad: 2,\n gap: 2\n }}\n ref={ref}\n >\n {isSmallOrAbove ? (\n <>\n {orientation === 'vertical' && (\n <Flex\n container={{\n justify: 'between',\n alignItems: 'center',\n pad: [0, 0, 1, 0]\n }}\n >\n <StyledTextWithEllipsis variant='h3'>{t('filters')}</StyledTextWithEllipsis>\n <Button\n variant='simple'\n onClick={() => {\n clearHandle.current?.clear();\n }}\n >\n {t('clear_all')}\n </Button>\n </Flex>\n )}\n\n <PromotedFiltersContent\n filters={filters}\n onChange={onChange}\n condition={condition}\n orientation={orientation}\n ref={ref}\n handle={clearHandle}\n />\n\n {orientation === 'horizontal' && (\n <div>\n <StyledClearAllButton\n variant='simple'\n onClick={() => {\n clearHandle.current?.clear();\n }}\n >\n {t('promoted_filters_clear_all_button_label')}\n </StyledClearAllButton>\n </div>\n )}\n </>\n ) : (\n <>\n <Button type='button' variant='text' onClick={openFiltersModal}>\n <Flex container={{ alignItems: 'center', gap: 0.5 }} forwardedAs='span'>\n <Icon name='filter' />\n <span>\n {t('filters')}\n {conditionsCount && `\\u00a0(${conditionsCount})`}\n </span>\n </Flex>\n </Button>\n <Button\n variant='simple'\n onClick={() => {\n onChange();\n }}\n >\n {t('clear_all')}\n </Button>\n </>\n )}\n </Flex>\n );\n }\n);\n\nexport default PromotedFilters;\n"]}
@@ -1,4 +0,0 @@
1
- export declare const StyledPromotedFilters: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
2
- export declare const StyledClearAllButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
3
- export declare const StyledTextWithEllipsis: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
4
- //# sourceMappingURL=PromotedFilters.styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromotedFilters.styles.d.ts","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB,yGAgBhC,CAAC;AAIH,eAAO,MAAM,oBAAoB,qOAOhC,CAAC;AAIF,eAAO,MAAM,sBAAsB,mOAIlC,CAAC"}
@@ -1,38 +0,0 @@
1
- import styled, { css } from 'styled-components';
2
- import { defaultThemeProp, Button, Text } from '@pega/cosmos-react-core';
3
- import { StyledModalChildrenWrap } from '@pega/cosmos-react-core/lib/components/Modal/Modal.styles';
4
- import { StyledSelectInput } from '@pega/cosmos-react-core/lib/components/ComboBox/ComboBox.styles';
5
- export const StyledPromotedFilters = styled.div(({ theme }) => {
6
- return css `
7
- border-radius: ${theme.components.card['border-radius']};
8
- background-color: ${theme.base.palette['secondary-background']};
9
- padding-block: ${theme.base.spacing};
10
-
11
- ${StyledSelectInput} {
12
- min-width: calc(${theme.base['content-width'].xs} + ${theme.base['hit-area']['mouse-min']});
13
-
14
- @media (pointer: coarse) {
15
- min-width: calc(
16
- ${theme.base['content-width'].xs} + ${theme.base['hit-area']['finger-min']}
17
- );
18
- }
19
- }
20
- `;
21
- });
22
- StyledPromotedFilters.defaultProps = defaultThemeProp;
23
- export const StyledClearAllButton = styled(Button) `
24
- margin: 1.125rem 0 0.625rem;
25
- white-space: nowrap;
26
-
27
- ${StyledModalChildrenWrap} & {
28
- margin-top: 0;
29
- }
30
- `;
31
- StyledClearAllButton.defaultProps = defaultThemeProp;
32
- export const StyledTextWithEllipsis = styled(Text) `
33
- overflow: hidden;
34
- white-space: nowrap;
35
- text-overflow: ellipsis;
36
- `;
37
- StyledTextWithEllipsis.defaultProps = defaultThemeProp;
38
- //# sourceMappingURL=PromotedFilters.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromotedFilters.styles.js","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2DAA2D,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,iEAAiE,CAAC;AAEpG,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5D,OAAO,GAAG,CAAA;qBACS,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC;wBACnC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC;qBAC7C,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEjC,iBAAiB;wBACC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;;;;YAInF,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC;;;;GAIjF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;IAI9C,uBAAuB;;;CAG1B,CAAC;AAEF,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;CAIjD,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, Button, Text } from '@pega/cosmos-react-core';\nimport { StyledModalChildrenWrap } from '@pega/cosmos-react-core/lib/components/Modal/Modal.styles';\nimport { StyledSelectInput } from '@pega/cosmos-react-core/lib/components/ComboBox/ComboBox.styles';\n\nexport const StyledPromotedFilters = styled.div(({ theme }) => {\n return css`\n border-radius: ${theme.components.card['border-radius']};\n background-color: ${theme.base.palette['secondary-background']};\n padding-block: ${theme.base.spacing};\n\n ${StyledSelectInput} {\n min-width: calc(${theme.base['content-width'].xs} + ${theme.base['hit-area']['mouse-min']});\n\n @media (pointer: coarse) {\n min-width: calc(\n ${theme.base['content-width'].xs} + ${theme.base['hit-area']['finger-min']}\n );\n }\n }\n `;\n});\n\nStyledPromotedFilters.defaultProps = defaultThemeProp;\n\nexport const StyledClearAllButton = styled(Button)`\n margin: 1.125rem 0 0.625rem;\n white-space: nowrap;\n\n ${StyledModalChildrenWrap} & {\n margin-top: 0;\n }\n`;\n\nStyledClearAllButton.defaultProps = defaultThemeProp;\n\nexport const StyledTextWithEllipsis = styled(Text)`\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n`;\n\nStyledTextWithEllipsis.defaultProps = defaultThemeProp;\n"]}
@@ -1,33 +0,0 @@
1
- import { Ref } from 'react';
2
- import { BaseProps, HandleValue, NoChildrenProp } from '@pega/cosmos-react-core';
3
- import type { Condition, LeafCondition } from '../ConditionBuilder/ConditionBuilder.types';
4
- import type { ConditionInputMode, ConditionField } from '../ConditionInput/ConditionInput.types';
5
- export interface PromotedFilter {
6
- /** Definition of the field to be filtered. */
7
- field: ConditionField;
8
- /** Display mode. */
9
- mode: ConditionInputMode;
10
- /** Label for the filter. */
11
- label?: string;
12
- /** List of possible predefined Conditions */
13
- predefinedConditions?: {
14
- id: string;
15
- value: LeafCondition;
16
- label?: string;
17
- }[];
18
- }
19
- export interface PromotedFiltersProps extends BaseProps, NoChildrenProp {
20
- /** Configuration of filters for every field that has been defined as promoted. */
21
- filters: PromotedFilter[];
22
- /** A value representing the current condition state. */
23
- condition?: Condition;
24
- /** Orientation mode. The default is horizontal. */
25
- orientation?: 'vertical' | 'horizontal';
26
- /** Callback fired on change of any of the filters. */
27
- onChange: (condition?: Condition) => void;
28
- /** Ref for the wrapping element. */
29
- ref?: Ref<HTMLDivElement>;
30
- /** Imperative handle */
31
- handle?: Ref<HandleValue>;
32
- }
33
- //# sourceMappingURL=PromotedFilters.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromotedFilters.types.d.ts","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEjF,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAEjG,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,KAAK,EAAE,cAAc,CAAC;IACtB,oBAAoB;IACpB,IAAI,EAAE,kBAAkB,CAAC;IACzB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,oBAAoB,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,aAAa,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/E;AAED,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc;IACrE,kFAAkF;IAClF,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,wDAAwD;IACxD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,mDAAmD;IACnD,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACxC,sDAAsD;IACtD,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,KAAK,IAAI,CAAC;IAC1C,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,wBAAwB;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CAC3B"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=PromotedFilters.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PromotedFilters.types.js","sourceRoot":"","sources":["../../../src/components/PromotedFilters/PromotedFilters.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref } from 'react';\n\nimport { BaseProps, HandleValue, NoChildrenProp } from '@pega/cosmos-react-core';\n\nimport type { Condition, LeafCondition } from '../ConditionBuilder/ConditionBuilder.types';\nimport type { ConditionInputMode, ConditionField } from '../ConditionInput/ConditionInput.types';\n\nexport interface PromotedFilter {\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 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. */\n condition?: Condition;\n /** Orientation mode. The default is horizontal. */\n orientation?: 'vertical' | 'horizontal';\n /** Callback fired on change of any of the filters. */\n onChange: (condition?: Condition) => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n}\n"]}
@@ -1,3 +0,0 @@
1
- export { default } from './PromotedFilters';
2
- export type { PromotedFiltersProps, PromotedFilter } from './PromotedFilters.types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PromotedFilters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { default } from './PromotedFilters';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/PromotedFilters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './PromotedFilters';\nexport type { PromotedFiltersProps, PromotedFilter } from './PromotedFilters.types';\n"]}
package/lib/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export { default as ConditionBuilder } from './components/ConditionBuilder';
2
- export * from './components/ConditionBuilder';
3
- export { default as ConditionInput } from './components/ConditionInput';
4
- export * from './components/ConditionInput';
5
- export { default as PromotedFilters } from './components/PromotedFilters';
6
- export * from './components/PromotedFilters';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,cAAc,8BAA8B,CAAC"}
package/lib/index.js DELETED
@@ -1,8 +0,0 @@
1
- // This file is autogenerated. Any changes will be overwritten.
2
- export { default as ConditionBuilder } from './components/ConditionBuilder';
3
- export * from './components/ConditionBuilder';
4
- export { default as ConditionInput } from './components/ConditionInput';
5
- export * from './components/ConditionInput';
6
- export { default as PromotedFilters } from './components/PromotedFilters';
7
- export * from './components/PromotedFilters';
8
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,cAAc,8BAA8B,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\nexport { default as ConditionBuilder } from './components/ConditionBuilder';\nexport * from './components/ConditionBuilder';\nexport { default as ConditionInput } from './components/ConditionInput';\nexport * from './components/ConditionInput';\nexport { default as PromotedFilters } from './components/PromotedFilters';\nexport * from './components/PromotedFilters';\n"]}