@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,158 @@
|
|
|
1
|
+
# Skill: Checkbox
|
|
2
|
+
|
|
3
|
+
Checkbox field supporting single boolean toggle, multi-selection mode, and optional card-style variant.
|
|
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 one or more checkboxes. Supports three usage modes: (1) a single boolean checkbox, (2) a multi-select list of checkboxes bound to a reference list, and (3) a card-style selectable grid. Display mode shows the true/false label rather than the raw boolean.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `Checkbox`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Boolean`
|
|
17
|
+
- **Registration key:** `Checkbox` (mapped to `CheckboxComponent` import in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
> Note: `Checkbox` uses `Omit<PConnFieldProps, 'value'>` with its own `value?: boolean`. Import type as:
|
|
22
|
+
> ```typescript
|
|
23
|
+
> import type { PConnFieldProps } from '@pega/sdk-react';
|
|
24
|
+
> ```
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Description |
|
|
27
|
+
|------|------|-------------|
|
|
28
|
+
| `value` | `boolean` (optional) | Checked state for single-mode checkbox |
|
|
29
|
+
| `caption` | `string` (optional) | Label shown next to the single checkbox (not the group label) |
|
|
30
|
+
| `trueLabel` | `string` (optional) | Display text when `value` is `true` (used in display modes) |
|
|
31
|
+
| `falseLabel` | `string` (optional) | Display text when `value` is `false` (used in display modes) |
|
|
32
|
+
| `selectionMode` | `string` (optional) | `'multi'` — enables multi-selection mode from a datasource list |
|
|
33
|
+
| `datasource` | `any` (optional) | Options source for multi/card modes |
|
|
34
|
+
| `selectionKey` | `string` (optional) | The property path used as the key in selection list |
|
|
35
|
+
| `selectionList` | `any` (optional) | Property path for the reference list (multi mode) |
|
|
36
|
+
| `primaryField` | `string` | Primary display field for multi/card mode |
|
|
37
|
+
| `readonlyContextList` | `any` | Array of currently selected items (for multi/card read-only display) |
|
|
38
|
+
| `referenceList` | `string` | Reference list property path |
|
|
39
|
+
| `variant` | `string` (optional) | `'card'` — renders options as selectable card grid |
|
|
40
|
+
| `hideFieldLabels` | `boolean` | Hide field labels inside card variant |
|
|
41
|
+
| `additionalProps` | `any` | Extra props passed to card or checkbox |
|
|
42
|
+
| `imagePosition` | `string` | Card image position |
|
|
43
|
+
| `imageSize` | `string` | Card image size |
|
|
44
|
+
| `showImageDescription` | `string` | Whether to show image description |
|
|
45
|
+
| `renderMode` | `string` | `'ReadOnly'` — sets read-only mode alongside `readOnly` prop |
|
|
46
|
+
| `image` | `string` | Image field path for card variant |
|
|
47
|
+
|
|
48
|
+
## Behavioral Contract
|
|
49
|
+
|
|
50
|
+
### Common
|
|
51
|
+
|
|
52
|
+
1. **Read-only determination:** `readOnlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly`.
|
|
53
|
+
2. **Local state:** Maintain `checked` (boolean) from `value` prop. `useEffect` watching `value` → `setChecked(value)`.
|
|
54
|
+
3. **Reference list init:** On mount (`useEffect` watching `pConn`), if `referenceList.length > 0 && !readOnlyMode`, call `pConn.setReferenceList(selectionList)` and `updateNewInstuctions(pConn, selectionList)`.
|
|
55
|
+
|
|
56
|
+
### Variant: Single checkbox (default)
|
|
57
|
+
|
|
58
|
+
Render a single checkbox with:
|
|
59
|
+
- `checked={checked}`
|
|
60
|
+
- `onChange={!readOnly ? handleChange : undefined}`
|
|
61
|
+
- `onBlur={!readOnly ? handleBlur : undefined}`
|
|
62
|
+
- Label = `caption` (next to checkbox)
|
|
63
|
+
- Group label = `label` (above, hidden if `hideLabel`)
|
|
64
|
+
- **On change:** `handleEvent(actionsApi, 'changeNblur', propName, event.target.checked)` — passes boolean.
|
|
65
|
+
- **On blur:** `pConn.getValidationApi().validate(event.target.checked)`.
|
|
66
|
+
|
|
67
|
+
### Variant: Multi-select (`selectionMode === 'multi'`)
|
|
68
|
+
|
|
69
|
+
Render a list of checkboxes from `datasource.source`:
|
|
70
|
+
- Each option: `key` from `selectionKey` extraction, `text`/`value` as label.
|
|
71
|
+
- `checked` per option: `selectedvalues.some(data => data[dataField] === element.key)` where `dataField = selectionKey.split('.')[1]`.
|
|
72
|
+
- **On change per checkbox:**
|
|
73
|
+
- If checked: `insertInstruction(pConn, selectionList, selectionKey, primaryField, { id, primary })`.
|
|
74
|
+
- If unchecked: `deleteInstruction(pConn, selectionList, selectionKey, { id, primary })`.
|
|
75
|
+
- `pConn.clearErrorMessages({ property: selectionList, category: '', context: '' })`.
|
|
76
|
+
- Layout: vertical column (`display: flex, flexDirection: column`).
|
|
77
|
+
|
|
78
|
+
### Variant: Card (`variant === 'card'`)
|
|
79
|
+
|
|
80
|
+
Render a heading (`<h4>`) + CSS Grid + `SelectableCard` component:
|
|
81
|
+
- Grid: `repeat(auto-fit, minmax(min(100%, 40ch), 1fr))`, `gridAutoRows: '1fr'`, `gap: '0.5rem'`.
|
|
82
|
+
- `SelectableCard` props:
|
|
83
|
+
- `type='checkbox'`
|
|
84
|
+
- `dataSource={datasource}`
|
|
85
|
+
- `readOnlyList={selectedvalues}` (for read-only display)
|
|
86
|
+
- `readOnly={renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly}`
|
|
87
|
+
- `recordKey={selectionKey?.split('.').pop()}`
|
|
88
|
+
- `cardLabel={primaryField.split('.').pop()}`
|
|
89
|
+
- `image` config from `imagePosition`, `imageSize`, `showImageDescription`, `image` props
|
|
90
|
+
- `showNoValue={(readOnlyMode) && selectedvalues.length === 0}`
|
|
91
|
+
- `onChange`: calls `handleCheckboxChange` on each item
|
|
92
|
+
- `onBlur`: `pConn.getValidationApi().validate(selectedvalues, selectionList)`
|
|
93
|
+
|
|
94
|
+
## Display Mode Rendering
|
|
95
|
+
|
|
96
|
+
Display mode uses `caption` (not `label`) and shows true/false label:
|
|
97
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} />`
|
|
98
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} variant='stacked' />`
|
|
99
|
+
|
|
100
|
+
## Read-Only Rendering
|
|
101
|
+
|
|
102
|
+
Single mode: Set `readOnly` on checkbox element; disable `onChange`/`onBlur`.
|
|
103
|
+
Multi/Card mode: `readOnlyMode` flag prevents `insertInstruction`/`deleteInstruction`; cards show `readOnlyList`.
|
|
104
|
+
|
|
105
|
+
## Visual Specifications
|
|
106
|
+
|
|
107
|
+
### Standard / Multi-select
|
|
108
|
+
|
|
109
|
+
| Property | Value |
|
|
110
|
+
|----------|-------|
|
|
111
|
+
| Checkbox size | Default (24px) |
|
|
112
|
+
| Label placement | End (right of checkbox) |
|
|
113
|
+
| Group label | `<legend>` above group, hidden if `hideLabel` |
|
|
114
|
+
| Layout | Single: single row. Multi: vertical column |
|
|
115
|
+
| Helper text | Below group |
|
|
116
|
+
| Error state | Red text/border on helper |
|
|
117
|
+
| Disabled/readOnly | Greyed out, pointer-events none |
|
|
118
|
+
|
|
119
|
+
**CSS-only:**
|
|
120
|
+
```css
|
|
121
|
+
.checkbox-group { display: flex; flex-direction: column; gap: 4px; }
|
|
122
|
+
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
|
|
123
|
+
input[type="checkbox"]:disabled { opacity: 0.38; }
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Card Variant
|
|
127
|
+
|
|
128
|
+
| Property | Value |
|
|
129
|
+
|----------|-------|
|
|
130
|
+
| Layout | CSS Grid `repeat(auto-fit, minmax(min(100%, 40ch), 1fr))`, row height equal (`1fr`), gap `0.5rem` |
|
|
131
|
+
| Heading | `<h4>` with `marginTop: 0, marginBottom: 0` |
|
|
132
|
+
|
|
133
|
+
## Edge Cases & Special Logic
|
|
134
|
+
|
|
135
|
+
- **`handleCheckboxChange`** (card mode): Finds the selected item from `datasource.source` by matching `item[recordKey] === e.target.id`, then calls `insertInstruction`/`deleteInstruction`.
|
|
136
|
+
- `updateNewInstuctions` is called on mount to sync reference list state.
|
|
137
|
+
- `clearErrorMessages` is called after every multi-select change.
|
|
138
|
+
- For card read-only: use `readOnlyList` prop populated from `selectedvalues`.
|
|
139
|
+
|
|
140
|
+
## Dependencies
|
|
141
|
+
|
|
142
|
+
- `insertInstruction`, `deleteInstruction`, `updateNewInstuctions` from `../../helpers/instructions-utils` — for multi-selection reference list management.
|
|
143
|
+
- `handleEvent` from `../../helpers/event-utils`.
|
|
144
|
+
- `getComponentFromRegistry('FieldValueList')` for display modes.
|
|
145
|
+
- `getComponentFromRegistry('SelectableCard')` for card variant.
|
|
146
|
+
|
|
147
|
+
## Design System Mapping
|
|
148
|
+
|
|
149
|
+
**UI control type:** Single or multi-select checkbox (boolean or list).
|
|
150
|
+
|
|
151
|
+
Listed design systems are examples only.
|
|
152
|
+
|
|
153
|
+
| Design System | Recommended Component |
|
|
154
|
+
|---|---|
|
|
155
|
+
| Default (CSS only) | `<input type="checkbox">` with `<label>` |
|
|
156
|
+
| MUI | `<Checkbox>` in `<FormControlLabel>`, `<FormGroup>` |
|
|
157
|
+
| Ant Design | `<Checkbox>` / `<Checkbox.Group>` |
|
|
158
|
+
| Chakra UI | `<Checkbox>` / `<CheckboxGroup>` |
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Skill: Currency
|
|
2
|
+
|
|
3
|
+
Currency input field with locale-aware symbol, decimal separator, and thousands separator. Supports ISO currency codes.
|
|
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 numeric input formatted as a currency value. Displays the correct currency symbol, decimal separator, and thousands separator for the given ISO currency code. Uses a numeric formatting library to handle locale-aware input. Shows formatted read-only values in display modes.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `Currency`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Decimal-Currency`
|
|
17
|
+
- **Registration key:** `Currency` (in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
|------|------|---------|-------------|
|
|
23
|
+
| `currencyISOCode` | `string` (optional) | `'USD'` | ISO 4217 currency code (e.g., `'USD'`, `'EUR'`, `'GBP'`) |
|
|
24
|
+
| `allowDecimals` | `boolean` | — | Whether to allow decimal input. If `false`, `decimalScale=0`. If `true`, fixed 2 decimal places shown. |
|
|
25
|
+
|
|
26
|
+
All other props from `PConnFieldProps`. Import type as:
|
|
27
|
+
```typescript
|
|
28
|
+
import type { PConnFieldProps } from '@pega/sdk-react';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Behavioral Contract
|
|
32
|
+
|
|
33
|
+
1. **Local state:** Maintain `values` (string). Initialize from `value.toString()`.
|
|
34
|
+
2. **Sync from store:** `useEffect` watching `value` → `setValues(value.toString())`.
|
|
35
|
+
3. **Currency symbols:** Derive the currency symbol, decimal indicator, and digit group separator from the `currencyISOCode` using locale-aware lookup:
|
|
36
|
+
- Call locale-aware currency formatter for the ISO code to determine: `theCurrencySymbol`, `theDecimalIndicator`, `theDigitGroupSeparator`.
|
|
37
|
+
- Default: `$`, `.`, `,` (USD/en-US).
|
|
38
|
+
4. **Numeric format config:**
|
|
39
|
+
- `prefix`: the currency symbol
|
|
40
|
+
- `decimalSeparator`: `theDecimalIndicator`
|
|
41
|
+
- `thousandSeparator`: `theDigitGroupSeparator`
|
|
42
|
+
- `decimalScale`: `allowDecimals !== false ? 2 : 0`
|
|
43
|
+
- `fixedDecimalScale`: `allowDecimals` — forces exactly 2 decimal places when `true`
|
|
44
|
+
- `valueIsNumericString`: `true`
|
|
45
|
+
5. **On value change:** Update local `values` state with the raw numeric string (from the numeric format library's callback).
|
|
46
|
+
6. **On blur:** Commit via `handleEvent(actions, 'changeNblur', propName, values)`.
|
|
47
|
+
7. **Read-only:** Set `readOnly: true` on the input. Visual style switches to flat/borderless. The formatted display value (from `format()` helper) is shown rather than raw numeric.
|
|
48
|
+
|
|
49
|
+
## Display Mode Rendering
|
|
50
|
+
|
|
51
|
+
Format the value before display using a currency formatter with `currencyISOCode`:
|
|
52
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedValue} />` where `formattedValue = format(value, 'currency', currencyOptions)`.
|
|
53
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />`.
|
|
54
|
+
|
|
55
|
+
The `formattedValue` uses the locale and currency from `currencyISOCode` to produce a localized string (e.g., `$1,234.56`).
|
|
56
|
+
|
|
57
|
+
## Read-Only Rendering
|
|
58
|
+
|
|
59
|
+
Keep the numeric format input but set `readOnly: true` on the input element. Switch the visual variant to flat/borderless. The `onBlur` handler is omitted (`onBlur={!readOnly ? currOnBlur : undefined}`).
|
|
60
|
+
|
|
61
|
+
## Visual Specifications
|
|
62
|
+
|
|
63
|
+
| Property | Standard (editable) | Read-only |
|
|
64
|
+
|----------|---------------------|-----------|
|
|
65
|
+
| Width | 100% | 100% |
|
|
66
|
+
| Size | Small | Small |
|
|
67
|
+
| Variant | Outlined | Standard (flat) |
|
|
68
|
+
| Prefix | Currency symbol (e.g., `$`) | Currency symbol |
|
|
69
|
+
| Alignment | Left-aligned text | Left-aligned |
|
|
70
|
+
| Decimal places | 2 (when `allowDecimals`) | 2 |
|
|
71
|
+
| Error state | Red border + red helper text | — |
|
|
72
|
+
| Placeholder | From `placeholder` prop | — |
|
|
73
|
+
|
|
74
|
+
## Edge Cases & Special Logic
|
|
75
|
+
|
|
76
|
+
- **EUR uses `nl-NL` locale:** When `currencyISOCode === 'EUR'`, use NL locale for symbol/separator lookup.
|
|
77
|
+
- **Fallback:** If `currencyISOCode` lookup fails, fall back to USD (`$`, `.`, `,`).
|
|
78
|
+
- **`allowDecimals` vs `fixedDecimalScale`:** `fixedDecimalScale` is only applied when `allowDecimals` is explicitly `true`. It forces `decimalScale=2` and shows trailing zeros.
|
|
79
|
+
- The input stores the raw numeric string (e.g., `'1234.56'`) in state and in the Pega store — not the formatted display string.
|
|
80
|
+
- `data-test-id` is passed via `inputProps` on the inner input element.
|
|
81
|
+
|
|
82
|
+
## Dependencies
|
|
83
|
+
|
|
84
|
+
- A numeric formatting library (e.g., `react-number-format`'s `NumericFormat`) — handles locale-aware separators, prefix, and decimal scale.
|
|
85
|
+
- `format()` from `../../helpers/formatters` — for display mode value formatting.
|
|
86
|
+
- `getCurrencyCharacters(currencyISOCode)` — returns `{ theCurrencySymbol, theDecimalIndicator, theDigitGroupSeparator }`.
|
|
87
|
+
- `getCurrencyOptions(currencyISOCode)` — returns `{ locale, style: 'currency', currency }` for the `format()` call.
|
|
88
|
+
- `handleEvent` from `../../helpers/event-utils`.
|
|
89
|
+
- `getComponentFromRegistry('FieldValueList')` for display modes.
|
|
90
|
+
|
|
91
|
+
**For CSS-only / design-system-agnostic implementations:**
|
|
92
|
+
- The numeric format library handles the input masking. Use any numeric format library that supports prefix, decimal separator, and thousands separator configuration.
|
|
93
|
+
- Alternatively, implement manually: on change, strip non-numeric chars, insert separators, prepend symbol.
|
|
94
|
+
|
|
95
|
+
## Design System Mapping
|
|
96
|
+
|
|
97
|
+
**UI control type:** Currency / numeric formatted input with prefix symbol.
|
|
98
|
+
|
|
99
|
+
Listed design systems are examples only.
|
|
100
|
+
|
|
101
|
+
| Design System | Recommended Component |
|
|
102
|
+
|---|---|
|
|
103
|
+
| Default (CSS only) | `<input type="text">` + custom numeric formatting logic |
|
|
104
|
+
| MUI | `NumericFormat` (from `react-number-format`) with `customInput={TextField}` |
|
|
105
|
+
| Ant Design | `<InputNumber prefix="$" precision={2} />` |
|
|
106
|
+
| Chakra UI | `<NumberInput>` + custom formatting |
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Skill: Date
|
|
2
|
+
|
|
3
|
+
Date picker field with locale-aware date format string, 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 date picker input. Stores dates as `YYYY-MM-DD` strings. Displays dates according to locale-aware format (e.g., `MM/DD/YYYY` for en-US). Uses a date picker library for the calendar UI. Delegates read-only rendering to `TextInput`.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `Date`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Date`
|
|
17
|
+
- **Registration key:** `Date` (mapped to `DateField` import in `component-map.ts` to avoid conflicts with the JS `Date` global)
|
|
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:** The component file exports a function named `Date`. In `component-map.ts`, import it as `DateField` and register it as `Date: DateField`.
|
|
27
|
+
|
|
28
|
+
## Behavioral Contract
|
|
29
|
+
|
|
30
|
+
1. **Local state:** Maintain `dateValue` as a date object (e.g., a `dayjs` object or `Date` instance), initialized from `value` prop using the date library's parser. Default to `null` if value is empty/falsy.
|
|
31
|
+
2. **Sync from store:** `useEffect` watching `value` → re-parse and `setDateValue(dayjs(value))`.
|
|
32
|
+
3. **Date format:** Get locale-aware format string via `getDateFormatInfo()`:
|
|
33
|
+
- Returns `dateFormatString` (display format, e.g., `'MM/DD/YYYY'`), `dateFormatStringLC` (lowercase for placeholder, e.g., `'mm/dd/yyyy'`), `dateFormatMask`.
|
|
34
|
+
- Start from `dateFormatInfoDefault` and override with locale-specific values.
|
|
35
|
+
4. **On change (valid date selected):**
|
|
36
|
+
- Validate the date is valid (e.g., `date.isValid()`).
|
|
37
|
+
- Format to `YYYY-MM-DD` string: `${year}-${(month+1).padStart(2,'0')}-${day.padStart(2,'0')}`.
|
|
38
|
+
- Commit immediately via `handleEvent(actions, 'changeNblur', propName, formattedDate)`.
|
|
39
|
+
- Update local `dateValue` state.
|
|
40
|
+
5. **Invalid dates:** If `date.isValid()` is false, do NOT commit — ignore the change.
|
|
41
|
+
6. **Read-only:** Delegate to `TextInput`: `return <TextInput {...props} />`.
|
|
42
|
+
7. **Placeholder:** Use lowercase format string (e.g., `'mm/dd/yyyy'`).
|
|
43
|
+
|
|
44
|
+
## Display Mode Rendering
|
|
45
|
+
|
|
46
|
+
Format the value before display using `format(value, 'date', { format: dateFormatInfo.dateFormatString })`:
|
|
47
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedDate} />`.
|
|
48
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedDate} variant='stacked' />`.
|
|
49
|
+
- Both modes compute `formattedDate` from the raw `props.value` (not local state).
|
|
50
|
+
|
|
51
|
+
## Read-Only Rendering
|
|
52
|
+
|
|
53
|
+
Delegate to `TextInput`: `return <TextInput {...props} />`. The raw `YYYY-MM-DD` string is displayed as-is (or formatted by `TextInput`'s read-only rendering).
|
|
54
|
+
|
|
55
|
+
## Visual Specifications
|
|
56
|
+
|
|
57
|
+
| Property | Value |
|
|
58
|
+
|----------|-------|
|
|
59
|
+
| Width | Auto (date picker natural width) |
|
|
60
|
+
| Size | Small |
|
|
61
|
+
| Variant | Outlined |
|
|
62
|
+
| Placeholder | Lowercase format string (e.g., `mm/dd/yyyy`) |
|
|
63
|
+
| Calendar popup | Opens below the input |
|
|
64
|
+
| Error state | Red border + red helper text |
|
|
65
|
+
| Required indicator | `*` on label |
|
|
66
|
+
| Format display | Locale-aware (e.g., `MM/DD/YYYY`, `DD/MM/YYYY`) |
|
|
67
|
+
|
|
68
|
+
**CSS-only notes:** For a CSS-only date input, use `<input type="date">` — note that the display format is browser-controlled. A custom date picker component is needed for locale-aware format strings.
|
|
69
|
+
|
|
70
|
+
## Edge Cases & Special Logic
|
|
71
|
+
|
|
72
|
+
- Commit on **change** (when a valid date is selected), not on blur — this differs from text inputs.
|
|
73
|
+
- Always store value as `YYYY-MM-DD` regardless of display format.
|
|
74
|
+
- Invalid/incomplete dates (e.g., partially typed) are ignored — only commit when `isValid()` returns true.
|
|
75
|
+
- Locale format info is derived at render time from `getDateFormatInfo()` — this reads the Pega environment locale.
|
|
76
|
+
|
|
77
|
+
## Dependencies
|
|
78
|
+
|
|
79
|
+
- Date manipulation library (e.g., `dayjs`) — for parsing, formatting, validity checking.
|
|
80
|
+
- Date picker UI component (e.g., `@mui/x-date-pickers/DatePicker`) — for calendar popup.
|
|
81
|
+
- `getDateFormatInfo()` from `../../helpers/date-format-utils` — for locale-aware format string.
|
|
82
|
+
- `dateFormatInfoDefault` from same helper — default fallback.
|
|
83
|
+
- `format()` from `../../helpers/formatters` — for display mode formatting.
|
|
84
|
+
- `handleEvent` from `../../helpers/event-utils`.
|
|
85
|
+
- `getComponentFromRegistry('TextInput')` for read-only delegation.
|
|
86
|
+
- `getComponentFromRegistry('FieldValueList')` for display modes.
|
|
87
|
+
|
|
88
|
+
## Design System Mapping
|
|
89
|
+
|
|
90
|
+
**UI control type:** Date picker with calendar popup.
|
|
91
|
+
|
|
92
|
+
Listed design systems are examples only.
|
|
93
|
+
|
|
94
|
+
| Design System | Recommended Component |
|
|
95
|
+
|---|---|
|
|
96
|
+
| Default (CSS only) | `<input type="date">` (browser native, limited locale control) |
|
|
97
|
+
| MUI | `<DatePicker />` from `@mui/x-date-pickers` with `dayjs` adapter |
|
|
98
|
+
| Ant Design | `<DatePicker format="MM/DD/YYYY" />` |
|
|
99
|
+
| Chakra UI | Third-party date picker or `<input type="date">` |
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Skill: DateTime
|
|
2
|
+
|
|
3
|
+
Date and time picker with timezone conversion, 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 combined date and time picker. Stores values as ISO 8601 UTC strings. Converts to/from the Pega environment's configured timezone for display. Shows formatted date-time in display modes. Delegates read-only rendering to `TextInput` with a formatted string.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `DateTime`
|
|
16
|
+
- **Type / Subtype:** `Field` / `DateTime`
|
|
17
|
+
- **Registration key:** `DateTime` (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. **Timezone:** Read the environment timezone at render time:
|
|
29
|
+
```
|
|
30
|
+
const timezone = PCore.getEnvironmentInfo().getTimeZone()
|
|
31
|
+
```
|
|
32
|
+
2. **Local state:** Maintain `dateValue` as a timezone-aware date object. Initialize from `value` prop by converting to the environment timezone using `DateFormatter.convertToTimezone(value, { timezone })`.
|
|
33
|
+
3. **Sync from store:** `useEffect` watching `value` → re-convert and `setDateValue(dayjs(DateFormatter.convertToTimezone(value, { timezone })))`.
|
|
34
|
+
4. **Date/time format:** Get locale-aware format from `getDateFormatInfo()`. Combined format: `${dateFormatString} hh:mm a` (e.g., `'MM/DD/YYYY hh:mm a'`). Placeholder: `${dateFormatStringLC} hh:mm a`.
|
|
35
|
+
5. **Minutes step:** `minutesStep={5}` — time picker snaps to 5-minute increments.
|
|
36
|
+
6. **On change:**
|
|
37
|
+
- Convert the selected date to timezone-aware ISO string:
|
|
38
|
+
```
|
|
39
|
+
const timeZoneDateTime = dayjs.tz(date.format('YYYY-MM-DDTHH:mm:ss'), timezone)
|
|
40
|
+
const changeValue = timeZoneDateTime?.isValid() ? timeZoneDateTime.toISOString() : ''
|
|
41
|
+
```
|
|
42
|
+
- Commit immediately via `handleEvent(actions, 'changeNblur', propName, changeValue)`.
|
|
43
|
+
- Update local `dateValue`.
|
|
44
|
+
7. **Read-only:** Format value as string using `format(value, 'datetime')`, then delegate: `return <TextInput {...props} value={formattedDateTime} />`.
|
|
45
|
+
|
|
46
|
+
## Display Mode Rendering
|
|
47
|
+
|
|
48
|
+
Format using `format(value, 'datetime', { format: \`${dateFormatString} hh:mm a\` })`:
|
|
49
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} />`.
|
|
50
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedDateTime} variant='stacked' />`.
|
|
51
|
+
|
|
52
|
+
## Read-Only Rendering
|
|
53
|
+
|
|
54
|
+
Format value as `format(props.value, 'datetime')` then pass to `TextInput`:
|
|
55
|
+
```
|
|
56
|
+
return <TextInput {...props} value={formattedDateTime} />
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Visual Specifications
|
|
60
|
+
|
|
61
|
+
| Property | Value |
|
|
62
|
+
|----------|-------|
|
|
63
|
+
| Width | Auto |
|
|
64
|
+
| Size | Small |
|
|
65
|
+
| Variant | Outlined |
|
|
66
|
+
| Format | `MM/DD/YYYY hh:mm a` (locale-aware date + 12h time) |
|
|
67
|
+
| Placeholder | Lowercase format, e.g., `mm/dd/yyyy hh:mm a` |
|
|
68
|
+
| Minutes step | 5 minutes |
|
|
69
|
+
| Error state | Red border + red helper text |
|
|
70
|
+
|
|
71
|
+
**Note on known issue:** Keyboard input in the minute field may jump to the am/pm field after one digit — this is a known quirk of some date-time picker library versions.
|
|
72
|
+
|
|
73
|
+
## Edge Cases & Special Logic
|
|
74
|
+
|
|
75
|
+
- All stored values are **UTC ISO 8601 strings** (e.g., `'2024-03-15T14:30:00.000Z'`).
|
|
76
|
+
- **Timezone conversion** is critical: always convert from UTC → environment timezone for display, and from environment timezone → UTC when committing.
|
|
77
|
+
- If `timeZoneDateTime.isValid()` is false, commit an empty string `''`.
|
|
78
|
+
- Commits on **change** (picker selection), not on blur.
|
|
79
|
+
- `dayjs.tz` requires `dayjs-timezone` plugin.
|
|
80
|
+
|
|
81
|
+
## Dependencies
|
|
82
|
+
|
|
83
|
+
- Date manipulation library with timezone support (e.g., `dayjs` + `dayjs/plugin/timezone`).
|
|
84
|
+
- `DateFormatter.convertToTimezone(value, { timezone })` from `../../helpers/formatters/Date` — converts stored UTC value to display timezone.
|
|
85
|
+
- `format()` from `../../helpers/formatters` — for display mode formatting.
|
|
86
|
+
- `getDateFormatInfo()` from `../../helpers/date-format-utils` — for locale date format string.
|
|
87
|
+
- Date-time picker UI component (e.g., `@mui/x-date-pickers/DateTimePicker`).
|
|
88
|
+
- `handleEvent` from `../../helpers/event-utils`.
|
|
89
|
+
- `getComponentFromRegistry('TextInput')` for read-only.
|
|
90
|
+
- `getComponentFromRegistry('FieldValueList')` for display modes.
|
|
91
|
+
|
|
92
|
+
## Design System Mapping
|
|
93
|
+
|
|
94
|
+
**UI control type:** Combined date and time picker with timezone awareness.
|
|
95
|
+
|
|
96
|
+
Listed design systems are examples only.
|
|
97
|
+
|
|
98
|
+
| Design System | Recommended Component |
|
|
99
|
+
|---|---|
|
|
100
|
+
| Default (CSS only) | `<input type="datetime-local">` (no timezone control) |
|
|
101
|
+
| MUI | `<DateTimePicker />` from `@mui/x-date-pickers` + `dayjs.tz` |
|
|
102
|
+
| Ant Design | `<DatePicker showTime />` |
|
|
103
|
+
| Chakra UI | Third-party datetime picker |
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Skill: Decimal
|
|
2
|
+
|
|
3
|
+
Decimal number input with configurable precision, group separators, and optional currency/percentage display formatting.
|
|
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 numeric input that accepts decimal values. Supports configurable decimal precision, optional thousands separator, and optional formatter override (`'Currency'` or `'Percentage'`). Differs from `Currency` in that it's more generic — it can display values as currency, percentage, or plain decimal based on a `formatter` prop.
|
|
12
|
+
|
|
13
|
+
## Pega Metadata
|
|
14
|
+
|
|
15
|
+
- **Pega Name:** `Decimal`
|
|
16
|
+
- **Type / Subtype:** `Field` / `Decimal`
|
|
17
|
+
- **Registration key:** `Decimal` (in `component-map.ts`)
|
|
18
|
+
|
|
19
|
+
## Props (component-specific)
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Description |
|
|
22
|
+
|------|------|---------|-------------|
|
|
23
|
+
| `currencyISOCode` | `string` (optional) | `'USD'` | ISO code for symbol/separator lookup (used when `formatter === 'Currency'`) |
|
|
24
|
+
| `decimalPrecision` | `number` (optional) | — | Number of decimal places to show |
|
|
25
|
+
| `showGroupSeparators` | `boolean` (optional) | — | Whether to show thousands separators |
|
|
26
|
+
| `formatter` | `string` (optional) | — | `'Currency'` or `'Percentage'` — changes display mode formatting and read-only prefix/suffix |
|
|
27
|
+
|
|
28
|
+
## Behavioral Contract
|
|
29
|
+
|
|
30
|
+
1. **Local state:** Maintain `values` (string). Initialize from `value.toString()`.
|
|
31
|
+
2. **Sync from store:** `useEffect` watching `value` → `setValues(value.toString())`.
|
|
32
|
+
3. **Separators:** Always derive `decimalSeparator` and `thousandSeparator` from locale lookup using `currencyISOCode`. Apply `thousandSeparator` only when `showGroupSeparators` is `true`.
|
|
33
|
+
4. **Decimal scale:** Use `decimalPrecision` prop for `decimalScale` — except in read-only mode with `formatter === 'Currency'`, where `decimalScale` is `undefined`.
|
|
34
|
+
5. **Prefix/Suffix in read-only:**
|
|
35
|
+
- If `readOnly && formatter === 'Currency'`: show currency symbol as prefix.
|
|
36
|
+
- If `readOnly && formatter === 'Percentage'`: show `%` as suffix.
|
|
37
|
+
- Otherwise: no prefix/suffix.
|
|
38
|
+
6. **Formatted display value:**
|
|
39
|
+
- If `formatter === 'Currency'`: `formattedValue = format(value, 'currency', currencyOptions)`.
|
|
40
|
+
- Otherwise: `formattedValue = format(value, 'decimal', currencyOptions)`.
|
|
41
|
+
7. **On value change:** Update local `values` state with the raw numeric string.
|
|
42
|
+
8. **On blur:** Commit via `handleEvent(actions, 'changeNblur', propName, values)`.
|
|
43
|
+
9. **Read-only:** Set `readOnly: true` on the input. Visual style switches to flat/borderless. `onBlur` omitted.
|
|
44
|
+
|
|
45
|
+
## Display Mode Rendering
|
|
46
|
+
|
|
47
|
+
- **`DISPLAY_ONLY`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedValue} />`.
|
|
48
|
+
- **`STACKED_LARGE_VAL`:** `<FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />`.
|
|
49
|
+
|
|
50
|
+
`formattedValue` is computed before display-mode check:
|
|
51
|
+
- `formatter === 'Currency'` → currency-formatted string.
|
|
52
|
+
- Otherwise → decimal-formatted string using `pConn.getComponentName()?.toLowerCase()` as format key.
|
|
53
|
+
|
|
54
|
+
## Read-Only Rendering
|
|
55
|
+
|
|
56
|
+
Keep numeric format input with `readOnly: true`. Apply prefix (`$`) or suffix (`%`) based on `formatter`. Flat/borderless visual style.
|
|
57
|
+
|
|
58
|
+
## Visual Specifications
|
|
59
|
+
|
|
60
|
+
| Property | Standard (editable) | Read-only |
|
|
61
|
+
|----------|---------------------|-----------|
|
|
62
|
+
| Width | 100% | 100% |
|
|
63
|
+
| Size | Small | Small |
|
|
64
|
+
| Variant | Outlined | Standard (flat) |
|
|
65
|
+
| Prefix | None (unless read-only Currency) | Currency symbol if `formatter='Currency'` |
|
|
66
|
+
| Suffix | None (unless read-only Percentage) | `%` if `formatter='Percentage'` |
|
|
67
|
+
| Thousands separator | Only when `showGroupSeparators=true` | Same |
|
|
68
|
+
| Decimal scale | From `decimalPrecision` | Undefined for Currency, `decimalPrecision` otherwise |
|
|
69
|
+
| Placeholder | From `placeholder` prop | — |
|
|
70
|
+
|
|
71
|
+
## Edge Cases & Special Logic
|
|
72
|
+
|
|
73
|
+
- In read-only Currency mode, `decimalScale` is set to `undefined` (let the formatter decide), not `decimalPrecision`.
|
|
74
|
+
- `thousandSeparator` defaults to `''` (disabled) unless `showGroupSeparators` is `true`.
|
|
75
|
+
- `prefix` and `suffix` are only rendered in read-only mode — NOT in editable mode.
|
|
76
|
+
- The stored value is always a raw numeric string, not the formatted display string.
|
|
77
|
+
|
|
78
|
+
## Dependencies
|
|
79
|
+
|
|
80
|
+
- Numeric formatting library (e.g., `react-number-format`'s `NumericFormat`).
|
|
81
|
+
- `getCurrencyCharacters(currencyISOCode)` — for `theDecimalIndicator` and `theDigitGroupSeparator`.
|
|
82
|
+
- `getCurrencyOptions(currencyISOCode)` — for `format()` options.
|
|
83
|
+
- `format()` from `../../helpers/formatters`.
|
|
84
|
+
- `handleEvent` from `../../helpers/event-utils`.
|
|
85
|
+
- `getComponentFromRegistry('FieldValueList')` for display modes.
|
|
86
|
+
|
|
87
|
+
## Design System Mapping
|
|
88
|
+
|
|
89
|
+
**UI control type:** Decimal / numeric formatted input.
|
|
90
|
+
|
|
91
|
+
Listed design systems are examples only.
|
|
92
|
+
|
|
93
|
+
| Design System | Recommended Component |
|
|
94
|
+
|---|---|
|
|
95
|
+
| Default (CSS only) | `<input type="text">` with custom numeric masking |
|
|
96
|
+
| MUI | `NumericFormat` with `customInput={TextField}` |
|
|
97
|
+
| Ant Design | `<InputNumber precision={decimalPrecision} />` |
|
|
98
|
+
| Chakra UI | `<NumberInput>` |
|