@pega/cosmos-react-build 7.0.0-build.2.2 → 7.0.0-build.20.0

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 (233) hide show
  1. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppShell.styles.js +7 -7
  3. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  4. package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
  5. package/lib/components/AppShell/Header/AppHeader.styles.js +27 -27
  6. package/lib/components/AppShell/Header/AppHeader.styles.js.map +1 -1
  7. package/lib/components/AppShell/Header/BranchButton.d.ts.map +1 -1
  8. package/lib/components/AppShell/Header/BranchButton.js +23 -24
  9. package/lib/components/AppShell/Header/BranchButton.js.map +1 -1
  10. package/lib/components/DynamicInput/BooleanControl.d.ts +9 -0
  11. package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -0
  12. package/lib/components/DynamicInput/BooleanControl.js +24 -0
  13. package/lib/components/DynamicInput/BooleanControl.js.map +1 -0
  14. package/lib/components/DynamicInput/DynamicInput.d.ts +7 -0
  15. package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -0
  16. package/lib/components/DynamicInput/DynamicInput.js +83 -0
  17. package/lib/components/DynamicInput/DynamicInput.js.map +1 -0
  18. package/lib/components/DynamicInput/DynamicInput.styles.d.ts +5 -0
  19. package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -0
  20. package/lib/components/DynamicInput/DynamicInput.styles.js +59 -0
  21. package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -0
  22. package/lib/components/DynamicInput/DynamicInput.test-ids.d.ts +2 -0
  23. package/lib/components/DynamicInput/DynamicInput.test-ids.d.ts.map +1 -0
  24. package/lib/components/DynamicInput/DynamicInput.test-ids.js +9 -0
  25. package/lib/components/DynamicInput/DynamicInput.test-ids.js.map +1 -0
  26. package/lib/components/DynamicInput/DynamicInput.types.d.ts +70 -0
  27. package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -0
  28. package/lib/components/DynamicInput/DynamicInput.types.js +2 -0
  29. package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -0
  30. package/lib/components/DynamicInput/SourceButton.d.ts +10 -0
  31. package/lib/components/DynamicInput/SourceButton.d.ts.map +1 -0
  32. package/lib/components/DynamicInput/SourceButton.js +42 -0
  33. package/lib/components/DynamicInput/SourceButton.js.map +1 -0
  34. package/lib/components/DynamicInput/index.d.ts +3 -0
  35. package/lib/components/DynamicInput/index.d.ts.map +1 -0
  36. package/lib/components/DynamicInput/index.js +3 -0
  37. package/lib/components/DynamicInput/index.js.map +1 -0
  38. package/lib/components/DynamicInput/utils.d.ts +6 -0
  39. package/lib/components/DynamicInput/utils.d.ts.map +1 -0
  40. package/lib/components/DynamicInput/utils.js +29 -0
  41. package/lib/components/DynamicInput/utils.js.map +1 -0
  42. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  43. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +493 -493
  44. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  45. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  46. package/lib/components/FlowModeller/Node/NodeTemplates.js +1 -2
  47. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  48. package/lib/components/IconTile/IconTile.d.ts +5 -0
  49. package/lib/components/IconTile/IconTile.d.ts.map +1 -0
  50. package/lib/components/IconTile/IconTile.js +8 -0
  51. package/lib/components/IconTile/IconTile.js.map +1 -0
  52. package/lib/components/IconTile/IconTile.styles.d.ts +7 -0
  53. package/lib/components/IconTile/IconTile.styles.d.ts.map +1 -0
  54. package/lib/components/IconTile/IconTile.styles.js +68 -0
  55. package/lib/components/IconTile/IconTile.styles.js.map +1 -0
  56. package/lib/components/IconTile/IconTile.types.d.ts +27 -0
  57. package/lib/components/IconTile/IconTile.types.d.ts.map +1 -0
  58. package/lib/components/IconTile/IconTile.types.js +2 -0
  59. package/lib/components/IconTile/IconTile.types.js.map +1 -0
  60. package/lib/components/IconTile/Tiles/Ai.d.ts +5 -0
  61. package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -0
  62. package/lib/components/IconTile/Tiles/Ai.js +7 -0
  63. package/lib/components/IconTile/Tiles/Ai.js.map +1 -0
  64. package/lib/components/IconTile/Tiles/Automation.d.ts +5 -0
  65. package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -0
  66. package/lib/components/IconTile/Tiles/Automation.js +7 -0
  67. package/lib/components/IconTile/Tiles/Automation.js.map +1 -0
  68. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +5 -0
  69. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -0
  70. package/lib/components/IconTile/Tiles/AutomationAppend.js +7 -0
  71. package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -0
  72. package/lib/components/IconTile/Tiles/AutomationCall.d.ts +5 -0
  73. package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -0
  74. package/lib/components/IconTile/Tiles/AutomationCall.js +7 -0
  75. package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -0
  76. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +5 -0
  77. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -0
  78. package/lib/components/IconTile/Tiles/AutomationForEach.js +7 -0
  79. package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -0
  80. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +5 -0
  81. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -0
  82. package/lib/components/IconTile/Tiles/AutomationReturn.js +7 -0
  83. package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -0
  84. package/lib/components/IconTile/Tiles/AutomationSet.d.ts +5 -0
  85. package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -0
  86. package/lib/components/IconTile/Tiles/AutomationSet.js +7 -0
  87. package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -0
  88. package/lib/components/IconTile/Tiles/Case.d.ts +5 -0
  89. package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -0
  90. package/lib/components/IconTile/Tiles/Case.js +7 -0
  91. package/lib/components/IconTile/Tiles/Case.js.map +1 -0
  92. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +5 -0
  93. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -0
  94. package/lib/components/IconTile/Tiles/CaseGoTo.js +7 -0
  95. package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -0
  96. package/lib/components/IconTile/Tiles/CaseProcess.d.ts +5 -0
  97. package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -0
  98. package/lib/components/IconTile/Tiles/CaseProcess.js +7 -0
  99. package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -0
  100. package/lib/components/IconTile/Tiles/CaseSla.d.ts +5 -0
  101. package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -0
  102. package/lib/components/IconTile/Tiles/CaseSla.js +7 -0
  103. package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -0
  104. package/lib/components/IconTile/Tiles/CaseStage.d.ts +5 -0
  105. package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -0
  106. package/lib/components/IconTile/Tiles/CaseStage.js +7 -0
  107. package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -0
  108. package/lib/components/IconTile/Tiles/CaseWait.d.ts +5 -0
  109. package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -0
  110. package/lib/components/IconTile/Tiles/CaseWait.js +7 -0
  111. package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -0
  112. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +5 -0
  113. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -0
  114. package/lib/components/IconTile/Tiles/LogicDecisionStep.js +7 -0
  115. package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -0
  116. package/lib/components/IconTile/Tiles/LogicFunction.d.ts +5 -0
  117. package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -0
  118. package/lib/components/IconTile/Tiles/LogicFunction.js +7 -0
  119. package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -0
  120. package/lib/components/IconTile/Tiles/LogicValidation.d.ts +5 -0
  121. package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -0
  122. package/lib/components/IconTile/Tiles/LogicValidation.js +7 -0
  123. package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -0
  124. package/lib/components/IconTile/Tiles/LogicWhen.d.ts +5 -0
  125. package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -0
  126. package/lib/components/IconTile/Tiles/LogicWhen.js +7 -0
  127. package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -0
  128. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +5 -0
  129. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -0
  130. package/lib/components/IconTile/Tiles/RuleAuthenticate.js +7 -0
  131. package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -0
  132. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +5 -0
  133. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -0
  134. package/lib/components/IconTile/Tiles/RuleConfiguration.js +7 -0
  135. package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -0
  136. package/lib/components/IconTile/Tiles/RuleConnector.d.ts +5 -0
  137. package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -0
  138. package/lib/components/IconTile/Tiles/RuleConnector.js +7 -0
  139. package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -0
  140. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +5 -0
  141. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -0
  142. package/lib/components/IconTile/Tiles/RuleDataPage.js +7 -0
  143. package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -0
  144. package/lib/components/IconTile/Tiles/RuleField.d.ts +5 -0
  145. package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -0
  146. package/lib/components/IconTile/Tiles/RuleField.js +7 -0
  147. package/lib/components/IconTile/Tiles/RuleField.js.map +1 -0
  148. package/lib/components/IconTile/Tiles/RuleInsight.d.ts +5 -0
  149. package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -0
  150. package/lib/components/IconTile/Tiles/RuleInsight.js +7 -0
  151. package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -0
  152. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +5 -0
  153. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -0
  154. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js +7 -0
  155. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -0
  156. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +5 -0
  157. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -0
  158. package/lib/components/IconTile/Tiles/RuleLiveData.js +7 -0
  159. package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -0
  160. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +5 -0
  161. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -0
  162. package/lib/components/IconTile/Tiles/RuleParagraph.js +7 -0
  163. package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -0
  164. package/lib/components/IconTile/Tiles/RulePermission.d.ts +5 -0
  165. package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -0
  166. package/lib/components/IconTile/Tiles/RulePermission.js +7 -0
  167. package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -0
  168. package/lib/components/IconTile/Tiles/RulePersona.d.ts +5 -0
  169. package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -0
  170. package/lib/components/IconTile/Tiles/RulePersona.js +7 -0
  171. package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -0
  172. package/lib/components/IconTile/Tiles/RulePortal.d.ts +5 -0
  173. package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -0
  174. package/lib/components/IconTile/Tiles/RulePortal.js +7 -0
  175. package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -0
  176. package/lib/components/IconTile/Tiles/RuleRecord.d.ts +5 -0
  177. package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -0
  178. package/lib/components/IconTile/Tiles/RuleRecord.js +7 -0
  179. package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -0
  180. package/lib/components/IconTile/Tiles/RuleSystem.d.ts +5 -0
  181. package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -0
  182. package/lib/components/IconTile/Tiles/RuleSystem.js +7 -0
  183. package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -0
  184. package/lib/components/IconTile/Tiles/RuleView.d.ts +5 -0
  185. package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -0
  186. package/lib/components/IconTile/Tiles/RuleView.js +7 -0
  187. package/lib/components/IconTile/Tiles/RuleView.js.map +1 -0
  188. package/lib/components/IconTile/Tiles/Task.d.ts +5 -0
  189. package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -0
  190. package/lib/components/IconTile/Tiles/Task.js +7 -0
  191. package/lib/components/IconTile/Tiles/Task.js.map +1 -0
  192. package/lib/components/IconTile/Tiles/TaskAction.d.ts +5 -0
  193. package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -0
  194. package/lib/components/IconTile/Tiles/TaskAction.js +7 -0
  195. package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -0
  196. package/lib/components/IconTile/index.d.ts +36 -0
  197. package/lib/components/IconTile/index.d.ts.map +1 -0
  198. package/lib/components/IconTile/index.js +36 -0
  199. package/lib/components/IconTile/index.js.map +1 -0
  200. package/lib/components/ItemLibrary/ItemLibrary.js +1 -2
  201. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  202. package/lib/components/LifeCycle/Stage.js +1 -2
  203. package/lib/components/LifeCycle/Stage.js.map +1 -1
  204. package/lib/components/LifeCycle/Step.js +1 -2
  205. package/lib/components/LifeCycle/Step.js.map +1 -1
  206. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
  207. package/lib/components/ObjectSelect/ObjectSummary.js +18 -18
  208. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
  209. package/lib/components/PageBanner/PageBanner.js +1 -2
  210. package/lib/components/PageBanner/PageBanner.js.map +1 -1
  211. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  212. package/lib/components/PageTemplates/PageTemplates.js +4 -4
  213. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  214. package/lib/components/RuleSelect/RuleSelect.d.ts +5 -0
  215. package/lib/components/RuleSelect/RuleSelect.d.ts.map +1 -0
  216. package/lib/components/RuleSelect/RuleSelect.js +76 -0
  217. package/lib/components/RuleSelect/RuleSelect.js.map +1 -0
  218. package/lib/components/RuleSelect/RuleSelect.types.d.ts +56 -0
  219. package/lib/components/RuleSelect/RuleSelect.types.d.ts.map +1 -0
  220. package/lib/components/RuleSelect/RuleSelect.types.js +2 -0
  221. package/lib/components/RuleSelect/RuleSelect.types.js.map +1 -0
  222. package/lib/components/RuleSelect/index.d.ts +3 -0
  223. package/lib/components/RuleSelect/index.d.ts.map +1 -0
  224. package/lib/components/RuleSelect/index.js +3 -0
  225. package/lib/components/RuleSelect/index.js.map +1 -0
  226. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  227. package/lib/components/Workbench/Workbench.styles.js +1 -2
  228. package/lib/components/Workbench/Workbench.styles.js.map +1 -1
  229. package/lib/index.d.ts +4 -0
  230. package/lib/index.d.ts.map +1 -1
  231. package/lib/index.js +4 -0
  232. package/lib/index.js.map +1 -1
  233. package/package.json +7 -4
@@ -0,0 +1,9 @@
1
+ import { createTestIds } from '@pega/cosmos-react-core';
2
+ import { elements } from '@pega/cosmos-react-core/lib/components/FormField/FormField.test-ids';
3
+ export const getDynamicInputTestIds = createTestIds('dynamic-input', [
4
+ 'field',
5
+ 'menu',
6
+ 'control',
7
+ ...elements
8
+ ]);
9
+ //# sourceMappingURL=DynamicInput.test-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DynamicInput.test-ids.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,qEAAqE,CAAC;AAE/F,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC,eAAe,EAAE;IACnE,OAAO;IACP,MAAM;IACN,SAAS;IACT,GAAG,QAAQ;CACH,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\nimport { elements } from '@pega/cosmos-react-core/lib/components/FormField/FormField.test-ids';\n\nexport const getDynamicInputTestIds = createTestIds('dynamic-input', [\n 'field',\n 'menu',\n 'control',\n ...elements\n] as const);\n"]}
@@ -0,0 +1,70 @@
1
+ import type { ComponentProps, ComponentType, Ref } from 'react';
2
+ import type { FormFieldProps, InputProps, TextAreaProps, CurrencyInputProps, NumberInputProps, PhoneInputProps, DateTimeInputProps, DateInputProps, TimeInputProps, TestIdProp } from '@pega/cosmos-react-core';
3
+ import type { CodeEditor } from '../ExpressionBuilder';
4
+ import type { RuleSelectProps } from '../RuleSelect';
5
+ export type Source = 'Constant' | 'Rule' | 'Expression';
6
+ export type ConstantValueTypeMap = {
7
+ Text: InputProps['value'];
8
+ 'Text (paragraph)': TextAreaProps['value'];
9
+ Boolean: boolean;
10
+ Currency: CurrencyInputProps['value'];
11
+ Percentage: NumberInputProps['value'];
12
+ Integer: NumberInputProps['value'];
13
+ Decimal: NumberInputProps['value'];
14
+ Phone: PhoneInputProps['value'];
15
+ DateTime: DateTimeInputProps['value'];
16
+ Date: DateInputProps['value'];
17
+ Time: TimeInputProps['value'];
18
+ };
19
+ export type ConstantFormat = keyof ConstantValueTypeMap;
20
+ export type BooleanLabels = 'true|false' | 'always|never';
21
+ export type ConstantProps = {
22
+ value?: string | number | boolean | Date;
23
+ booleanLabels?: BooleanLabels;
24
+ onChange: (value: NonNullable<ConstantProps['value']>) => void;
25
+ };
26
+ export type SourceConfig = {
27
+ type: Source;
28
+ selected?: boolean;
29
+ };
30
+ export type ExpressionControlConfig = {
31
+ component: ComponentType<ComponentProps<typeof CodeEditor>>;
32
+ props: ComponentProps<typeof CodeEditor>;
33
+ };
34
+ export type ConstantControlConfig = {
35
+ format: ConstantFormat;
36
+ props: ConstantProps;
37
+ };
38
+ export type RuleControlConfig = {
39
+ props: RuleSelectProps;
40
+ };
41
+ export interface DynamicInputProps extends TestIdProp, Pick<FormFieldProps, 'labelHidden' | 'required' | 'status' | 'id'> {
42
+ /**
43
+ * The accessible and visual field label.
44
+ * When used as an independent control label should represent the data field.
45
+ * When used in combination with another LHS element the default "Value" may be sufficient.
46
+ * @default "Value"
47
+ */
48
+ label?: string;
49
+ /**
50
+ * The form control displayed on the RHS
51
+ */
52
+ controls: {
53
+ constant?: ConstantControlConfig;
54
+ rule?: RuleControlConfig;
55
+ expression?: ExpressionControlConfig;
56
+ };
57
+ /**
58
+ * Methods to source a value from.
59
+ */
60
+ sources: SourceConfig[];
61
+ /**
62
+ * Called when the source method changes.
63
+ */
64
+ onSourceChange: (source: Source) => void;
65
+ /**
66
+ * Ref to the component's root element.
67
+ */
68
+ ref?: Ref<HTMLDivElement>;
69
+ }
70
+ //# sourceMappingURL=DynamicInput.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DynamicInput.types.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,aAAa,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;IAC5D,KAAK,EAAE,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAGF,MAAM,WAAW,iBACf,SAAQ,UAAU,EAChB,IAAI,CAAC,cAAc,EAAE,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAC;IACpE;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE;QACR,QAAQ,CAAC,EAAE,qBAAqB,CAAC;QACjC,IAAI,CAAC,EAAE,iBAAiB,CAAC;QACzB,UAAU,CAAC,EAAE,uBAAuB,CAAC;KACtC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,YAAY,EAAE,CAAC;IAExB;;OAEG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAEzC;;OAEG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DynamicInput.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DynamicInput.types.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/DynamicInput.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentType, Ref } from 'react';\n\nimport type {\n FormFieldProps,\n InputProps,\n TextAreaProps,\n CurrencyInputProps,\n NumberInputProps,\n PhoneInputProps,\n DateTimeInputProps,\n DateInputProps,\n TimeInputProps,\n TestIdProp\n} from '@pega/cosmos-react-core';\n\nimport type { CodeEditor } from '../ExpressionBuilder';\nimport type { RuleSelectProps } from '../RuleSelect';\n\nexport type Source = 'Constant' | 'Rule' | 'Expression'; // Input type options\n\nexport type ConstantValueTypeMap = {\n Text: InputProps['value'];\n 'Text (paragraph)': TextAreaProps['value'];\n Boolean: boolean;\n Currency: CurrencyInputProps['value'];\n Percentage: NumberInputProps['value'];\n Integer: NumberInputProps['value'];\n Decimal: NumberInputProps['value'];\n Phone: PhoneInputProps['value'];\n DateTime: DateTimeInputProps['value'];\n Date: DateInputProps['value'];\n Time: TimeInputProps['value'];\n};\n\nexport type ConstantFormat = keyof ConstantValueTypeMap;\n\nexport type BooleanLabels = 'true|false' | 'always|never';\n\nexport type ConstantProps = {\n value?: string | number | boolean | Date;\n booleanLabels?: BooleanLabels;\n onChange: (value: NonNullable<ConstantProps['value']>) => void;\n};\n\nexport type SourceConfig = { type: Source; selected?: boolean };\n\nexport type ExpressionControlConfig = {\n component: ComponentType<ComponentProps<typeof CodeEditor>>;\n props: ComponentProps<typeof CodeEditor>;\n};\n\nexport type ConstantControlConfig = {\n format: ConstantFormat;\n props: ConstantProps;\n};\n\nexport type RuleControlConfig = {\n props: RuleSelectProps;\n};\n\n// ## (DynamicInput) Top level props for the component.\nexport interface DynamicInputProps\n extends TestIdProp,\n Pick<FormFieldProps, 'labelHidden' | 'required' | 'status' | 'id'> {\n /**\n * The accessible and visual field label.\n * When used as an independent control label should represent the data field.\n * When used in combination with another LHS element the default \"Value\" may be sufficient.\n * @default \"Value\"\n */\n label?: string;\n\n /**\n * The form control displayed on the RHS\n */\n controls: {\n constant?: ConstantControlConfig;\n rule?: RuleControlConfig;\n expression?: ExpressionControlConfig;\n };\n\n /**\n * Methods to source a value from.\n */\n sources: SourceConfig[];\n\n /**\n * Called when the source method changes.\n */\n onSourceChange: (source: Source) => void;\n\n /**\n * Ref to the component's root element.\n */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import { type MenuButtonProps, type TestIdProp } from '@pega/cosmos-react-core';
3
+ import type { ConstantFormat, DynamicInputProps } from './DynamicInput.types';
4
+ interface SourceButtonProps extends Pick<DynamicInputProps, 'sources' | 'onSourceChange'>, TestIdProp {
5
+ icon?: MenuButtonProps['icon'];
6
+ constantFormat?: ConstantFormat;
7
+ }
8
+ declare const SourceButton: FC<SourceButtonProps>;
9
+ export default SourceButton;
10
+ //# sourceMappingURL=SourceButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SourceButton.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/SourceButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAIL,KAAK,eAAe,EACpB,KAAK,UAAU,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAwB,MAAM,sBAAsB,CAAC;AAGpG,UAAU,iBACR,SAAQ,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAC3D,UAAU;IACZ,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA4DvC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Icon, MenuButton, useI18n } from '@pega/cosmos-react-core';
3
+ import { getSourceIcon } from './utils';
4
+ const SourceButton = ({ sources, icon, constantFormat, onSourceChange, testId }) => {
5
+ const t = useI18n();
6
+ const secondaryText = {
7
+ Constant: t('constant_description'),
8
+ Expression: t('expression_description'),
9
+ Rule: t('rule_description')
10
+ };
11
+ const primaryText = (config) => {
12
+ const type = config.type;
13
+ return {
14
+ Constant: t('constant_label', [
15
+ constantFormat ? t(`dynamicInput_format_${constantFormat}`) : ''
16
+ ]),
17
+ Expression: t('expression_label'),
18
+ Rule: t('rule_label')
19
+ }[type];
20
+ };
21
+ return (_jsx(MenuButton, { testId: testId, text: t('value_type'), icon: icon, iconSet: 'streamline', menu: {
22
+ mode: 'single-select',
23
+ items: sources.map(config => {
24
+ const type = config.type;
25
+ return {
26
+ id: type,
27
+ primary: primaryText(config),
28
+ secondary: [secondaryText[type]],
29
+ visual: (_jsx(Icon, { name: getSourceIcon({
30
+ source: type,
31
+ format: type === 'Constant' ? constantFormat : undefined
32
+ }), set: 'streamline' })),
33
+ selected: config.selected
34
+ };
35
+ }),
36
+ onItemClick: id => {
37
+ onSourceChange(id);
38
+ }
39
+ }, iconOnly: true }));
40
+ };
41
+ export default SourceButton;
42
+ //# sourceMappingURL=SourceButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SourceButton.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/SourceButton.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAGR,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AASxC,MAAM,YAAY,GAA0B,CAAC,EAC3C,OAAO,EACP,IAAI,EACJ,cAAc,EACd,cAAc,EACd,MAAM,EACY,EAAE,EAAE;IACtB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,aAAa,GAAgC;QACjD,QAAQ,EAAE,CAAC,CAAC,sBAAsB,CAAC;QACnC,UAAU,EAAE,CAAC,CAAC,wBAAwB,CAAC;QACvC,IAAI,EA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C;YAC/B,CAAC;SACF,EACD,QAAQ,SACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import type { FC } from 'react';\n\nimport {\n Icon,\n MenuButton,\n useI18n,\n type MenuButtonProps,\n type TestIdProp\n} from '@pega/cosmos-react-core';\n\nimport type { ConstantFormat, DynamicInputProps, Source, SourceConfig } from './DynamicInput.types';\nimport { getSourceIcon } from './utils';\n\ninterface SourceButtonProps\n extends Pick<DynamicInputProps, 'sources' | 'onSourceChange'>,\n TestIdProp {\n icon?: MenuButtonProps['icon'];\n constantFormat?: ConstantFormat;\n}\n\nconst SourceButton: FC<SourceButtonProps> = ({\n sources,\n icon,\n constantFormat,\n onSourceChange,\n testId\n}: SourceButtonProps) => {\n const t = useI18n();\n const secondaryText: { [key in Source]: string } = {\n Constant: t('constant_description'),\n Expression: t('expression_description'),\n Rule: t('rule_description')\n };\n\n const primaryText = (config: SourceConfig) => {\n const type = config.type;\n\n return {\n Constant: t('constant_label', [\n constantFormat ? t(`dynamicInput_format_${constantFormat}`) : ''\n ]),\n Expression: t('expression_label'),\n Rule: t('rule_label')\n }[type];\n };\n\n return (\n <MenuButton\n testId={testId}\n text={t('value_type')}\n icon={icon}\n iconSet='streamline'\n menu={{\n mode: 'single-select',\n items: sources.map(config => {\n const type = config.type;\n\n return {\n id: type,\n primary: primaryText(config),\n secondary: [secondaryText[type]],\n visual: (\n <Icon\n name={getSourceIcon({\n source: type,\n format: type === 'Constant' ? constantFormat : undefined\n })}\n set='streamline'\n />\n ),\n selected: config.selected\n };\n }),\n onItemClick: id => {\n onSourceChange(id as Source);\n }\n }}\n iconOnly\n />\n );\n};\n\nexport default SourceButton;\n"]}
@@ -0,0 +1,3 @@
1
+ export { default as DynamicInput } from './DynamicInput';
2
+ export * from './DynamicInput.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as DynamicInput } from './DynamicInput';
2
+ export * from './DynamicInput.types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,cAAc,sBAAsB,CAAC","sourcesContent":["export { default as DynamicInput } from './DynamicInput';\nexport * from './DynamicInput.types';\n"]}
@@ -0,0 +1,6 @@
1
+ import type { ConstantFormat, Source } from './DynamicInput.types';
2
+ export declare const getSourceIcon: ({ source, format }: {
3
+ source: Source;
4
+ format?: keyof import("./DynamicInput.types").ConstantValueTypeMap | undefined;
5
+ }) => string;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicInput/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAqBnE,eAAO,MAAM,aAAa;YAIhB,MAAM;;MAEZ,MAgBH,CAAC"}
@@ -0,0 +1,29 @@
1
+ const iconMap = {
2
+ Text: 'dataviz-string-field',
3
+ 'Text (paragraph)': 'dataviz-string-field',
4
+ Boolean: 'circle-mixed-left',
5
+ Percentage: 'percentage',
6
+ Integer: 'dataviz-numeric-field',
7
+ Decimal: 'number-decimal',
8
+ Currency: 'currency',
9
+ Phone: 'phone-call',
10
+ DateTime: 'dataviz-datetime-field',
11
+ Date: 'calendar-range',
12
+ Time: 'clock',
13
+ Rule: 'rule-library',
14
+ Advanced: 'function'
15
+ };
16
+ export const getSourceIcon = ({ source, format }) => {
17
+ let iconName;
18
+ if (source === 'Constant') {
19
+ iconName = iconMap[format ?? 'Text'];
20
+ }
21
+ if (source === 'Rule') {
22
+ iconName = iconMap.Rule;
23
+ }
24
+ if (source === 'Expression') {
25
+ iconName = iconMap.Advanced;
26
+ }
27
+ return iconName ?? iconMap.Text;
28
+ };
29
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/DynamicInput/utils.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,GAGT;IACF,IAAI,EAAE,sBAAsB;IAC5B,kBAAkB,EAAE,sBAAsB;IAC1C,OAAO,EAAE,mBAAmB;IAC5B,UAAU,EAAE,YAAY;IACxB,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,wBAAwB;IAClC,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,MAAM,EACN,MAAM,EAIP,EAAU,EAAE;IACX,IAAI,QAAQ,CAAC;IAEb,IAAI,MAAM,KAAK,UAAU,EAAE;QACzB,QAAQ,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC;KACtC;IAED,IAAI,MAAM,KAAK,MAAM,EAAE;QACrB,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;KACzB;IAED,IAAI,MAAM,KAAK,YAAY,EAAE;QAC3B,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;KAC7B;IAED,OAAO,QAAQ,IAAK,OAAO,CAAC,IAAe,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["/* eslint-disable import/prefer-default-export */\nimport type { StreamlineIconName } from '@pega/cosmos-react-core';\n\nimport type { ConstantFormat, Source } from './DynamicInput.types';\n\nconst iconMap: Partial<Record<ConstantFormat, StreamlineIconName>> & {\n Rule: 'rule-library';\n Advanced: 'function';\n} = {\n Text: 'dataviz-string-field',\n 'Text (paragraph)': 'dataviz-string-field',\n Boolean: 'circle-mixed-left',\n Percentage: 'percentage',\n Integer: 'dataviz-numeric-field',\n Decimal: 'number-decimal',\n Currency: 'currency',\n Phone: 'phone-call',\n DateTime: 'dataviz-datetime-field',\n Date: 'calendar-range',\n Time: 'clock',\n Rule: 'rule-library',\n Advanced: 'function'\n};\n\nexport const getSourceIcon = ({\n source,\n format\n}: {\n source: Source;\n format?: ConstantFormat;\n}): string => {\n let iconName;\n\n if (source === 'Constant') {\n iconName = iconMap[format ?? 'Text'];\n }\n\n if (source === 'Rule') {\n iconName = iconMap.Rule;\n }\n\n if (source === 'Expression') {\n iconName = iconMap.Advanced;\n }\n\n return iconName ?? (iconMap.Text as string);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;iBAId,cAAc,EAAE;SA4hB9B,CAAC"}
1
+ {"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;iBAId,cAAc,EAAE;SA0hB7B,CAAC"}