@pega/cosmos-react-build 3.0.0-dev.2.0 → 3.0.0-dev.21.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 (258) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts +4 -2
  2. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -1
  3. package/lib/components/AppHeader/AppHeader.js +10 -9
  4. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts +1 -1
  6. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  7. package/lib/components/AppHeader/AppHeader.styles.js +5 -19
  8. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  9. package/lib/components/AppHeader/BranchButton.d.ts.map +1 -1
  10. package/lib/components/AppHeader/BranchButton.js +1 -1
  11. package/lib/components/AppHeader/BranchButton.js.map +1 -1
  12. package/lib/components/AppShell/AppShell.d.ts +1 -0
  13. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  14. package/lib/components/AppShell/AppShell.js +15 -20
  15. package/lib/components/AppShell/AppShell.js.map +1 -1
  16. package/lib/components/AppShell/AppShell.styles.d.ts +1 -0
  17. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  18. package/lib/components/AppShell/AppShell.styles.js +17 -2
  19. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  20. package/lib/components/AppShell/AppShell.types.d.ts +6 -9
  21. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  22. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  23. package/lib/components/AppShell/AppShellContext.d.ts +1 -0
  24. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  25. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +9 -0
  26. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -0
  27. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +238 -0
  28. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -0
  29. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +23 -0
  30. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -0
  31. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js +2 -0
  32. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -0
  33. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts +308 -0
  34. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -0
  35. package/lib/components/DynamicContentEditor/PegaCustomElement.js +23 -0
  36. package/lib/components/DynamicContentEditor/PegaCustomElement.js.map +1 -0
  37. package/lib/components/DynamicContentEditor/index.d.ts +3 -0
  38. package/lib/components/DynamicContentEditor/index.d.ts.map +1 -0
  39. package/lib/components/DynamicContentEditor/index.js +2 -0
  40. package/lib/components/DynamicContentEditor/index.js.map +1 -0
  41. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +6 -0
  42. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -0
  43. package/lib/components/ExpressionBuilder/ExpressionBuilder.js +77 -0
  44. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -0
  45. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +5 -0
  46. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -0
  47. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js +44 -0
  48. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.js.map +1 -0
  49. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +47 -0
  50. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -0
  51. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js +2 -0
  52. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -0
  53. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts +6 -0
  54. package/lib/components/ExpressionBuilder/ExpressionItem.d.ts.map +1 -0
  55. package/lib/components/ExpressionBuilder/ExpressionItem.js +17 -0
  56. package/lib/components/ExpressionBuilder/ExpressionItem.js.map +1 -0
  57. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +6 -0
  58. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -0
  59. package/lib/components/ExpressionBuilder/ExpressionList.js +22 -0
  60. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -0
  61. package/lib/components/ExpressionBuilder/index.d.ts +5 -0
  62. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -0
  63. package/lib/components/ExpressionBuilder/index.js +4 -0
  64. package/lib/components/ExpressionBuilder/index.js.map +1 -0
  65. package/lib/components/FlowModeller/AddNode.d.ts +11 -9
  66. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  67. package/lib/components/FlowModeller/AddNode.js +9 -3
  68. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  69. package/lib/components/FlowModeller/Connector.d.ts +7 -0
  70. package/lib/components/FlowModeller/Connector.d.ts.map +1 -0
  71. package/lib/components/FlowModeller/Connector.js +71 -0
  72. package/lib/components/FlowModeller/Connector.js.map +1 -0
  73. package/lib/components/FlowModeller/DeletePopover.d.ts +19 -0
  74. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -0
  75. package/lib/components/FlowModeller/DeletePopover.js +136 -0
  76. package/lib/components/FlowModeller/DeletePopover.js.map +1 -0
  77. package/lib/components/FlowModeller/FlowModeller.d.ts +3 -19
  78. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  79. package/lib/components/FlowModeller/FlowModeller.js +185 -61
  80. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  81. package/lib/components/FlowModeller/FlowModeller.types.d.ts +25 -0
  82. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +1 -0
  83. package/lib/components/FlowModeller/FlowModeller.types.js +2 -0
  84. package/lib/components/FlowModeller/FlowModeller.types.js.map +1 -0
  85. package/lib/components/FlowModeller/FlowModellerContext.d.ts +6 -0
  86. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +1 -0
  87. package/lib/components/FlowModeller/FlowModellerContext.js +7 -0
  88. package/lib/components/FlowModeller/FlowModellerContext.js.map +1 -0
  89. package/lib/components/FlowModeller/Node/Node.types.d.ts +22 -9
  90. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  91. package/lib/components/FlowModeller/Node/Node.types.js +2 -3
  92. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  93. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +7 -4
  94. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  95. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +21 -11
  96. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  97. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -1
  98. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  99. package/lib/components/FlowModeller/Node/NodeTemplates.js +42 -18
  100. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  101. package/lib/components/FlowModeller/Node.d.ts +5 -0
  102. package/lib/components/FlowModeller/Node.d.ts.map +1 -0
  103. package/lib/components/FlowModeller/Node.js +22 -0
  104. package/lib/components/FlowModeller/Node.js.map +1 -0
  105. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  106. package/lib/components/FlowModeller/Renderer/Renderer.js +37 -6
  107. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  108. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +9 -9
  109. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  110. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  111. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +8 -3
  112. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -1
  113. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +7 -1
  114. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  115. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +2 -1
  116. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +1 -1
  117. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +19 -6
  118. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  119. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +9 -6
  120. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  121. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +23 -3
  122. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  123. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +17 -0
  124. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +1 -0
  125. package/lib/components/FlowModeller/Utils/{AddNodeUtils.js → addNodeUtils.js} +58 -35
  126. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -0
  127. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +30 -0
  128. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -0
  129. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +81 -0
  130. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -0
  131. package/lib/components/FlowModeller/helper.d.ts +18 -8
  132. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  133. package/lib/components/FlowModeller/helper.js +114 -55
  134. package/lib/components/FlowModeller/helper.js.map +1 -1
  135. package/lib/components/FlowModeller/index.d.ts +8 -3
  136. package/lib/components/FlowModeller/index.d.ts.map +1 -1
  137. package/lib/components/FlowModeller/index.js +5 -1
  138. package/lib/components/FlowModeller/index.js.map +1 -1
  139. package/lib/components/ItemLibrary/ItemLibrary.d.ts +8 -6
  140. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  141. package/lib/components/ItemLibrary/ItemLibrary.js +6 -8
  142. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  143. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  144. package/lib/components/LifeCycle/Category.js +17 -13
  145. package/lib/components/LifeCycle/Category.js.map +1 -1
  146. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  147. package/lib/components/LifeCycle/LifeCycle.js +2 -3
  148. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  149. package/lib/components/LifeCycle/LifeCycle.types.d.ts +2 -4
  150. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  151. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  152. package/lib/components/LifeCycle/LifeCycleList.d.ts +1 -1
  153. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  154. package/lib/components/LifeCycle/LifeCycleList.js +3 -2
  155. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  156. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  157. package/lib/components/LifeCycle/Stage.js +8 -17
  158. package/lib/components/LifeCycle/Stage.js.map +1 -1
  159. package/lib/components/LifeCycle/Step.d.ts +3 -6
  160. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  161. package/lib/components/LifeCycle/Step.js +20 -42
  162. package/lib/components/LifeCycle/Step.js.map +1 -1
  163. package/lib/components/LifeCycle/Task.d.ts +4 -1
  164. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  165. package/lib/components/LifeCycle/Task.js +17 -10
  166. package/lib/components/LifeCycle/Task.js.map +1 -1
  167. package/lib/components/LifeCycle/index.d.ts +1 -2
  168. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  169. package/lib/components/LifeCycle/index.js.map +1 -1
  170. package/lib/components/ObjectPreview/ObjectPreview.d.ts +16 -0
  171. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -0
  172. package/lib/components/ObjectPreview/ObjectPreview.js +25 -0
  173. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -0
  174. package/lib/components/ObjectPreview/index.d.ts +3 -0
  175. package/lib/components/ObjectPreview/index.d.ts.map +1 -0
  176. package/lib/components/ObjectPreview/index.js +3 -0
  177. package/lib/components/ObjectPreview/index.js.map +1 -0
  178. package/lib/components/ObjectSelect/ObjectPicker.d.ts +15 -0
  179. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -0
  180. package/lib/components/ObjectSelect/ObjectPicker.js +36 -0
  181. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -0
  182. package/lib/components/ObjectSelect/ObjectSelect.d.ts +32 -0
  183. package/lib/components/ObjectSelect/ObjectSelect.d.ts.map +1 -0
  184. package/lib/components/ObjectSelect/ObjectSelect.js +41 -0
  185. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -0
  186. package/lib/components/ObjectSelect/ObjectSummary.d.ts +24 -0
  187. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -0
  188. package/lib/components/ObjectSelect/ObjectSummary.js +45 -0
  189. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -0
  190. package/lib/components/ObjectSelect/index.d.ts +3 -0
  191. package/lib/components/ObjectSelect/index.d.ts.map +1 -0
  192. package/lib/components/ObjectSelect/index.js +2 -0
  193. package/lib/components/ObjectSelect/index.js.map +1 -0
  194. package/lib/components/ObjectSelect/useCreateModal.d.ts +34 -0
  195. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -0
  196. package/lib/components/ObjectSelect/useCreateModal.js +61 -0
  197. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -0
  198. package/lib/components/PageTemplates/GalleryPage.js +4 -4
  199. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  200. package/lib/components/PageTemplates/PageTemplates.d.ts +3 -3
  201. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  202. package/lib/components/PageTemplates/PageTemplates.js +45 -37
  203. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  204. package/lib/components/SummaryCard/SummaryCard.d.ts +2 -3
  205. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  206. package/lib/components/SummaryCard/SummaryCard.js +3 -4
  207. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  208. package/lib/components/Workbench/ConfigurationPanel.d.ts.map +1 -1
  209. package/lib/components/Workbench/ConfigurationPanel.js +2 -3
  210. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  211. package/lib/components/Workbench/Toolbar.d.ts +1 -5
  212. package/lib/components/Workbench/Toolbar.d.ts.map +1 -1
  213. package/lib/components/Workbench/Toolbar.js +8 -8
  214. package/lib/components/Workbench/Toolbar.js.map +1 -1
  215. package/lib/components/Workbench/UtilityPanel.js +1 -1
  216. package/lib/components/Workbench/UtilityPanel.js.map +1 -1
  217. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  218. package/lib/components/Workbench/Workbench.js +3 -4
  219. package/lib/components/Workbench/Workbench.js.map +1 -1
  220. package/lib/components/Workbench/Workbench.styles.d.ts +1 -1
  221. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  222. package/lib/components/Workbench/Workbench.styles.js +12 -17
  223. package/lib/components/Workbench/Workbench.styles.js.map +1 -1
  224. package/lib/components/Workbench/Workbench.types.d.ts +0 -2
  225. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  226. package/lib/components/Workbench/Workbench.types.js.map +1 -1
  227. package/lib/index.d.ts +8 -1
  228. package/lib/index.d.ts.map +1 -1
  229. package/lib/index.js +8 -1
  230. package/lib/index.js.map +1 -1
  231. package/lib/utils/index.d.ts +2 -0
  232. package/lib/utils/index.d.ts.map +1 -0
  233. package/lib/utils/index.js +2 -0
  234. package/lib/utils/index.js.map +1 -0
  235. package/lib/utils/utils.d.ts +14 -0
  236. package/lib/utils/utils.d.ts.map +1 -0
  237. package/lib/utils/utils.js +13 -0
  238. package/lib/utils/utils.js.map +1 -0
  239. package/package.json +22 -14
  240. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +0 -13
  241. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +0 -1
  242. package/lib/components/FlowModeller/Renderer/Connectors.js +0 -47
  243. package/lib/components/FlowModeller/Renderer/Connectors.js.map +0 -1
  244. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +0 -9
  245. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +0 -1
  246. package/lib/components/FlowModeller/Renderer/Nodes.js +0 -25
  247. package/lib/components/FlowModeller/Renderer/Nodes.js.map +0 -1
  248. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts +0 -16
  249. package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts.map +0 -1
  250. package/lib/components/FlowModeller/Utils/AddNodeUtils.js.map +0 -1
  251. package/lib/components/Visual/Visual.d.ts +0 -17
  252. package/lib/components/Visual/Visual.d.ts.map +0 -1
  253. package/lib/components/Visual/Visual.js +0 -28
  254. package/lib/components/Visual/Visual.js.map +0 -1
  255. package/lib/components/Visual/index.d.ts +0 -3
  256. package/lib/components/Visual/index.d.ts.map +0 -1
  257. package/lib/components/Visual/index.js +0 -3
  258. package/lib/components/Visual/index.js.map +0 -1
@@ -0,0 +1,308 @@
1
+ export declare const pegaReferenceElementStyle = "pega-reference {\n color:#076bc9;\n cursor:pointer;\n}\npega-reference:hover{\n text-decoration:underline;\n}\npega-reference::before{\n content: '['\n}\npega-reference::after{\n content: ']'\n}";
2
+ export declare const createPegaReferenceElement: (win: typeof globalThis) => {
3
+ new (): {
4
+ connectedCallback(): void;
5
+ accessKey: string;
6
+ readonly accessKeyLabel: string;
7
+ autocapitalize: string;
8
+ dir: string;
9
+ draggable: boolean;
10
+ hidden: boolean;
11
+ innerText: string;
12
+ lang: string;
13
+ readonly offsetHeight: number;
14
+ readonly offsetLeft: number;
15
+ readonly offsetParent: Element | null;
16
+ readonly offsetTop: number;
17
+ readonly offsetWidth: number;
18
+ outerText: string;
19
+ spellcheck: boolean;
20
+ title: string;
21
+ translate: boolean;
22
+ attachInternals(): ElementInternals;
23
+ click(): void;
24
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
25
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
26
+ removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
27
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
28
+ readonly attributes: NamedNodeMap;
29
+ readonly classList: DOMTokenList;
30
+ className: string;
31
+ readonly clientHeight: number;
32
+ readonly clientLeft: number;
33
+ readonly clientTop: number;
34
+ readonly clientWidth: number;
35
+ id: string;
36
+ readonly localName: string;
37
+ readonly namespaceURI: string | null;
38
+ onfullscreenchange: ((this: Element, ev: Event) => any) | null;
39
+ onfullscreenerror: ((this: Element, ev: Event) => any) | null;
40
+ outerHTML: string;
41
+ readonly ownerDocument: Document;
42
+ readonly part: DOMTokenList;
43
+ readonly prefix: string | null;
44
+ readonly scrollHeight: number;
45
+ scrollLeft: number;
46
+ scrollTop: number;
47
+ readonly scrollWidth: number;
48
+ readonly shadowRoot: ShadowRoot | null;
49
+ slot: string;
50
+ readonly tagName: string;
51
+ attachShadow(init: ShadowRootInit): ShadowRoot;
52
+ closest<K_2 extends keyof HTMLElementTagNameMap>(selector: K_2): HTMLElementTagNameMap[K_2] | null;
53
+ closest<K_3 extends keyof SVGElementTagNameMap>(selector: K_3): SVGElementTagNameMap[K_3] | null;
54
+ closest<E extends Element = Element>(selectors: string): E | null;
55
+ getAttribute(qualifiedName: string): string | null;
56
+ getAttributeNS(namespace: string | null, localName: string): string | null;
57
+ getAttributeNames(): string[];
58
+ getAttributeNode(qualifiedName: string): Attr | null;
59
+ getAttributeNodeNS(namespace: string | null, localName: string): Attr | null;
60
+ getBoundingClientRect(): DOMRect;
61
+ getClientRects(): DOMRectList;
62
+ getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
63
+ getElementsByTagName<K_4 extends keyof HTMLElementTagNameMap>(qualifiedName: K_4): HTMLCollectionOf<HTMLElementTagNameMap[K_4]>;
64
+ getElementsByTagName<K_5 extends keyof SVGElementTagNameMap>(qualifiedName: K_5): HTMLCollectionOf<SVGElementTagNameMap[K_5]>;
65
+ getElementsByTagName(qualifiedName: string): HTMLCollectionOf<Element>;
66
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf<HTMLElement>;
67
+ getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf<SVGElement>;
68
+ getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
69
+ hasAttribute(qualifiedName: string): boolean;
70
+ hasAttributeNS(namespace: string | null, localName: string): boolean;
71
+ hasAttributes(): boolean;
72
+ hasPointerCapture(pointerId: number): boolean;
73
+ insertAdjacentElement(where: InsertPosition, element: Element): Element | null;
74
+ insertAdjacentHTML(position: InsertPosition, text: string): void;
75
+ insertAdjacentText(where: InsertPosition, data: string): void;
76
+ matches(selectors: string): boolean;
77
+ releasePointerCapture(pointerId: number): void;
78
+ removeAttribute(qualifiedName: string): void;
79
+ removeAttributeNS(namespace: string | null, localName: string): void;
80
+ removeAttributeNode(attr: Attr): Attr;
81
+ requestFullscreen(options?: FullscreenOptions | undefined): Promise<void>;
82
+ requestPointerLock(): void;
83
+ scroll(options?: ScrollToOptions | undefined): void;
84
+ scroll(x: number, y: number): void;
85
+ scrollBy(options?: ScrollToOptions | undefined): void;
86
+ scrollBy(x: number, y: number): void;
87
+ scrollIntoView(arg?: boolean | ScrollIntoViewOptions | undefined): void;
88
+ scrollTo(options?: ScrollToOptions | undefined): void;
89
+ scrollTo(x: number, y: number): void;
90
+ setAttribute(qualifiedName: string, value: string): void;
91
+ setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void;
92
+ setAttributeNode(attr: Attr): Attr | null;
93
+ setAttributeNodeNS(attr: Attr): Attr | null;
94
+ setPointerCapture(pointerId: number): void;
95
+ toggleAttribute(qualifiedName: string, force?: boolean | undefined): boolean;
96
+ webkitMatchesSelector(selectors: string): boolean;
97
+ readonly baseURI: string;
98
+ readonly childNodes: NodeListOf<ChildNode>;
99
+ readonly firstChild: ChildNode | null;
100
+ readonly isConnected: boolean;
101
+ readonly lastChild: ChildNode | null;
102
+ readonly nextSibling: ChildNode | null;
103
+ readonly nodeName: string;
104
+ readonly nodeType: number;
105
+ nodeValue: string | null;
106
+ readonly parentElement: HTMLElement | null;
107
+ readonly parentNode: ParentNode | null;
108
+ readonly previousSibling: ChildNode | null;
109
+ textContent: string | null;
110
+ appendChild<T extends Node>(node: T): T;
111
+ cloneNode(deep?: boolean | undefined): Node;
112
+ compareDocumentPosition(other: Node): number;
113
+ contains(other: Node | null): boolean;
114
+ getRootNode(options?: GetRootNodeOptions | undefined): Node;
115
+ hasChildNodes(): boolean;
116
+ insertBefore<T_1 extends Node>(node: T_1, child: Node | null): T_1;
117
+ isDefaultNamespace(namespace: string | null): boolean;
118
+ isEqualNode(otherNode: Node | null): boolean;
119
+ isSameNode(otherNode: Node | null): boolean;
120
+ lookupNamespaceURI(prefix: string | null): string | null;
121
+ lookupPrefix(namespace: string | null): string | null;
122
+ normalize(): void;
123
+ removeChild<T_2 extends Node>(child: T_2): T_2;
124
+ replaceChild<T_3 extends Node>(node: Node, child: T_3): T_3;
125
+ readonly ATTRIBUTE_NODE: number;
126
+ readonly CDATA_SECTION_NODE: number;
127
+ readonly COMMENT_NODE: number;
128
+ readonly DOCUMENT_FRAGMENT_NODE: number;
129
+ readonly DOCUMENT_NODE: number;
130
+ readonly DOCUMENT_POSITION_CONTAINED_BY: number;
131
+ readonly DOCUMENT_POSITION_CONTAINS: number;
132
+ readonly DOCUMENT_POSITION_DISCONNECTED: number;
133
+ readonly DOCUMENT_POSITION_FOLLOWING: number;
134
+ readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;
135
+ readonly DOCUMENT_POSITION_PRECEDING: number;
136
+ readonly DOCUMENT_TYPE_NODE: number;
137
+ readonly ELEMENT_NODE: number;
138
+ readonly ENTITY_NODE: number;
139
+ readonly ENTITY_REFERENCE_NODE: number;
140
+ readonly NOTATION_NODE: number;
141
+ readonly PROCESSING_INSTRUCTION_NODE: number;
142
+ readonly TEXT_NODE: number;
143
+ dispatchEvent(event: Event): boolean;
144
+ ariaAtomic: string | null;
145
+ ariaAutoComplete: string | null;
146
+ ariaBusy: string | null;
147
+ ariaChecked: string | null;
148
+ ariaColCount: string | null;
149
+ ariaColIndex: string | null;
150
+ ariaColSpan: string | null;
151
+ ariaCurrent: string | null;
152
+ ariaDisabled: string | null;
153
+ ariaExpanded: string | null;
154
+ ariaHasPopup: string | null;
155
+ ariaHidden: string | null;
156
+ ariaKeyShortcuts: string | null;
157
+ ariaLabel: string | null;
158
+ ariaLevel: string | null;
159
+ ariaLive: string | null;
160
+ ariaModal: string | null;
161
+ ariaMultiLine: string | null;
162
+ ariaMultiSelectable: string | null;
163
+ ariaOrientation: string | null;
164
+ ariaPlaceholder: string | null;
165
+ ariaPosInSet: string | null;
166
+ ariaPressed: string | null;
167
+ ariaReadOnly: string | null;
168
+ ariaRequired: string | null;
169
+ ariaRoleDescription: string | null;
170
+ ariaRowCount: string | null;
171
+ ariaRowIndex: string | null;
172
+ ariaRowSpan: string | null;
173
+ ariaSelected: string | null;
174
+ ariaSetSize: string | null;
175
+ ariaSort: string | null;
176
+ ariaValueMax: string | null;
177
+ ariaValueMin: string | null;
178
+ ariaValueNow: string | null;
179
+ ariaValueText: string | null;
180
+ animate(keyframes: PropertyIndexedKeyframes | Keyframe[] | null, options?: number | KeyframeAnimationOptions | undefined): Animation;
181
+ getAnimations(options?: GetAnimationsOptions | undefined): Animation[];
182
+ after(...nodes: (string | Node)[]): void;
183
+ before(...nodes: (string | Node)[]): void;
184
+ remove(): void;
185
+ replaceWith(...nodes: (string | Node)[]): void;
186
+ innerHTML: string;
187
+ readonly nextElementSibling: Element | null;
188
+ readonly previousElementSibling: Element | null;
189
+ readonly childElementCount: number;
190
+ readonly children: HTMLCollection;
191
+ readonly firstElementChild: Element | null;
192
+ readonly lastElementChild: Element | null;
193
+ append(...nodes: (string | Node)[]): void;
194
+ prepend(...nodes: (string | Node)[]): void;
195
+ querySelector<K_6 extends keyof HTMLElementTagNameMap>(selectors: K_6): HTMLElementTagNameMap[K_6] | null;
196
+ querySelector<K_7 extends keyof SVGElementTagNameMap>(selectors: K_7): SVGElementTagNameMap[K_7] | null;
197
+ querySelector<E_1 extends Element = Element>(selectors: string): E_1 | null;
198
+ querySelectorAll<K_8 extends keyof HTMLElementTagNameMap>(selectors: K_8): NodeListOf<HTMLElementTagNameMap[K_8]>;
199
+ querySelectorAll<K_9 extends keyof SVGElementTagNameMap>(selectors: K_9): NodeListOf<SVGElementTagNameMap[K_9]>;
200
+ querySelectorAll<E_2 extends Element = Element>(selectors: string): NodeListOf<E_2>;
201
+ replaceChildren(...nodes: (string | Node)[]): void;
202
+ readonly assignedSlot: HTMLSlotElement | null;
203
+ oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
204
+ oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
205
+ onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null;
206
+ readonly style: CSSStyleDeclaration;
207
+ contentEditable: string;
208
+ enterKeyHint: string;
209
+ inputMode: string;
210
+ readonly isContentEditable: boolean;
211
+ onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
212
+ onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
213
+ onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
214
+ onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
215
+ onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null;
216
+ onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
217
+ onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
218
+ oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
219
+ oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null;
220
+ onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
221
+ onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
222
+ onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null;
223
+ oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
224
+ oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
225
+ ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
226
+ ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
227
+ ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
228
+ ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
229
+ ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
230
+ ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
231
+ ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
232
+ ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null;
233
+ ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
234
+ onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null;
235
+ onended: ((this: GlobalEventHandlers, ev: Event) => any) | null;
236
+ onerror: OnErrorEventHandler;
237
+ onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null;
238
+ onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null;
239
+ ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
240
+ oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null;
241
+ oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null;
242
+ onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
243
+ onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
244
+ onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null;
245
+ onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;
246
+ onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
247
+ onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null;
248
+ onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
249
+ onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
250
+ onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
251
+ onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
252
+ onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
253
+ onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
254
+ onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
255
+ onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
256
+ onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null;
257
+ onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null;
258
+ onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null;
259
+ onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null;
260
+ onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
261
+ onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
262
+ onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
263
+ onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
264
+ onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
265
+ onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
266
+ onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
267
+ onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;
268
+ onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any) | null;
269
+ onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
270
+ onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null;
271
+ onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null;
272
+ onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null;
273
+ onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null;
274
+ onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null;
275
+ onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null;
276
+ onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null;
277
+ onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
278
+ onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
279
+ onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
280
+ onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null;
281
+ onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null;
282
+ onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
283
+ ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null;
284
+ ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null;
285
+ ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
286
+ ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
287
+ ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
288
+ ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined;
289
+ ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
290
+ ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
291
+ ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
292
+ ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null;
293
+ onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null;
294
+ onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null;
295
+ onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
296
+ onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null;
297
+ onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null;
298
+ onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null;
299
+ onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;
300
+ autofocus: boolean;
301
+ readonly dataset: DOMStringMap;
302
+ nonce?: string | undefined;
303
+ tabIndex: number;
304
+ blur(): void;
305
+ focus(options?: FocusOptions | undefined): void;
306
+ };
307
+ };
308
+ //# sourceMappingURL=PegaCustomElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PegaCustomElement.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,4MAYpC,CAAC;AAEH,eAAO,MAAM,0BAA0B,QAAS,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQhE,CAAC"}
@@ -0,0 +1,23 @@
1
+ export const pegaReferenceElementStyle = `pega-reference {
2
+ color:#076bc9;
3
+ cursor:pointer;
4
+ }
5
+ pega-reference:hover{
6
+ text-decoration:underline;
7
+ }
8
+ pega-reference::before{
9
+ content: '['
10
+ }
11
+ pega-reference::after{
12
+ content: ']'
13
+ }`;
14
+ export const createPegaReferenceElement = (win) => {
15
+ return class PegaReferenceElement extends win.HTMLElement {
16
+ connectedCallback() {
17
+ const template = document.createElement('template');
18
+ const temp = document.importNode(template.content, true);
19
+ this.append(temp);
20
+ }
21
+ };
22
+ };
23
+ //# sourceMappingURL=PegaCustomElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PegaCustomElement.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/PegaCustomElement.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;EAYvC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,GAAsB,EAAE,EAAE;IACnE,OAAO,MAAM,oBAAqB,SAAQ,GAAG,CAAC,WAAW;QACvD,iBAAiB;YACf,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["export const pegaReferenceElementStyle = `pega-reference {\n color:#076bc9;\n cursor:pointer;\n}\npega-reference:hover{\n text-decoration:underline;\n}\npega-reference::before{\n content: '['\n}\npega-reference::after{\n content: ']'\n}`;\n\nexport const createPegaReferenceElement = (win: typeof globalThis) => {\n return class PegaReferenceElement extends win.HTMLElement {\n connectedCallback() {\n const template = document.createElement('template');\n const temp = document.importNode(template.content, true);\n this.append(temp);\n }\n };\n};\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from './DynamicContentEditor';
2
+ export { DynamicContentEditorProps, ItemType } from './DynamicContentEditor.types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from './DynamicContentEditor';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DynamicContentEditor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["export { default } from './DynamicContentEditor';\nexport { DynamicContentEditorProps, ItemType } from './DynamicContentEditor.types';\n"]}
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { ForwardProps } from '@pega/cosmos-react-core';
3
+ import { ExpressionBuilderProps } from './ExpressionBuilder.types';
4
+ declare const ExpressionBuilder: FunctionComponent<ExpressionBuilderProps & ForwardProps>;
5
+ export default ExpressionBuilder;
6
+ //# sourceMappingURL=ExpressionBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilder.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAQ,YAAY,EAAkC,MAAM,yBAAyB,CAAC;AAE7F,OAAO,EAAuB,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAIxF,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CA+H/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
3
+ import { Flex, SearchInput, TextArea, useI18n } from '@pega/cosmos-react-core';
4
+ import ExpressionList from './ExpressionList';
5
+ import { StyledExpressionBuilder, StyledExpressionEditor } from './ExpressionBuilder.styles';
6
+ const ExpressionBuilder = forwardRef(({ list, search, errors, defaultValue, handle, ...restProps }, ref) => {
7
+ const t = useI18n();
8
+ const textArea = useRef();
9
+ const [selection, setSelection] = useState({
10
+ start: 0,
11
+ end: 0
12
+ });
13
+ const getExpression = () => {
14
+ return textArea.current?.value || '';
15
+ };
16
+ useImperativeHandle(handle, () => ({
17
+ getExpression
18
+ }), [getExpression]);
19
+ const insertExpression = (expression) => {
20
+ if (!textArea.current)
21
+ return;
22
+ const currentValue = textArea.current.value;
23
+ const newValue = `${currentValue.slice(0, selection.start)}${expression}${currentValue.slice(selection.end)}`;
24
+ textArea.current.value = newValue;
25
+ setSelection(prev => {
26
+ return { start: prev.start + expression.length, end: prev.start + expression.length };
27
+ });
28
+ textArea.current.focus();
29
+ };
30
+ const onBlur = () => {
31
+ if (!textArea.current)
32
+ return;
33
+ const lastIndex = textArea.current.value.length >= 0 ? textArea.current.value.length : 0;
34
+ const selectionStart = textArea.current.selectionStart === null ? lastIndex : textArea.current.selectionStart;
35
+ const selectionEnd = textArea.current.selectionEnd === null ? lastIndex : textArea.current.selectionEnd;
36
+ const currentSelection = {
37
+ start: selectionStart,
38
+ end: selectionEnd
39
+ };
40
+ if (selectionStart > selectionEnd) {
41
+ currentSelection.start = selectionEnd;
42
+ currentSelection.end = selectionStart;
43
+ }
44
+ setSelection(currentSelection);
45
+ };
46
+ const onItemInsert = (id) => {
47
+ list.onItemInsert(id, insertExpression);
48
+ };
49
+ useEffect(() => {
50
+ if (defaultValue && textArea.current) {
51
+ setSelection({ start: defaultValue.length, end: defaultValue.length });
52
+ textArea.current.value = defaultValue;
53
+ }
54
+ }, []);
55
+ return (_jsxs(Flex, { ...restProps, as: StyledExpressionBuilder, ref: ref, container: {
56
+ justify: 'between',
57
+ colGap: 2,
58
+ pad: 1
59
+ }, item: {
60
+ grow: 1
61
+ }, children: [_jsxs(Flex, { container: {
62
+ direction: 'column',
63
+ justify: 'between',
64
+ gap: 1
65
+ }, item: {
66
+ grow: 1,
67
+ basis: '50%'
68
+ }, children: [_jsx(SearchInput, { ...search }), _jsx(ExpressionList, { ...list, onItemInsert: onItemInsert })] }), _jsx(Flex, { as: StyledExpressionEditor, container: {
69
+ direction: 'column',
70
+ justify: 'between'
71
+ }, item: {
72
+ grow: 1,
73
+ basis: '50%'
74
+ }, children: _jsx(TextArea, { status: errors ? 'error' : undefined, ref: textArea, onBlur: onBlur, label: t('expression_editor'), labelHidden: true, info: errors }) })] }));
75
+ });
76
+ export default ExpressionBuilder;
77
+ //# sourceMappingURL=ExpressionBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilder.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n useEffect,\n useImperativeHandle,\n useRef,\n useState\n} from 'react';\n\nimport { Flex, ForwardProps, SearchInput, TextArea, useI18n } from '@pega/cosmos-react-core';\n\nimport { ExpressionItemProps, ExpressionBuilderProps } from './ExpressionBuilder.types';\nimport ExpressionList from './ExpressionList';\nimport { StyledExpressionBuilder, StyledExpressionEditor } from './ExpressionBuilder.styles';\n\nconst ExpressionBuilder: FunctionComponent<ExpressionBuilderProps & ForwardProps> = forwardRef(\n (\n {\n list,\n search,\n errors,\n defaultValue,\n handle,\n ...restProps\n }: PropsWithoutRef<ExpressionBuilderProps>,\n ref: ExpressionBuilderProps['ref']\n ) => {\n const t = useI18n();\n const textArea = useRef<HTMLInputElement>();\n const [selection, setSelection] = useState<{ start: number; end: number }>({\n start: 0,\n end: 0\n });\n\n const getExpression = () => {\n return textArea.current?.value || '';\n };\n\n useImperativeHandle(\n handle,\n () => ({\n getExpression\n }),\n [getExpression]\n );\n\n const insertExpression = (expression: string) => {\n if (!textArea.current) return;\n const currentValue = textArea.current.value;\n const newValue = `${currentValue.slice(0, selection.start)}${expression}${currentValue.slice(\n selection.end\n )}`;\n textArea.current.value = newValue;\n setSelection(prev => {\n return { start: prev.start + expression.length, end: prev.start + expression.length };\n });\n textArea.current.focus();\n };\n\n const onBlur = () => {\n if (!textArea.current) return;\n const lastIndex = textArea.current.value.length >= 0 ? textArea.current.value.length : 0;\n const selectionStart =\n textArea.current.selectionStart === null ? lastIndex : textArea.current.selectionStart;\n const selectionEnd =\n textArea.current.selectionEnd === null ? lastIndex : textArea.current.selectionEnd;\n const currentSelection = {\n start: selectionStart,\n end: selectionEnd\n };\n if (selectionStart > selectionEnd) {\n currentSelection.start = selectionEnd;\n currentSelection.end = selectionStart;\n }\n\n setSelection(currentSelection);\n };\n\n const onItemInsert = (id: ExpressionItemProps['id']) => {\n list.onItemInsert(id, insertExpression);\n };\n\n useEffect(() => {\n if (defaultValue && textArea.current) {\n setSelection({ start: defaultValue.length, end: defaultValue.length });\n textArea.current.value = defaultValue;\n }\n }, []);\n\n return (\n <Flex\n {...restProps}\n as={StyledExpressionBuilder}\n ref={ref}\n container={{\n justify: 'between',\n colGap: 2,\n pad: 1\n }}\n item={{\n grow: 1\n }}\n >\n {/* Column 1 */}\n <Flex\n container={{\n direction: 'column',\n justify: 'between',\n gap: 1\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n >\n <SearchInput {...search} />\n <ExpressionList {...list} onItemInsert={onItemInsert} />\n </Flex>\n {/* Column 2 */}\n <Flex\n as={StyledExpressionEditor}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1,\n basis: '50%'\n }}\n >\n <TextArea\n status={errors ? 'error' : undefined}\n ref={textArea}\n onBlur={onBlur}\n label={t('expression_editor')}\n labelHidden\n info={errors}\n />\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default ExpressionBuilder;\n"]}
@@ -0,0 +1,5 @@
1
+ export declare const StyledExpressionItem: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
2
+ export declare const StyledExpressionList: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, {}, never>;
3
+ export declare const StyledExpressionBuilder: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const StyledExpressionEditor: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
5
+ //# sourceMappingURL=ExpressionBuilder.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilder.styles.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB,wGAY/B,CAAC;AAIH,eAAO,MAAM,oBAAoB,wGAGhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yGAYlC,CAAC;AAIH,eAAO,MAAM,sBAAsB,yGAMjC,CAAC"}
@@ -0,0 +1,44 @@
1
+ import styled, { css } from 'styled-components';
2
+ import { defaultThemeProp } from '@pega/cosmos-react-core';
3
+ import StyledTextArea from '@pega/cosmos-react-core/lib/components/TextArea/TextArea.styles';
4
+ import { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
5
+ export const StyledExpressionItem = styled.li(({ theme }) => {
6
+ return css `
7
+ background-color: ${theme.base.palette['primary-background']};
8
+ padding-block: ${theme.base.spacing};
9
+ padding-inline: calc(0.5 * ${theme.base.spacing});
10
+ :not(:last-child) {
11
+ border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
12
+ }
13
+ & + & {
14
+ margin-inline-start: 0;
15
+ }
16
+ `;
17
+ });
18
+ StyledExpressionItem.defaultProps = defaultThemeProp;
19
+ export const StyledExpressionList = styled.ul `
20
+ overflow-y: auto;
21
+ flex-grow: 1;
22
+ `;
23
+ export const StyledExpressionBuilder = styled.div(({ theme }) => {
24
+ return css `
25
+ background-color: ${theme.base.palette['primary-background']};
26
+ min-height: calc(30 * ${theme.base.spacing});
27
+ max-height: 100%;
28
+ max-width: calc(2 * ${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});
29
+ min-width: calc(${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});
30
+
31
+ ${StyledTextArea} {
32
+ flex-grow: 1;
33
+ }
34
+ `;
35
+ });
36
+ StyledExpressionBuilder.defaultProps = defaultThemeProp;
37
+ export const StyledExpressionEditor = styled.div(() => {
38
+ return css `
39
+ ${StyledFormField} {
40
+ flex-grow: 1;
41
+ }
42
+ `;
43
+ });
44
+ //# sourceMappingURL=ExpressionBuilder.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilder.styles.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,cAAc,MAAM,iEAAiE,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAE7F,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1D,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;qBAC3C,KAAK,CAAC,IAAI,CAAC,OAAO;iCACN,KAAK,CAAC,IAAI,CAAC,OAAO;;uCAEZ,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;;;;GAKrE,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAA;;;CAG5C,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;4BACpC,KAAK,CAAC,IAAI,CAAC,OAAO;;0BAEpB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,UAAU,KAAK,CAAC,IAAI,CAAC,OAAO;sBAC9D,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,UAAU,KAAK,CAAC,IAAI,CAAC,OAAO;;MAE1E,cAAc;;;GAGjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;IACpD,OAAO,GAAG,CAAA;MACN,eAAe;;;GAGlB,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\nimport StyledTextArea from '@pega/cosmos-react-core/lib/components/TextArea/TextArea.styles';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nexport const StyledExpressionItem = styled.li(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['primary-background']};\n padding-block: ${theme.base.spacing};\n padding-inline: calc(0.5 * ${theme.base.spacing});\n :not(:last-child) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n }\n & + & {\n margin-inline-start: 0;\n }\n `;\n});\n\nStyledExpressionItem.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionList = styled.ul`\n overflow-y: auto;\n flex-grow: 1;\n`;\n\nexport const StyledExpressionBuilder = styled.div(({ theme }) => {\n return css`\n background-color: ${theme.base.palette['primary-background']};\n min-height: calc(30 * ${theme.base.spacing});\n max-height: 100%;\n max-width: calc(2 * ${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});\n min-width: calc(${theme.base['content-width'].lg} + 4 * ${theme.base.spacing});\n\n ${StyledTextArea} {\n flex-grow: 1;\n }\n `;\n});\n\nStyledExpressionBuilder.defaultProps = defaultThemeProp;\n\nexport const StyledExpressionEditor = styled.div(() => {\n return css`\n ${StyledFormField} {\n flex-grow: 1;\n }\n `;\n});\n"]}
@@ -0,0 +1,47 @@
1
+ import { Ref } from 'react';
2
+ import { BaseProps, EmptyStateProps, OmitStrict, SearchInputProps, TextAreaProps } from '@pega/cosmos-react-core';
3
+ export interface ExpressionItemProps {
4
+ /** Id of the item */
5
+ id: string;
6
+ /** Item name to be displayed as rule name */
7
+ primary: string;
8
+ /** Type of expression item. Eg: Decision, When, Automation etc. */
9
+ type: string;
10
+ /** Click on the plus button to add it in the expression input */
11
+ onInsert: (id: ExpressionItemProps['id']) => void;
12
+ /** Display the React node for parameters */
13
+ onExpand?: (id: ExpressionItemProps['id']) => void;
14
+ /** show the expanded */
15
+ isExpanded?: boolean;
16
+ }
17
+ export interface ExpressionListProps extends BaseProps {
18
+ ref?: Ref<HTMLDivElement>;
19
+ /** Expression builder items */
20
+ items?: OmitStrict<ExpressionItemProps, 'onInsert' | 'onExpand'>[];
21
+ /** Handler for plus button on ExpressionItem */
22
+ onItemInsert: ExpressionItemProps['onInsert'];
23
+ /** Handler for expand button on ExpressionItem */
24
+ onItemExpand?: ExpressionItemProps['onExpand'];
25
+ /** No items */
26
+ emptyText?: EmptyStateProps['message'];
27
+ }
28
+ export interface HandleValue {
29
+ /** Returns the expression value */
30
+ getExpression: () => string;
31
+ }
32
+ export interface ExpressionBuilderProps extends BaseProps {
33
+ ref?: Ref<HTMLDivElement>;
34
+ /** Expression items list */
35
+ list: OmitStrict<ExpressionListProps, 'ref' | 'onItemInsert'> & {
36
+ onItemInsert: (id: ExpressionItemProps['id'], insertExpression: (expression: string) => void) => void;
37
+ };
38
+ /** Search input props */
39
+ search: Pick<Required<SearchInputProps>, 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'> & Pick<SearchInputProps, 'defaultFilter'>;
40
+ /** Default expression to set in the text area */
41
+ defaultValue?: string;
42
+ /** Compiled error message */
43
+ errors?: TextAreaProps['info'];
44
+ /** Imperative handle */
45
+ handle?: Ref<HandleValue>;
46
+ }
47
+ //# sourceMappingURL=ExpressionBuilder.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilder.types.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EACL,SAAS,EACT,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,QAAQ,EAAE,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAClD,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IACnD,yBAAyB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,UAAU,CAAC,mBAAmB,EAAE,UAAU,GAAG,UAAU,CAAC,EAAE,CAAC;IACnE,gDAAgD;IAChD,YAAY,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC9C,kDAAkD;IAClD,YAAY,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC/C,eAAe;IACf,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,aAAa,EAAE,MAAM,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,4BAA4B;IAC5B,IAAI,EAAE,UAAU,CAAC,mBAAmB,EAAE,KAAK,GAAG,cAAc,CAAC,GAAG;QAC9D,YAAY,EAAE,CACZ,EAAE,EAAE,mBAAmB,CAAC,IAAI,CAAC,EAC7B,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,KAC3C,IAAI,CAAC;KACX,CAAC;IACF,yBAAyB;IACzB,MAAM,EAAE,IAAI,CACV,QAAQ,CAAC,gBAAgB,CAAC,EAC1B,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,OAAO,CAC1D,GACC,IAAI,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAE1C,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/B,wBAAwB;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ExpressionBuilder.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionBuilder.types.js","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionBuilder.types.ts"],"names":[],"mappings":"","sourcesContent":["import { Ref } from 'react';\n\nimport {\n BaseProps,\n EmptyStateProps,\n OmitStrict,\n SearchInputProps,\n TextAreaProps\n} from '@pega/cosmos-react-core';\n\nexport interface ExpressionItemProps {\n /** Id of the item */\n id: string;\n /** Item name to be displayed as rule name */\n primary: string;\n /** Type of expression item. Eg: Decision, When, Automation etc. */\n type: string;\n /** Click on the plus button to add it in the expression input */\n onInsert: (id: ExpressionItemProps['id']) => void;\n /** Display the React node for parameters */\n onExpand?: (id: ExpressionItemProps['id']) => void;\n /** show the expanded */\n isExpanded?: boolean;\n}\n\nexport interface ExpressionListProps extends BaseProps {\n ref?: Ref<HTMLDivElement>;\n /** Expression builder items */\n items?: OmitStrict<ExpressionItemProps, 'onInsert' | 'onExpand'>[];\n /** Handler for plus button on ExpressionItem */\n onItemInsert: ExpressionItemProps['onInsert'];\n /** Handler for expand button on ExpressionItem */\n onItemExpand?: ExpressionItemProps['onExpand'];\n /** No items */\n emptyText?: EmptyStateProps['message'];\n}\n\nexport interface HandleValue {\n /** Returns the expression value */\n getExpression: () => string;\n}\n\nexport interface ExpressionBuilderProps extends BaseProps {\n ref?: Ref<HTMLDivElement>;\n /** Expression items list */\n list: OmitStrict<ExpressionListProps, 'ref' | 'onItemInsert'> & {\n onItemInsert: (\n id: ExpressionItemProps['id'],\n insertExpression: (expression: string) => void\n ) => void;\n };\n /** Search input props */\n search: Pick<\n Required<SearchInputProps>,\n 'filters' | 'onFilterChange' | 'onSearchChange' | 'value'\n > &\n Pick<SearchInputProps, 'defaultFilter'>;\n\n /** Default expression to set in the text area */\n defaultValue?: string;\n /** Compiled error message */\n errors?: TextAreaProps['info'];\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { ForwardProps } from '@pega/cosmos-react-core';
3
+ import { ExpressionItemProps } from './ExpressionBuilder.types';
4
+ declare const ExpressionItem: FunctionComponent<ExpressionItemProps & ForwardProps>;
5
+ export default ExpressionItem;
6
+ //# sourceMappingURL=ExpressionItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpressionItem.d.ts","sourceRoot":"","sources":["../../../src/components/ExpressionBuilder/ExpressionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAEnD,OAAO,EAGL,YAAY,EAMb,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CA+CzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { Button, Flex, Icon, registerIcon, Text, useDirection, useI18n } from '@pega/cosmos-react-core';
4
+ import * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';
5
+ import * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';
6
+ import { StyledExpressionItem } from './ExpressionBuilder.styles';
7
+ registerIcon(caretLeftIcon, caretRightIcon);
8
+ const ExpressionItem = ({ id, primary, type, onInsert, onExpand, isExpanded = false, ...restProps }) => {
9
+ const { end: caretDirection } = useDirection();
10
+ const t = useI18n();
11
+ const caretIcon = useMemo(() => {
12
+ return isExpanded ? 'caret-down' : `caret-${caretDirection}`;
13
+ }, [isExpanded, caretDirection]);
14
+ return (_jsxs(Flex, { ...restProps, as: StyledExpressionItem, id: id, container: { alignItems: 'center', justify: 'between' }, children: [_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsx(Button, { icon: true, variant: 'simple', onClick: onExpand ? () => onExpand(id) : undefined, "aria-label": t('expand_noun', [`${type}: ${primary}`]), children: _jsx(Icon, { name: caretIcon }) }), _jsx(Text, { variant: 'primary', children: primary })] }), _jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, children: [_jsx(Text, { variant: 'secondary', children: type }), _jsx(Button, { icon: true, variant: 'simple', onClick: () => onInsert(id), "aria-label": t('insert_noun', [`${type}: ${primary}`]), children: _jsx(Icon, { name: 'plus' }) })] })] }));
15
+ };
16
+ export default ExpressionItem;
17
+ //# sourceMappingURL=ExpressionItem.js.map