@salesforce/ui-bundle-template-feature-angular-object-search 12.5.4
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 +101 -0
- 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 +5238 -0
- package/dist/README.md +77 -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-object-search/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.postcssrc.json +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.prettierignore +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/.prettierrc +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/CHANGELOG.md +4 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/README.md +85 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/angular.json +98 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/components.json +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/e2e/app.spec.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/esbuild/api-version.mjs +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/esbuild/graphql-codegen.mjs +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/eslint-plugin-angular-graphql.js +148 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/eslint.config.js +76 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/feature-angular-object-search.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/middleware/html.mjs +3 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/middleware/proxy.mjs +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/package.json +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/playwright.config.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/public/favicon.ico +0 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/scripts/get-graphql-schema.mjs +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/scripts/rewrite-e2e-assets.mjs +30 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/account-search.service.ts +108 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/distinctAccountIndustries.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/distinctAccountTypes.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/getAccountDetail.ts +128 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/account/searchAccounts.ts +58 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/data-client.service.spec.ts +184 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/data-client.service.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/api/graphql-operations-types.ts +29389 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.config.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.html +1 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.routes.ts +32 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.spec.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/app.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/layout/app-layout/app-layout.html +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/layout/app-layout/app-layout.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/alert/alert.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/alert/alert.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/button/button.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/button/button.ts +66 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/card/card.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/collapsible/collapsible.html +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/collapsible/collapsible.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-picker/date-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-picker/date-picker.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dialog/dialog.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dialog/dialog.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field/field.html +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field/field.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field-appearance.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/field-size.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/icon/icon.ts +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/input/input.html +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/input/input.ts +79 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/label/label.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/paginator/paginator.html +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/paginator/paginator.ts +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/paginator/types.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/popover/popover.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/popover/popover.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/select/select.html +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/select/select.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/separator/separator.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/skeleton/skeleton.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/components/ui/spinner/spinner.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/api/object-search.service.ts +94 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/breadcrumb/breadcrumb.html +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/breadcrumb/breadcrumb.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/active-filters.html +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/active-filters.ts +78 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-filter.html +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-filter.ts +137 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-range-filter.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/date-range-filter.ts +60 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/filter-field-wrapper.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/filter-field-wrapper.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/multi-select-filter.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/multi-select-filter.ts +58 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/numeric-range-filter.html +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/numeric-range-filter.ts +128 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/search-filter.html +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/search-filter.ts +78 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/select-filter.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/select-filter.ts +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/text-filter.html +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/filters/text-filter.ts +76 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/object-search-state.service.ts +232 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/pagination/pagination.html +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/pagination/pagination.ts +45 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/search-bar/search-bar.html +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/search-bar/search-bar.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/sort-control/sort-control.html +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/sort-control/sort-control.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/debounce.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/field-utils.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/filter-utils.ts +354 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/index.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/features/object-search/utils/sort-utils.ts +39 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-detail/account-detail-page.html +142 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-detail/account-detail-page.ts +176 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-search/account-search-page.html +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/account-search/account-search-page.ts +196 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/home/home.html +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/home/home.spec.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/home/home.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/not-found/not-found.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/not-found/not-found.spec.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/pages/not-found/not-found.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert-action.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert-title.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/hlm-alert.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/alert/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/button/hlm-button.token.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/button/hlm-button.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/button/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-calendar.ts +189 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/calendar/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-action.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-avatar.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-footer.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-header.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card.token.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/hlm-card.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/card/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/collapsible/index.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/date-picker/index.ts +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/hlm-dialog.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dialog/index.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/dropdown-menu/index.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-description.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-error.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-group.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-legend.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-separator.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-set.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field-title.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/hlm-field.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/field/index.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input/hlm-input.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/hlm-input-group.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/input-group/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/label/hlm-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/label/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/label/label.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/hlm-pagination.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/pagination/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-content.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/hlm-popover.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/popover/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-content.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-item.ts +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-label.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-multiple.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-placeholder.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-separator.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-trigger.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-value-template.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-value.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-values-content.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select-values.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/hlm-select.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/select/index.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/separator/hlm-separator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/separator/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/skeleton/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/spinner/hlm-spinner.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/spinner/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/utils/hlm.ts +313 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/utils/index.ts +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/app/utils/async-data.ts +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/index.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/main.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/styles.css +139 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/src/types/sf-globals.d.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/tsconfig.app.json +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/tsconfig.json +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-search/tsconfig.spec.json +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-object-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/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 +278 -0
- package/dist/scripts/org-setup.config.json +5 -0
- package/dist/scripts/org-setup.mjs +2537 -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 +51 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
|
|
2
|
+
import { BrnDialog, provideBrnDialogDefaultOptions } from '@spartan-ng/brain/dialog';
|
|
3
|
+
import { HlmDialogOverlay } from './hlm-dialog-overlay';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'hlm-dialog',
|
|
7
|
+
exportAs: 'hlmDialog',
|
|
8
|
+
imports: [HlmDialogOverlay],
|
|
9
|
+
providers: [
|
|
10
|
+
{
|
|
11
|
+
provide: BrnDialog,
|
|
12
|
+
useExisting: forwardRef(() => HlmDialog),
|
|
13
|
+
},
|
|
14
|
+
provideBrnDialogDefaultOptions({
|
|
15
|
+
// add custom options here
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
+
template: `
|
|
20
|
+
<hlm-dialog-overlay />
|
|
21
|
+
<ng-content />
|
|
22
|
+
`,
|
|
23
|
+
})
|
|
24
|
+
export class HlmDialog extends BrnDialog {}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HlmDialog } from './hlm-dialog';
|
|
2
|
+
import { HlmDialogClose } from './hlm-dialog-close';
|
|
3
|
+
import { HlmDialogContent } from './hlm-dialog-content';
|
|
4
|
+
import { HlmDialogDescription } from './hlm-dialog-description';
|
|
5
|
+
import { HlmDialogFooter } from './hlm-dialog-footer';
|
|
6
|
+
import { HlmDialogHeader } from './hlm-dialog-header';
|
|
7
|
+
import { HlmDialogOverlay } from './hlm-dialog-overlay';
|
|
8
|
+
import { HlmDialogPortal } from './hlm-dialog-portal';
|
|
9
|
+
import { HlmDialogTitle } from './hlm-dialog-title';
|
|
10
|
+
import { HlmDialogTrigger } from './hlm-dialog-trigger';
|
|
11
|
+
|
|
12
|
+
export * from './hlm-dialog';
|
|
13
|
+
export * from './hlm-dialog-close';
|
|
14
|
+
export * from './hlm-dialog-content';
|
|
15
|
+
export * from './hlm-dialog-description';
|
|
16
|
+
export * from './hlm-dialog-footer';
|
|
17
|
+
export * from './hlm-dialog-header';
|
|
18
|
+
export * from './hlm-dialog-overlay';
|
|
19
|
+
export * from './hlm-dialog-portal';
|
|
20
|
+
export * from './hlm-dialog-title';
|
|
21
|
+
export * from './hlm-dialog-trigger';
|
|
22
|
+
export * from './hlm-dialog.service';
|
|
23
|
+
|
|
24
|
+
export const HlmDialogImports = [
|
|
25
|
+
HlmDialog,
|
|
26
|
+
HlmDialogContent,
|
|
27
|
+
HlmDialogDescription,
|
|
28
|
+
HlmDialogFooter,
|
|
29
|
+
HlmDialogHeader,
|
|
30
|
+
HlmDialogOverlay,
|
|
31
|
+
HlmDialogPortal,
|
|
32
|
+
HlmDialogTitle,
|
|
33
|
+
HlmDialogTrigger,
|
|
34
|
+
HlmDialogClose,
|
|
35
|
+
] as const;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
|
+
import { lucideCheck } from '@ng-icons/lucide';
|
|
4
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'hlm-dropdown-menu-checkbox-indicator',
|
|
8
|
+
imports: [NgIcon],
|
|
9
|
+
providers: [provideIcons({ lucideCheck })],
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
host: { 'data-slot': 'dropdown-menu-checkbox-item-indicator' },
|
|
12
|
+
template: ` <ng-icon name="lucideCheck" /> `,
|
|
13
|
+
})
|
|
14
|
+
export class HlmDropdownMenuCheckboxIndicator {
|
|
15
|
+
constructor() {
|
|
16
|
+
classes(
|
|
17
|
+
() =>
|
|
18
|
+
'absolute end-2 flex items-center justify-center [&_ng-icon]:text-[length:--spacing(4)] pointer-events-none opacity-0 group-data-checked/dropdown-menu-checkbox:opacity-100',
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { CdkMenuItem, CdkMenuItemCheckbox, CdkMenuItemSelectable } from '@angular/cdk/menu';
|
|
3
|
+
import { Directive, booleanAttribute, inject, input } from '@angular/core';
|
|
4
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
5
|
+
import { HlmDropdownMenuFocusOnHover } from './hlm-dropdown-menu-focus-on-hover';
|
|
6
|
+
|
|
7
|
+
/** @internal. Use HlmDropdownMenuCheckbox instead. */
|
|
8
|
+
@Directive({
|
|
9
|
+
selector: '[hlmDropdownMenuCheckboxCdk]',
|
|
10
|
+
providers: [
|
|
11
|
+
{ provide: CdkMenuItemCheckbox, useExisting: HlmDropdownMenuCheckboxCdk },
|
|
12
|
+
{ provide: CdkMenuItemSelectable, useExisting: HlmDropdownMenuCheckboxCdk },
|
|
13
|
+
{ provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
|
|
14
|
+
],
|
|
15
|
+
})
|
|
16
|
+
export class HlmDropdownMenuCheckboxCdk extends CdkMenuItemCheckbox {
|
|
17
|
+
public readonly keepOpen = input<boolean, BooleanInput>(true, { transform: booleanAttribute });
|
|
18
|
+
|
|
19
|
+
public override trigger(options?: { keepOpen: boolean }) {
|
|
20
|
+
super.trigger({ ...options, keepOpen: this.keepOpen() });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Directive({
|
|
25
|
+
selector: '[hlmDropdownMenuCheckbox],[hlmDropdownMenuCheckboxItem]',
|
|
26
|
+
hostDirectives: [
|
|
27
|
+
{
|
|
28
|
+
directive: HlmDropdownMenuCheckboxCdk,
|
|
29
|
+
inputs: ['cdkMenuItemDisabled: disabled', 'cdkMenuItemChecked: checked', 'keepOpen'],
|
|
30
|
+
outputs: ['cdkMenuItemTriggered: triggered'],
|
|
31
|
+
},
|
|
32
|
+
HlmDropdownMenuFocusOnHover,
|
|
33
|
+
],
|
|
34
|
+
host: {
|
|
35
|
+
'data-slot': 'dropdown-menu-checkbox-item',
|
|
36
|
+
'[attr.data-disabled]': '_cdkMenuItem.disabled ? "" : null',
|
|
37
|
+
'[attr.data-checked]': '_cdkMenuItem.checked ? "" : null',
|
|
38
|
+
'[attr.data-inset]': 'inset() ? "" : null',
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
export class HlmDropdownMenuCheckbox {
|
|
42
|
+
protected readonly _cdkMenuItem = inject(HlmDropdownMenuCheckboxCdk);
|
|
43
|
+
|
|
44
|
+
public readonly inset = input<boolean, BooleanInput>(false, {
|
|
45
|
+
transform: booleanAttribute,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
constructor() {
|
|
49
|
+
classes(
|
|
50
|
+
() =>
|
|
51
|
+
"hover:bg-accent focus:bg-accent hover:text-accent-foreground focus:text-accent-foreground gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm data-inset:ps-8 [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] group/dropdown-menu-checkbox relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0",
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { InputModalityDetector } from '@angular/cdk/a11y';
|
|
2
|
+
import { CdkMenu, CdkMenuItem } from '@angular/cdk/menu';
|
|
3
|
+
import { Directive, inject } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* Moves DOM focus to the hovered menu item. CDK menus only move focus with the keyboard, so on a pointer
|
|
8
|
+
* the highlight would otherwise stay on the last keyboard-focused item (leaving two rows highlighted) and,
|
|
9
|
+
* when a submenu closes, focus would fall to <body>, the menu stack would report no focus, and the whole
|
|
10
|
+
* dropdown would collapse. Following the pointer with focus (Radix/shadcn behaviour) keeps a single
|
|
11
|
+
* highlight and keeps focus inside the menu stack. setActiveMenuItem also syncs the key manager so keyboard
|
|
12
|
+
* navigation continues from the hovered item.
|
|
13
|
+
*
|
|
14
|
+
* Applied as a host directive on every dropdown item type (item, checkbox, radio, sub-trigger).
|
|
15
|
+
*/
|
|
16
|
+
@Directive({
|
|
17
|
+
selector: '[hlmDropdownMenuFocusOnHover]',
|
|
18
|
+
host: {
|
|
19
|
+
'(mouseenter)': '_focusOnHover()',
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
export class HlmDropdownMenuFocusOnHover {
|
|
23
|
+
private readonly _cdkMenuItem = inject(CdkMenuItem, { self: true });
|
|
24
|
+
private readonly _parentMenu = inject(CdkMenu, { optional: true });
|
|
25
|
+
private readonly _inputModality = inject(InputModalityDetector);
|
|
26
|
+
|
|
27
|
+
protected _focusOnHover(): void {
|
|
28
|
+
// Only skip synthetic hovers from touch taps; every real hover (mouse, or keyboard-then-hover,
|
|
29
|
+
// which leaves the modality as 'keyboard') should move focus to keep a single highlight.
|
|
30
|
+
if (this._inputModality.mostRecentModality === 'touch' || this._cdkMenuItem.disabled) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this._parentMenu?.setActiveMenuItem(this._cdkMenuItem);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CdkMenuGroup } from '@angular/cdk/menu';
|
|
2
|
+
import { Directive } from '@angular/core';
|
|
3
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmDropdownMenuGroup],hlm-dropdown-menu-group',
|
|
7
|
+
hostDirectives: [CdkMenuGroup],
|
|
8
|
+
host: { 'data-slot': 'dropdown-menu-group' },
|
|
9
|
+
})
|
|
10
|
+
export class HlmDropdownMenuGroup {
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'block');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
|
+
import { lucideChevronRight } from '@ng-icons/lucide';
|
|
4
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'hlm-dropdown-menu-item-sub-indicator',
|
|
8
|
+
imports: [NgIcon],
|
|
9
|
+
providers: [provideIcons({ lucideChevronRight })],
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
template: `
|
|
12
|
+
<ng-icon name="lucideChevronRight" class="text-[length:--spacing(4)] rtl:rotate-180" />
|
|
13
|
+
`,
|
|
14
|
+
})
|
|
15
|
+
export class HlmDropdownMenuItemSubIndicator {
|
|
16
|
+
constructor() {
|
|
17
|
+
classes(() => 'ms-auto flex items-center justify-center');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { CdkMenuItem } from '@angular/cdk/menu';
|
|
3
|
+
import { booleanAttribute, Directive, HOST_TAG_NAME, inject, input } from '@angular/core';
|
|
4
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
5
|
+
import { HlmDropdownMenuFocusOnHover } from './hlm-dropdown-menu-focus-on-hover';
|
|
6
|
+
|
|
7
|
+
@Directive({
|
|
8
|
+
selector: '[hlmDropdownMenuItem],hlm-dropdown-menu-item',
|
|
9
|
+
hostDirectives: [
|
|
10
|
+
{
|
|
11
|
+
directive: CdkMenuItem,
|
|
12
|
+
inputs: ['cdkMenuItemDisabled: disabled'],
|
|
13
|
+
outputs: ['cdkMenuItemTriggered: triggered'],
|
|
14
|
+
},
|
|
15
|
+
HlmDropdownMenuFocusOnHover,
|
|
16
|
+
],
|
|
17
|
+
host: {
|
|
18
|
+
'data-slot': 'dropdown-menu-item',
|
|
19
|
+
'[attr.disabled]': '_isButton && disabled() ? "" : null',
|
|
20
|
+
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
21
|
+
'[attr.data-variant]': 'variant()',
|
|
22
|
+
'[attr.data-inset]': 'inset() ? "" : null',
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
export class HlmDropdownMenuItem {
|
|
26
|
+
protected readonly _isButton = inject(HOST_TAG_NAME) === 'button';
|
|
27
|
+
|
|
28
|
+
public readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
29
|
+
|
|
30
|
+
public readonly variant = input<'default' | 'destructive'>('default');
|
|
31
|
+
|
|
32
|
+
public readonly inset = input<boolean, BooleanInput>(false, {
|
|
33
|
+
transform: booleanAttribute,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
constructor() {
|
|
37
|
+
classes(
|
|
38
|
+
() =>
|
|
39
|
+
"hover:bg-accent focus:bg-accent hover:text-accent-foreground focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:hover:bg-destructive/10 data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:hover:text-destructive data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[ng-icon]:text-destructive not-data-[variant=destructive]:hover:**:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm data-inset:ps-8 [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] group/dropdown-menu-item relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0",
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { booleanAttribute, Directive, input } from '@angular/core';
|
|
3
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmDropdownMenuLabel],hlm-dropdown-menu-label',
|
|
7
|
+
host: {
|
|
8
|
+
'data-slot': 'dropdown-menu-label',
|
|
9
|
+
'[attr.data-inset]': 'inset() ? "" : null',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
export class HlmDropdownMenuLabel {
|
|
13
|
+
public readonly inset = input<boolean, BooleanInput>(false, {
|
|
14
|
+
transform: booleanAttribute,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
classes(() => 'text-muted-foreground px-2 py-1.5 text-xs font-medium data-inset:ps-8 block');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
|
+
import { lucideCheck } from '@ng-icons/lucide';
|
|
4
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'hlm-dropdown-menu-radio-indicator',
|
|
8
|
+
imports: [NgIcon],
|
|
9
|
+
providers: [provideIcons({ lucideCheck })],
|
|
10
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
host: { 'data-slot': 'dropdown-menu-radio-item-indicator' },
|
|
12
|
+
template: ` <ng-icon name="lucideCheck" /> `,
|
|
13
|
+
})
|
|
14
|
+
export class HlmDropdownMenuRadioIndicator {
|
|
15
|
+
constructor() {
|
|
16
|
+
classes(
|
|
17
|
+
() =>
|
|
18
|
+
'absolute end-2 flex items-center justify-center [&_ng-icon]:text-[length:--spacing(4)] pointer-events-none opacity-0 group-data-checked/dropdown-menu-radio:opacity-100',
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { CdkMenuItem, CdkMenuItemRadio, CdkMenuItemSelectable } from '@angular/cdk/menu';
|
|
3
|
+
import { Directive, booleanAttribute, inject, input } from '@angular/core';
|
|
4
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
5
|
+
import { HlmDropdownMenuFocusOnHover } from './hlm-dropdown-menu-focus-on-hover';
|
|
6
|
+
|
|
7
|
+
/** @internal. Use HlmDropdownMenuRadio instead. */
|
|
8
|
+
@Directive({
|
|
9
|
+
selector: '[hlmDropdownMenuRadioCdk]',
|
|
10
|
+
providers: [
|
|
11
|
+
{ provide: CdkMenuItemRadio, useExisting: HlmDropdownMenuRadioCdk },
|
|
12
|
+
{ provide: CdkMenuItemSelectable, useExisting: HlmDropdownMenuRadioCdk },
|
|
13
|
+
{ provide: CdkMenuItem, useExisting: CdkMenuItemSelectable },
|
|
14
|
+
],
|
|
15
|
+
})
|
|
16
|
+
export class HlmDropdownMenuRadioCdk extends CdkMenuItemRadio {
|
|
17
|
+
public readonly keepOpen = input<boolean, BooleanInput>(true, { transform: booleanAttribute });
|
|
18
|
+
|
|
19
|
+
public override trigger(options?: { keepOpen: boolean }) {
|
|
20
|
+
super.trigger({ ...options, keepOpen: this.keepOpen() });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Directive({
|
|
25
|
+
selector: '[hlmDropdownMenuRadio]',
|
|
26
|
+
hostDirectives: [
|
|
27
|
+
{
|
|
28
|
+
directive: HlmDropdownMenuRadioCdk,
|
|
29
|
+
inputs: ['cdkMenuItemDisabled: disabled', 'cdkMenuItemChecked: checked', 'keepOpen'],
|
|
30
|
+
outputs: ['cdkMenuItemTriggered: triggered'],
|
|
31
|
+
},
|
|
32
|
+
HlmDropdownMenuFocusOnHover,
|
|
33
|
+
],
|
|
34
|
+
host: {
|
|
35
|
+
'data-slot': 'dropdown-menu-radio-item',
|
|
36
|
+
'[attr.data-disabled]': '_cdkMenuItem.disabled ? "" : null',
|
|
37
|
+
'[attr.data-checked]': '_cdkMenuItem.checked ? "" : null',
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
export class HlmDropdownMenuRadio {
|
|
41
|
+
protected readonly _cdkMenuItem = inject(HlmDropdownMenuRadioCdk);
|
|
42
|
+
|
|
43
|
+
constructor() {
|
|
44
|
+
classes(
|
|
45
|
+
() =>
|
|
46
|
+
"hover:bg-accent focus:bg-accent hover:text-accent-foreground focus:text-accent-foreground gap-2 rounded-sm py-1.5 ps-2 pe-8 text-sm data-inset:ps-8 [&_ng-icon:not([class*='text-'])]:text-[length:--spacing(4)] group/dropdown-menu-radio relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0",
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmDropdownMenuSeparator],hlm-dropdown-menu-separator',
|
|
6
|
+
host: { 'data-slot': 'dropdown-menu-separator' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmDropdownMenuSeparator {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'bg-border -mx-1 my-1 h-px block');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmDropdownMenuShortcut],hlm-dropdown-menu-shortcut',
|
|
6
|
+
host: { 'data-slot': 'dropdown-menu-shortcut' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmDropdownMenuShortcut {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(
|
|
11
|
+
() =>
|
|
12
|
+
'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-xs tracking-widest',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CdkMenuTrigger } from '@angular/cdk/menu';
|
|
2
|
+
import { computed, Directive, effect, forwardRef, inject, input } from '@angular/core';
|
|
3
|
+
import {
|
|
4
|
+
createMenuPosition,
|
|
5
|
+
MENU_SIDE,
|
|
6
|
+
type MenuAlign,
|
|
7
|
+
type MenuSide,
|
|
8
|
+
} from '@spartan-ng/brain/core';
|
|
9
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
10
|
+
import { injectHlmDropdownMenuConfig } from './hlm-dropdown-menu-token';
|
|
11
|
+
|
|
12
|
+
@Directive({
|
|
13
|
+
selector: '[hlmDropdownMenuSubTrigger]',
|
|
14
|
+
providers: [{ provide: MENU_SIDE, useExisting: forwardRef(() => HlmDropdownMenuSubTrigger) }],
|
|
15
|
+
hostDirectives: [
|
|
16
|
+
{
|
|
17
|
+
directive: CdkMenuTrigger,
|
|
18
|
+
inputs: [
|
|
19
|
+
'cdkMenuTriggerFor: hlmDropdownMenuSubTrigger',
|
|
20
|
+
'cdkMenuTriggerData: hlmDropdownMenuTriggerData',
|
|
21
|
+
],
|
|
22
|
+
outputs: [
|
|
23
|
+
'cdkMenuOpened: hlmDropdownMenuSubOpened',
|
|
24
|
+
'cdkMenuClosed: hlmDropdownMenuSubClosed',
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
host: { 'data-slot': 'dropdown-menu-sub-trigger' },
|
|
29
|
+
})
|
|
30
|
+
export class HlmDropdownMenuSubTrigger {
|
|
31
|
+
private readonly _cdkTrigger = inject(CdkMenuTrigger, { host: true });
|
|
32
|
+
private readonly _config = injectHlmDropdownMenuConfig();
|
|
33
|
+
|
|
34
|
+
public readonly align = input<MenuAlign>(this._config.align);
|
|
35
|
+
public readonly side = input<MenuSide>(this._config.side);
|
|
36
|
+
|
|
37
|
+
private readonly _menuPosition = computed(() => createMenuPosition(this.align(), this.side()));
|
|
38
|
+
|
|
39
|
+
constructor() {
|
|
40
|
+
// CDK sets transform-origin on the submenu content from the resolved position; the content reads it
|
|
41
|
+
// to animate from the anchored corner and to derive its data-side. Cast tolerates @angular/cdk < 21.2
|
|
42
|
+
// (we still support >=21.0), where the property is absent and the assignment is a harmless no-op.
|
|
43
|
+
(this._cdkTrigger as { transformOriginSelector?: string }).transformOriginSelector =
|
|
44
|
+
'[data-slot="dropdown-menu-sub"]';
|
|
45
|
+
|
|
46
|
+
effect(() => {
|
|
47
|
+
this._cdkTrigger.menuPosition = this._menuPosition();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
classes(() => 'aria-expanded:bg-accent aria-expanded:text-accent-foreground');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CdkMenu } from '@angular/cdk/menu';
|
|
2
|
+
import { Directive, ElementRef, inject, signal } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import {
|
|
5
|
+
deriveMenuSideFromTransformOrigin,
|
|
6
|
+
MENU_SIDE,
|
|
7
|
+
type MenuSide,
|
|
8
|
+
} from '@spartan-ng/brain/core';
|
|
9
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
10
|
+
|
|
11
|
+
@Directive({
|
|
12
|
+
selector: '[hlmDropdownMenuSub],hlm-dropdown-menu-sub',
|
|
13
|
+
hostDirectives: [CdkMenu],
|
|
14
|
+
host: {
|
|
15
|
+
'data-slot': 'dropdown-menu-sub',
|
|
16
|
+
'[attr.data-state]': '_state()',
|
|
17
|
+
'[attr.data-side]': '_side()',
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
export class HlmDropdownMenuSub {
|
|
21
|
+
private readonly _host = inject(CdkMenu);
|
|
22
|
+
private readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
23
|
+
// The sub-trigger provides its configured side; CDK parents this content's injector under it.
|
|
24
|
+
private readonly _menuSide = inject(MENU_SIDE, { optional: true });
|
|
25
|
+
|
|
26
|
+
protected readonly _state = signal('open');
|
|
27
|
+
protected readonly _side = signal<MenuSide>(this._menuSide?.side() ?? 'right');
|
|
28
|
+
|
|
29
|
+
constructor() {
|
|
30
|
+
this.setSideFromTransformOrigin();
|
|
31
|
+
// this is a best effort, but does not seem to work currently
|
|
32
|
+
// TODO: figure out a way for us to know the host is about to be closed. might not be possible with CDK
|
|
33
|
+
this._host.closed.pipe(takeUntilDestroyed()).subscribe(() => this._state.set('closed'));
|
|
34
|
+
|
|
35
|
+
classes(
|
|
36
|
+
() =>
|
|
37
|
+
'motion-safe:data-open:animate-in motion-safe:data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-md p-1 shadow-lg ring-1 duration-100 w-auto',
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private setSideFromTransformOrigin() {
|
|
42
|
+
const side = this._menuSide?.side() ?? 'right';
|
|
43
|
+
// CDK sets transform-origin on this element synchronously on attach; read it next tick and derive side
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
this._side.set(
|
|
46
|
+
deriveMenuSideFromTransformOrigin(
|
|
47
|
+
this._elementRef.nativeElement.style.transformOrigin,
|
|
48
|
+
side,
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InjectionToken, type ValueProvider, inject } from '@angular/core';
|
|
2
|
+
import { type MenuAlign, type MenuSide } from '@spartan-ng/brain/core';
|
|
3
|
+
|
|
4
|
+
export interface HlmDropdownMenuConfig {
|
|
5
|
+
align: MenuAlign;
|
|
6
|
+
side: MenuSide;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const defaultConfig: HlmDropdownMenuConfig = {
|
|
10
|
+
align: 'start',
|
|
11
|
+
side: 'bottom',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const HlmDropdownMenuConfigToken = new InjectionToken<HlmDropdownMenuConfig>(
|
|
15
|
+
'HlmDropdownMenuConfig',
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export function provideHlmDropdownMenuConfig(
|
|
19
|
+
config: Partial<HlmDropdownMenuConfig>,
|
|
20
|
+
): ValueProvider {
|
|
21
|
+
return { provide: HlmDropdownMenuConfigToken, useValue: { ...defaultConfig, ...config } };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function injectHlmDropdownMenuConfig(): HlmDropdownMenuConfig {
|
|
25
|
+
return inject(HlmDropdownMenuConfigToken, { optional: true }) ?? defaultConfig;
|
|
26
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { CdkMenuTrigger } from '@angular/cdk/menu';
|
|
2
|
+
import { computed, Directive, effect, forwardRef, inject, input } from '@angular/core';
|
|
3
|
+
import {
|
|
4
|
+
createMenuPosition,
|
|
5
|
+
MENU_SIDE,
|
|
6
|
+
type MenuAlign,
|
|
7
|
+
type MenuSide,
|
|
8
|
+
} from '@spartan-ng/brain/core';
|
|
9
|
+
import { injectHlmDropdownMenuConfig } from './hlm-dropdown-menu-token';
|
|
10
|
+
|
|
11
|
+
@Directive({
|
|
12
|
+
selector: '[hlmDropdownMenuTrigger]',
|
|
13
|
+
providers: [{ provide: MENU_SIDE, useExisting: forwardRef(() => HlmDropdownMenuTrigger) }],
|
|
14
|
+
hostDirectives: [
|
|
15
|
+
{
|
|
16
|
+
directive: CdkMenuTrigger,
|
|
17
|
+
inputs: [
|
|
18
|
+
'cdkMenuTriggerFor: hlmDropdownMenuTrigger',
|
|
19
|
+
'cdkMenuTriggerData: hlmDropdownMenuTriggerData',
|
|
20
|
+
],
|
|
21
|
+
outputs: ['cdkMenuOpened: hlmDropdownMenuOpened', 'cdkMenuClosed: hlmDropdownMenuClosed'],
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
host: { 'data-slot': 'dropdown-menu-trigger' },
|
|
25
|
+
})
|
|
26
|
+
export class HlmDropdownMenuTrigger {
|
|
27
|
+
private readonly _cdkTrigger = inject(CdkMenuTrigger, { host: true });
|
|
28
|
+
private readonly _config = injectHlmDropdownMenuConfig();
|
|
29
|
+
|
|
30
|
+
public readonly align = input<MenuAlign>(this._config.align);
|
|
31
|
+
public readonly side = input<MenuSide>(this._config.side);
|
|
32
|
+
|
|
33
|
+
private readonly _menuPosition = computed(() => createMenuPosition(this.align(), this.side()));
|
|
34
|
+
|
|
35
|
+
constructor() {
|
|
36
|
+
// CDK sets transform-origin on the menu content from the resolved position; the content reads it to
|
|
37
|
+
// animate from the anchored corner and to derive its data-side. Cast tolerates @angular/cdk < 21.2
|
|
38
|
+
// (we still support >=21.0), where the property is absent and the assignment is a harmless no-op.
|
|
39
|
+
(this._cdkTrigger as { transformOriginSelector?: string }).transformOriginSelector =
|
|
40
|
+
'[data-slot="dropdown-menu"]';
|
|
41
|
+
|
|
42
|
+
effect(() => {
|
|
43
|
+
this._cdkTrigger.menuPosition = this._menuPosition();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type NumberInput } from '@angular/cdk/coercion';
|
|
2
|
+
import { CdkMenu } from '@angular/cdk/menu';
|
|
3
|
+
import { Directive, ElementRef, inject, input, numberAttribute, signal } from '@angular/core';
|
|
4
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
+
import {
|
|
6
|
+
deriveMenuSideFromTransformOrigin,
|
|
7
|
+
MENU_SIDE,
|
|
8
|
+
type MenuSide,
|
|
9
|
+
} from '@spartan-ng/brain/core';
|
|
10
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
11
|
+
|
|
12
|
+
@Directive({
|
|
13
|
+
selector: '[hlmDropdownMenu],hlm-dropdown-menu',
|
|
14
|
+
hostDirectives: [CdkMenu],
|
|
15
|
+
host: {
|
|
16
|
+
'data-slot': 'dropdown-menu',
|
|
17
|
+
'[attr.data-state]': '_state()',
|
|
18
|
+
'[attr.data-side]': '_side()',
|
|
19
|
+
'[style.--side-offset]': 'sideOffset()',
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
export class HlmDropdownMenu {
|
|
23
|
+
private readonly _host = inject(CdkMenu);
|
|
24
|
+
private readonly _elementRef = inject(ElementRef<HTMLElement>);
|
|
25
|
+
// The trigger provides its configured side; CDK parents this content's injector under the trigger's.
|
|
26
|
+
private readonly _menuSide = inject(MENU_SIDE, { optional: true });
|
|
27
|
+
|
|
28
|
+
protected readonly _state = signal('open');
|
|
29
|
+
protected readonly _side = signal<MenuSide>(this._menuSide?.side() ?? 'bottom');
|
|
30
|
+
|
|
31
|
+
public readonly sideOffset = input<number, NumberInput>(1, { transform: numberAttribute });
|
|
32
|
+
|
|
33
|
+
constructor() {
|
|
34
|
+
classes(
|
|
35
|
+
() =>
|
|
36
|
+
'motion-safe:data-open:animate-in motion-safe:data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 my-[--spacing(var(--side-offset))] overflow-x-hidden overflow-y-auto outline-none',
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
this.setSideFromTransformOrigin();
|
|
40
|
+
// this is a best effort, but does not seem to work currently
|
|
41
|
+
// TODO: figure out a way for us to know the host is about to be closed. might not be possible with CDK
|
|
42
|
+
this._host.closed.pipe(takeUntilDestroyed()).subscribe(() => this._state.set('closed'));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private setSideFromTransformOrigin() {
|
|
46
|
+
const side = this._menuSide?.side() ?? 'bottom';
|
|
47
|
+
// CDK sets transform-origin on this element synchronously on attach; read it next tick and derive side
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
this._side.set(
|
|
50
|
+
deriveMenuSideFromTransformOrigin(
|
|
51
|
+
this._elementRef.nativeElement.style.transformOrigin,
|
|
52
|
+
side,
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|