@pega/sdk 0.0.1
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/LICENSE +201 -0
- package/README.md +111 -0
- package/SECURITY.md +10 -0
- package/dist/index.js +753 -0
- package/package.json +41 -0
- package/templates/angular-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/angular-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/angular-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/angular-sdk-reference/angular.json +34 -0
- package/templates/angular-sdk-reference/package.json +31 -0
- package/templates/angular-sdk-reference/sdk-config.json +26 -0
- package/templates/angular-sdk-reference/src/app/app.component.ts +54 -0
- package/templates/angular-sdk-reference/src/index.html +12 -0
- package/templates/angular-sdk-reference/src/main.ts +4 -0
- package/templates/angular-sdk-reference/src/styles.css +19 -0
- package/templates/angular-sdk-reference/tsconfig.json +32 -0
- package/templates/react-native-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/react-native-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/react-native-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/react-native-sdk-reference/App.tsx +51 -0
- package/templates/react-native-sdk-reference/app.json +11 -0
- package/templates/react-native-sdk-reference/package.json +22 -0
- package/templates/react-native-sdk-reference/sdk-config.json +14 -0
- package/templates/react-native-sdk-reference/tsconfig.json +12 -0
- package/templates/react-sdk-reference/.github/copilot-instructions.md +185 -0
- package/templates/react-sdk-reference/.github/instructions/component-map.instructions.md +40 -0
- package/templates/react-sdk-reference/.github/instructions/dse-component.instructions.md +77 -0
- package/templates/react-sdk-reference/.github/instructions/field-component.instructions.md +73 -0
- package/templates/react-sdk-reference/.github/instructions/template-component.instructions.md +94 -0
- package/templates/react-sdk-reference/.github/instructions/widget-component.instructions.md +89 -0
- package/templates/react-sdk-reference/.github/prompts/add-component.prompt.md +21 -0
- package/templates/react-sdk-reference/.github/prompts/component-manifest.json +111 -0
- package/templates/react-sdk-reference/.github/prompts/identify-components.prompt.md +110 -0
- package/templates/react-sdk-reference/.github/prompts/replace-all-fields.prompt.md +48 -0
- package/templates/react-sdk-reference/.github/prompts/replace-component.prompt.md +81 -0
- package/templates/react-sdk-reference/.github/prompts/replace-design-system.prompt.md +524 -0
- package/templates/react-sdk-reference/.github/prompts/replace-field.prompt.md +41 -0
- package/templates/react-sdk-reference/.github/prompts/swap-design-system.prompt.md +49 -0
- package/templates/react-sdk-reference/.github/skills/component-contracts.md +140 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/AlertBanner.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Banner.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/CaseSummaryFields.md +154 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/DetailsFields.md +144 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroup.md +131 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldGroupList.md +111 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/FieldValueList.md +115 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Operator.md +149 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/Pulse.md +83 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/RichTextEditor.md +206 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension-skills/WssQuickCreate.md +135 -0
- package/templates/react-sdk-reference/.github/skills/design-system-extension.md +249 -0
- package/templates/react-sdk-reference/.github/skills/field-components.md +262 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/AutoComplete.md +112 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/CancelAlert.md +203 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Checkbox.md +158 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Currency.md +106 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Date.md +99 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/DateTime.md +103 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Decimal.md +98 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Dropdown.md +114 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Email.md +107 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Group.md +90 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Integer.md +87 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Location.md +136 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Multiselect.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ObjectReference.md +164 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Percentage.md +92 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Phone.md +110 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RadioButtons.md +146 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/RichText.md +138 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/ScalarList.md +124 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SelectableCard.md +216 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/SemanticLink.md +148 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextArea.md +96 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextContent.md +101 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/TextInput.md +104 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/Time.md +88 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/URL.md +85 -0
- package/templates/react-sdk-reference/.github/skills/field-skills/UserReference.md +180 -0
- package/templates/react-sdk-reference/.github/skills/run-and-verify.md +68 -0
- package/templates/react-sdk-reference/.github/skills/swap-design-system.md +105 -0
- package/templates/react-sdk-reference/.github/skills/template-components.md +285 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AdvancedSearch.md +144 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/AppShell.md +122 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/BannerPage.md +83 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseSummary.md +100 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseView.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/CaseViewActionsMenu.md +126 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Confirmation.md +107 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DataReference.md +120 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultForm.md +102 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DefaultPage.md +110 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/Details.md +88 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsSubTabs.md +95 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsThreeColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DetailsTwoColumn.md +78 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/DynamicTabs.md +101 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/FieldGroupTemplate.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/HierarchicalForm.md +113 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboard.md +104 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/InlineDashboardPage.md +85 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListPage.md +68 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/ListView.md +139 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/MultiReferenceReadOnly.md +80 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/NarrowWide.md +141 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/OneColumn.md +109 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/PromotedFilters.md +124 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SelfServiceCaseView.md +135 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SimpleTable.md +127 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SingleReferenceReadOnly.md +103 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/SubTabs.md +79 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/TwoColumn.md +131 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WideNarrow.md +150 -0
- package/templates/react-sdk-reference/.github/skills/template-skills/WssNavBar.md +135 -0
- package/templates/react-sdk-reference/.github/skills/widget-components.md +234 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/AppAnnouncement.md +82 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Attachment.md +146 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/CaseHistory.md +107 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/FileUtility.md +200 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/Followers.md +99 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/QuickCreate.md +114 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/SummaryItem.md +167 -0
- package/templates/react-sdk-reference/.github/skills/widget-skills/ToDo.md +190 -0
- package/templates/react-sdk-reference/AGENTS.md +59 -0
- package/templates/react-sdk-reference/assets/icons/analytics-good-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/cart-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/headset.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/mobile-phone-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/money-solid.svg +3 -0
- package/templates/react-sdk-reference/assets/icons/multi-device-solid.svg +3 -0
- package/templates/react-sdk-reference/index.html +36 -0
- package/templates/react-sdk-reference/package.json +52 -0
- package/templates/react-sdk-reference/sdk-config.json +26 -0
- package/templates/react-sdk-reference/src/AppSelector.tsx +18 -0
- package/templates/react-sdk-reference/src/FallbackComponent.tsx +40 -0
- package/templates/react-sdk-reference/src/MashupApp.styles.ts +105 -0
- package/templates/react-sdk-reference/src/MashupApp.tsx +254 -0
- package/templates/react-sdk-reference/src/PortalApp.tsx +175 -0
- package/templates/react-sdk-reference/src/components/component-map.ts +255 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/AlertBanner.tsx +91 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.css +39 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/Banner.tsx +53 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Banner/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +16 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +270 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/CaseSummaryFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/DetailsFields.tsx +164 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/DetailsFields/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/FieldGroup.tsx +79 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroup/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/FieldGroupList.tsx +58 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldGroupList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/FieldValueList.tsx +84 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/FieldValueList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/Operator.tsx +220 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Operator/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/Pulse.tsx +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/Pulse/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/RichTextEditor.tsx +201 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.css +33 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +48 -0
- package/templates/react-sdk-reference/src/components/designSystemExtension/WssQuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/AutoComplete.tsx +218 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/AutoComplete/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.css +24 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/CancelAlert.tsx +148 -0
- package/templates/react-sdk-reference/src/components/field/CancelAlert/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/Checkbox.tsx +263 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Checkbox/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Currency/Currency.tsx +111 -0
- package/templates/react-sdk-reference/src/components/field/Currency/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Currency/currency-utils.ts +67 -0
- package/templates/react-sdk-reference/src/components/field/Currency/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Date/Date.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/Date/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/field/Date/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/DateTime.tsx +101 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/DateTime/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/Decimal.tsx +122 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Decimal/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/Dropdown.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Dropdown/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Email/Email.tsx +96 -0
- package/templates/react-sdk-reference/src/components/field/Email/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Email/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Group/Group.tsx +41 -0
- package/templates/react-sdk-reference/src/components/field/Group/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/Group/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Integer/Integer.tsx +100 -0
- package/templates/react-sdk-reference/src/components/field/Integer/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Integer/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.css +4 -0
- package/templates/react-sdk-reference/src/components/field/Location/Location.tsx +258 -0
- package/templates/react-sdk-reference/src/components/field/Location/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Location/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/Multiselect.tsx +238 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Multiselect/utils.ts +230 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/ObjectReference.tsx +235 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ObjectReference/utils.ts +111 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/Percentage.tsx +112 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Percentage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Phone/Phone.tsx +113 -0
- package/templates/react-sdk-reference/src/components/field/Phone/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Phone/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/RadioButtons.tsx +158 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/RadioButtons/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.css +79 -0
- package/templates/react-sdk-reference/src/components/field/RichText/RichText.tsx +98 -0
- package/templates/react-sdk-reference/src/components/field/RichText/config-ext.json +10 -0
- package/templates/react-sdk-reference/src/components/field/RichText/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/ScalarList.tsx +63 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/ScalarList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/SelectableCard.tsx +189 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SelectableCard/utils.tsx +223 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/SemanticLink.tsx +208 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/SemanticLink/utils.ts +49 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/TextArea.tsx +94 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextArea/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/TextContent.tsx +46 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/TextContent/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/TextInput.tsx +92 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/TextInput/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/Time/Time.tsx +79 -0
- package/templates/react-sdk-reference/src/components/field/Time/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/Time/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/URL/URL.tsx +89 -0
- package/templates/react-sdk-reference/src/components/field/URL/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/field/URL/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReference.tsx +198 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/UserReferenceUtils.ts +13 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/field/UserReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/helpers/attachmentShared.ts +6 -0
- package/templates/react-sdk-reference/src/components/helpers/case-utils.tsx +99 -0
- package/templates/react-sdk-reference/src/components/helpers/common-utils.ts +26 -0
- package/templates/react-sdk-reference/src/components/helpers/data_page.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/date-format-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/event-utils.ts +20 -0
- package/templates/react-sdk-reference/src/components/helpers/field-group-utils.ts +63 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Boolean.ts +21 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Currency.ts +77 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/CurrencyMap.ts +913 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/Date.ts +71 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/common.ts +14 -0
- package/templates/react-sdk-reference/src/components/helpers/formatters/index.ts +130 -0
- package/templates/react-sdk-reference/src/components/helpers/instructions-utils.ts +38 -0
- package/templates/react-sdk-reference/src/components/helpers/object-utils.ts +10 -0
- package/templates/react-sdk-reference/src/components/helpers/reactContextHelpers.ts +3 -0
- package/templates/react-sdk-reference/src/components/helpers/simpleTableHelpers.ts +452 -0
- package/templates/react-sdk-reference/src/components/helpers/state-utils.tsx +43 -0
- package/templates/react-sdk-reference/src/components/helpers/template-utils.ts +76 -0
- package/templates/react-sdk-reference/src/components/helpers/utils.ts +349 -0
- package/templates/react-sdk-reference/src/components/helpers/versionHelpers.ts +14 -0
- package/templates/react-sdk-reference/src/components/index.ts +8 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +329 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/AdvancedSearch/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.css +35 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/AppShell.tsx +259 -0
- package/templates/react-sdk-reference/src/components/template/AppShell/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/BannerPage.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/BannerPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/CaseSummary.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseSummary/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/CaseView.tsx +261 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/CaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +117 -0
- package/templates/react-sdk-reference/src/components/template/CaseViewActionsMenu/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/Confirmation.tsx +102 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/config-ext.json +11 -0
- package/templates/react-sdk-reference/src/components/template/Confirmation/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReference.tsx +590 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/SearchForm.tsx +213 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DataReference/utils.ts +90 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.css +34 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/DefaultForm.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/DefaultForm/utils/index.ts +26 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/DefaultPage.tsx +108 -0
- package/templates/react-sdk-reference/src/components/template/DefaultPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/Details.tsx +74 -0
- package/templates/react-sdk-reference/src/components/template/Details/Details/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsSubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsThreeColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/Details/DetailsTwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/config.json +36 -0
- package/templates/react-sdk-reference/src/components/template/Details/DynamicTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx +116 -0
- package/templates/react-sdk-reference/src/components/template/FieldGroupTemplate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/hooks.ts +293 -0
- package/templates/react-sdk-reference/src/components/template/HierarchicalForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/InlineDashboard.tsx +72 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboard/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/InlineDashboardPage.tsx +39 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/template/InlineDashboardPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/ListPage.tsx +16 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/ListPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/DefaultViewMeta.ts +220 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.css +10 -0
- package/templates/react-sdk-reference/src/components/template/ListView/ListView.tsx +1391 -0
- package/templates/react-sdk-reference/src/components/template/ListView/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/ListView/hooks.ts +93 -0
- package/templates/react-sdk-reference/src/components/template/ListView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ListView/utils.ts +781 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +52 -0
- package/templates/react-sdk-reference/src/components/template/MultiReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/NarrowWide.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWide/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +85 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWideForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/NarrowWide/NarrowWidePage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/ObjectPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/OneColumn.tsx +32 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/OneColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/OneColumnTab.tsx +11 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/OneColumn/OneColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.css +7 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/PromotedFilters.tsx +204 -0
- package/templates/react-sdk-reference/src/components/template/PromotedFilters/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
- package/templates/react-sdk-reference/src/components/template/SelfServiceCaseView/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/SimpleTable.tsx +126 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/config-ext.json +7 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTable/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +985 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableManual/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +122 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelect/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +207 -0
- package/templates/react-sdk-reference/src/components/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +71 -0
- package/templates/react-sdk-reference/src/components/template/SingleReferenceReadOnly/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/SubTabs.tsx +46 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/SubTabs/tabUtils.ts +185 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/TwoColumn.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumn/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +17 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.css +12 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +54 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/TwoColumn/TwoColumnTab/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/WideNarrow.tsx +37 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrow/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +96 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowDetails/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +19 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +22 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowForm/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +28 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/template/WideNarrow/WideNarrowPage/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.css +11 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/WssNavBar.tsx +160 -0
- package/templates/react-sdk-reference/src/components/template/WssNavBar/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/template/utils.tsx +58 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/AppAnnouncement.tsx +60 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/AppAnnouncement/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.css +95 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.tsx +541 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/Attachment.types.ts +96 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/AttachmentUtils.ts +316 -0
- package/templates/react-sdk-reference/src/components/widget/Attachment/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/CaseHistory.tsx +171 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/CaseHistory/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +13 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +32 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/ActionButtonsForFileUtil/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.css +118 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/FileUtility.tsx +653 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/FileUtility/FileUtility/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/Followers.tsx +43 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/Followers/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/QuickCreate.tsx +88 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/config-ext.json +9 -0
- package/templates/react-sdk-reference/src/components/widget/QuickCreate/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.css +76 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/SummaryItem.tsx +89 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryItem/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/SummaryList.tsx +23 -0
- package/templates/react-sdk-reference/src/components/widget/SummaryList/index.tsx +1 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.css +81 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/ToDo.tsx +507 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/config-ext.json +8 -0
- package/templates/react-sdk-reference/src/components/widget/ToDo/index.tsx +1 -0
- package/templates/react-sdk-reference/src/main.tsx +13 -0
- package/templates/react-sdk-reference/src/mui-theme-augmentation.d.ts +6 -0
- package/templates/react-sdk-reference/tsconfig.json +24 -0
- package/templates/react-sdk-reference/vite.config.ts +65 -0
- package/templates/wc-sdk-reference/.github/AGENTS.md +23 -0
- package/templates/wc-sdk-reference/.github/copilot-instructions.md +40 -0
- package/templates/wc-sdk-reference/.github/skills/pega-sdk-component.md +48 -0
- package/templates/wc-sdk-reference/index.html +21 -0
- package/templates/wc-sdk-reference/package.json +19 -0
- package/templates/wc-sdk-reference/sdk-config.json +19 -0
- package/templates/wc-sdk-reference/src/index.ts +98 -0
- package/templates/wc-sdk-reference/tsconfig.json +21 -0
- package/templates/wc-sdk-reference/vite.config.ts +8 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Skill: TextArea
|
|
2
|
+
|
|
3
|
+
Multi-line text input field that binds to a Pega case property.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, props interface, display modes, event handling, and registration patterns common to ALL field components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders an editable multi-line text area. Used for long-form text input such as descriptions, notes, or comments. Similar to `TextInput` but allows multiple lines with configurable min/max rows.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `TextArea`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Text` (multi-line)
|
|
17
|
+
- **Registration key:** `TextArea` (in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Description |
|
|
22
|
+
|------|------|-------------|
|
|
23
|
+
| `fieldMetadata` | `any` (optional) | Metadata object; used to read `maxLength` for the textarea |
|
|
24
|
+
|
|
25
|
+
All other props come from `PConnFieldProps`. Import type as:
|
|
26
|
+
```typescript
|
|
27
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Behavioral Contract
|
|
31
|
+
|
|
32
|
+
1. **Local state:** Maintain `inputValue` in local state (string). Initialize to `''`.
|
|
33
|
+
2. **Sync from store:** `useEffect` watching `value` prop — call `setInputValue(value)` whenever `value` changes.
|
|
34
|
+
3. **On change:** Update local `inputValue` state only (do NOT commit to store on every keystroke).
|
|
35
|
+
4. **On blur:** Commit to store by calling `handleEvent(actions, 'changeNblur', propName, inputValue)`.
|
|
36
|
+
5. **Read-only:** Set `readOnly` attribute on the textarea; use visually borderless ("standard") variant. Omit `onBlur` handler: `onBlur={!readOnly ? handleBlur : undefined}`.
|
|
37
|
+
6. **maxLength:** Read from `fieldMetadata?.maxLength`; pass to the textarea's `maxLength` attribute.
|
|
38
|
+
7. **Row sizing:** Fixed at `minRows={5}` and `maxRows={5}` — the textarea does not auto-expand; it shows a scrollbar if content exceeds 5 rows.
|
|
39
|
+
|
|
40
|
+
## Display Mode Rendering
|
|
41
|
+
|
|
42
|
+
- **`DISPLAY_ONLY`:** Render `<FieldValueList name={hideLabel ? '' : label} value={value} />`.
|
|
43
|
+
- **`STACKED_LARGE_VAL`:** Render `<FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />`.
|
|
44
|
+
- Both modes short-circuit before interactive rendering.
|
|
45
|
+
|
|
46
|
+
## Read-Only Rendering
|
|
47
|
+
|
|
48
|
+
Set `readOnly` on the textarea element (NOT a read-only version via `TextInput` — preserves the multiline appearance). Switch to a flat/borderless visual style. The `minRows`/`maxRows` constraint is still applied in read-only.
|
|
49
|
+
|
|
50
|
+
## Visual Specifications
|
|
51
|
+
|
|
52
|
+
Derived from the reference component's MUI props:
|
|
53
|
+
|
|
54
|
+
| Property | Standard (editable) | Read-only |
|
|
55
|
+
|----------|---------------------|-----------|
|
|
56
|
+
| Width | 100% | 100% |
|
|
57
|
+
| Min rows | 5 | 5 |
|
|
58
|
+
| Max rows | 5 (scrollable beyond) | 5 |
|
|
59
|
+
| Border | 1px solid (outlined) | None (standard/flat) |
|
|
60
|
+
| Border radius | 4px | — |
|
|
61
|
+
| Label | Floating label | Floating label |
|
|
62
|
+
| Helper text | Below textarea | Below textarea |
|
|
63
|
+
| Error state | Red border + red helper text | — |
|
|
64
|
+
| Resize | Vertical resize handle (browser default) | Same |
|
|
65
|
+
| Font size | 0.875rem | 0.875rem |
|
|
66
|
+
| Padding | 8px 14px | — |
|
|
67
|
+
|
|
68
|
+
**CSS-only implementation notes:**
|
|
69
|
+
- `textarea { min-height: calc(5 * 1.4375em + 16px); max-height: calc(5 * 1.4375em + 16px); overflow-y: auto; resize: vertical; }`
|
|
70
|
+
- Error: `border-color: #d32f2f`
|
|
71
|
+
- Read-only: `border: none; background: transparent;`
|
|
72
|
+
|
|
73
|
+
## Edge Cases & Special Logic
|
|
74
|
+
|
|
75
|
+
- Unlike `TextInput`, do NOT delegate to `TextInput` in read-only mode — render the textarea directly with `readOnly` set, so the multi-line appearance is preserved.
|
|
76
|
+
- `maxLength` is optional; only apply the attribute if `fieldMetadata?.maxLength` is defined.
|
|
77
|
+
|
|
78
|
+
## Dependencies
|
|
79
|
+
|
|
80
|
+
- `handleEvent` from `../../helpers/event-utils`
|
|
81
|
+
- `getComponentFromRegistry('FieldValueList')` for display modes
|
|
82
|
+
- No third-party UI libraries required
|
|
83
|
+
|
|
84
|
+
## Design System Mapping
|
|
85
|
+
|
|
86
|
+
**UI control type:** Multi-line text input (`<textarea>`).
|
|
87
|
+
|
|
88
|
+
Listed design systems are examples only.
|
|
89
|
+
|
|
90
|
+
| Design System | Recommended Component |
|
|
91
|
+
|---|---|
|
|
92
|
+
| Default (CSS only) | `<textarea rows="5">` with floating label |
|
|
93
|
+
| MUI | `<TextField multiline minRows={5} maxRows={5} />` |
|
|
94
|
+
| Ant Design | `<Input.TextArea rows={5} />` |
|
|
95
|
+
| Chakra UI | `<Textarea />` |
|
|
96
|
+
| Shadcn/ui | `<Textarea />` |
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Skill: TextContent
|
|
2
|
+
|
|
3
|
+
Static text display component that renders formatted text content (paragraph or heading). Non-interactive — no form binding.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, props interface, display modes, event handling, and registration patterns common to ALL field components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Displays static, read-only text content. Used to embed headings or descriptive paragraph text within forms or views. Not an input field — does NOT bind to a case property value and does NOT use `PConnFieldProps`. It renders purely based on static configuration props.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `TextContent`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Text`
|
|
17
|
+
- **Registration key:** `TextContent` (in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
Extends `PConnProps` (NOT `PConnFieldProps` — there is no form value binding):
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
25
|
+
|
|
26
|
+
interface TextContentProps extends PConnProps {
|
|
27
|
+
content: string;
|
|
28
|
+
displayAs: 'Paragraph' | 'Heading 1' | 'Heading 2' | 'Heading 3' | 'Heading 4';
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Description |
|
|
33
|
+
|------|------|-------------|
|
|
34
|
+
| `content` | `string` | The text string to render |
|
|
35
|
+
| `displayAs` | `'Paragraph' \| 'Heading 1' \| 'Heading 2' \| 'Heading 3' \| 'Heading 4'` | How to render the text — maps to typography level |
|
|
36
|
+
|
|
37
|
+
## Behavioral Contract
|
|
38
|
+
|
|
39
|
+
1. **No state, no effects** — purely presentational. Render `content` using the appropriate typography element for `displayAs`.
|
|
40
|
+
2. **Mapping:**
|
|
41
|
+
- `'Paragraph'` → `<p>` / body text
|
|
42
|
+
- `'Heading 1'` → `<h1>`
|
|
43
|
+
- `'Heading 2'` → `<h2>`
|
|
44
|
+
- `'Heading 3'` → `<h3>`
|
|
45
|
+
- `'Heading 4'` → `<h4>`
|
|
46
|
+
3. **Fallthrough:** Log an error for unrecognized `displayAs` values and render nothing (or a default fallback).
|
|
47
|
+
|
|
48
|
+
## Display Mode Rendering
|
|
49
|
+
|
|
50
|
+
Not applicable — this component is display-only by nature. It does not accept a `displayMode` prop.
|
|
51
|
+
|
|
52
|
+
## Read-Only Rendering
|
|
53
|
+
|
|
54
|
+
Always read-only — there is no editable state.
|
|
55
|
+
|
|
56
|
+
## Visual Specifications
|
|
57
|
+
|
|
58
|
+
Derived from standard HTML typography:
|
|
59
|
+
|
|
60
|
+
| `displayAs` | Element | Font size | Font weight |
|
|
61
|
+
|-------------|---------|-----------|-------------|
|
|
62
|
+
| `Paragraph` | `<p>` / `body1` | 1rem (16px) | 400 |
|
|
63
|
+
| `Heading 1` | `<h1>` | 2.5rem | 300 |
|
|
64
|
+
| `Heading 2` | `<h2>` | 2rem | 300 |
|
|
65
|
+
| `Heading 3` | `<h3>` | 1.75rem | 400 |
|
|
66
|
+
| `Heading 4` | `<h4>` | 1.5rem | 400 |
|
|
67
|
+
|
|
68
|
+
Color inherits from the surrounding text color. No padding, margin, border, or background beyond what the browser/design-system applies to the heading element.
|
|
69
|
+
|
|
70
|
+
**CSS-only implementation notes:**
|
|
71
|
+
```css
|
|
72
|
+
.text-content-h1 { font-size: 2.5rem; font-weight: 300; }
|
|
73
|
+
.text-content-h2 { font-size: 2rem; font-weight: 300; }
|
|
74
|
+
.text-content-h3 { font-size: 1.75rem; font-weight: 400; }
|
|
75
|
+
.text-content-h4 { font-size: 1.5rem; font-weight: 400; }
|
|
76
|
+
.text-content-body { font-size: 1rem; font-weight: 400; }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Edge Cases & Special Logic
|
|
80
|
+
|
|
81
|
+
- Unrecognized `displayAs` values should trigger a `console.error` and fall back to body text.
|
|
82
|
+
- No `handleEvent`, no store interaction, no `useEffect`.
|
|
83
|
+
|
|
84
|
+
## Dependencies
|
|
85
|
+
|
|
86
|
+
- No event utilities needed
|
|
87
|
+
- No `FieldValueList` needed
|
|
88
|
+
- Only a typography rendering element
|
|
89
|
+
|
|
90
|
+
## Design System Mapping
|
|
91
|
+
|
|
92
|
+
**UI control type:** Static typography / text block.
|
|
93
|
+
|
|
94
|
+
Listed design systems are examples only.
|
|
95
|
+
|
|
96
|
+
| Design System | Recommended Component |
|
|
97
|
+
|---|---|
|
|
98
|
+
| Default (CSS only) | Native `<h1>`–`<h4>` or `<p>` |
|
|
99
|
+
| MUI | `<Typography variant='h1' \| 'h2' \| 'h3' \| 'h4' \| 'body1'>` |
|
|
100
|
+
| Ant Design | `<Typography.Title level={1-4}>` or `<Typography.Text>` |
|
|
101
|
+
| Chakra UI | `<Heading as='h1'-'h4'>` or `<Text>` |
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Skill: TextInput
|
|
2
|
+
|
|
3
|
+
Single-line text input field that binds to a Pega case property.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, props interface, display modes, event handling, and registration patterns common to ALL field components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders a single-line editable text field. It is the simplest and most foundational field component — used directly for free-text string properties and also delegated to by other components (e.g., `Email`, `URL`, `Date` in read-only mode).
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `TextInput`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Text`
|
|
17
|
+
- **Registration key:** `TextInput` (in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Description |
|
|
22
|
+
|------|------|-------------|
|
|
23
|
+
| `fieldMetadata` | `any` (optional) | Metadata object; used to read `maxLength` for the input |
|
|
24
|
+
|
|
25
|
+
All other props come from `PConnFieldProps`. Import type as:
|
|
26
|
+
```typescript
|
|
27
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Behavioral Contract
|
|
31
|
+
|
|
32
|
+
1. **Local state:** Maintain `inputValue` in local state (string). Initialize to `value` prop (`''` default).
|
|
33
|
+
2. **Sync from store:** `useEffect` watching `value` prop — call `setInputValue(value)` whenever `value` changes.
|
|
34
|
+
3. **On change:** Update local `inputValue` state only (do NOT commit to store on every keystroke).
|
|
35
|
+
4. **On blur:** Commit to store by calling `handleEvent(actions, 'changeNblur', propName, inputValue)`.
|
|
36
|
+
5. **Read-only:** Render input with `readOnly` attribute set; use a visually borderless ("standard") variant. Do NOT skip the blur handler when readOnly — simply omit it (`onBlur={!readOnly ? handleBlur : undefined}`).
|
|
37
|
+
6. **maxLength:** Read from `fieldMetadata?.maxLength`; pass to the underlying input's `maxLength` attribute.
|
|
38
|
+
7. **testId:** Pass as `data-test-id` attribute on the underlying `<input>` element.
|
|
39
|
+
|
|
40
|
+
## Display Mode Rendering
|
|
41
|
+
|
|
42
|
+
- **`DISPLAY_ONLY`:** Render `<FieldValueList name={hideLabel ? '' : label} value={value} />` — display raw string value, no formatting.
|
|
43
|
+
- **`STACKED_LARGE_VAL`:** Render `<FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />`.
|
|
44
|
+
- Both modes use `value` prop directly (not local state).
|
|
45
|
+
- Both modes short-circuit before any interactive rendering.
|
|
46
|
+
|
|
47
|
+
## Read-Only Rendering
|
|
48
|
+
|
|
49
|
+
Set the `readOnly` attribute on the underlying input element. Use a visually flat/borderless style (no border box). The editable `outlined` variant switches to a `standard` (no outline) variant when read-only.
|
|
50
|
+
|
|
51
|
+
## Visual Specifications
|
|
52
|
+
|
|
53
|
+
Derived from the reference component's MUI props and styles:
|
|
54
|
+
|
|
55
|
+
| Property | Standard (editable) | Read-only |
|
|
56
|
+
|----------|---------------------|-----------|
|
|
57
|
+
| Width | 100% of container | 100% of container |
|
|
58
|
+
| Height / size | Small (`height ~40px`) | Small |
|
|
59
|
+
| Border | 1px solid (outlined) | None (standard variant) |
|
|
60
|
+
| Border radius | 4px | — |
|
|
61
|
+
| Label | Floating label (above input when focused/filled) | Floating label |
|
|
62
|
+
| Helper text | Shown below input | Shown below input |
|
|
63
|
+
| Error state | Red border + red helper text | — |
|
|
64
|
+
| Disabled | Reduced opacity (~0.38), not-allowed cursor | — |
|
|
65
|
+
| Padding (input) | 8px 14px | — |
|
|
66
|
+
| Font size | 0.875rem (14px) | 0.875rem |
|
|
67
|
+
|
|
68
|
+
**CSS-only implementation notes:**
|
|
69
|
+
- Floating label: use `<label>` positioned absolutely, translate upward on `:focus-within` or when input has value.
|
|
70
|
+
- Error state: add `.error` class → border-color: `#d32f2f`; helper text color: `#d32f2f`.
|
|
71
|
+
- Outlined box shadow on focus: `0 0 0 2px rgba(25, 118, 210, 0.2)`.
|
|
72
|
+
|
|
73
|
+
## Edge Cases & Special Logic
|
|
74
|
+
|
|
75
|
+
- If `value` prop is `undefined`, default to `''` to keep the input controlled.
|
|
76
|
+
- If `readOnly` is true, the `onBlur` handler must be omitted — do not commit on blur for read-only.
|
|
77
|
+
- `maxLength` is optional; only apply the attribute if `fieldMetadata?.maxLength` is defined.
|
|
78
|
+
|
|
79
|
+
## Dependencies
|
|
80
|
+
|
|
81
|
+
- `handleEvent` from `../../helpers/event-utils` — for committing value to store.
|
|
82
|
+
- `getComponentFromRegistry('FieldValueList')` — for display modes.
|
|
83
|
+
- No third-party UI libraries required beyond a basic text input element.
|
|
84
|
+
|
|
85
|
+
## Design System Mapping
|
|
86
|
+
|
|
87
|
+
**UI control type:** Single-line text input (`<input type="text">`).
|
|
88
|
+
|
|
89
|
+
Listed design systems are examples only.
|
|
90
|
+
|
|
91
|
+
| Design System | Recommended Component |
|
|
92
|
+
|---|---|
|
|
93
|
+
| Default (CSS only) | `<input type="text">` with floating label pattern |
|
|
94
|
+
| MUI | `<TextField variant='outlined' size='small' fullWidth />` |
|
|
95
|
+
| Ant Design | `<Input />` |
|
|
96
|
+
| Chakra UI | `<Input />` |
|
|
97
|
+
| Shadcn/ui | `<Input />` |
|
|
98
|
+
|
|
99
|
+
When implementing in a specific design system, map the following behaviors:
|
|
100
|
+
- `error={status === 'error'}` → error/danger variant
|
|
101
|
+
- `helperText` → helper/description slot below the input
|
|
102
|
+
- `label` → field label (floating or static depending on design system)
|
|
103
|
+
- `disabled` → disabled prop
|
|
104
|
+
- `required` → required/asterisk indicator
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Skill: Time
|
|
2
|
+
|
|
3
|
+
Time picker field with 5-minute step increments, binds to a Pega case property.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, props interface, display modes, event handling, and registration patterns common to ALL field components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders a time-only picker. Stores time as `HH:mm:ss` string. Displays time in 12-hour (`hh:mm a`) format. Uses `minutesStep={5}` for the picker. Delegates read-only rendering to `TextInput`.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `Time`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Time`
|
|
17
|
+
- **Registration key:** `Time` (in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
No props beyond `PConnFieldProps`. Import type as:
|
|
22
|
+
```typescript
|
|
23
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Behavioral Contract
|
|
27
|
+
|
|
28
|
+
1. **Value format stored/committed:** `HH:mm:ss` (24-hour, e.g., `'14:30:00'`).
|
|
29
|
+
2. **Value parsed for display:** Split the `HH:mm:ss` string into `[hours, minutes, seconds]` and construct a time object. Use the date library: `dayjs().hour(hours).minute(minutes)`.
|
|
30
|
+
3. **Local state:** No explicit local state for the time value — the picker's controlled `value` is derived from `props.value` directly on each render.
|
|
31
|
+
4. **On change:**
|
|
32
|
+
- If date is valid: `theValue = date.format('HH:mm:ss')`, else `theValue = null`.
|
|
33
|
+
- Commit immediately via `handleEvent(actions, 'changeNblur', propName, theValue)`.
|
|
34
|
+
5. **Display format:** `'hh:mm a'` (12-hour with am/pm) in the picker UI.
|
|
35
|
+
6. **Placeholder:** `'hh:mm am'`.
|
|
36
|
+
7. **Minutes step:** 5 minutes.
|
|
37
|
+
8. **Read-only:** Delegate to `TextInput`: `return <TextInput {...props} />`.
|
|
38
|
+
|
|
39
|
+
## Display Mode Rendering
|
|
40
|
+
|
|
41
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={value} />` — raw time string, no extra formatting.
|
|
42
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />`.
|
|
43
|
+
|
|
44
|
+
## Read-Only Rendering
|
|
45
|
+
|
|
46
|
+
Delegate to `TextInput`: `return <TextInput {...props} />`.
|
|
47
|
+
|
|
48
|
+
## Visual Specifications
|
|
49
|
+
|
|
50
|
+
| Property | Value |
|
|
51
|
+
|----------|-------|
|
|
52
|
+
| Width | Auto (time picker natural width) |
|
|
53
|
+
| Size | Small |
|
|
54
|
+
| Variant | Outlined |
|
|
55
|
+
| Format | `hh:mm a` (12-hour) |
|
|
56
|
+
| Placeholder | `hh:mm am` |
|
|
57
|
+
| Minutes step | 5 |
|
|
58
|
+
| Error state | Red border + red helper text |
|
|
59
|
+
|
|
60
|
+
**Note on known issue:** Keyboard input in the minute field may jump to the am/pm field after one digit — same as DateTime, this is a known date picker library quirk.
|
|
61
|
+
|
|
62
|
+
## Edge Cases & Special Logic
|
|
63
|
+
|
|
64
|
+
- **Null/empty value:** When `value` is empty or `Object.keys(value).length === 0`, set `timeValue = null` — do NOT try to parse an empty object.
|
|
65
|
+
- **Value parsing:** Split by `:` and convert each part to a number before constructing the time object.
|
|
66
|
+
- **Commits on change** (picker selection), not on blur.
|
|
67
|
+
- If `date.isValid()` is false (user clears the time), commit `null`.
|
|
68
|
+
|
|
69
|
+
## Dependencies
|
|
70
|
+
|
|
71
|
+
- Date manipulation library (e.g., `dayjs`) — for time parsing and `format('HH:mm:ss')`.
|
|
72
|
+
- Time picker UI component (e.g., `@mui/x-date-pickers/TimePicker`).
|
|
73
|
+
- `handleEvent` from `../../helpers/event-utils`.
|
|
74
|
+
- `getComponentFromRegistry('TextInput')` for read-only.
|
|
75
|
+
- `getComponentFromRegistry('FieldValueList')` for display modes.
|
|
76
|
+
|
|
77
|
+
## Design System Mapping
|
|
78
|
+
|
|
79
|
+
**UI control type:** Time picker (clock popup or input with am/pm selector).
|
|
80
|
+
|
|
81
|
+
Listed design systems are examples only.
|
|
82
|
+
|
|
83
|
+
| Design System | Recommended Component |
|
|
84
|
+
|---|---|
|
|
85
|
+
| Default (CSS only) | `<input type="time">` (24h, no am/pm) |
|
|
86
|
+
| MUI | `<TimePicker minutesStep={5} format='hh:mm a' />` |
|
|
87
|
+
| Ant Design | `<TimePicker format="hh:mm a" minuteStep={5} />` |
|
|
88
|
+
| Chakra UI | Third-party time picker |
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Skill: URL
|
|
2
|
+
|
|
3
|
+
URL input field with browser-native URL validation, binds to a Pega case property.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, props interface, display modes, event handling, and registration patterns common to ALL field components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders a single-line text input of type `url`. Provides browser-native URL format validation. Delegates read-only rendering to the `TextInput` component.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `URL`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Text-URL`
|
|
17
|
+
- **Registration key:** `URL` (mapped to `URLComponent` in `component-map.ts` — the component export is named `URLComponent` to avoid conflicts with the global `URL` API)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
No props beyond `PConnFieldProps`. Import type as:
|
|
22
|
+
```typescript
|
|
23
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> **Important naming note:** Export the component as `URLComponent` (not `URL`) to avoid conflicts with the browser's built-in `URL` global. Register it in `component-map.ts` as `URL: URLComponent`.
|
|
27
|
+
|
|
28
|
+
## Behavioral Contract
|
|
29
|
+
|
|
30
|
+
1. **Local state:** Maintain `inputValue` (string). Initialize from `value` prop (`''` default).
|
|
31
|
+
2. **Sync from store:** `useEffect` watching `value` → `setInputValue(value)`.
|
|
32
|
+
3. **On change:** Update local state only.
|
|
33
|
+
4. **On blur:** Commit via `handleEvent(actions, 'changeNblur', propName, inputValue)`.
|
|
34
|
+
5. **Input type:** Use `type='url'` for browser-native URL format hint/validation.
|
|
35
|
+
6. **Read-only:** Delegate entirely to `TextInput`: `return <TextInput {...props} />`.
|
|
36
|
+
|
|
37
|
+
## Display Mode Rendering
|
|
38
|
+
|
|
39
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={value} />` — raw URL string.
|
|
40
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />`.
|
|
41
|
+
|
|
42
|
+
## Read-Only Rendering
|
|
43
|
+
|
|
44
|
+
Delegate to `TextInput`: `return <TextInput {...props} />`.
|
|
45
|
+
|
|
46
|
+
## Visual Specifications
|
|
47
|
+
|
|
48
|
+
Identical to `TextInput` visually — no additional adornments.
|
|
49
|
+
|
|
50
|
+
| Property | Value |
|
|
51
|
+
|----------|-------|
|
|
52
|
+
| Width | 100% |
|
|
53
|
+
| Size | Small (~40px height) |
|
|
54
|
+
| Variant | Outlined |
|
|
55
|
+
| Border | 1px solid outlined |
|
|
56
|
+
| Border radius | 4px |
|
|
57
|
+
| Error state | Red border + red helper text |
|
|
58
|
+
| Helper text | Below input |
|
|
59
|
+
|
|
60
|
+
No special icon or adornment — the only difference from `TextInput` is `type='url'`.
|
|
61
|
+
|
|
62
|
+
## Edge Cases & Special Logic
|
|
63
|
+
|
|
64
|
+
- The component is named `URLComponent` internally to avoid shadowing the global `URL` constructor. Register under the key `URL` in the component map.
|
|
65
|
+
- `type='url'` triggers browser tooltip/validation but Pega validation is the authoritative source.
|
|
66
|
+
- `onBlur` is only wired when `!readOnly`.
|
|
67
|
+
|
|
68
|
+
## Dependencies
|
|
69
|
+
|
|
70
|
+
- `handleEvent` from `../../helpers/event-utils`
|
|
71
|
+
- `getComponentFromRegistry('TextInput')` — for read-only delegation
|
|
72
|
+
- `getComponentFromRegistry('FieldValueList')` — for display modes
|
|
73
|
+
|
|
74
|
+
## Design System Mapping
|
|
75
|
+
|
|
76
|
+
**UI control type:** Single-line URL text input.
|
|
77
|
+
|
|
78
|
+
Listed design systems are examples only.
|
|
79
|
+
|
|
80
|
+
| Design System | Recommended Component |
|
|
81
|
+
|---|---|
|
|
82
|
+
| Default (CSS only) | `<input type="url">` |
|
|
83
|
+
| MUI | `<TextField type='url' />` |
|
|
84
|
+
| Ant Design | `<Input type="url" />` |
|
|
85
|
+
| Chakra UI | `<Input type="url" />` |
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Skill: UserReference
|
|
2
|
+
|
|
3
|
+
User picker field that renders as either a search box (AutoComplete) or a dropdown, populated from the Pega operators data page.
|
|
4
|
+
|
|
5
|
+
> **Prerequisite skill:** [`field-components.md`](../field-components.md) — covers architecture, props interface, display modes, event handling, and registration patterns common to ALL field components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Component Purpose
|
|
10
|
+
|
|
11
|
+
Renders a user selection field. Can display as a typeahead search box or a dropdown list of Pega users. Resolves user IDs to display names for read-only and display modes. Optimized with shallow comparison to avoid unnecessary re-renders.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `UserReference`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Text-UserReference`
|
|
17
|
+
- **Registration key:** `UserReference` (in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
> Extends `PConnProps` (NOT `PConnFieldProps` — field-specific props are defined manually):
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import type { PConnProps } from '@pega/sdk-react';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Description |
|
|
28
|
+
|------|------|---------|-------------|
|
|
29
|
+
| `displayAs` | `string` (optional) | `''` | `'Drop-down list'` or `'Search box'` — determines the input type |
|
|
30
|
+
| `displayMode` | `string` (optional) | `''` | `'DISPLAY_ONLY'` or `'STACKED_LARGE_VAL'` |
|
|
31
|
+
| `label` | `string` (optional) | `''` | Field label |
|
|
32
|
+
| `value` | `any` (optional) | `''` | Raw value from Pega store (may be a user object or string ID) |
|
|
33
|
+
| `testId` | `string` (optional) | `''` | Test identifier |
|
|
34
|
+
| `placeholder` | `string` (optional) | `''` | Placeholder text |
|
|
35
|
+
| `helperText` | `string` (optional) | `''` | Helper text |
|
|
36
|
+
| `disabled` | `boolean` (optional) | `false` | |
|
|
37
|
+
| `readOnly` | `boolean` (optional) | `false` | |
|
|
38
|
+
| `required` | `boolean` (optional) | `false` | |
|
|
39
|
+
| `validatemessage` | `string` (optional) | `''` | Validation error message |
|
|
40
|
+
| `showAsFormattedText` | `boolean` (optional) | `false` | When `true` in read-only mode, show formatted user name text |
|
|
41
|
+
| `additionalProps` | `object` (optional) | `{}` | Extra props forwarded to the child component |
|
|
42
|
+
| `hideLabel` | `boolean` (optional) | `false` | |
|
|
43
|
+
| `variant` | `string` (optional) | `'inline'` | Layout variant |
|
|
44
|
+
| `onChange` | `any` (optional) | — | Change handler (passed through to child) |
|
|
45
|
+
|
|
46
|
+
## Behavioral Contract
|
|
47
|
+
|
|
48
|
+
### User ID extraction
|
|
49
|
+
|
|
50
|
+
`getUserId(value)` — utility that extracts the user identifier from the value (which may be a plain string or a user object with an ID property).
|
|
51
|
+
|
|
52
|
+
### State
|
|
53
|
+
|
|
54
|
+
- `dropDownDataSource` (array): populated when `displayAs === 'Drop-down list'`
|
|
55
|
+
- `userName` (string): resolved display name for formatted text mode
|
|
56
|
+
|
|
57
|
+
### Mount effect: `useEffect([displayAs, readOnly, showAsFormattedText, value])`
|
|
58
|
+
|
|
59
|
+
**Case 1: `userId && readOnly && showAsFormattedText`**
|
|
60
|
+
- If `isUserNameAvailable(value)`: `setUserName(value.userName)` — username already in value object
|
|
61
|
+
- Else: call `PCore.getUserApi().getOperatorDetails(userId)` and extract `pyUserName` from response
|
|
62
|
+
|
|
63
|
+
**Case 2: `displayAs === 'Drop-down list'`**
|
|
64
|
+
- Call `PCore.getRestClient().invokeRestApi('getListData', { queryPayload: { dataViewName: OPERATORS_DP } })`
|
|
65
|
+
- Map results to `{key: pyUserIdentifier, value: pyUserName}` array
|
|
66
|
+
- `setDropDownDataSource(mapped)`
|
|
67
|
+
|
|
68
|
+
`OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP()` — the default operators data page name.
|
|
69
|
+
|
|
70
|
+
### Rendering decision tree
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
if displayMode === 'DISPLAY_ONLY' → FieldValueList(userName || '')
|
|
74
|
+
if displayMode === 'STACKED_LARGE_VAL' → FieldValueList(userName || '', variant='stacked')
|
|
75
|
+
if readOnly && showAsFormattedText && userId → formatted text label+body
|
|
76
|
+
else if displayAs === 'Search box' → AutoComplete component
|
|
77
|
+
else if displayAs === 'Drop-down list' → Dropdown component
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Subsection: Search box mode (`displayAs === 'Search box'`)
|
|
81
|
+
|
|
82
|
+
Render `AutoComplete` with hardcoded columns for operator search:
|
|
83
|
+
```typescript
|
|
84
|
+
columns = [
|
|
85
|
+
{ value: 'pyUserName', display: 'true', useForSearch: true, primary: 'true' },
|
|
86
|
+
{ value: 'pyUserIdentifier', setProperty: 'Associated property', key: 'true', display: 'true', secondary: 'true', useForSearch: 'true' }
|
|
87
|
+
]
|
|
88
|
+
```
|
|
89
|
+
Props: `datasource={OPERATORS_DP}`, `listType='datapage'`, `value={userId}`, plus label/placeholder/readOnly/disabled/required/helperText/validatemessage/hideLabel/onChange/additionalProps/testId.
|
|
90
|
+
|
|
91
|
+
### Subsection: Dropdown mode (`displayAs === 'Drop-down list'`)
|
|
92
|
+
|
|
93
|
+
Render `Dropdown` with:
|
|
94
|
+
- `datasource={dropDownDataSource}` (fetched user list)
|
|
95
|
+
- `listType='associated'`
|
|
96
|
+
- `value={userId}`
|
|
97
|
+
- Plus same field props as above
|
|
98
|
+
|
|
99
|
+
### Subsection: Formatted text read-only (`readOnly && showAsFormattedText && userId`)
|
|
100
|
+
|
|
101
|
+
Render a label + name display:
|
|
102
|
+
```html
|
|
103
|
+
<div>
|
|
104
|
+
<caption-text>{label}</caption-text>
|
|
105
|
+
<body-text>{userName}</body-text>
|
|
106
|
+
</div>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Re-render optimization
|
|
110
|
+
|
|
111
|
+
Export with `memo` using custom comparison `comparisonFn`:
|
|
112
|
+
```typescript
|
|
113
|
+
const comparisonFn = (prevProps, nextProps) =>
|
|
114
|
+
getUserId(prevProps.value) === getUserId(nextProps.value) &&
|
|
115
|
+
prevProps.validatemessage === nextProps.validatemessage &&
|
|
116
|
+
prevProps.required === nextProps.required &&
|
|
117
|
+
prevProps.disabled === nextProps.disabled &&
|
|
118
|
+
prevProps.readOnly === nextProps.readOnly
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`export default memo(UserReference, comparisonFn)`
|
|
122
|
+
|
|
123
|
+
## Display Mode Rendering
|
|
124
|
+
|
|
125
|
+
Uses resolved `userName` (not raw `value`):
|
|
126
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={userName || ''} />`
|
|
127
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={userName || ''} variant='stacked' />`
|
|
128
|
+
|
|
129
|
+
`userName` may still be empty string while the async `getOperatorDetails` call resolves — this is expected.
|
|
130
|
+
|
|
131
|
+
## Visual Specifications
|
|
132
|
+
|
|
133
|
+
The visual appearance is determined by the child component rendered:
|
|
134
|
+
- **Search box**: Same as `AutoComplete` — combobox input with outlined border, floating label
|
|
135
|
+
- **Dropdown**: Same as `Dropdown` — select field with outlined border, floating label
|
|
136
|
+
- **Formatted text read-only**:
|
|
137
|
+
|
|
138
|
+
| Property | Value |
|
|
139
|
+
|----------|-------|
|
|
140
|
+
| Label | Caption-size text (small, secondary color) above the name |
|
|
141
|
+
| Name | Body text (normal size) |
|
|
142
|
+
| Spacing | Standard form field spacing |
|
|
143
|
+
|
|
144
|
+
**CSS-only for formatted text:**
|
|
145
|
+
```css
|
|
146
|
+
.user-reference-label { font-size: 0.75rem; color: rgba(0,0,0,0.6); margin-bottom: 4px; }
|
|
147
|
+
.user-reference-name { font-size: 1rem; }
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Edge Cases & Special Logic
|
|
151
|
+
|
|
152
|
+
- **`getUserId`**: handles both plain string values and object values with an ID property.
|
|
153
|
+
- **`isUserNameAvailable`**: checks whether the value object already contains a `userName` property (avoiding unnecessary API call).
|
|
154
|
+
- **Async name resolution**: when `userName` is not available in the value object, a REST call is made. The component renders empty initially and updates when the call completes.
|
|
155
|
+
- **Drop-down source**: Users are fetched via REST API (`getListData`), not via a data page config — this is different from `AutoComplete`/`Dropdown` field patterns.
|
|
156
|
+
- **`onChange` prop** is passed through to the child component unchanged — it's the platform-wired handler.
|
|
157
|
+
|
|
158
|
+
## Dependencies
|
|
159
|
+
|
|
160
|
+
- `memo` from React.
|
|
161
|
+
- `getUserId`, `isUserNameAvailable` from `./UserReferenceUtils` (local utility).
|
|
162
|
+
- `getComponentFromRegistry('AutoComplete')` — for search box mode.
|
|
163
|
+
- `getComponentFromRegistry('Dropdown')` — for dropdown mode.
|
|
164
|
+
- `getComponentFromRegistry('FieldValueList')` — for display modes.
|
|
165
|
+
- `PCore.getUserApi().getOperatorDetails()` — for async user name resolution.
|
|
166
|
+
- `PCore.getRestClient().invokeRestApi('getListData', ...)` — for dropdown data source.
|
|
167
|
+
- `PCore.getEnvironmentInfo().getDefaultOperatorDP()` — for operators data page name.
|
|
168
|
+
|
|
169
|
+
## Design System Mapping
|
|
170
|
+
|
|
171
|
+
**UI control type:** User picker — delegates to AutoComplete or Dropdown for the actual input.
|
|
172
|
+
|
|
173
|
+
Listed design systems are examples only.
|
|
174
|
+
|
|
175
|
+
| Mode | Underlying control |
|
|
176
|
+
|------|--------------------|
|
|
177
|
+
| Search box | AutoComplete (combobox/typeahead) |
|
|
178
|
+
| Drop-down list | Dropdown (select) |
|
|
179
|
+
| Formatted text read-only | Label + text display |
|
|
180
|
+
| Display mode | FieldValueList |
|