@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.
- package/package.json +1 -1
- package/templates/angular-sdk-reference/angular.json +2 -1
- package/templates/angular-sdk-reference/package.json +1 -0
- package/templates/angular-sdk-reference/pega-constellationjs-0.26.3-local.tgz +0 -0
- package/templates/angular-sdk-reference/src/app/app.component.ts +232 -15
- package/templates/angular-sdk-reference/src/components/component-map.ts +90 -0
- package/templates/angular-sdk-reference/src/components/fields/auto-complete/auto-complete.component.ts +267 -0
- package/templates/angular-sdk-reference/src/components/fields/checkbox/checkbox.component.ts +84 -0
- package/templates/angular-sdk-reference/src/components/fields/currency/currency.component.ts +97 -0
- package/templates/angular-sdk-reference/src/components/fields/date-input/date-input.component.ts +88 -0
- package/templates/angular-sdk-reference/src/components/fields/dropdown/dropdown.component.ts +101 -0
- package/templates/angular-sdk-reference/src/components/fields/email/email.component.ts +91 -0
- package/templates/angular-sdk-reference/src/components/fields/integer/integer.component.ts +93 -0
- package/templates/angular-sdk-reference/src/components/fields/phone/phone.component.ts +91 -0
- package/templates/angular-sdk-reference/src/components/fields/radio-buttons/radio-buttons.component.ts +102 -0
- package/templates/angular-sdk-reference/src/components/fields/text-area/text-area.component.ts +98 -0
- package/templates/angular-sdk-reference/src/components/fields/text-input/text-input.component.ts +97 -0
- package/templates/angular-sdk-reference/src/components/fields/url-input/url-input.component.ts +94 -0
- package/templates/angular-sdk-reference/src/components/infra/assignment/assignment.component.ts +206 -0
- package/templates/angular-sdk-reference/src/components/infra/case-summary/case-summary.component.ts +76 -0
- package/templates/angular-sdk-reference/src/components/infra/case-view/case-view.component.ts +114 -0
- package/templates/angular-sdk-reference/src/components/infra/flow-container/flow-container.component.ts +411 -0
- package/templates/angular-sdk-reference/src/components/infra/reference/reference.component.ts +158 -0
- package/templates/angular-sdk-reference/src/components/infra/region/region.component.ts +39 -0
- package/templates/angular-sdk-reference/src/components/infra/root-container/root-container.component.ts +193 -0
- package/templates/angular-sdk-reference/src/components/infra/stages/stages.component.ts +78 -0
- package/templates/angular-sdk-reference/src/components/infra/view/view.component.ts +139 -0
- package/templates/angular-sdk-reference/src/components/infra/view-container/view-container.component.ts +191 -0
- package/templates/angular-sdk-reference/src/components/templates/default-form/default-form.component.ts +101 -0
- package/templates/angular-sdk-reference/src/components/templates/narrow-wide/narrow-wide.component.ts +37 -0
- package/templates/angular-sdk-reference/src/components/templates/one-column/one-column.component.ts +37 -0
- package/templates/angular-sdk-reference/src/components/templates/two-column/two-column.component.ts +37 -0
- package/templates/angular-sdk-reference/src/components/templates/wide-narrow/wide-narrow.component.ts +37 -0
- package/templates/angular-sdk-reference/src/helpers/event-utils.ts +18 -0
- package/templates/angular-sdk-reference/src/helpers/utils.ts +38 -0
- package/templates/angular-sdk-reference/src/helpers/versionHelpers.ts +14 -0
- package/templates/angular-sdk-reference/tsconfig.json +5 -2
- package/templates/react-sdk-reference/.ai-common/agents/embedded-flow-expert.md +11 -4
- package/templates/react-sdk-reference/.ai-common/prompts/component-manifest.json +7 -0
- package/templates/react-sdk-reference/.ai-common/prompts/generate-all-components.md +3 -1
- package/templates/react-sdk-reference/.ai-common/skills/field-components.md +75 -29
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/AutoComplete.md +133 -101
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedData.md +385 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/EmbeddedDataMulti.md +506 -0
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/ObjectReference.md +549 -86
- package/templates/react-sdk-reference/.ai-common/skills/field-skills/UserReference.md +181 -83
- package/templates/react-sdk-reference/.ai-common/skills/template-skills/ListView.md +125 -153
- 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
|
-
|
|
|
22
|
-
| ---------------------- |
|
|
23
|
-
| `
|
|
24
|
-
| `
|
|
25
|
-
| `
|
|
26
|
-
| `
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
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
|
|
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** —
|
|
46
|
+
**Main Component Logic** — in order:
|
|
39
47
|
|
|
40
|
-
1. Resolve
|
|
41
|
-
2. **
|
|
42
|
-
3. **
|
|
43
|
-
4. **
|
|
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 (
|
|
54
|
+
### SimpleTableManual (manually-fed table)
|
|
46
55
|
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 —
|
|
83
|
+
### SimpleTableManual — Manually-Fed Table
|
|
71
84
|
|
|
72
|
-
|
|
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`
|
|
77
|
-
2. **
|
|
78
|
-
3. **
|
|
79
|
-
4. **
|
|
80
|
-
5. **
|
|
81
|
-
6. **
|
|
82
|
-
7. **
|
|
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 `
|
|
89
|
-
-
|
|
90
|
-
- Used when
|
|
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
|
|
109
|
+
### SimpleTableSelectReadonly — Read-Only with a List Dialog
|
|
93
110
|
|
|
94
|
-
1.
|
|
95
|
-
2.
|
|
96
|
-
3.
|
|
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
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
| Add
|
|
107
|
-
|
|
|
108
|
-
|
|
|
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
|
-
-
|
|
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
|
|
120
|
-
|
|
|
121
|
-
| Trigger
|
|
122
|
-
|
|
|
123
|
-
|
|
|
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
|
-
-
|
|
128
|
-
- `
|
|
129
|
-
-
|
|
130
|
-
-
|
|
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
|
|
136
|
-
- `ListView
|
|
137
|
-
-
|
|
138
|
-
- The
|
|
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
|
|
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** →
|
|
147
|
-
- **SimpleTableSelect** →
|
|
148
|
-
- **SimpleTableSelectReadonly** →
|
|
149
|
-
-
|
|
150
|
-
-
|
|
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
|