@salesforce/ui-bundle-template-app-angular-template-b2x 11.60.0 → 11.62.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/dist/CHANGELOG.md +16 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/angular.json +2 -7
- package/dist/force-app/main/default/uiBundles/angularextapp/components.json +6 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/eslint.config.js +9 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/package.json +16 -11
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/app.config.ts +4 -6
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/app.routes.ts +2 -2
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/alert/alert.html +9 -13
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/alert/alert.ts +16 -28
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/button/button.html +19 -10
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/button/button.ts +34 -25
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/card/card.ts +40 -50
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/collapsible/collapsible.html +38 -10
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/collapsible/collapsible.ts +6 -11
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/date-picker/date-picker.html +17 -22
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/date-picker/date-picker.ts +29 -21
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/date-range-picker/date-range-picker.html +16 -30
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/date-range-picker/date-range-picker.ts +39 -36
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/dialog/dialog.html +13 -30
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/dialog/dialog.ts +6 -21
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/field/field.html +5 -11
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/field/field.ts +10 -18
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/field-appearance.ts +8 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/icon/icon.ts +62 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/input/input.html +32 -17
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/input/input.ts +57 -14
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/label/label.ts +8 -4
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/paginator/paginator.html +74 -10
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/paginator/paginator.ts +74 -18
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/paginator/types.ts +13 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/popover/popover.html +10 -38
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/popover/popover.ts +12 -15
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/select/select.html +34 -22
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/select/select.ts +25 -34
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/separator/separator.ts +11 -36
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/skeleton/skeleton.ts +5 -9
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/spinner/spinner.ts +14 -21
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/authentication/auth-form/auth-form.html +2 -3
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/authentication/menu/auth-menu/auth-menu.html +31 -21
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/authentication/menu/auth-menu/auth-menu.ts +6 -18
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/authentication/session/session.html +2 -2
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/authentication/submit-button/submit-button.html +8 -4
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/authentication/submit-button/submit-button.ts +4 -16
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/breadcrumb/breadcrumb.html +4 -24
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/breadcrumb/breadcrumb.ts +3 -16
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/date-filter.ts +1 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/date-range-filter.html +2 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/date-range-filter.ts +6 -15
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/filter-field-wrapper.html +2 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/filter-field-wrapper.ts +2 -17
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/multi-select-filter.html +2 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/numeric-range-filter.ts +3 -21
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/search-filter.html +3 -3
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/search-filter.ts +9 -13
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/select-filter.html +2 -5
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/select-filter.ts +1 -15
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/text-filter.html +2 -5
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/filters/text-filter.ts +3 -17
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/pagination/pagination.ts +4 -20
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/search-bar/search-bar.html +10 -59
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/search-bar/search-bar.ts +13 -93
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/sort-control/sort-control.html +3 -29
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/object-search/sort-control/sort-control.ts +5 -12
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/account-detail/account-detail-page.html +1 -23
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/account-detail/account-detail-page.ts +3 -23
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/account-search/account-search-page.html +1 -19
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/account-search/account-search-page.ts +8 -36
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/home/home.html +15 -4
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/home/home.spec.ts +8 -6
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/home/home.ts +56 -4
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/alert/src/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/alert/src/lib/hlm-alert-action.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/alert/src/lib/hlm-alert-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/alert/src/lib/hlm-alert-title.ts +17 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/alert/src/lib/hlm-alert.ts +35 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/button/src/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/button/src/lib/hlm-button.token.ts +22 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/button/src/lib/hlm-button.ts +72 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/calendar/src/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/calendar/src/lib/hlm-calendar-multi.ts +195 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/calendar/src/lib/hlm-calendar-range.ts +194 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/calendar/src/lib/hlm-calendar.ts +189 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/calendar/src/lib/hlm-month-year-calendar.ts +119 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card-action.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card-avatar.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card-footer.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card-header.ts +15 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card.token.ts +19 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/card/src/lib/hlm-card.ts +22 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/collapsible/src/index.ts +13 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/collapsible/src/lib/hlm-collapsible-content.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/collapsible/src/lib/hlm-collapsible-trigger.ts +9 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/collapsible/src/lib/hlm-collapsible.ts +15 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/index.ts +38 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-multi-input.ts +104 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-picker-anchor.ts +23 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-picker-input.ts +118 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-picker-multi.token.ts +109 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-picker-multi.ts +220 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-picker-trigger.ts +104 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-picker.token.ts +69 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-picker.ts +203 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-range-input.ts +120 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-range-picker.token.ts +86 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-date-range-picker.ts +252 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-month-year-input.ts +105 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-month-year-picker.token.ts +89 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/date-picker/src/lib/hlm-month-year-picker.ts +196 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/index.ts +35 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-close.ts +9 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-content.ts +74 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-footer.ts +15 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-overlay.ts +27 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-title.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog.service.ts +46 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dialog/src/lib/hlm-dialog.ts +24 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/index.ts +49 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-checkbox.ts +54 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-focus-on-hover.ts +35 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-item.ts +42 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-label.ts +20 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-radio-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-radio.ts +49 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-separator.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-shortcut.ts +15 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-sub-trigger.ts +52 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-sub.ts +53 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-token.ts +26 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu-trigger.ts +46 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/dropdown-menu/src/lib/hlm-dropdown-menu.ts +57 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/index.ts +34 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-description.ts +53 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-error.ts +100 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-group.ts +15 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-legend.ts +19 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-separator.ts +24 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-set.ts +15 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field-title.ts +15 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/field/src/lib/hlm-field.ts +47 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input/src/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input/src/lib/hlm-input.ts +21 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input-group/src/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input-group/src/lib/hlm-input-group-addon.ts +40 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input-group/src/lib/hlm-input-group-button.ts +47 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input-group/src/lib/hlm-input-group-input.ts +17 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input-group/src/lib/hlm-input-group-text.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/input-group/src/lib/hlm-input-group.ts +18 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/label/label.html +11 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/label/src/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/label/src/lib/hlm-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-numbered-pagination-query-params.ts +191 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-numbered-pagination.ts +290 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-pagination-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-pagination-ellipsis.ts +27 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-pagination-item.ts +7 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-pagination-link.ts +51 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-pagination-next.ts +65 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-pagination-previous.ts +65 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/pagination/src/lib/hlm-pagination.ts +19 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/lib/hlm-popover-content.ts +25 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/lib/hlm-popover-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/lib/hlm-popover-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/lib/hlm-popover-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/lib/hlm-popover-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/lib/hlm-popover-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/popover/src/lib/hlm-popover.ts +23 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/index.ts +52 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-content.ts +44 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-item.ts +36 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-label.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-multiple.ts +37 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-placeholder.ts +17 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-scroll-down.ts +22 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-scroll-up.ts +22 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-separator.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-trigger.ts +59 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-value-template.ts +5 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-value.ts +18 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-values-content.ts +9 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select-values.ts +5 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/select/src/lib/hlm-select.ts +37 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/separator/src/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/separator/src/lib/hlm-separator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/skeleton/src/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/skeleton/src/lib/hlm-skeleton.ts +14 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/spinner/src/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/spinner/src/lib/hlm-spinner.ts +26 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/utils/src/index.ts +2 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/utils/src/lib/hlm.ts +313 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/shared/spartan/utils/src/lib/provide-spartan-hlm.ts +34 -0
- package/dist/force-app/main/default/uiBundles/angularextapp/src/index.html +0 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/src/{styles.scss → styles.css} +7 -38
- package/dist/force-app/main/default/uiBundles/angularextapp/tsconfig.json +4 -1
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/_field-size.scss +0 -42
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/button/button.scss +0 -112
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/card/card.scss +0 -34
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/date-picker/date-picker.scss +0 -36
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/date-range-picker/date-range-picker.scss +0 -33
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/input/input.scss +0 -35
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/label/label.html +0 -3
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/select/select.scss +0 -35
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/separator/separator.html +0 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/separator/separator.scss +0 -23
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/skeleton/skeleton.html +0 -1
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/components/ui/skeleton/skeleton.scss +0 -28
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/features/authentication/submit-button/submit-button.scss +0 -17
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/account-detail/account-detail-page.scss +0 -7
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/home/home-page.html +0 -18
- package/dist/force-app/main/default/uiBundles/angularextapp/src/app/pages/home/home-page.ts +0 -47
- package/dist/force-app/main/default/uiBundles/angularextapp/src/theme.scss +0 -39
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { HlmField } from './lib/hlm-field';
|
|
2
|
+
import { HlmFieldContent } from './lib/hlm-field-content';
|
|
3
|
+
import { HlmFieldDescription } from './lib/hlm-field-description';
|
|
4
|
+
import { HlmFieldError } from './lib/hlm-field-error';
|
|
5
|
+
import { HlmFieldGroup } from './lib/hlm-field-group';
|
|
6
|
+
import { HlmFieldLabel } from './lib/hlm-field-label';
|
|
7
|
+
import { HlmFieldLegend } from './lib/hlm-field-legend';
|
|
8
|
+
import { HlmFieldSeparator } from './lib/hlm-field-separator';
|
|
9
|
+
import { HlmFieldSet } from './lib/hlm-field-set';
|
|
10
|
+
import { HlmFieldTitle } from './lib/hlm-field-title';
|
|
11
|
+
|
|
12
|
+
export * from './lib/hlm-field';
|
|
13
|
+
export * from './lib/hlm-field-content';
|
|
14
|
+
export * from './lib/hlm-field-description';
|
|
15
|
+
export * from './lib/hlm-field-error';
|
|
16
|
+
export * from './lib/hlm-field-group';
|
|
17
|
+
export * from './lib/hlm-field-label';
|
|
18
|
+
export * from './lib/hlm-field-legend';
|
|
19
|
+
export * from './lib/hlm-field-separator';
|
|
20
|
+
export * from './lib/hlm-field-set';
|
|
21
|
+
export * from './lib/hlm-field-title';
|
|
22
|
+
|
|
23
|
+
export const HlmFieldImports = [
|
|
24
|
+
HlmField,
|
|
25
|
+
HlmFieldContent,
|
|
26
|
+
HlmFieldDescription,
|
|
27
|
+
HlmFieldError,
|
|
28
|
+
HlmFieldGroup,
|
|
29
|
+
HlmFieldLabel,
|
|
30
|
+
HlmFieldLegend,
|
|
31
|
+
HlmFieldSeparator,
|
|
32
|
+
HlmFieldSet,
|
|
33
|
+
HlmFieldTitle,
|
|
34
|
+
] as const;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmFieldContent],hlm-field-content',
|
|
6
|
+
host: { 'data-slot': 'field-content' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmFieldContent {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(() => 'gap-0.5 group/field-content flex flex-1 flex-col leading-snug');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Directive, effect, EffectRef, inject, input, OnDestroy } from '@angular/core';
|
|
2
|
+
import { BrnFieldA11yService } from '@spartan-ng/brain/field';
|
|
3
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
4
|
+
|
|
5
|
+
@Directive({
|
|
6
|
+
selector: '[hlmFieldDescription],hlm-field-description',
|
|
7
|
+
host: {
|
|
8
|
+
'data-slot': 'field-description',
|
|
9
|
+
'[attr.id]': 'id()',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
export class HlmFieldDescription implements OnDestroy {
|
|
13
|
+
private static _id = 0;
|
|
14
|
+
|
|
15
|
+
private readonly _a11y = inject(BrnFieldA11yService, { optional: true, host: true });
|
|
16
|
+
|
|
17
|
+
public readonly id = input<string>(`hlm-field-description-${HlmFieldDescription._id++}`);
|
|
18
|
+
|
|
19
|
+
private _registeredId?: string;
|
|
20
|
+
|
|
21
|
+
private readonly _cleanup: EffectRef | null = this._a11y
|
|
22
|
+
? effect(() => {
|
|
23
|
+
const a11y = this._a11y;
|
|
24
|
+
if (!a11y) return;
|
|
25
|
+
|
|
26
|
+
const id = this.id();
|
|
27
|
+
if (this._registeredId && this._registeredId !== id) {
|
|
28
|
+
a11y.unregisterDescription(this._registeredId);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (this._registeredId !== id) {
|
|
32
|
+
a11y.registerDescription(id);
|
|
33
|
+
this._registeredId = id;
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
: null;
|
|
37
|
+
|
|
38
|
+
constructor() {
|
|
39
|
+
classes(() => [
|
|
40
|
+
'text-muted-foreground text-start text-sm [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-data-horizontal/field:text-balance',
|
|
41
|
+
'last:mt-0 nth-last-2:-mt-1',
|
|
42
|
+
'[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ngOnDestroy() {
|
|
47
|
+
this._cleanup?.destroy();
|
|
48
|
+
|
|
49
|
+
if (this._registeredId) {
|
|
50
|
+
this._a11y?.unregisterDescription(this._registeredId);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import {
|
|
3
|
+
booleanAttribute,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
effect,
|
|
8
|
+
EffectRef,
|
|
9
|
+
inject,
|
|
10
|
+
input,
|
|
11
|
+
OnDestroy,
|
|
12
|
+
} from '@angular/core';
|
|
13
|
+
import { BrnField, BrnFieldA11yService } from '@spartan-ng/brain/field';
|
|
14
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'hlm-field-error',
|
|
18
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
+
host: {
|
|
20
|
+
role: 'alert',
|
|
21
|
+
'data-slot': 'field-error',
|
|
22
|
+
'[attr.id]': 'id()',
|
|
23
|
+
'[hidden]': '!_display()',
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
@if (_display()) {
|
|
27
|
+
<ng-content />
|
|
28
|
+
}
|
|
29
|
+
`,
|
|
30
|
+
})
|
|
31
|
+
export class HlmFieldError implements OnDestroy {
|
|
32
|
+
private static _id = 0;
|
|
33
|
+
|
|
34
|
+
private readonly _field = inject(BrnField, { optional: true });
|
|
35
|
+
private readonly _a11y = inject(BrnFieldA11yService, { optional: true, host: true });
|
|
36
|
+
|
|
37
|
+
private _registeredId?: string | undefined;
|
|
38
|
+
|
|
39
|
+
private readonly _hasParentField = !!this._field;
|
|
40
|
+
|
|
41
|
+
/** The unique ID for the field error. If none is supplied, it will be auto-generated. */
|
|
42
|
+
public readonly id = input<string>(`hlm-field-error-${HlmFieldError._id++}`);
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The name of the specific validator error key to match (e.g. 'required').
|
|
46
|
+
* When omitted, the error is shown if any validation error is present.
|
|
47
|
+
*/
|
|
48
|
+
public readonly validator = input<string>();
|
|
49
|
+
|
|
50
|
+
/** Forces the error message to be visible regardless of the control's validation state. */
|
|
51
|
+
public readonly forceShow = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
52
|
+
|
|
53
|
+
protected readonly _display = computed(
|
|
54
|
+
() => !this._hasParentField || this.forceShow() || this._hasError(),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
protected readonly _hasError = computed(() => {
|
|
58
|
+
const errors = this._field?.errors();
|
|
59
|
+
if (!errors) return false;
|
|
60
|
+
|
|
61
|
+
const validator = this.validator();
|
|
62
|
+
const spartanInvalid = this._field?.controlState()?.spartanInvalid;
|
|
63
|
+
|
|
64
|
+
if (!spartanInvalid) return false;
|
|
65
|
+
|
|
66
|
+
return validator ? validator in errors : Object.keys(errors).length > 0;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
private readonly _cleanup: EffectRef | null = this._a11y
|
|
70
|
+
? effect(() => {
|
|
71
|
+
const a11y = this._a11y;
|
|
72
|
+
if (!a11y) return;
|
|
73
|
+
|
|
74
|
+
const id = this.id();
|
|
75
|
+
const hasError = this._hasError();
|
|
76
|
+
|
|
77
|
+
if (this._registeredId && (this._registeredId !== id || !hasError)) {
|
|
78
|
+
a11y.unregisterError(this._registeredId);
|
|
79
|
+
this._registeredId = undefined;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (hasError && this._registeredId !== id) {
|
|
83
|
+
a11y.registerError(id);
|
|
84
|
+
this._registeredId = id;
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
: null;
|
|
88
|
+
|
|
89
|
+
constructor() {
|
|
90
|
+
classes(() => 'text-destructive text-sm font-normal');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
ngOnDestroy() {
|
|
94
|
+
this._cleanup?.destroy();
|
|
95
|
+
|
|
96
|
+
if (this._registeredId) {
|
|
97
|
+
this._a11y?.unregisterError(this._registeredId);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '@spartan-ng/styles/utils';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[hlmFieldGroup],hlm-field-group',
|
|
6
|
+
host: { 'data-slot': 'field-group' },
|
|
7
|
+
})
|
|
8
|
+
export class HlmFieldGroup {
|
|
9
|
+
constructor() {
|
|
10
|
+
classes(
|
|
11
|
+
() =>
|
|
12
|
+
'gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4 group/field-group @container/field-group flex w-full flex-col',
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
}
|