@pega/sdk 0.0.13 → 0.0.14

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 (48) hide show
  1. package/package.json +1 -1
  2. package/templates/angular-sdk-reference/angular.json +2 -1
  3. package/templates/angular-sdk-reference/package.json +1 -0
  4. package/templates/angular-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
  5. package/templates/angular-sdk-reference/src/app/app.component.ts +232 -15
  6. package/templates/angular-sdk-reference/src/components/component-map.ts +90 -0
  7. package/templates/angular-sdk-reference/src/components/fields/auto-complete/auto-complete.component.ts +267 -0
  8. package/templates/angular-sdk-reference/src/components/fields/checkbox/checkbox.component.ts +84 -0
  9. package/templates/angular-sdk-reference/src/components/fields/currency/currency.component.ts +97 -0
  10. package/templates/angular-sdk-reference/src/components/fields/date-input/date-input.component.ts +88 -0
  11. package/templates/angular-sdk-reference/src/components/fields/dropdown/dropdown.component.ts +101 -0
  12. package/templates/angular-sdk-reference/src/components/fields/email/email.component.ts +91 -0
  13. package/templates/angular-sdk-reference/src/components/fields/integer/integer.component.ts +93 -0
  14. package/templates/angular-sdk-reference/src/components/fields/phone/phone.component.ts +91 -0
  15. package/templates/angular-sdk-reference/src/components/fields/radio-buttons/radio-buttons.component.ts +102 -0
  16. package/templates/angular-sdk-reference/src/components/fields/text-area/text-area.component.ts +98 -0
  17. package/templates/angular-sdk-reference/src/components/fields/text-input/text-input.component.ts +97 -0
  18. package/templates/angular-sdk-reference/src/components/fields/url-input/url-input.component.ts +94 -0
  19. package/templates/angular-sdk-reference/src/components/infra/assignment/assignment.component.ts +206 -0
  20. package/templates/angular-sdk-reference/src/components/infra/case-summary/case-summary.component.ts +76 -0
  21. package/templates/angular-sdk-reference/src/components/infra/case-view/case-view.component.ts +114 -0
  22. package/templates/angular-sdk-reference/src/components/infra/flow-container/flow-container.component.ts +411 -0
  23. package/templates/angular-sdk-reference/src/components/infra/reference/reference.component.ts +158 -0
  24. package/templates/angular-sdk-reference/src/components/infra/region/region.component.ts +39 -0
  25. package/templates/angular-sdk-reference/src/components/infra/root-container/root-container.component.ts +193 -0
  26. package/templates/angular-sdk-reference/src/components/infra/stages/stages.component.ts +78 -0
  27. package/templates/angular-sdk-reference/src/components/infra/view/view.component.ts +139 -0
  28. package/templates/angular-sdk-reference/src/components/infra/view-container/view-container.component.ts +191 -0
  29. package/templates/angular-sdk-reference/src/components/templates/default-form/default-form.component.ts +101 -0
  30. package/templates/angular-sdk-reference/src/components/templates/narrow-wide/narrow-wide.component.ts +37 -0
  31. package/templates/angular-sdk-reference/src/components/templates/one-column/one-column.component.ts +37 -0
  32. package/templates/angular-sdk-reference/src/components/templates/two-column/two-column.component.ts +37 -0
  33. package/templates/angular-sdk-reference/src/components/templates/wide-narrow/wide-narrow.component.ts +37 -0
  34. package/templates/angular-sdk-reference/src/helpers/event-utils.ts +18 -0
  35. package/templates/angular-sdk-reference/src/helpers/utils.ts +38 -0
  36. package/templates/angular-sdk-reference/src/helpers/versionHelpers.ts +14 -0
  37. package/templates/angular-sdk-reference/tsconfig.json +5 -2
  38. package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +11 -4
  39. package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +7 -0
  40. package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +3 -1
  41. package/templates/react-sdk-reference/.ai-common/skills/field-components.md +75 -29
  42. package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +133 -101
  43. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedData.md +385 -0
  44. package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedDataMulti.md +506 -0
  45. package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +549 -86
  46. package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +181 -83
  47. package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +125 -153
  48. package/templates/react-sdk-reference/.ai-common/skills/template-skills/SimpleTable.md +90 -81
@@ -18,134 +18,143 @@ Entry-point template for embedded table data in a form or detail view. Routes to
18
18
 
19
19
  ## Inputs
20
20
 
21
- | Prop | Type | Required | Description |
22
- | ---------------------- | ---------- | -------- | ----------------------------------------------------------------------------------------- |
23
- | `multiRecordDisplayAs` | `string` | No | `'fieldGroup'` delegates to FieldGroupTemplate; else table |
24
- | `fieldMetadata` | `object` | No | Field-level metadata including `dataRetrievalType` |
25
- | `referenceList` | `string` | No | Property path to the reference list |
26
- | `displayAs` | `string` | No | For SimpleTableSelectReadonly: `'readonlyMulti'`, `'combobox'`, `'checkboxgroup'` routing |
27
- | `selectionMode` | `string` | No | `'single'` or `'multi'` (for SimpleTableSelect) |
28
- | `displayMode` | `string` | No | `'DISPLAY_ONLY'` triggers read-only sub-variant |
29
- | `readOnly` | `boolean` | No | Alternative read-only flag |
30
- | `getPConnect` | `function` | Yes | PConnect getter |
21
+ | Name | Type | Description |
22
+ | ---------------------- | -------------------- | ----------------------------------------------------------------------------------------------- |
23
+ | `getPConnect` | accessor | The PConnect accessor |
24
+ | `multiRecordDisplayAs` | `string` (optional) | `fieldGroup` routes to the repeating-group template; anything else to a table |
25
+ | `fieldMetadata` | `object` (optional) | Field metadata, including its `type`, its `dataRetrievalType` and its datasource parameters |
26
+ | `referenceList` | `string` or `list` | The router receives the list path; the manually-fed table receives the resolved list of records |
27
+ | `contextClass` | `string` (optional) | The records' class; when absent, taken from the list property's field metadata `pageClass` |
28
+ | `allowActions` | `object` (optional) | `allowAdd`, `allowEdit`, `allowDelete`, `allowDragDrop` |
29
+ | `allowTableEdit` | `boolean` (optional) | When false, hides add and delete and disables reordering |
30
+ | `editMode` | `string` (optional) | `modal` or `tableRows` |
31
+ | `editModeConfig` | `object` (optional) | The add-and-edit targets — see the EmbeddedDataMulti skill |
32
+ | `renderMode` | `string` (optional) | `ReadOnly` or `Editable` |
33
+ | `uniqueField` | `string` (optional) | Property that receives a fresh identifier on every inserted record |
34
+ | `targetClassLabel` | `string` (optional) | Used in the add caption |
35
+ | `displayAs` | `string` (optional) | For the read-only selection variant: `readonlyMulti`, `combobox` or `checkboxgroup` |
36
+ | `selectionMode` | `string` (optional) | `single` or `multi`, for the selection variant |
37
+ | `displayMode` | `string` (optional) | A display-only value forces read-only behaviour |
38
+ | `readOnly` | `boolean` (optional) | Alternative read-only flag |
31
39
 
32
40
  ## Implementation Structure
33
41
 
34
42
  ### SimpleTable (router)
35
43
 
36
- **Module Setup:** The component depends on the project's component registry (to resolve `ListView`, `FieldGroupTemplate`, and `SimpleTableManual`) and the project's simple-table helper utilities (`buildMetaForListView` and `getContext`).
44
+ **Module Setup:** The component depends on the project's component registry, which resolves `ListView`, `FieldGroupTemplate` and `SimpleTableManual`, and on the project's simple-table helpers, which build a list-view configuration and read the list path.
37
45
 
38
- **Main Component Logic** — steps in order:
46
+ **Main Component Logic** — in order:
39
47
 
40
- 1. Resolve `ListView`, `FieldGroupTemplate`, and `SimpleTableManual` from the project's component registry; receive `getPConnect`, `multiRecordDisplayAs`, `allowTableEdit`, `fieldMetadata`, `displayMode`, and other relevant inputs.
41
- 2. **Route to `fieldGroup`:** when `multiRecordDisplayAs === 'fieldGroup'`, render `FieldGroupTemplate` with all inputs plus `contextClass`.
42
- 3. **Route to a read-only reference list:** when `fieldMetadata?.type === 'Page List'` and `fieldMetadata?.dataRetrievalType === 'refer'`, build `metaForListView` via `buildMetaForListView(...)` and render `ListView` with the list-view inputs plus `bInForm: true` and `displayMode`.
43
- 4. **Route to the editable table:** otherwise, render `SimpleTableManual` with all inputs plus `contextClass`.
48
+ 1. **Resolve the class.** When `contextClass` is absent, take the `pageClass` from the field metadata of the list property named by the configuration's `referenceList`.
49
+ 2. **Repeating group.** When `multiRecordDisplayAs` is `fieldGroup`, render `FieldGroupTemplate` with every input plus the class, and stop.
50
+ 3. **Read-only reference list.** When the field metadata's `type` is `Page List` and its `dataRetrievalType` is `refer`, build a list-view configuration from the field metadata, the raw column descriptors, the label and the parameters; create an accessor for it once, with `PCore.createPConnect(...)`, in the current context and page reference — plus the list path when display-only — and render `ListView` inside a form with that accessor, and stop.
51
+ 4. **Allow settings.** When an edit mode is set and allow settings exist — or the configuration allows row editing — hide the add, delete and edit affordances whose allow flag is false, and pass the row-editing flag and the edit flag through. Otherwise, when `allowTableEdit` is false, hide add and delete and disable reordering.
52
+ 5. **Editable table.** Render `SimpleTableManual` with every input, the class, and the settings from step 4.
44
53
 
45
- ### SimpleTableManual (editable table — ~600+ lines)
54
+ ### SimpleTableManual (manually-fed table)
46
55
 
47
- Key structural outline:
48
-
49
- - `getReferenceList(pConn)` + `setReferenceList`
50
- - `buildElementsForTable()` — creates PConnect views per cell
51
- - `generateRowsData()` — for read-only/modal mode
52
- - `addRecord()` / `deleteRecord()` / `editRecord()` with modal support
53
- - Sort/filter/column menu (same pattern as ListView)
54
- - Render: Table with header sort + body rows + add/delete controls
56
+ The largest of the variants. It reads its rows from the resolved list, its columns from its own raw configuration, and writes every change through the accessor's list actions or the embedded-data modal. Its full contract is under Behavioral Contract. Split the implementation into small pieces — column resolution, row formatting, add, edit, delete, sort and filter — using whatever composition mechanism the target framework offers.
55
57
 
56
58
  ### SimpleTableSelect (selection wrapper)
57
59
 
58
- Retrieve `ListView` and `PromotedFilters` from the component registry. Build an `additionalTableConfig` incorporating `selectionMode` and `compositeKeys`. When promoted filters are configured, render `<PromotedFilters ... />`; otherwise render `<ListView {...listViewProps} />` directly.
60
+ A router first: when the configuration's `selectionMode` is `multi` and `renderMode` is `ReadOnly`, render `SimpleTableManual` with every input. Otherwise render the selectable table below.
61
+
62
+ The selectable table receives everything through its **own** configuration, because the reference field creates it with `getPConnect().createComponent` — including the table preset that carries its columns. It never builds, filters or reorders columns. It:
63
+
64
+ 1. Resolves `ListView` and `PromotedFilters` from the registry.
65
+ 2. Clears the label when the inherited `showLabel` is false.
66
+ 3. Derives the **composite keys** from the field metadata of the selection list: for multi-selection the list's property name, for single selection the relationship context under the current page reference. Every data page parameter whose bound path points back into that property is a composite key, named by its last segment.
67
+ 4. In multi-selection, the first time it is displayed and before painting, registers `selectionList` in its state inputs with `setStateProps` and calls `getPConnect().getListActions().initDefaultPageInstructions(selectionList, compositeKeys)`. Without this, checked rows are never saved to the case.
68
+ 5. Chooses the preselected values: the read-only context list for multi-selection, the context page for single selection, and none for advanced search.
69
+ 6. Renders `ListView` with all of its own inputs plus: the resolved label as the title, `globalSearch` true, `personalization`, `grouping` and `editing` all false, `basicMode` true, the composite keys, the preselected values, the view name, the parameters, the raw `searchFields`, and an item key of `$key`. When promoted filters are configured and switched on, render `PromotedFilters` around the same inputs instead.
59
70
 
60
- ### SimpleTableSelectReadonly (link + modal)
71
+ Both table presentations of a reference field arrive here and render identically. Grouping is switched off, and configured filters, sort, row density and column visibility are not supported — ignore them.
61
72
 
62
- Renders a `SemanticLink` per selected item (comma-separated). When the list has more than 5 items, show a "(N Total)" link that opens a modal. The modal renders a `<Dialog>` wrapping a read-only `<SimpleTableManual readOnly ... />`.
73
+ ### SimpleTableSelectReadonly (links and a list dialog)
74
+
75
+ Shows each selected record as a link, separated by commas. When more than five are selected, show the first five followed by a link reading the total count, which opens a dialog holding a read-only `SimpleTableManual` of every selected record.
63
76
 
64
77
  ## Behavioral Contract
65
78
 
66
79
  ### SimpleTable — Routing Logic
67
80
 
68
- When `multiRecordDisplayAs === 'fieldGroup'`, render `FieldGroupTemplate`. Otherwise, when `fieldMetadata.dataRetrievalType === 'refer'`, render `ListView` (read-only, `bInForm: true`). Otherwise, render `SimpleTableManual` (the editable table).
81
+ First match wins: `fieldGroup` goes to `FieldGroupTemplate`; a `Page List` field whose data retrieval type is `refer` goes to a read-only `ListView` inside a form; everything else goes to `SimpleTableManual`.
69
82
 
70
- ### SimpleTableManual — Full Editable Table
83
+ ### SimpleTableManual — Manually-Fed Table
71
84
 
72
- Full editable table with add/delete rows, inline editing, sort, filter, and column customization (~600+ lines).
85
+ A table whose rows are the case's own records, with add, edit, delete, reorder, inline editing, sort and filter.
73
86
 
74
87
  Key behaviors:
75
88
 
76
- 1. **Row data source:** `referenceList` property path via `pConn.getValue(referenceList + '.pxResults')`.
77
- 2. **Add row:** `pConn.getListActions().insert({})`.
78
- 3. **Delete row:** `pConn.getListActions().deleteEntry(index)`.
79
- 4. **Inline field editing:** Each cell renders the field's registered edit component via `buildView(pConn, rowIndex, colFieldName)`.
80
- 5. **Sort:** Client-side sort on loaded data.
81
- 6. **Column customization:** Visibility toggles per column via a settings popover.
82
- 7. **Filter dialog:** Same filter pattern as ListView.
89
+ 1. **Row data source:** the resolved `referenceList` input, which is the list of records itself. Register it with `pConn.setReferenceList(...)`. When it is empty and a `dataPageName` is supplied, fetch the rows from that data page instead, using the parameters from `fieldMetadata`.
90
+ 2. **Columns:** the children of the first child region in the raw configuration, or of the first preset's first region. An entry whose value is `pyPrimaryFields`, or its namespace-qualified form, is replaced in place by the descriptors of the primary-fields view resolved with `PCore.getMetadataUtils().resolveView(...)`, choosing the resolved view whose class is the table's `contextClass`; then duplicates by bound path are removed. Every descriptor is rendered through the registry by its own type. A descriptor whose configuration sets `hide` is never shown.
91
+ 3. **Add row:** when adding and editing happen in a modal and a view or an action is configured, call `getPConnect().getActionsApi().openEmbeddedDataModal(view, pConn, listPath, listLength, PCore.getConstants().RESOURCE_STATUS.CREATE, targetClassLabel, editType, actionId)`. Otherwise insert with `pConn.getListActions().insert(payload, listLength)`, where the payload carries the table's class as `classID` and, when `uniqueField` is set, a fresh identifier under that property.
92
+ 4. **Edit row in a modal:** call `openEmbeddedDataModal` with the edit view when a separate one is configured, otherwise the add view, the row index, `RESOURCE_STATUS.UPDATE`, the class label, the edit type, and the edit action — the separate one when configured, otherwise the add action.
93
+ 5. **Delete row:** `pConn.getListActions().deleteEntry(index)`. A row may be deleted only when deletion is shown and the raw `allowRowDelete` is absent or true, or — when it is an expression-marked string — when `PCore.getExpressionEngine().evaluate(expression, row)` returns true for that row.
94
+ 6. **Page instructions:** before first painting, call `getPConnect().getListActions().initDefaultPageInstructions(...)` with the list path — plus the column names, excluding attachments, in the modal flow, or plus `uniqueField` otherwise.
95
+ 7. **Inline field editing:** each cell renders the field's registered edit component for that row.
96
+ 8. **Read-only cells:** each value is formatted by its descriptor's type, with a checkbox shown through its true and false labels.
97
+ 9. **Sort and filter:** client-side, from the column menu, on loaded data.
98
+ 10. **Add caption:** `Add` followed by the class label when one is available, otherwise `Add`, both localized.
99
+ 11. **Containment:** the table scrolls horizontally inside its own container, never widening the form around it.
83
100
 
84
101
  ### SimpleTableSelect — Selection Mode
85
102
 
86
103
  Wraps `ListView` with additional selection configuration:
87
104
 
88
- - Passes `additionalTableConfig` with `selectionMode: 'single'` or `'multi'`.
89
- - On selection: calls `pConn.getListActions().setSelectedRow(selectedData)`.
90
- - Used when `DataReference` routes to table-based selection.
105
+ - Passes `selectionMode` of `single` or `multi`, the composite keys and the preselected values.
106
+ - Selection is written by `ListView` through `getPConnect().getListActions().setSelectedRows(...)` and `clearSelectedRows()` — see the ListView skill. There is no `setSelectedRow` call.
107
+ - Used when a reference field routes to table-based selection.
91
108
 
92
- ### SimpleTableSelectReadonly — Read-Only with Modal
109
+ ### SimpleTableSelectReadonly — Read-Only with a List Dialog
93
110
 
94
- 1. Renders a link/chip showing the current selection count.
95
- 2. On click: opens a `<Dialog>` containing a `<SimpleTableManual>` in read-only mode.
96
- 3. Inputs: same as `SimpleTableManual` but all fields locked (no add/delete/edit).
111
+ 1. Shows the selected records as links, as described above.
112
+ 2. The total-count link opens a dialog containing `SimpleTableManual` in read-only mode.
113
+ 3. Inside the dialog every field is locked: no add, delete or edit.
97
114
 
98
115
  ## Visual Specifications
99
116
 
100
117
  ### SimpleTableManual
101
118
 
102
- | Element | Description |
103
- | --------------- | ------------------------------------------------------ |
104
- | Toolbar | Column settings button, filter button, optional search |
105
- | Table | Full-width, alternating row colors |
106
- | Add row | `"+ Add row"` button below the table |
107
- | Delete row | Trash icon per row (rightmost column) |
108
- | Column settings | Popover with checkboxes for visibility toggles |
109
-
110
- **CSS-only implementation notes:**
119
+ | Element | Description |
120
+ | ---------- | -------------------------------------------------------------------- |
121
+ | Table | Full width of its container, inside its own horizontal scroll region |
122
+ | Header | Column labels, with a menu for sorting and filtering |
123
+ | Add | An add action below the table, captioned as described above |
124
+ | Row delete | A delete action at the end of each row that may be deleted |
125
+ | Row edit | An edit action per row when editing happens in a modal |
111
126
 
112
- - Table: `width: 100%; border-collapse: collapse`.
113
- - Add row button: `margin-top: 0.5rem; text-align: left`.
114
- - Delete cell: `width: 40px; text-align: center`.
115
- - Read-only mode: hide add/delete controls; cells show plain text.
127
+ In read-only mode, hide the add, delete and edit actions, and show each cell as formatted text. Keep the delete column narrow and centred, and align the add action with the table's start edge.
116
128
 
117
129
  ### SimpleTableSelectReadonly
118
130
 
119
- | Element | Description |
120
- | ----------- | -------------------------------------------------- |
121
- | Trigger | Link or chip showing selection count |
122
- | Modal | Full-screen or large dialog with SimpleTableManual |
123
- | Modal close | `X` button in modal header |
131
+ | Element | Description |
132
+ | ------------ | --------------------------------------------------- |
133
+ | Trigger | The selected records as links, then the total count |
134
+ | Dialog | A large dialog holding the read-only table |
135
+ | Dialog close | A close control in the dialog header |
124
136
 
125
137
  ## Edge Cases & Special Logic
126
138
 
127
- - `multiRecordDisplayAs === 'fieldGroup'` — completely bypasses table; delegates to `FieldGroupTemplate`.
128
- - `dataRetrievalType === 'refer'` — data comes from a reference list, not a full data page; use `ListView` in read-only mode.
129
- - `SimpleTableManual` with 600+ lines — break into sub-hooks if re-implementing.
130
- - Row keys must be unique — use composite keys from `compositeKeys` config if available.
131
- - Column customization state is local — not persisted across navigation.
139
+ - The repeating-group route bypasses the table entirely.
140
+ - A `refer` page list gets its rows from a data page, not from the case, so it goes to a read-only `ListView`.
141
+ - Row identity must be unique: use the composite keys when they are supplied.
142
+ - Sort and filter choices are the user's own and are not persisted across navigation.
132
143
 
133
144
  ## Dependencies
134
145
 
135
- - `FieldGroupTemplate` (for `multiRecordDisplayAs === 'fieldGroup'` routing)
136
- - `ListView` (for `dataRetrievalType === 'refer'` routing)
137
- - `buildView` from the project's field-group utility helpers (for inline cell rendering in SimpleTableManual)
138
- - The design system's table, dialog, popover, icon button, button, and checkbox components.
146
+ - `FieldGroupTemplate`, for the repeating-group route.
147
+ - `ListView`, for the `refer` route and for selection.
148
+ - The project's helper that builds one field view per row for inline editing.
149
+ - The platform APIs named in this skill: the accessor's list actions and actions interface, `PCore.createPConnect`, `PCore.getMetadataUtils().resolveView`, and `PCore.getExpressionEngine().evaluate`.
150
+ - The design system's table, dialog, menu, icon action, button and checkbox, or native equivalents.
139
151
 
140
152
  ## Design System Mapping
141
153
 
142
- **UI control type:** Embedded data table with routing to field group, read-only list, or fully editable table.
143
-
144
- When implementing in a specific design system, map the following:
154
+ **UI control type:** Embedded data table that routes to a repeating group, a read-only list, or an editable table.
145
155
 
146
- - **SimpleTableManual** → use the DS's table component with add/delete row controls and inline editing
147
- - **SimpleTableSelect** → use `ListView` with selection mode enabled, optionally with promoted filters
148
- - **SimpleTableSelectReadonly** → render selected values as chips/links that open a modal with full list view
149
- - Always check `multiRecordDisplayAs === 'fieldGroup'` first — this bypasses the table entirely
150
- - `SimpleTableManual` add/delete row controls must be hidden when `readOnly === true` or `displayMode === 'DISPLAY_ONLY'`
151
- - `SimpleTableSelect` uses the same `ListView` but adds selection callbacks
156
+ - **SimpleTableManual** → the design system's table, with add, edit and delete actions and inline editing
157
+ - **SimpleTableSelect** → `ListView` with a selection mode, optionally inside promoted filters
158
+ - **SimpleTableSelectReadonly** → links for the selected records, opening a dialog with the full list
159
+ - Check the repeating-group route first — it bypasses the table entirely
160
+ - Hide the add, edit and delete actions whenever the table is read-only or the surrounding view is display-only