@salesforce/ui-bundle-template-feature-angular-language-switcher 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 +193 -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-language-switcher/.forceignore +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.graphqlrc.yml +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.postcssrc.json +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.prettierignore +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/.prettierrc +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/CHANGELOG.md +4 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/README.md +85 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/angular.json +98 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/codegen.yml +95 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/components.json +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/e2e/app.spec.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/esbuild/api-version.mjs +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/esbuild/graphql-codegen.mjs +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/eslint-plugin-angular-graphql.js +148 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/eslint.config.js +76 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/feature-angular-language-switcher.uibundle-meta.xml +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/middleware/html.mjs +3 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/middleware/proxy.mjs +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/package.json +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/playwright.config.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/public/favicon.ico +0 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/scripts/get-graphql-schema.mjs +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/scripts/rewrite-e2e-assets.mjs +30 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/api/data-client.service.spec.ts +184 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/api/data-client.service.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.config.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.html +1 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.routes.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.spec.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/app.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/layout/app-layout/app-layout.html +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/layout/app-layout/app-layout.spec.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/layout/app-layout/app-layout.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/alert/alert.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/alert/alert.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/button/button.html +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/button/button.ts +66 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/card/card.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/collapsible/collapsible.html +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/collapsible/collapsible.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-picker/date-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-picker/date-picker.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-range-picker/date-range-picker.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/date-range-picker/date-range-picker.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dialog/dialog.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dialog/dialog.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dropdown-menu/dropdown-menu.html +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/dropdown-menu/dropdown-menu.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field/field.html +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field/field.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field-appearance.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/field-size.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/icon/icon.ts +68 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/input/input.html +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/input/input.ts +79 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/label/label.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/paginator/paginator.html +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/paginator/paginator.ts +93 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/paginator/types.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/popover/popover.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/popover/popover.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/select/select.html +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/select/select.ts +63 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/separator/separator.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/skeleton/skeleton.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/components/ui/spinner/spinner.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/__examples__/html-middleware-site-example.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/__examples__/language-switcher-example.ts +41 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/build-language-url.ts +158 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/language-switcher.html +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/language-switcher.ts +110 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/features/language-switcher/languages.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/home/home.html +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/home/home.spec.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/home/home.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/not-found/not-found.html +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/not-found/not-found.spec.ts +33 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/pages/not-found/not-found.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert-action.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert-title.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/hlm-alert.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/alert/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/button/hlm-button.token.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/button/hlm-button.ts +72 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/button/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-calendar-multi.ts +195 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-calendar-range.ts +194 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-calendar.ts +189 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/hlm-month-year-calendar.ts +119 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/calendar/index.ts +16 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-action.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-avatar.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-footer.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-header.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card.token.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/hlm-card.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/card/index.ts +28 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/hlm-collapsible-content.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/hlm-collapsible-trigger.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/hlm-collapsible.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/collapsible/index.ts +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-multi-input.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-anchor.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-input.ts +118 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-multi.token.ts +109 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-multi.ts +220 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker-trigger.ts +104 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker.token.ts +69 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-picker.ts +203 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-range-input.ts +120 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-range-picker.token.ts +86 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-date-range-picker.ts +252 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-month-year-input.ts +105 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-month-year-picker.token.ts +89 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/hlm-month-year-picker.ts +196 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/date-picker/index.ts +38 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-close.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-content.ts +74 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-description.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-footer.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-overlay.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-title.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog.service.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/hlm-dialog.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dialog/index.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-checkbox.ts +54 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-focus-on-hover.ts +35 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-item-sub-indicator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-item.ts +42 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-label.ts +20 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio-indicator.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-radio.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-separator.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-shortcut.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub-trigger.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-sub.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-token.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu-trigger.ts +46 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/hlm-dropdown-menu.ts +57 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/dropdown-menu/index.ts +49 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-description.ts +53 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-error.ts +100 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-group.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-legend.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-separator.ts +24 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-set.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field-title.ts +15 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/hlm-field.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/field/index.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input/hlm-input.ts +21 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-addon.ts +40 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-button.ts +47 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-input.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group-text.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/hlm-input-group.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/input-group/index.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/label/hlm-label.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/label/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/label/label.html +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-numbered-pagination-query-params.ts +191 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-numbered-pagination.ts +290 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-content.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-ellipsis.ts +27 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-item.ts +7 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-link.ts +51 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-next.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination-previous.ts +65 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/hlm-pagination.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/pagination/index.ts +31 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-content.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-description.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-header.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-title.ts +12 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover-trigger.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/hlm-popover.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/popover/index.ts +25 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-content.ts +44 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-group.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-item.ts +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-label.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-multiple.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-placeholder.ts +17 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-portal.ts +8 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-scroll-down.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-scroll-up.ts +22 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-separator.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-trigger.ts +59 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-value-template.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-value.ts +18 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-values-content.ts +9 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select-values.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/hlm-select.ts +37 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/select/index.ts +52 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/separator/hlm-separator.ts +19 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/separator/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/skeleton/hlm-skeleton.ts +14 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/skeleton/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/spinner/hlm-spinner.ts +26 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/spinner/index.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/utils/hlm.ts +313 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/utils/index.ts +2 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/shared/utils/provide-spartan-hlm.ts +34 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/app/utils/async-data.ts +99 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/index.html +13 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/main.ts +5 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/styles.css +139 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/src/types/sf-globals.d.ts +23 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/tsconfig.app.json +11 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/tsconfig.json +36 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/tsconfig.spec.json +10 -0
- package/dist/force-app/main/default/uiBundles/feature-angular-language-switcher/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 +46 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import type { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import {
|
|
3
|
+
booleanAttribute,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
contentChild,
|
|
8
|
+
forwardRef,
|
|
9
|
+
input,
|
|
10
|
+
linkedSignal,
|
|
11
|
+
output,
|
|
12
|
+
signal,
|
|
13
|
+
untracked,
|
|
14
|
+
viewChild,
|
|
15
|
+
} from '@angular/core';
|
|
16
|
+
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
17
|
+
import {
|
|
18
|
+
type BrnDatePickerBase,
|
|
19
|
+
BrnDatePickerTriggerToken,
|
|
20
|
+
provideBrnDatePicker,
|
|
21
|
+
} from '@spartan-ng/brain/date-picker';
|
|
22
|
+
import { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';
|
|
23
|
+
import type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
24
|
+
import type { BrnOverlayState } from '@spartan-ng/brain/overlay';
|
|
25
|
+
import { BrnPopover, type BrnPopoverAlign } from '@spartan-ng/brain/popover';
|
|
26
|
+
import { HlmCalendarRange } from '@spartan-ng/styles/calendar';
|
|
27
|
+
import { HlmPopoverImports } from '@spartan-ng/styles/popover';
|
|
28
|
+
import { injectHlmDateRangePickerConfig } from './hlm-date-range-picker.token';
|
|
29
|
+
|
|
30
|
+
export const HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR = {
|
|
31
|
+
provide: NG_VALUE_ACCESSOR,
|
|
32
|
+
useExisting: forwardRef(() => HlmDateRangePicker),
|
|
33
|
+
multi: true,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
@Component({
|
|
37
|
+
selector: 'hlm-date-range-picker',
|
|
38
|
+
imports: [HlmPopoverImports, HlmCalendarRange],
|
|
39
|
+
providers: [
|
|
40
|
+
HLM_DATE_RANGE_PICKER_VALUE_ACCESSOR,
|
|
41
|
+
provideBrnDatePicker(HlmDateRangePicker),
|
|
42
|
+
provideBrnLabelable(HlmDateRangePicker),
|
|
43
|
+
],
|
|
44
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
45
|
+
hostDirectives: [BrnFieldControl],
|
|
46
|
+
host: { class: 'block' },
|
|
47
|
+
template: `
|
|
48
|
+
<hlm-popover
|
|
49
|
+
[align]="align()"
|
|
50
|
+
sideOffset="5"
|
|
51
|
+
[state]="_popoverState()"
|
|
52
|
+
(stateChanged)="_onStateChange($event)"
|
|
53
|
+
>
|
|
54
|
+
<ng-content />
|
|
55
|
+
|
|
56
|
+
<hlm-popover-content class="w-fit p-0" *hlmPopoverPortal="let ctx">
|
|
57
|
+
<ng-content select="[hlmDatePickerHeader]" />
|
|
58
|
+
<hlm-calendar-range
|
|
59
|
+
class="rounded-none border-0"
|
|
60
|
+
[startDate]="_start()"
|
|
61
|
+
[captionLayout]="captionLayout()"
|
|
62
|
+
[endDate]="_end()"
|
|
63
|
+
[min]="minDate()"
|
|
64
|
+
[max]="maxDate()"
|
|
65
|
+
[disabled]="_disabled()"
|
|
66
|
+
(startDateChange)="_handleStartDayChange($event)"
|
|
67
|
+
(endDateChange)="_handleEndDateChange($event)"
|
|
68
|
+
/>
|
|
69
|
+
<ng-content select="[hlmDatePickerFooter]" />
|
|
70
|
+
</hlm-popover-content>
|
|
71
|
+
</hlm-popover>
|
|
72
|
+
`,
|
|
73
|
+
})
|
|
74
|
+
export class HlmDateRangePicker<T> implements BrnDatePickerBase<[T, T]>, ControlValueAccessor {
|
|
75
|
+
private readonly _config = injectHlmDateRangePickerConfig<T>();
|
|
76
|
+
|
|
77
|
+
public readonly popover = viewChild.required(BrnPopover);
|
|
78
|
+
|
|
79
|
+
private readonly _trigger = contentChild(BrnDatePickerTriggerToken);
|
|
80
|
+
|
|
81
|
+
public readonly align = input<BrnPopoverAlign>('center');
|
|
82
|
+
|
|
83
|
+
/** Show dropdowns to navigate between months or years. */
|
|
84
|
+
public readonly captionLayout = input<
|
|
85
|
+
'dropdown' | 'label' | 'dropdown-months' | 'dropdown-years'
|
|
86
|
+
>('label');
|
|
87
|
+
|
|
88
|
+
/** The minimum date that can be selected.*/
|
|
89
|
+
public readonly minDate = input<T>();
|
|
90
|
+
|
|
91
|
+
/** The maximum date that can be selected. */
|
|
92
|
+
public readonly maxDate = input<T>();
|
|
93
|
+
|
|
94
|
+
/** Determine if the date picker is disabled. */
|
|
95
|
+
public readonly disabled = input<boolean, BooleanInput>(false, {
|
|
96
|
+
transform: booleanAttribute,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
/** The selected value. */
|
|
100
|
+
public readonly date = input<[T, T]>();
|
|
101
|
+
|
|
102
|
+
protected readonly _mutableDate = linkedSignal(this.date);
|
|
103
|
+
|
|
104
|
+
protected readonly _start = linkedSignal(() => this._mutableDate()?.[0]);
|
|
105
|
+
protected readonly _end = linkedSignal(() => this._mutableDate()?.[1]);
|
|
106
|
+
|
|
107
|
+
/** If true, the date picker will close when the end date is selected */
|
|
108
|
+
public readonly autoCloseOnEndSelection = input<boolean, BooleanInput>(
|
|
109
|
+
this._config.autoCloseOnEndSelection,
|
|
110
|
+
{
|
|
111
|
+
transform: booleanAttribute,
|
|
112
|
+
},
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
/** Defines how the date should be displayed in the UI. */
|
|
116
|
+
public readonly formatDates = input<(dates: [T | null, T | null]) => string>(
|
|
117
|
+
this._config.formatDates,
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
/** Defines how the date should be transformed before saving to model/form. */
|
|
121
|
+
public readonly transformDates = input<(date: [T, T]) => [T, T]>(this._config.transformDates);
|
|
122
|
+
|
|
123
|
+
protected readonly _popoverState = signal<BrnOverlayState | null>(null);
|
|
124
|
+
|
|
125
|
+
protected readonly _disabled = linkedSignal(this.disabled);
|
|
126
|
+
|
|
127
|
+
/** @internal The disabled state as a readonly signal */
|
|
128
|
+
public readonly disabledState = this._disabled.asReadonly();
|
|
129
|
+
|
|
130
|
+
public readonly formattedDate = computed(() => {
|
|
131
|
+
const start = this._start();
|
|
132
|
+
const end = this._end();
|
|
133
|
+
return start || end ? this.formatDates()([start ?? null, end ?? null]) : undefined;
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
public readonly dateChange = output<[T, T] | null>();
|
|
137
|
+
|
|
138
|
+
public readonly labelableId = computed(() => this._trigger()?.triggerId());
|
|
139
|
+
|
|
140
|
+
public readonly hasDate = computed(() => !!this._start() || !!this._end());
|
|
141
|
+
|
|
142
|
+
/** @internal The current raw value, used by inputs to reformat on focus. */
|
|
143
|
+
public readonly value = computed(() => this._mutableDate() ?? null);
|
|
144
|
+
|
|
145
|
+
protected _onChange?: ChangeFn<[T, T] | null>;
|
|
146
|
+
protected _onTouched?: TouchFn;
|
|
147
|
+
|
|
148
|
+
protected _onStateChange(state: BrnOverlayState) {
|
|
149
|
+
this._popoverState.set(state);
|
|
150
|
+
if (state === 'closed') {
|
|
151
|
+
this._onClose();
|
|
152
|
+
this._onTouched?.();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
protected _handleStartDayChange(value: T | undefined) {
|
|
157
|
+
this._start.set(value);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
protected _handleEndDateChange(value: T | undefined): void {
|
|
161
|
+
this._end.set(value);
|
|
162
|
+
if (this._disabled()) return;
|
|
163
|
+
|
|
164
|
+
const start = this._start();
|
|
165
|
+
if (start && value) {
|
|
166
|
+
const transformedDates = this.transformDates()([start, value]);
|
|
167
|
+
this._mutableDate.set(transformedDates);
|
|
168
|
+
this.dateChange.emit(transformedDates);
|
|
169
|
+
this._onChange?.(transformedDates);
|
|
170
|
+
|
|
171
|
+
if (this.autoCloseOnEndSelection()) {
|
|
172
|
+
this._popoverState.set('closed');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Commit a range to the picker. Updates the internal model, notifies form
|
|
179
|
+
* controls, and emits `dateChange`. Intended to be called from a text input
|
|
180
|
+
* that parses user-entered values. Pass `null` to clear the range.
|
|
181
|
+
*/
|
|
182
|
+
public updateDate(value: [T, T] | null) {
|
|
183
|
+
if (this._disabled()) return;
|
|
184
|
+
|
|
185
|
+
if (!value) {
|
|
186
|
+
this._mutableDate.set(undefined);
|
|
187
|
+
this._start.set(undefined);
|
|
188
|
+
this._end.set(undefined);
|
|
189
|
+
this._onChange?.(null);
|
|
190
|
+
this.dateChange.emit(null);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const transformedDates = this.transformDates()(value);
|
|
195
|
+
this._mutableDate.set(transformedDates);
|
|
196
|
+
this._start.set(transformedDates[0]);
|
|
197
|
+
this._end.set(transformedDates[1]);
|
|
198
|
+
this._onChange?.(transformedDates);
|
|
199
|
+
this.dateChange.emit(transformedDates);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
public touched(): void {
|
|
203
|
+
this._onTouched?.();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** CONTROL VALUE ACCESSOR */
|
|
207
|
+
public writeValue(value: [T, T] | null): void {
|
|
208
|
+
untracked(() => {
|
|
209
|
+
if (!value) {
|
|
210
|
+
this._mutableDate.set(undefined);
|
|
211
|
+
} else {
|
|
212
|
+
this._mutableDate.set(this.transformDates()(value));
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
public registerOnChange(fn: ChangeFn<[T, T] | null>): void {
|
|
218
|
+
this._onChange = fn;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
public registerOnTouched(fn: TouchFn): void {
|
|
222
|
+
this._onTouched = fn;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
public setDisabledState(isDisabled: boolean): void {
|
|
226
|
+
this._disabled.set(isDisabled);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
public open() {
|
|
230
|
+
this._popoverState.set('open');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
public close() {
|
|
234
|
+
this._popoverState.set('closed');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
public reset() {
|
|
238
|
+
this._mutableDate.set(undefined);
|
|
239
|
+
this._start.set(undefined);
|
|
240
|
+
this._end.set(undefined);
|
|
241
|
+
this._onChange?.(null);
|
|
242
|
+
this.dateChange.emit(null);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
protected _onClose(): void {
|
|
246
|
+
const dates = this._mutableDate();
|
|
247
|
+
if (this._start() && !this._end() && dates) {
|
|
248
|
+
this._start.set(dates[0]);
|
|
249
|
+
this._end.set(dates[1]);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
|
2
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
|
+
import { lucideCalendar, lucideX } from '@ng-icons/lucide';
|
|
4
|
+
import {
|
|
5
|
+
BrnDateInput,
|
|
6
|
+
type BrnDatePickerTriggerBase,
|
|
7
|
+
provideBrnDatePickerTrigger,
|
|
8
|
+
} from '@spartan-ng/brain/date-picker';
|
|
9
|
+
import { BrnFieldControl } from '@spartan-ng/brain/field';
|
|
10
|
+
import { HlmInputGroup, HlmInputGroupImports } from '@spartan-ng/styles/input-group';
|
|
11
|
+
import { injectHlmMonthYearPickerConfig } from './hlm-month-year-picker.token';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'hlm-month-year-input',
|
|
15
|
+
imports: [HlmInputGroupImports, NgIcon],
|
|
16
|
+
providers: [
|
|
17
|
+
provideIcons({ lucideCalendar, lucideX }),
|
|
18
|
+
provideBrnDatePickerTrigger(HlmMonthYearInput),
|
|
19
|
+
],
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
hostDirectives: [HlmInputGroup],
|
|
22
|
+
template: `
|
|
23
|
+
<input
|
|
24
|
+
#input
|
|
25
|
+
hlmInputGroupInput
|
|
26
|
+
[value]="_inputValue()"
|
|
27
|
+
[id]="inputId()"
|
|
28
|
+
[placeholder]="placeholder()"
|
|
29
|
+
[disabled]="_disabled()"
|
|
30
|
+
[forceInvalid]="forceInvalid()"
|
|
31
|
+
[attr.aria-invalid]="_ariaInvalid()"
|
|
32
|
+
[attr.data-invalid]="_ariaInvalid()"
|
|
33
|
+
[attr.data-touched]="_touched?.() ? 'true' : null"
|
|
34
|
+
[attr.data-dirty]="_dirty?.() ? 'true' : null"
|
|
35
|
+
[attr.data-matches-spartan-invalid]="_spartanInvalid() ? 'true' : null"
|
|
36
|
+
(click)="_handleClick()"
|
|
37
|
+
(keydown.arrowDown)="_open()"
|
|
38
|
+
(keydown.enter)="_handleEnter($event)"
|
|
39
|
+
(input)="_handleInputChange($event)"
|
|
40
|
+
(focus)="_handleFocus()"
|
|
41
|
+
(blur)="_handleBlur()"
|
|
42
|
+
/>
|
|
43
|
+
<hlm-input-group-addon align="inline-end">
|
|
44
|
+
@if (_showClearButton()) {
|
|
45
|
+
<button
|
|
46
|
+
hlmInputGroupButton
|
|
47
|
+
size="icon-xs"
|
|
48
|
+
variant="ghost"
|
|
49
|
+
[attr.aria-label]="clearAriaLabel()"
|
|
50
|
+
(click)="_clear()"
|
|
51
|
+
[disabled]="_disabled()"
|
|
52
|
+
>
|
|
53
|
+
<ng-icon name="lucideX" />
|
|
54
|
+
</button>
|
|
55
|
+
}
|
|
56
|
+
<button
|
|
57
|
+
hlmInputGroupButton
|
|
58
|
+
size="icon-xs"
|
|
59
|
+
[attr.aria-label]="calendarAriaLabel()"
|
|
60
|
+
(click)="_popover().open()"
|
|
61
|
+
[disabled]="_disabled()"
|
|
62
|
+
>
|
|
63
|
+
<ng-icon name="lucideCalendar" />
|
|
64
|
+
</button>
|
|
65
|
+
</hlm-input-group-addon>
|
|
66
|
+
`,
|
|
67
|
+
})
|
|
68
|
+
export class HlmMonthYearInput<T> extends BrnDateInput<T> implements BrnDatePickerTriggerBase {
|
|
69
|
+
private readonly _config = injectHlmMonthYearPickerConfig<T>();
|
|
70
|
+
private readonly _fieldControl = inject(BrnFieldControl, { optional: true });
|
|
71
|
+
|
|
72
|
+
private readonly _invalid = this._fieldControl?.invalid;
|
|
73
|
+
protected readonly _spartanInvalid = computed(
|
|
74
|
+
() => this.forceInvalid() || this._fieldControl?.spartanInvalid(),
|
|
75
|
+
);
|
|
76
|
+
protected readonly _dirty = this._fieldControl?.dirty;
|
|
77
|
+
protected readonly _touched = this._fieldControl?.touched;
|
|
78
|
+
|
|
79
|
+
protected readonly _ariaInvalid = computed(() => (this._invalid?.() ? 'true' : null));
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Parses input text into a date value. Return `null` for invalid
|
|
83
|
+
* input - the picker's date is cleared while the text is preserved so
|
|
84
|
+
* the user can fix it.
|
|
85
|
+
*
|
|
86
|
+
* Defaults to `parseDate` from `HlmMonthYearPickerConfig`.
|
|
87
|
+
*/
|
|
88
|
+
public readonly parseDate = input<(value: string) => T | null>(this._config.parseDate);
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Formats the current date into the input/edit format shown while the
|
|
92
|
+
* input is focused. On blur the picker's display format is restored.
|
|
93
|
+
*
|
|
94
|
+
* Defaults to `formatInputDate` from `HlmMonthYearPickerConfig`.
|
|
95
|
+
*/
|
|
96
|
+
public readonly formatInputDate = input<(date: T) => string>(this._config.formatInputDate);
|
|
97
|
+
|
|
98
|
+
protected override parseValue(value: string): T | null {
|
|
99
|
+
return this.parseDate()(value);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
protected override formatInputValue(value: T): string {
|
|
103
|
+
return this.formatInputDate()(value);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { inject, InjectionToken, type ValueProvider } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export interface HlmMonthYearPickerConfig<T> {
|
|
4
|
+
/**
|
|
5
|
+
* If true, the date picker will close when a date is selected.
|
|
6
|
+
*/
|
|
7
|
+
autoCloseOnSelect: boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Defines how the date should be displayed in the UI.
|
|
11
|
+
*
|
|
12
|
+
* @param date
|
|
13
|
+
* @returns formatted date
|
|
14
|
+
*/
|
|
15
|
+
formatDate: (date: T) => string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Defines how the date should be displayed while the input is focused,
|
|
19
|
+
* i.e. the format the user is expected to type in.
|
|
20
|
+
*
|
|
21
|
+
* @param date
|
|
22
|
+
* @returns formatted date in the input/edit format
|
|
23
|
+
*/
|
|
24
|
+
formatInputDate: (date: T) => string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Defines how the date should be transformed before saving to model/form.
|
|
28
|
+
*
|
|
29
|
+
* @param date
|
|
30
|
+
* @returns transformed date
|
|
31
|
+
*/
|
|
32
|
+
transformDate: (date: T) => T;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Parse a user-entered string into a date.
|
|
36
|
+
*
|
|
37
|
+
* @param value the raw string from the input
|
|
38
|
+
* @returns the parsed date, or `null` when the value can't be parsed
|
|
39
|
+
*/
|
|
40
|
+
parseDate: (value: string) => T | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const mmYYYY = <T>(date: T) => {
|
|
44
|
+
if (!(date instanceof Date)) return `${date}`;
|
|
45
|
+
|
|
46
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
47
|
+
const year = date.getFullYear();
|
|
48
|
+
|
|
49
|
+
return `${month}/${year}`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
function getDefaultConfig<T>(): HlmMonthYearPickerConfig<T> {
|
|
53
|
+
return {
|
|
54
|
+
formatDate: mmYYYY,
|
|
55
|
+
formatInputDate: mmYYYY,
|
|
56
|
+
transformDate: (date) => date,
|
|
57
|
+
parseDate: (value) => {
|
|
58
|
+
if (typeof value !== 'string') return null;
|
|
59
|
+
|
|
60
|
+
const match = value.match(/^(\d{2})\/(\d{4})$/);
|
|
61
|
+
if (!match) return null;
|
|
62
|
+
|
|
63
|
+
const month = Number(match[1]);
|
|
64
|
+
const year = Number(match[2]);
|
|
65
|
+
|
|
66
|
+
if (month < 1 || month > 12) return null;
|
|
67
|
+
|
|
68
|
+
const date = new Date(year, month - 1, 1);
|
|
69
|
+
|
|
70
|
+
return date as T;
|
|
71
|
+
},
|
|
72
|
+
autoCloseOnSelect: false,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const HlmMonthYearPickerConfigToken = new InjectionToken<HlmMonthYearPickerConfig<unknown>>(
|
|
77
|
+
'HlmMonthYearPickerConfig',
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export function provideHlmMonthYearPickerConfig<T>(
|
|
81
|
+
config: Partial<HlmMonthYearPickerConfig<T>>,
|
|
82
|
+
): ValueProvider {
|
|
83
|
+
return { provide: HlmMonthYearPickerConfigToken, useValue: { ...getDefaultConfig(), ...config } };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function injectHlmMonthYearPickerConfig<T>(): HlmMonthYearPickerConfig<T> {
|
|
87
|
+
const injectedConfig = inject(HlmMonthYearPickerConfigToken, { optional: true });
|
|
88
|
+
return injectedConfig ? (injectedConfig as HlmMonthYearPickerConfig<T>) : getDefaultConfig();
|
|
89
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
+
import {
|
|
3
|
+
booleanAttribute,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
computed,
|
|
7
|
+
contentChild,
|
|
8
|
+
forwardRef,
|
|
9
|
+
input,
|
|
10
|
+
linkedSignal,
|
|
11
|
+
output,
|
|
12
|
+
signal,
|
|
13
|
+
viewChild,
|
|
14
|
+
} from '@angular/core';
|
|
15
|
+
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
16
|
+
import {
|
|
17
|
+
type BrnDatePickerBase,
|
|
18
|
+
BrnDatePickerTriggerToken,
|
|
19
|
+
provideBrnDatePicker,
|
|
20
|
+
} from '@spartan-ng/brain/date-picker';
|
|
21
|
+
import { BrnFieldControl, provideBrnLabelable } from '@spartan-ng/brain/field';
|
|
22
|
+
import type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
23
|
+
import type { BrnOverlayState } from '@spartan-ng/brain/overlay';
|
|
24
|
+
import { BrnPopover, type BrnPopoverAlign } from '@spartan-ng/brain/popover';
|
|
25
|
+
import { HlmCalendarImports } from '@spartan-ng/styles/calendar';
|
|
26
|
+
import { HlmPopoverImports } from '@spartan-ng/styles/popover';
|
|
27
|
+
import { injectHlmMonthYearPickerConfig } from './hlm-month-year-picker.token';
|
|
28
|
+
|
|
29
|
+
export const HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR = {
|
|
30
|
+
provide: NG_VALUE_ACCESSOR,
|
|
31
|
+
useExisting: forwardRef(() => HlmMonthYearPicker),
|
|
32
|
+
multi: true,
|
|
33
|
+
};
|
|
34
|
+
@Component({
|
|
35
|
+
selector: 'hlm-month-year-picker',
|
|
36
|
+
imports: [HlmPopoverImports, HlmCalendarImports],
|
|
37
|
+
providers: [
|
|
38
|
+
HLM_MONTH_YEAR_PICKER_VALUE_ACCESSOR,
|
|
39
|
+
provideBrnDatePicker(HlmMonthYearPicker),
|
|
40
|
+
provideBrnLabelable(HlmMonthYearPicker),
|
|
41
|
+
],
|
|
42
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
43
|
+
hostDirectives: [BrnFieldControl],
|
|
44
|
+
host: { class: 'block' },
|
|
45
|
+
template: `
|
|
46
|
+
<hlm-popover
|
|
47
|
+
[align]="align()"
|
|
48
|
+
sideOffset="5"
|
|
49
|
+
[state]="_popoverState()"
|
|
50
|
+
(stateChanged)="_onStateChange($event)"
|
|
51
|
+
>
|
|
52
|
+
<ng-content />
|
|
53
|
+
|
|
54
|
+
<hlm-popover-content class="w-fit p-0" *hlmPopoverPortal="let ctx">
|
|
55
|
+
<ng-content select="[hlmDatePickerHeader]" />
|
|
56
|
+
<hlm-month-year-calendar
|
|
57
|
+
class="rounded-none border-0"
|
|
58
|
+
[date]="_mutableDate()"
|
|
59
|
+
[defaultFocusedDate]="_mutableDate() ?? defaultFocusedDate()"
|
|
60
|
+
[min]="minDate()"
|
|
61
|
+
[max]="maxDate()"
|
|
62
|
+
[disabled]="_disabled()"
|
|
63
|
+
(dateChange)="_handleChange($event)"
|
|
64
|
+
/>
|
|
65
|
+
<ng-content select="[hlmDatePickerFooter]" />
|
|
66
|
+
</hlm-popover-content>
|
|
67
|
+
</hlm-popover>
|
|
68
|
+
`,
|
|
69
|
+
})
|
|
70
|
+
export class HlmMonthYearPicker<T> implements BrnDatePickerBase<T>, ControlValueAccessor {
|
|
71
|
+
private readonly _config = injectHlmMonthYearPickerConfig<T>();
|
|
72
|
+
|
|
73
|
+
public readonly popover = viewChild.required(BrnPopover);
|
|
74
|
+
|
|
75
|
+
private readonly _trigger = contentChild(BrnDatePickerTriggerToken);
|
|
76
|
+
|
|
77
|
+
public readonly align = input<BrnPopoverAlign>('center');
|
|
78
|
+
|
|
79
|
+
/** The minimum date that can be selected.*/
|
|
80
|
+
public readonly minDate = input<T>();
|
|
81
|
+
|
|
82
|
+
/** The maximum date that can be selected. */
|
|
83
|
+
public readonly maxDate = input<T>();
|
|
84
|
+
|
|
85
|
+
/** Determine if the date picker is disabled. */
|
|
86
|
+
public readonly disabled = input<boolean, BooleanInput>(false, {
|
|
87
|
+
transform: booleanAttribute,
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
/** The selected value. */
|
|
91
|
+
public readonly date = input<T>();
|
|
92
|
+
|
|
93
|
+
/** The date the calendar focuses on first open when no date is selected. */
|
|
94
|
+
public readonly defaultFocusedDate = input<T>();
|
|
95
|
+
|
|
96
|
+
protected readonly _mutableDate = linkedSignal(this.date);
|
|
97
|
+
|
|
98
|
+
/** If true, the date picker will close when a date is selected. */
|
|
99
|
+
public readonly autoCloseOnSelect = input<boolean, BooleanInput>(this._config.autoCloseOnSelect, {
|
|
100
|
+
transform: booleanAttribute,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
/** Defines how the date should be displayed in the UI. */
|
|
104
|
+
public readonly formatDate = input<(date: T) => string>(this._config.formatDate);
|
|
105
|
+
|
|
106
|
+
/** Defines how the date should be transformed before saving to model/form. */
|
|
107
|
+
public readonly transformDate = input<(date: T) => T>(this._config.transformDate);
|
|
108
|
+
|
|
109
|
+
protected readonly _popoverState = signal<BrnOverlayState | null>(null);
|
|
110
|
+
|
|
111
|
+
protected readonly _disabled = linkedSignal(this.disabled);
|
|
112
|
+
|
|
113
|
+
/** @internal The disabled state as a readonly signal */
|
|
114
|
+
public readonly disabledState = this._disabled.asReadonly();
|
|
115
|
+
|
|
116
|
+
public readonly formattedDate = computed(() => {
|
|
117
|
+
const date = this._mutableDate();
|
|
118
|
+
return date ? this.formatDate()(date) : undefined;
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
public readonly dateChange = output<T | null>();
|
|
122
|
+
|
|
123
|
+
public readonly labelableId = computed(() => this._trigger()?.triggerId());
|
|
124
|
+
|
|
125
|
+
public readonly hasDate = computed(() => !!this._mutableDate());
|
|
126
|
+
|
|
127
|
+
/** @internal The current raw value, used by inputs to reformat on focus. */
|
|
128
|
+
public readonly value = computed(() => this._mutableDate() ?? null);
|
|
129
|
+
|
|
130
|
+
protected _onChange?: ChangeFn<T | null>;
|
|
131
|
+
protected _onTouched?: TouchFn;
|
|
132
|
+
|
|
133
|
+
protected _onStateChange(state: BrnOverlayState) {
|
|
134
|
+
this._popoverState.set(state);
|
|
135
|
+
if (state === 'closed') this._onTouched?.();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
protected _handleChange(value: T | undefined) {
|
|
139
|
+
if (this._disabled()) return;
|
|
140
|
+
this.updateDate(value ?? null);
|
|
141
|
+
|
|
142
|
+
if (this.autoCloseOnSelect()) {
|
|
143
|
+
this._popoverState.set('closed');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Commit a date to the picker. Updates the internal model, notifies form
|
|
149
|
+
* controls, and emits `dateChange`. Unlike `_handleChange`, this does not
|
|
150
|
+
* close the popover - it's intended to be called from a text input that
|
|
151
|
+
* is parsing user-entered values while typing.
|
|
152
|
+
*/
|
|
153
|
+
public updateDate(value: T | null) {
|
|
154
|
+
if (this._disabled()) return;
|
|
155
|
+
const transformedDate = value != null ? this.transformDate()(value) : undefined;
|
|
156
|
+
|
|
157
|
+
this._mutableDate.set(transformedDate);
|
|
158
|
+
this._onChange?.(transformedDate ?? null);
|
|
159
|
+
this.dateChange.emit(transformedDate ?? null);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** CONTROL VALUE ACCESSOR */
|
|
163
|
+
public writeValue(value: T | null): void {
|
|
164
|
+
this._mutableDate.set(value ? this.transformDate()(value) : undefined);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
public registerOnChange(fn: ChangeFn<T | null>): void {
|
|
168
|
+
this._onChange = fn;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
public registerOnTouched(fn: TouchFn): void {
|
|
172
|
+
this._onTouched = fn;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
public touched(): void {
|
|
176
|
+
this._onTouched?.();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public setDisabledState(isDisabled: boolean): void {
|
|
180
|
+
this._disabled.set(isDisabled);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
public open() {
|
|
184
|
+
this._popoverState.set('open');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
public close() {
|
|
188
|
+
this._popoverState.set('closed');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
public reset() {
|
|
192
|
+
this._mutableDate.set(undefined);
|
|
193
|
+
this._onChange?.(null);
|
|
194
|
+
this.dateChange.emit(null);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HlmDateMultiInput } from './hlm-date-multi-input';
|
|
2
|
+
import { HlmDatePicker } from './hlm-date-picker';
|
|
3
|
+
import { HlmDatePickerAnchor } from './hlm-date-picker-anchor';
|
|
4
|
+
import { HlmDatePickerInput } from './hlm-date-picker-input';
|
|
5
|
+
import { HlmDatePickerMulti } from './hlm-date-picker-multi';
|
|
6
|
+
import { HlmDatePickerTrigger } from './hlm-date-picker-trigger';
|
|
7
|
+
import { HlmDateRangeInput } from './hlm-date-range-input';
|
|
8
|
+
import { HlmDateRangePicker } from './hlm-date-range-picker';
|
|
9
|
+
import { HlmMonthYearInput } from './hlm-month-year-input';
|
|
10
|
+
import { HlmMonthYearPicker } from './hlm-month-year-picker';
|
|
11
|
+
|
|
12
|
+
export * from './hlm-date-multi-input';
|
|
13
|
+
export * from './hlm-date-picker';
|
|
14
|
+
export * from './hlm-date-picker-anchor';
|
|
15
|
+
export * from './hlm-date-picker-input';
|
|
16
|
+
export * from './hlm-date-picker-multi';
|
|
17
|
+
export * from './hlm-date-picker-multi.token';
|
|
18
|
+
export * from './hlm-date-picker-trigger';
|
|
19
|
+
export * from './hlm-date-picker.token';
|
|
20
|
+
export * from './hlm-date-range-input';
|
|
21
|
+
export * from './hlm-date-range-picker';
|
|
22
|
+
export * from './hlm-date-range-picker.token';
|
|
23
|
+
export * from './hlm-month-year-input';
|
|
24
|
+
export * from './hlm-month-year-picker';
|
|
25
|
+
export * from './hlm-month-year-picker.token';
|
|
26
|
+
|
|
27
|
+
export const HlmDatePickerImports = [
|
|
28
|
+
HlmDatePicker,
|
|
29
|
+
HlmDatePickerAnchor,
|
|
30
|
+
HlmDatePickerInput,
|
|
31
|
+
HlmDatePickerMulti,
|
|
32
|
+
HlmDateMultiInput,
|
|
33
|
+
HlmDateRangeInput,
|
|
34
|
+
HlmDateRangePicker,
|
|
35
|
+
HlmDatePickerTrigger,
|
|
36
|
+
HlmMonthYearPicker,
|
|
37
|
+
HlmMonthYearInput,
|
|
38
|
+
] as const;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { BrnDialogClose } from '@spartan-ng/brain/dialog';
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: 'button[hlmDialogClose]',
|
|
6
|
+
hostDirectives: [BrnDialogClose],
|
|
7
|
+
host: { 'data-slot': 'dialog-close' },
|
|
8
|
+
})
|
|
9
|
+
export class HlmDialogClose {}
|