@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,70 @@
|
|
|
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
|
+
DestroyRef,
|
|
10
|
+
effect,
|
|
11
|
+
inject,
|
|
12
|
+
input,
|
|
13
|
+
output,
|
|
14
|
+
signal,
|
|
15
|
+
untracked,
|
|
16
|
+
} from "@angular/core";
|
|
17
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
18
|
+
import { Subject } from "rxjs";
|
|
19
|
+
import { debounceTime } from "rxjs/operators";
|
|
20
|
+
import { InputComponent } from "../../../components/ui/input/input";
|
|
21
|
+
import { FILTER_DEBOUNCE_MS, uniqueFilterId, type FilterValue } from "./filter-types";
|
|
22
|
+
import { FilterFieldWrapperComponent } from "./filter-field-wrapper";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Free-text filter. Keystrokes update a local draft immediately and are
|
|
26
|
+
* emitted on a trailing {@link FILTER_DEBOUNCE_MS}ms debounce; an empty string
|
|
27
|
+
* emits `undefined` (clear).
|
|
28
|
+
*/
|
|
29
|
+
@Component({
|
|
30
|
+
selector: "app-text-filter",
|
|
31
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
32
|
+
imports: [InputComponent, FilterFieldWrapperComponent],
|
|
33
|
+
templateUrl: "./text-filter.html",
|
|
34
|
+
})
|
|
35
|
+
export class TextFilterComponent {
|
|
36
|
+
private readonly destroyRef = inject(DestroyRef);
|
|
37
|
+
|
|
38
|
+
readonly label = input.required<string>();
|
|
39
|
+
readonly value = input<FilterValue | undefined>(undefined);
|
|
40
|
+
readonly placeholder = input<string | undefined>(undefined);
|
|
41
|
+
readonly helpText = input<string | undefined>(undefined);
|
|
42
|
+
readonly valueChange = output<FilterValue | undefined>();
|
|
43
|
+
|
|
44
|
+
protected readonly inputId = uniqueFilterId("filter-text");
|
|
45
|
+
protected readonly draft = signal("");
|
|
46
|
+
private readonly commit$ = new Subject<string>();
|
|
47
|
+
|
|
48
|
+
constructor() {
|
|
49
|
+
this.commit$
|
|
50
|
+
.pipe(debounceTime(FILTER_DEBOUNCE_MS), takeUntilDestroyed(this.destroyRef))
|
|
51
|
+
.subscribe((v) => this.valueChange.emit(v ? { value: v } : undefined));
|
|
52
|
+
|
|
53
|
+
// Re-seed the draft when the bound value changes externally (URL restore, reset).
|
|
54
|
+
effect(() => {
|
|
55
|
+
const external = this.value()?.value ?? "";
|
|
56
|
+
untracked(() => {
|
|
57
|
+
if (external !== this.draft()) this.draft.set(external);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
protected onInput(v: string): void {
|
|
63
|
+
this.draft.set(v);
|
|
64
|
+
this.commit$.next(v);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
protected placeholderText(): string {
|
|
68
|
+
return this.placeholder() ?? `Filter by ${this.label().toLowerCase()}...`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export * from "./types";
|
|
8
|
+
export * from "./constants";
|
|
9
|
+
export * from "./utils/debounce";
|
|
10
|
+
export * from "./utils/field-utils";
|
|
11
|
+
export * from "./utils/filter-utils";
|
|
12
|
+
export * from "./utils/sort-utils";
|
|
13
|
+
export * from "./utils/scope-utils";
|
|
14
|
+
export * from "./utils/merge-utils";
|
|
15
|
+
export * from "./utils/identifier";
|
|
16
|
+
export * from "./utils/validate-config";
|
|
17
|
+
export * from "./query/build-search-query";
|
|
18
|
+
export type { QueryFragmentContribution, SourceAdapter } from "./adapters/types";
|
|
19
|
+
export { getAdapter } from "./adapters/registry";
|
|
20
|
+
export { parseSearchResponse, type GraphQLErrorLike } from "./api/search-response";
|
|
21
|
+
export { SearchService } from "./api/search.service";
|
|
22
|
+
|
|
23
|
+
// State
|
|
24
|
+
export { SearchStateService } from "./state/search-state.service";
|
|
25
|
+
export type {
|
|
26
|
+
RestrictTo,
|
|
27
|
+
SearchInitOptions,
|
|
28
|
+
SourceLocalState,
|
|
29
|
+
SourceView,
|
|
30
|
+
} from "./state/search-state.types";
|
|
31
|
+
export { activeTypeFor, toActiveFilter, toFilterValue } from "./state/filter-mapping";
|
|
32
|
+
|
|
33
|
+
// Per-source result templates (Angular's `renderResult`)
|
|
34
|
+
export {
|
|
35
|
+
SearchResultTemplateDirective,
|
|
36
|
+
type SearchResultContext,
|
|
37
|
+
} from "./directives/search-result-template/search-result-template";
|
|
38
|
+
|
|
39
|
+
// Components
|
|
40
|
+
export { SearchComponent } from "./components/search/search";
|
|
41
|
+
export { ScopeSelectorComponent, type ScopeOption } from "./components/scope/scope-selector";
|
|
42
|
+
export { SearchResultsComponent } from "./components/results/search-results";
|
|
43
|
+
export { MergedSearchResultsComponent } from "./components/results/merged-search-results";
|
|
44
|
+
export { SourceSectionComponent } from "./components/results/source-section";
|
|
45
|
+
export { DefaultResultRowComponent } from "./components/results/default-result-row";
|
|
46
|
+
export { ResultItemComponent, type ResultTemplates } from "./components/results/result-item";
|
|
47
|
+
export { DefaultFilterPanelComponent } from "./components/filter-panel/default-filter-panel";
|
|
48
|
+
export { FilterBoxComponent } from "./components/filter-panel/filter-box";
|
|
49
|
+
export { GlobalSearchBoxComponent } from "./components/global-search-box/global-search-box";
|
|
50
|
+
export { SearchBarComponent } from "./components/search-bar/search-bar";
|
|
51
|
+
export { SortControlComponent } from "./components/sort-control/sort-control";
|
|
52
|
+
export { ActiveFiltersComponent } from "./components/active-filters/active-filters";
|
|
53
|
+
|
|
54
|
+
// Starter config for the shipped /search page
|
|
55
|
+
export { defaultSearchConfig } from "./default-search-config";
|
|
@@ -0,0 +1,157 @@
|
|
|
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 { buildSearchQuery } from "./build-search-query";
|
|
9
|
+
import type { SObjectSourceConfig } from "../types/search-config.types";
|
|
10
|
+
import type { SourceRequest } from "../types/search-result.types";
|
|
11
|
+
|
|
12
|
+
const accounts: SObjectSourceConfig = {
|
|
13
|
+
kind: "sobject",
|
|
14
|
+
key: "accounts",
|
|
15
|
+
label: "Accounts",
|
|
16
|
+
objectName: "Account",
|
|
17
|
+
displayFields: ["Name", { name: "Owner", subfields: ["Name"] }, { name: "Extra", raw: true }],
|
|
18
|
+
searchableFields: ["Name", "Owner.Name"],
|
|
19
|
+
filterBy: [{ field: "Type", label: "Type", type: "picklist" }],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const contacts: SObjectSourceConfig = {
|
|
23
|
+
kind: "sobject",
|
|
24
|
+
key: "contacts",
|
|
25
|
+
label: "Contacts",
|
|
26
|
+
objectName: "Contact",
|
|
27
|
+
idField: "ContactId",
|
|
28
|
+
displayFields: ["LastName"],
|
|
29
|
+
searchableFields: ["LastName"],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const request = (
|
|
33
|
+
source: SObjectSourceConfig,
|
|
34
|
+
overrides: Partial<SourceRequest> = {},
|
|
35
|
+
): SourceRequest => ({
|
|
36
|
+
source,
|
|
37
|
+
q: "acme",
|
|
38
|
+
filters: [],
|
|
39
|
+
sort: null,
|
|
40
|
+
pageSize: 20,
|
|
41
|
+
afterCursor: undefined,
|
|
42
|
+
...overrides,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
describe("buildSearchQuery", () => {
|
|
46
|
+
it("throws when no requests are provided", () => {
|
|
47
|
+
expect(() => buildSearchQuery([])).toThrow(
|
|
48
|
+
"buildSearchQuery requires at least one source request",
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("builds a single uiapi document with key-namespaced variables", () => {
|
|
53
|
+
const { document, variables } = buildSearchQuery([request(accounts)]);
|
|
54
|
+
|
|
55
|
+
expect(document).toContain("query Search(");
|
|
56
|
+
expect(document).toContain("uiapi {");
|
|
57
|
+
expect(document).toContain("accounts: Account(");
|
|
58
|
+
expect(document).toContain("$accounts_first: Int");
|
|
59
|
+
expect(document).toContain("$accounts_where: Account_Filter");
|
|
60
|
+
expect(document).toContain("$accounts_orderBy: Account_OrderBy");
|
|
61
|
+
expect(document).not.toContain("managed_content");
|
|
62
|
+
expect(variables).toMatchObject({
|
|
63
|
+
accounts_first: 20,
|
|
64
|
+
accounts_after: null,
|
|
65
|
+
accounts_orderBy: null,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("renders string, nested and raw display fields plus the id field", () => {
|
|
70
|
+
const { document } = buildSearchQuery([request(accounts)]);
|
|
71
|
+
|
|
72
|
+
expect(document).toContain("Id");
|
|
73
|
+
expect(document).toContain("Name @optional { value displayValue }");
|
|
74
|
+
expect(document).toContain("Owner @optional {");
|
|
75
|
+
expect(document).toMatch(/^\s+Extra$/m);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("batches multiple sources into one document and one variable map", () => {
|
|
79
|
+
const { document, variables } = buildSearchQuery([
|
|
80
|
+
request(accounts),
|
|
81
|
+
request(contacts, { afterCursor: "abc" }),
|
|
82
|
+
]);
|
|
83
|
+
|
|
84
|
+
expect(document.match(/query Search\(/g)).toHaveLength(1);
|
|
85
|
+
expect(document).toContain("accounts: Account(");
|
|
86
|
+
expect(document).toContain("contacts: Contact(");
|
|
87
|
+
expect(document).toContain("ContactId");
|
|
88
|
+
expect(variables).toHaveProperty("accounts_first");
|
|
89
|
+
expect(variables).toHaveProperty("contacts_first");
|
|
90
|
+
expect(variables["contacts_after"]).toBe("abc");
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("combines the global q clause with structured filters under and", () => {
|
|
94
|
+
const { variables } = buildSearchQuery([
|
|
95
|
+
request(accounts, {
|
|
96
|
+
filters: [{ field: "Type", label: "Type", type: "picklist", value: "Customer" }],
|
|
97
|
+
}),
|
|
98
|
+
]);
|
|
99
|
+
|
|
100
|
+
expect(variables["accounts_where"]).toEqual({
|
|
101
|
+
and: [
|
|
102
|
+
{
|
|
103
|
+
or: [{ Name: { like: "%acme%" } }, { Owner: { Name: { like: "%acme%" } } }],
|
|
104
|
+
},
|
|
105
|
+
{ Type: { eq: "Customer" } },
|
|
106
|
+
],
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it("emits orderBy from the sort", () => {
|
|
111
|
+
const { variables } = buildSearchQuery([
|
|
112
|
+
request(accounts, { sort: { field: "Name", direction: "DESC" } }),
|
|
113
|
+
]);
|
|
114
|
+
|
|
115
|
+
expect(variables["accounts_orderBy"]).toEqual({ Name: { order: "DESC", nulls: "LAST" } });
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("honours whereTypeName / orderByTypeName overrides", () => {
|
|
119
|
+
const { document } = buildSearchQuery([
|
|
120
|
+
request({ ...accounts, whereTypeName: "Acct_Where", orderByTypeName: "Acct_Order" }),
|
|
121
|
+
]);
|
|
122
|
+
|
|
123
|
+
expect(document).toContain("$accounts_where: Acct_Where");
|
|
124
|
+
expect(document).toContain("$accounts_orderBy: Acct_Order");
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("rejects a source key that is not a valid GraphQL alias", () => {
|
|
128
|
+
expect(() => buildSearchQuery([request({ ...accounts, key: "bad-key" })])).toThrow(
|
|
129
|
+
/Invalid source key/,
|
|
130
|
+
);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("rejects keys starting with __", () => {
|
|
134
|
+
expect(() => buildSearchQuery([request({ ...accounts, key: "__x" })])).toThrow(
|
|
135
|
+
/Invalid source key/,
|
|
136
|
+
);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("rejects duplicate source keys", () => {
|
|
140
|
+
expect(() => buildSearchQuery([request(accounts), request(accounts)])).toThrow(
|
|
141
|
+
/Duplicate source key/,
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it.each([
|
|
146
|
+
["objectName", { objectName: "Account) { x" }],
|
|
147
|
+
["idField", { idField: "Id }" }],
|
|
148
|
+
["whereTypeName", { whereTypeName: "A B" }],
|
|
149
|
+
["orderByTypeName", { orderByTypeName: "A-B" }],
|
|
150
|
+
["display field", { displayFields: ["Name } evil {"] }],
|
|
151
|
+
["nested subfield", { displayFields: [{ name: "Owner", subfields: ["Na me"] }] }],
|
|
152
|
+
])("rejects an unsafe %s", (_label, override) => {
|
|
153
|
+
expect(() =>
|
|
154
|
+
buildSearchQuery([request({ ...accounts, ...override } as SObjectSourceConfig)]),
|
|
155
|
+
).toThrow(/Invalid/);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
* Builds a single combined GraphQL document for search across every source.
|
|
9
|
+
*
|
|
10
|
+
* The builder is kind-agnostic: each source request is dispatched to its
|
|
11
|
+
* registered adapter for a `QueryFragmentContribution`:
|
|
12
|
+
* - `placement: "uiapi.query"` fragments go inside the shared
|
|
13
|
+
* `uiapi { query { ... } }` block.
|
|
14
|
+
* - `placement: "root"` fragments go in as siblings of `uiapi`.
|
|
15
|
+
* - every contribution's `variableDeclarations` are concatenated into the
|
|
16
|
+
* `query Search(...)` header and its `variables` merged into one flat map.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { getAdapter } from "../adapters/registry";
|
|
20
|
+
import type { SourceRequest } from "../types/search-result.types";
|
|
21
|
+
|
|
22
|
+
export interface SearchQueryPayload {
|
|
23
|
+
document: string;
|
|
24
|
+
variables: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Builds the combined query document and a flat variables map by dispatching
|
|
29
|
+
* each source through its adapter and partitioning fragments by placement.
|
|
30
|
+
*/
|
|
31
|
+
export function buildSearchQuery(requests: SourceRequest[]): SearchQueryPayload {
|
|
32
|
+
if (requests.length === 0) {
|
|
33
|
+
throw new Error("buildSearchQuery requires at least one source request");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const keys = new Set<string>();
|
|
37
|
+
for (const { source } of requests) {
|
|
38
|
+
if (keys.has(source.key)) {
|
|
39
|
+
throw new Error(`Duplicate source key "${source.key}". Source keys must be unique.`);
|
|
40
|
+
}
|
|
41
|
+
keys.add(source.key);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const variableDeclarations: string[] = [];
|
|
45
|
+
const uiapiFragments: string[] = [];
|
|
46
|
+
const rootFragments: string[] = [];
|
|
47
|
+
const variables: Record<string, unknown> = {};
|
|
48
|
+
|
|
49
|
+
for (const request of requests) {
|
|
50
|
+
const contribution = getAdapter(request.source.kind).buildRequest(request);
|
|
51
|
+
|
|
52
|
+
// Concatenate declarations (may be empty for a given source) and merge
|
|
53
|
+
// values — an omitted declaration means the variable is never declared,
|
|
54
|
+
// so it is likewise never supplied.
|
|
55
|
+
variableDeclarations.push(...contribution.variableDeclarations);
|
|
56
|
+
Object.assign(variables, contribution.variables);
|
|
57
|
+
|
|
58
|
+
if (contribution.placement === "root") {
|
|
59
|
+
rootFragments.push(contribution.fragment);
|
|
60
|
+
} else {
|
|
61
|
+
uiapiFragments.push(contribution.fragment);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const parts: string[] = [`query Search(${variableDeclarations.join(", ")}) {`];
|
|
66
|
+
|
|
67
|
+
// The `uiapi { query { … } }` block holds every `uiapi.query`-placed fragment.
|
|
68
|
+
// Emit it only when at least one such fragment exists; an empty block is an
|
|
69
|
+
// invalid selection set.
|
|
70
|
+
if (uiapiFragments.length > 0) {
|
|
71
|
+
parts.push(` uiapi {`);
|
|
72
|
+
parts.push(` query {`);
|
|
73
|
+
parts.push(uiapiFragments.map((s) => indent(s, " ")).join("\n"));
|
|
74
|
+
parts.push(` }`);
|
|
75
|
+
parts.push(` }`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Root-placement fragments are siblings of uiapi.
|
|
79
|
+
for (const fragment of rootFragments) {
|
|
80
|
+
parts.push(indent(fragment, " "));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
parts.push(`}`);
|
|
84
|
+
|
|
85
|
+
const document = parts.join("\n") + "\n";
|
|
86
|
+
|
|
87
|
+
return { document, variables };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function indent(s: string, prefix: string): string {
|
|
91
|
+
return s
|
|
92
|
+
.split("\n")
|
|
93
|
+
.map((line) => prefix + line)
|
|
94
|
+
.join("\n");
|
|
95
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
import type { ActiveFilterValue, FilterFieldConfig, FilterFieldType } from "../types/filter.types";
|
|
7
|
+
import type { FilterValue } from "../filters/filter-types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Maps between the state-agnostic filter-input contract ({@link FilterValue})
|
|
11
|
+
* and the canonical {@link ActiveFilterValue} the query builder consumes.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The type an active filter carries. The date inputs always emit a min/max
|
|
16
|
+
* pair, so `date` / `datetime` configs are normalized to their range form;
|
|
17
|
+
* `buildFilter` produces the same clause for a single bound, and a range keeps
|
|
18
|
+
* both bounds (the single-bound form would silently drop `max`).
|
|
19
|
+
*/
|
|
20
|
+
export function activeTypeFor(type: FilterFieldType): FilterFieldType {
|
|
21
|
+
if (type === "date") return "daterange";
|
|
22
|
+
if (type === "datetime") return "datetimerange";
|
|
23
|
+
return type;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const has = (s: string | undefined): s is string => s !== undefined && s !== "";
|
|
27
|
+
|
|
28
|
+
/** Active filter -> input value (`undefined` when the filter is inactive). */
|
|
29
|
+
export function toFilterValue(active: ActiveFilterValue | undefined): FilterValue | undefined {
|
|
30
|
+
if (!active) return undefined;
|
|
31
|
+
return { value: active.value, min: active.min, max: active.max };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Input value -> active filter (`undefined` when the value carries no constraint). */
|
|
35
|
+
export function toActiveFilter(
|
|
36
|
+
config: FilterFieldConfig,
|
|
37
|
+
value: FilterValue | undefined,
|
|
38
|
+
): ActiveFilterValue | undefined {
|
|
39
|
+
if (!value || (!has(value.value) && !has(value.min) && !has(value.max))) return undefined;
|
|
40
|
+
return {
|
|
41
|
+
field: config.field,
|
|
42
|
+
label: config.label,
|
|
43
|
+
type: activeTypeFor(config.type),
|
|
44
|
+
value: value.value,
|
|
45
|
+
min: value.min,
|
|
46
|
+
max: value.max,
|
|
47
|
+
};
|
|
48
|
+
}
|