@salesforce/ui-bundle-template-feature-angular-search 0.0.0-stage → 12.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/README.md +75 -2
- package/dist/.forceignore +15 -0
- package/dist/.husky/pre-commit +4 -0
- package/dist/.prettierignore +11 -0
- package/dist/.prettierrc +17 -0
- package/dist/CHANGELOG.md +5375 -0
- package/dist/README.md +83 -0
- package/dist/config/project-scratch-def.json +13 -0
- package/dist/eslint.config.js +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.postcssrc.json +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.prettierignore +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/.prettierrc +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/CHANGELOG.md +4 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/README.md +85 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/angular.json +98 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/components.json +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/e2e/app.spec.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/esbuild/api-version.mjs +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/esbuild/graphql-codegen.mjs +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/eslint-plugin-angular-graphql.js +148 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/eslint.config.js +77 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/feature-angular-search.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/middleware/html.mjs +3 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/middleware/proxy.mjs +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/package.json +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/playwright.config.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/public/favicon.ico +0 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/scripts/get-graphql-schema.mjs +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/scripts/rewrite-e2e-assets.mjs +30 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/api/data-client.service.spec.ts +184 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/api/data-client.service.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.config.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.html +1 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.routes.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.spec.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/app.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/layout/app-layout/app-layout.html +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/layout/app-layout/app-layout.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/alert/alert.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/alert/alert.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/button/button.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/button/button.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/card/card.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/collapsible/collapsible.html +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/collapsible/collapsible.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-picker/date-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-picker/date-picker.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dialog/dialog.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dialog/dialog.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field/field.html +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field/field.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field-appearance.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/field-size.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/icon/icon.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/input/input.html +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/input/input.ts +79 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/label/label.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/paginator/paginator.html +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/paginator/paginator.ts +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/paginator/types.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/popover/popover.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/popover/popover.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/select/select.html +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/select/select.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/separator/separator.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/skeleton/skeleton.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/components/ui/spinner/spinner.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/registry.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/sobject/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/sobject/parse-response.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/sobject/query-fragment.ts +169 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/adapters/types.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search-response.spec.ts +114 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search-response.ts +73 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search.service.spec.ts +124 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/api/search.service.ts +80 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/active-filters/active-filters.html +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/active-filters/active-filters.spec.ts +73 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/active-filters/active-filters.ts +77 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/default-filter-panel.html +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/default-filter-panel.ts +87 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/filter-box.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/filter-panel/filter-box.ts +39 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/global-search-box/global-search-box.html +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/global-search-box/global-search-box.ts +50 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/default-result-row.html +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/default-result-row.ts +91 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/merged-search-results.html +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/merged-search-results.ts +145 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/result-item.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/search-results.html +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/search-results.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/source-section.html +84 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/results/source-section.ts +146 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/scope/scope-selector.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/scope/scope-selector.ts +45 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search/search.html +55 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search/search.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search-bar/search-bar.html +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search-bar/search-bar.spec.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/search-bar/search-bar.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/sort-control/sort-control.html +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/sort-control/sort-control.spec.ts +67 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/components/sort-control/sort-control.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/constants.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/default-search-config.ts +83 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/directives/search-result-template/search-result-template.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/boolean-filter.html +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/boolean-filter.spec.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/boolean-filter.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-filter.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-filter.spec.ts +56 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-filter.ts +78 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-range-filter.html +43 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-range-filter.spec.ts +70 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/date-range-filter.ts +125 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-field-wrapper.html +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-field-wrapper.spec.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-field-wrapper.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-types.spec.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/filter-types.ts +64 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/multi-select-filter.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/multi-select-filter.spec.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/multi-select-filter.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/numeric-range-filter.html +32 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/numeric-range-filter.spec.ts +75 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/numeric-range-filter.ts +117 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/select-filter.html +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/select-filter.spec.ts +43 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/select-filter.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/text-filter.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/text-filter.spec.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/filters/text-filter.ts +70 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/index.ts +55 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/query/build-search-query.spec.ts +157 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/query/build-search-query.ts +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/filter-mapping.ts +48 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/search-state.service.spec.ts +293 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/search-state.service.ts +735 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/state/search-state.types.ts +48 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/filter.types.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/index.ts +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/scope.types.ts +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/search-config.types.ts +110 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/search-result.types.ts +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/types/sort.types.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/debounce.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/field-utils.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/filter-utils.spec.ts +335 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/filter-utils.ts +354 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/identifier.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/merge-utils.spec.ts +199 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/merge-utils.ts +177 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/scope-utils.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/sort-utils.ts +32 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/validate-config.spec.ts +48 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/features/search/utils/validate-config.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/home/home.html +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/home/home.spec.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/home/home.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/not-found/not-found.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/not-found/not-found.spec.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/not-found/not-found.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/search/search-page.html +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/pages/search/search-page.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert-action.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert-title.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/hlm-alert.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/alert/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/button/hlm-button.token.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/button/hlm-button.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/button/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-calendar.ts +189 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/calendar/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-action.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-avatar.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-footer.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-header.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card.token.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/hlm-card.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/card/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/collapsible/index.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/date-picker/index.ts +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/hlm-dialog.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dialog/index.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/dropdown-menu/index.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-description.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-error.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-group.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-legend.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-separator.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-set.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field-title.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/hlm-field.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/field/index.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input/hlm-input.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/hlm-input-group.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/input-group/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/label/hlm-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/label/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/label/label.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/hlm-pagination.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/pagination/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-content.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/hlm-popover.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/popover/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-content.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-item.ts +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-label.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-multiple.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-placeholder.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-separator.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-trigger.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-value-template.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-value.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-values-content.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select-values.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/hlm-select.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/select/index.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/separator/hlm-separator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/separator/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/skeleton/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/spinner/hlm-spinner.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/spinner/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/utils/hlm.ts +313 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/utils/index.ts +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/app/utils/async-data.ts +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/index.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/main.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/styles.css +139 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/src/types/sf-globals.d.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/tsconfig.app.json +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/tsconfig.json +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/tsconfig.spec.json +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-search/ui-bundle.json +7 -0
- package/dist/jest.config.js +6 -0
- package/dist/package-lock.json +12554 -0
- package/dist/package.json +46 -0
- package/dist/scripts/apex/hello.apex +10 -0
- package/dist/scripts/gitignore-templates.json +4 -0
- package/dist/scripts/graphql-search.sh +191 -0
- package/dist/scripts/network-senders.mjs +84 -0
- package/dist/scripts/org-setup-config-schema.mjs +132 -0
- package/dist/scripts/org-setup-dev.mjs +114 -0
- package/dist/scripts/org-setup-url.mjs +108 -0
- package/dist/scripts/org-setup-utils.mjs +569 -0
- package/dist/scripts/org-setup-xml.mjs +283 -0
- package/dist/scripts/org-setup.config.json +5 -0
- package/dist/scripts/org-setup.mjs +2545 -0
- package/dist/scripts/sf-project-setup.mjs +103 -0
- package/dist/scripts/soql/account.soql +6 -0
- package/dist/scripts/validate-org-setup-config.mjs +38 -0
- package/dist/sfdx-project.json +12 -0
- package/package.json +43 -4
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component, input, model } from '@angular/core';
|
|
7
|
+
import { HlmPopoverImports } from '@spartan-ng/styles/popover';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-popover',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
imports: [HlmPopoverImports],
|
|
13
|
+
templateUrl: './popover.html',
|
|
14
|
+
})
|
|
15
|
+
export class PopoverComponent {
|
|
16
|
+
readonly open = model<boolean>(false);
|
|
17
|
+
readonly align = input<'start' | 'center' | 'end'>('start');
|
|
18
|
+
readonly sideOffset = input<number>(4);
|
|
19
|
+
// The wrapper owns the single real trigger `<button>` (so callers project
|
|
20
|
+
// plain content, never a nested button); these style/label it.
|
|
21
|
+
readonly triggerClass = input<string>('');
|
|
22
|
+
readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });
|
|
23
|
+
|
|
24
|
+
toggle(): void {
|
|
25
|
+
this.open.set(!this.open());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
close(): void {
|
|
29
|
+
this.open.set(false);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
protected onStateChanged(state: 'open' | 'closed'): void {
|
|
33
|
+
this.open.set(state === 'open');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const PopoverImports = [PopoverComponent] as const;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@if (label()) {
|
|
2
|
+
<label hlmLabel [for]="labelId" class="mb-1.5 block">{{ label() }}</label>
|
|
3
|
+
}
|
|
4
|
+
@if (!multiple()) {
|
|
5
|
+
<hlm-select
|
|
6
|
+
[value]="value()"
|
|
7
|
+
(valueChange)="onSingleChange($event)"
|
|
8
|
+
[disabled]="disabled()"
|
|
9
|
+
[itemToString]="itemToString"
|
|
10
|
+
>
|
|
11
|
+
<hlm-select-trigger [buttonId]="labelId" [size]="size()" [class]="triggerClasses()">
|
|
12
|
+
<hlm-select-value [placeholder]="placeholder()" />
|
|
13
|
+
</hlm-select-trigger>
|
|
14
|
+
<hlm-select-content *hlmSelectPortal>
|
|
15
|
+
@for (option of options(); track option.value) {
|
|
16
|
+
<hlm-select-item [value]="option.value">{{ option.label }}</hlm-select-item>
|
|
17
|
+
}
|
|
18
|
+
</hlm-select-content>
|
|
19
|
+
</hlm-select>
|
|
20
|
+
} @else {
|
|
21
|
+
<hlm-select-multiple
|
|
22
|
+
[value]="$any(values())"
|
|
23
|
+
(valueChange)="onMultiChange($event)"
|
|
24
|
+
[disabled]="disabled()"
|
|
25
|
+
[itemToString]="itemToString"
|
|
26
|
+
>
|
|
27
|
+
<hlm-select-trigger [buttonId]="labelId" [size]="size()" [class]="triggerClasses()">
|
|
28
|
+
<hlm-select-value [placeholder]="placeholder()" />
|
|
29
|
+
</hlm-select-trigger>
|
|
30
|
+
<hlm-select-content *hlmSelectPortal>
|
|
31
|
+
@for (option of options(); track option.value) {
|
|
32
|
+
<hlm-select-item [value]="option.value">{{ option.label }}</hlm-select-item>
|
|
33
|
+
}
|
|
34
|
+
</hlm-select-content>
|
|
35
|
+
</hlm-select-multiple>
|
|
36
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import {
|
|
7
|
+
ChangeDetectionStrategy,
|
|
8
|
+
Component,
|
|
9
|
+
booleanAttribute,
|
|
10
|
+
computed,
|
|
11
|
+
input,
|
|
12
|
+
model,
|
|
13
|
+
} from '@angular/core';
|
|
14
|
+
import { HlmSelectImports } from '@spartan-ng/styles/select';
|
|
15
|
+
import { HlmLabelImports } from '@spartan-ng/styles/label';
|
|
16
|
+
import type { AppFieldSize } from '../field-size';
|
|
17
|
+
import type { AppFieldAppearance } from '../field-appearance';
|
|
18
|
+
|
|
19
|
+
export interface AppSelectOption {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-select',
|
|
26
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
27
|
+
imports: [HlmSelectImports, HlmLabelImports],
|
|
28
|
+
host: { class: 'block min-w-0' },
|
|
29
|
+
templateUrl: './select.html',
|
|
30
|
+
})
|
|
31
|
+
export class SelectComponent {
|
|
32
|
+
readonly value = model<string>('');
|
|
33
|
+
readonly values = model<readonly string[]>([]);
|
|
34
|
+
readonly multiple = input(false, { transform: booleanAttribute });
|
|
35
|
+
readonly options = input<readonly AppSelectOption[]>([]);
|
|
36
|
+
readonly placeholder = input<string>('');
|
|
37
|
+
readonly label = input<string>('');
|
|
38
|
+
readonly disabled = input(false, { transform: booleanAttribute });
|
|
39
|
+
readonly appearance = input<AppFieldAppearance>('outline');
|
|
40
|
+
readonly size = input<AppFieldSize>('default');
|
|
41
|
+
|
|
42
|
+
private static _uid = 0;
|
|
43
|
+
protected readonly labelId = `app-select-${SelectComponent._uid++}`;
|
|
44
|
+
|
|
45
|
+
protected readonly itemToString = (value: string): string => {
|
|
46
|
+
return this.options().find((o) => o.value === value)?.label ?? value;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
protected readonly triggerClasses = computed(() => {
|
|
50
|
+
if (this.appearance() === 'fill') return 'border-transparent bg-muted';
|
|
51
|
+
return '';
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
protected onSingleChange(event: string | null | undefined): void {
|
|
55
|
+
this.value.set(event ?? '');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
protected onMultiChange(event: string[] | readonly string[] | null | undefined): void {
|
|
59
|
+
this.values.set(event ?? []);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const SelectImports = [SelectComponent] as const;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
7
|
+
import { BrnSeparator } from '@spartan-ng/brain/separator';
|
|
8
|
+
import { hlmSeparatorClass } from '@spartan-ng/styles/separator';
|
|
9
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
10
|
+
|
|
11
|
+
export type AppSeparatorOrientation = 'horizontal' | 'vertical';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'app-separator',
|
|
15
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
+
hostDirectives: [{ directive: BrnSeparator, inputs: ['orientation', 'decorative'] }],
|
|
17
|
+
host: {
|
|
18
|
+
'data-slot': 'separator',
|
|
19
|
+
},
|
|
20
|
+
template: '',
|
|
21
|
+
})
|
|
22
|
+
export class SeparatorComponent {
|
|
23
|
+
readonly orientation = input<AppSeparatorOrientation>('horizontal');
|
|
24
|
+
readonly decorative = input(true, { transform: booleanAttribute });
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
classes(() => hlmSeparatorClass);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const SeparatorImports = [SeparatorComponent] as const;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
7
|
+
import { HlmSkeleton } from '@spartan-ng/styles/skeleton';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-skeleton',
|
|
11
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
+
hostDirectives: [HlmSkeleton],
|
|
13
|
+
host: {
|
|
14
|
+
'aria-hidden': 'true',
|
|
15
|
+
},
|
|
16
|
+
template: '<ng-content />',
|
|
17
|
+
})
|
|
18
|
+
export class SkeletonComponent {}
|
|
19
|
+
|
|
20
|
+
export const SkeletonImports = [SkeletonComponent] as const;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
7
|
+
import { HlmSpinnerImports } from '@spartan-ng/styles/spinner';
|
|
8
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'app-spinner',
|
|
12
|
+
imports: [HlmSpinnerImports],
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
host: {
|
|
15
|
+
role: 'status',
|
|
16
|
+
'[attr.aria-label]': 'ariaLabel()',
|
|
17
|
+
},
|
|
18
|
+
template: `<hlm-spinner />`,
|
|
19
|
+
})
|
|
20
|
+
export class SpinnerComponent {
|
|
21
|
+
public readonly ariaLabel = input<string>('Loading', { alias: 'aria-label' });
|
|
22
|
+
|
|
23
|
+
constructor() {
|
|
24
|
+
classes(() => 'text-[length:--spacing(4)]');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const SpinnerImports = [SpinnerComponent] as const;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Adapter registry, mapping a source `kind` to its runtime adapter. A new
|
|
9
|
+
* backend is added by extending the `SourceConfig` union and registering its
|
|
10
|
+
* adapter here.
|
|
11
|
+
*/
|
|
12
|
+
import type { SourceConfig } from "../types/search-config.types";
|
|
13
|
+
import type { SourceAdapter } from "./types";
|
|
14
|
+
import { sObjectAdapter } from "./sobject";
|
|
15
|
+
|
|
16
|
+
const REGISTRY: { [K in SourceConfig["kind"]]: SourceAdapter<Extract<SourceConfig, { kind: K }>> } =
|
|
17
|
+
{
|
|
18
|
+
sobject: sObjectAdapter,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** Returns the adapter registered for `kind`; throws on an unknown kind. */
|
|
22
|
+
export function getAdapter(kind: SourceConfig["kind"]): SourceAdapter {
|
|
23
|
+
const adapter = REGISTRY[kind];
|
|
24
|
+
if (!adapter) {
|
|
25
|
+
throw new Error(`No search adapter registered for source kind "${kind}".`);
|
|
26
|
+
}
|
|
27
|
+
return adapter as SourceAdapter;
|
|
28
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { SObjectSourceConfig } from "../../types/search-config.types";
|
|
8
|
+
import type { SourceAdapter } from "../types";
|
|
9
|
+
import { assertValidSObjectSource, buildSObjectFragment } from "./query-fragment";
|
|
10
|
+
import { parseSObjectResponse } from "./parse-response";
|
|
11
|
+
|
|
12
|
+
export const sObjectAdapter: SourceAdapter<SObjectSourceConfig> = {
|
|
13
|
+
kind: "sobject",
|
|
14
|
+
buildRequest: buildSObjectFragment,
|
|
15
|
+
parseResponse: parseSObjectResponse,
|
|
16
|
+
// SObject aliases live under uiapi.query.<key>
|
|
17
|
+
validateSource: assertValidSObjectSource,
|
|
18
|
+
errorPath: (request) => ["uiapi", "query", request.source.key],
|
|
19
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SObject response parser. Reads its subtree from `root.uiapi.query[source.key]`
|
|
9
|
+
* and returns `null` when the alias is absent (partial-failure leniency).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { SObjectSourceConfig } from "../../types/search-config.types";
|
|
13
|
+
import type { SourceRequest, SourceResult } from "../../types/search-result.types";
|
|
14
|
+
|
|
15
|
+
interface RawSourceResult {
|
|
16
|
+
edges?: Array<{ node?: unknown }> | null;
|
|
17
|
+
pageInfo?: {
|
|
18
|
+
hasNextPage?: boolean | null;
|
|
19
|
+
hasPreviousPage?: boolean | null;
|
|
20
|
+
startCursor?: string | null;
|
|
21
|
+
endCursor?: string | null;
|
|
22
|
+
} | null;
|
|
23
|
+
totalCount?: number | null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Maps `root.uiapi.query[source.key]` (an `edges`/`pageInfo`/`totalCount`
|
|
28
|
+
* subtree) to a {@link SourceResult}. Returns `null` when the alias is missing
|
|
29
|
+
* from the response (e.g. a partial GraphQL error blanked this source only).
|
|
30
|
+
*/
|
|
31
|
+
export function parseSObjectResponse(
|
|
32
|
+
root: Record<string, unknown>,
|
|
33
|
+
request: SourceRequest<SObjectSourceConfig>,
|
|
34
|
+
): SourceResult | null {
|
|
35
|
+
const queryRoot = (root?.["uiapi"] as Record<string, unknown> | undefined)?.["query"] as
|
|
36
|
+
Record<string, RawSourceResult | null | undefined> | undefined;
|
|
37
|
+
|
|
38
|
+
const raw = queryRoot?.[request.source.key];
|
|
39
|
+
if (raw == null) return null;
|
|
40
|
+
|
|
41
|
+
const nodes = (raw.edges ?? [])
|
|
42
|
+
.map((edge) => edge?.node)
|
|
43
|
+
.filter((node): node is unknown => node != null);
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
nodes,
|
|
47
|
+
pageInfo: raw.pageInfo
|
|
48
|
+
? {
|
|
49
|
+
hasNextPage: raw.pageInfo.hasNextPage ?? false,
|
|
50
|
+
hasPreviousPage: raw.pageInfo.hasPreviousPage ?? false,
|
|
51
|
+
startCursor: raw.pageInfo.startCursor ?? null,
|
|
52
|
+
endCursor: raw.pageInfo.endCursor ?? null,
|
|
53
|
+
}
|
|
54
|
+
: null,
|
|
55
|
+
totalCount: raw.totalCount ?? null,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SObject fragment builder. Emits one `QueryFragmentContribution` with
|
|
9
|
+
* `placement: "uiapi.query"`: the `${key}: ${objectName}(...) { ... }` selection,
|
|
10
|
+
* its 4 per-source variable declarations, and their 4 values.
|
|
11
|
+
*
|
|
12
|
+
* Selection sets are generated from `displayFields`:
|
|
13
|
+
* - string `"Name"` → `Name @optional { value displayValue }`
|
|
14
|
+
* - `{ name, raw: true }` → `Name`
|
|
15
|
+
* - `{ name, subfields }` → nested `Name @optional { ... }`
|
|
16
|
+
*
|
|
17
|
+
* The `idField` (default "Id") is always emitted; it is **not** wrapped
|
|
18
|
+
* because uiapi's Id is a scalar.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { buildFilter, buildGlobalQueryClause } from "../../utils/filter-utils";
|
|
22
|
+
import { assertValidIdentifier } from "../../utils/identifier";
|
|
23
|
+
import { buildOrderBy } from "../../utils/sort-utils";
|
|
24
|
+
import type { ActiveFilterValue } from "../../types/filter.types";
|
|
25
|
+
import type { DisplayField, SObjectSourceConfig } from "../../types/search-config.types";
|
|
26
|
+
import type { SourceRequest } from "../../types/search-result.types";
|
|
27
|
+
import type { QueryFragmentContribution } from "../types";
|
|
28
|
+
|
|
29
|
+
const KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
30
|
+
|
|
31
|
+
function assertValidKey(key: string): void {
|
|
32
|
+
if (key.startsWith("__")) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
`Invalid source key "${key}". Keys must not start with "__" (reserved by GraphQL).`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
if (!KEY_PATTERN.test(key)) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`Invalid source key "${key}". Must match /^[A-Za-z_][A-Za-z0-9_]*$/ to be a valid GraphQL alias and variable prefix.`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Combines a per-source structured-filter clause with the global-q `or` clause.
|
|
46
|
+
* Returns `undefined` when neither side has any constraints.
|
|
47
|
+
*/
|
|
48
|
+
function assertValidDisplayField(field: DisplayField): void {
|
|
49
|
+
if (typeof field === "string") {
|
|
50
|
+
assertValidIdentifier(field, "display field");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
assertValidIdentifier(field.name, "display field");
|
|
54
|
+
if ("subfields" in field) field.subfields.forEach(assertValidDisplayField);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Validates every config value that is interpolated into the query document
|
|
59
|
+
* (alias, object, field and type names). Throws on the first invalid one.
|
|
60
|
+
*/
|
|
61
|
+
export function assertValidSObjectSource(source: SObjectSourceConfig): void {
|
|
62
|
+
assertValidKey(source.key);
|
|
63
|
+
assertValidIdentifier(source.objectName, "objectName");
|
|
64
|
+
if (source.idField !== undefined) assertValidIdentifier(source.idField, "idField");
|
|
65
|
+
if (source.whereTypeName !== undefined) {
|
|
66
|
+
assertValidIdentifier(source.whereTypeName, "whereTypeName");
|
|
67
|
+
}
|
|
68
|
+
if (source.orderByTypeName !== undefined) {
|
|
69
|
+
assertValidIdentifier(source.orderByTypeName, "orderByTypeName");
|
|
70
|
+
}
|
|
71
|
+
source.displayFields.forEach(assertValidDisplayField);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function buildSourceWhere(
|
|
75
|
+
source: SObjectSourceConfig,
|
|
76
|
+
q: string,
|
|
77
|
+
filters: ActiveFilterValue[],
|
|
78
|
+
): unknown {
|
|
79
|
+
const clauses: unknown[] = [];
|
|
80
|
+
const globalClause = buildGlobalQueryClause(q, source.searchableFields);
|
|
81
|
+
if (globalClause) clauses.push(globalClause);
|
|
82
|
+
const structured = buildFilter(filters, source.filterBy ?? []);
|
|
83
|
+
if (structured) clauses.push(structured);
|
|
84
|
+
if (clauses.length === 0) return undefined;
|
|
85
|
+
if (clauses.length === 1) return clauses[0];
|
|
86
|
+
return { and: clauses };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function buildSelectionBody(source: SObjectSourceConfig): string {
|
|
90
|
+
const idField = source.idField ?? "Id";
|
|
91
|
+
const fieldLines = [` ${idField}`];
|
|
92
|
+
for (const field of source.displayFields) {
|
|
93
|
+
fieldLines.push(...renderField(field, " "));
|
|
94
|
+
}
|
|
95
|
+
return [
|
|
96
|
+
` edges { node {`,
|
|
97
|
+
...fieldLines,
|
|
98
|
+
` } }`,
|
|
99
|
+
` pageInfo { hasNextPage hasPreviousPage startCursor endCursor }`,
|
|
100
|
+
` totalCount`,
|
|
101
|
+
].join("\n");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function renderField(field: DisplayField, indentStr: string): string[] {
|
|
105
|
+
if (typeof field === "string") {
|
|
106
|
+
return [`${indentStr}${field} @optional { value displayValue }`];
|
|
107
|
+
}
|
|
108
|
+
if ("raw" in field) {
|
|
109
|
+
return [`${indentStr}${field.name}`];
|
|
110
|
+
}
|
|
111
|
+
const lines = [`${indentStr}${field.name} @optional {`];
|
|
112
|
+
for (const sub of field.subfields) {
|
|
113
|
+
lines.push(...renderField(sub, indentStr + " "));
|
|
114
|
+
}
|
|
115
|
+
lines.push(`${indentStr}}`);
|
|
116
|
+
return lines;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Builds one SObject source's `QueryFragmentContribution`.
|
|
121
|
+
*
|
|
122
|
+
* The fragment is the `${key}: ${objectName}(...) { … }` selection that lives
|
|
123
|
+
* inside `uiapi.query`; the 4 declarations/values are the per-source
|
|
124
|
+
* `first / after / where / orderBy` variables.
|
|
125
|
+
*/
|
|
126
|
+
export function buildSObjectFragment(
|
|
127
|
+
request: SourceRequest<SObjectSourceConfig>,
|
|
128
|
+
): QueryFragmentContribution {
|
|
129
|
+
const { source } = request;
|
|
130
|
+
assertValidSObjectSource(source);
|
|
131
|
+
|
|
132
|
+
const firstVar = `${source.key}_first`;
|
|
133
|
+
const afterVar = `${source.key}_after`;
|
|
134
|
+
const whereVar = `${source.key}_where`;
|
|
135
|
+
const orderByVar = `${source.key}_orderBy`;
|
|
136
|
+
const whereType = source.whereTypeName ?? `${source.objectName}_Filter`;
|
|
137
|
+
const orderByType = source.orderByTypeName ?? `${source.objectName}_OrderBy`;
|
|
138
|
+
|
|
139
|
+
const variableDeclarations = [
|
|
140
|
+
`$${firstVar}: Int`,
|
|
141
|
+
`$${afterVar}: String`,
|
|
142
|
+
`$${whereVar}: ${whereType}`,
|
|
143
|
+
`$${orderByVar}: ${orderByType}`,
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
const fragment =
|
|
147
|
+
`${source.key}: ${source.objectName}(` +
|
|
148
|
+
`first: $${firstVar}, ` +
|
|
149
|
+
`after: $${afterVar}, ` +
|
|
150
|
+
`where: $${whereVar}, ` +
|
|
151
|
+
`orderBy: $${orderByVar}` +
|
|
152
|
+
`) {\n` +
|
|
153
|
+
buildSelectionBody(source) +
|
|
154
|
+
`\n}`;
|
|
155
|
+
|
|
156
|
+
const variables: Record<string, unknown> = {
|
|
157
|
+
[firstVar]: request.pageSize,
|
|
158
|
+
[afterVar]: request.afterCursor ?? null,
|
|
159
|
+
[whereVar]: buildSourceWhere(source, request.q, request.filters) ?? null,
|
|
160
|
+
[orderByVar]: buildOrderBy(request.sort) ?? null,
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
variableDeclarations,
|
|
165
|
+
variables,
|
|
166
|
+
placement: "uiapi.query",
|
|
167
|
+
fragment,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Kind-agnostic adapter contracts for multi-source search. Every searchable
|
|
9
|
+
* backend is fronted by a {@link SourceAdapter}; the query builder and response
|
|
10
|
+
* parser dispatch to the adapter registered for a source's `kind`.
|
|
11
|
+
*/
|
|
12
|
+
import type { SourceConfig } from "../types/search-config.types";
|
|
13
|
+
import type { SourceRequest, SourceResult } from "../types/search-result.types";
|
|
14
|
+
|
|
15
|
+
/** One source's contribution to the combined GraphQL document. */
|
|
16
|
+
export interface QueryFragmentContribution {
|
|
17
|
+
/** GraphQL variable declarations, e.g. `"$accounts_first: Int"`. */
|
|
18
|
+
variableDeclarations: string[];
|
|
19
|
+
/** Values for the declared variables, keyed by (unprefixed) variable name. */
|
|
20
|
+
variables: Record<string, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Where the fragment is spliced into the combined document: inside the shared
|
|
23
|
+
* `uiapi { query { ... } }` block, or as a sibling of `uiapi` at the root.
|
|
24
|
+
*/
|
|
25
|
+
placement: "uiapi.query" | "root";
|
|
26
|
+
/** The GraphQL selection fragment (unindented; the builder indents it). */
|
|
27
|
+
fragment: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SourceAdapter<T extends SourceConfig = SourceConfig> {
|
|
31
|
+
readonly kind: T["kind"];
|
|
32
|
+
/** Build this source's fragment/variables contribution for the combined doc. */
|
|
33
|
+
buildRequest(request: SourceRequest<T>): QueryFragmentContribution;
|
|
34
|
+
/**
|
|
35
|
+
* Extract this source's result from the response `data` root. Returns `null`
|
|
36
|
+
* when the source's own subtree is absent or errored; never throws for a
|
|
37
|
+
* partial failure.
|
|
38
|
+
*/
|
|
39
|
+
parseResponse(root: Record<string, unknown>, request: SourceRequest<T>): SourceResult | null;
|
|
40
|
+
/** Throws if the source config holds anything unsafe to put in a query document. */
|
|
41
|
+
validateSource(source: T): void;
|
|
42
|
+
/** The GraphQL error `path` prefix that locates this source in the response. */
|
|
43
|
+
errorPath(request: SourceRequest<T>): Array<string | number>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { describe, it, expect } from "vitest";
|
|
8
|
+
import { parseSearchResponse } from "./search-response";
|
|
9
|
+
import type { SObjectSourceConfig } from "../types/search-config.types";
|
|
10
|
+
import type { SourceRequest } from "../types/search-result.types";
|
|
11
|
+
|
|
12
|
+
const source = (key: string): SObjectSourceConfig => ({
|
|
13
|
+
kind: "sobject",
|
|
14
|
+
key,
|
|
15
|
+
label: key,
|
|
16
|
+
objectName: "Account",
|
|
17
|
+
displayFields: ["Name"],
|
|
18
|
+
searchableFields: ["Name"],
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const request = (key: string): SourceRequest => ({
|
|
22
|
+
source: source(key),
|
|
23
|
+
q: "acme",
|
|
24
|
+
filters: [],
|
|
25
|
+
sort: null,
|
|
26
|
+
pageSize: 10,
|
|
27
|
+
afterCursor: undefined,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const connection = (nodes: unknown[], totalCount = nodes.length) => ({
|
|
31
|
+
edges: nodes.map((node) => ({ node })),
|
|
32
|
+
pageInfo: { hasNextPage: false, hasPreviousPage: false, startCursor: null, endCursor: "c1" },
|
|
33
|
+
totalCount,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe("parseSearchResponse", () => {
|
|
37
|
+
it("returns a result per source when every subtree is present", () => {
|
|
38
|
+
const outcome = parseSearchResponse(
|
|
39
|
+
[request("accounts"), request("contacts")],
|
|
40
|
+
{ uiapi: { query: { accounts: connection([{ Id: "1" }]), contacts: connection([]) } } },
|
|
41
|
+
[],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
expect(outcome.results["accounts"].nodes).toEqual([{ Id: "1" }]);
|
|
45
|
+
expect(outcome.results["accounts"].totalCount).toBe(1);
|
|
46
|
+
expect(outcome.results["accounts"].pageInfo?.endCursor).toBe("c1");
|
|
47
|
+
expect(outcome.results["contacts"].nodes).toEqual([]);
|
|
48
|
+
expect(outcome.errors).toEqual({});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("drops null edge nodes", () => {
|
|
52
|
+
const outcome = parseSearchResponse(
|
|
53
|
+
[request("accounts")],
|
|
54
|
+
{ uiapi: { query: { accounts: { edges: [{ node: null }, { node: { Id: "1" } }] } } } },
|
|
55
|
+
[],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
expect(outcome.results["accounts"].nodes).toEqual([{ Id: "1" }]);
|
|
59
|
+
expect(outcome.results["accounts"].pageInfo).toBeNull();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("partial failure: attributes the error to the failed source only", () => {
|
|
63
|
+
const outcome = parseSearchResponse(
|
|
64
|
+
[request("accounts"), request("contacts")],
|
|
65
|
+
{ uiapi: { query: { accounts: connection([{ Id: "1" }]), contacts: null } } },
|
|
66
|
+
[{ message: "Contact error", path: ["uiapi", "query", "contacts"] }],
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
expect(outcome.results).toHaveProperty("accounts");
|
|
70
|
+
expect(outcome.errors["contacts"]).toContain("Contact error");
|
|
71
|
+
expect(outcome.errors).not.toHaveProperty("accounts");
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("attributes errors by path across multiple failed sources", () => {
|
|
75
|
+
const outcome = parseSearchResponse(
|
|
76
|
+
[request("accounts"), request("contacts")],
|
|
77
|
+
{ uiapi: { query: { accounts: null, contacts: null } } },
|
|
78
|
+
[
|
|
79
|
+
{ message: "Account error", path: ["uiapi", "query", "accounts"] },
|
|
80
|
+
{ message: "Contact error", path: ["uiapi", "query", "contacts"] },
|
|
81
|
+
],
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
expect(outcome.errors["accounts"]).toContain("Account error");
|
|
85
|
+
expect(outcome.errors["contacts"]).toContain("Contact error");
|
|
86
|
+
expect(outcome.results).toEqual({});
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("does not cross-attribute: an unmatched source gets the generic message", () => {
|
|
90
|
+
const outcome = parseSearchResponse(
|
|
91
|
+
[request("accounts"), request("contacts")],
|
|
92
|
+
{ uiapi: { query: { accounts: null, contacts: null } } },
|
|
93
|
+
[{ message: "Account error", path: ["uiapi", "query", "accounts"] }],
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
expect(outcome.errors["accounts"]).toContain("Account error");
|
|
97
|
+
expect(outcome.errors["contacts"]).toBe("Search failed for this source.");
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it("falls back to the generic message when error paths are empty", () => {
|
|
101
|
+
const outcome = parseSearchResponse([request("accounts")], {}, [
|
|
102
|
+
{ message: "Validation error", path: [] },
|
|
103
|
+
]);
|
|
104
|
+
|
|
105
|
+
expect(outcome.results).toEqual({});
|
|
106
|
+
expect(outcome.errors["accounts"]).toBe("Search failed for this source.");
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it("leaves a missing subtree out of both maps when there are no errors", () => {
|
|
110
|
+
const outcome = parseSearchResponse([request("accounts")], {}, []);
|
|
111
|
+
|
|
112
|
+
expect(outcome).toEqual({ results: {}, errors: {} });
|
|
113
|
+
});
|
|
114
|
+
});
|