@spartan-ng/brain 0.0.1-alpha.373 → 0.0.1-alpha.379
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/accordion/README.md +3 -0
- package/accordion/index.d.ts +13 -0
- package/accordion/lib/brn-accordion-content.component.d.ts +15 -0
- package/accordion/lib/brn-accordion.directive.d.ts +47 -0
- package/alert-dialog/README.md +3 -0
- package/alert-dialog/index.d.ts +25 -0
- package/alert-dialog/lib/brn-alert-dialog-content.directive.d.ts +6 -0
- package/alert-dialog/lib/brn-alert-dialog-description.directive.d.ts +6 -0
- package/alert-dialog/lib/brn-alert-dialog-overlay.component.d.ts +6 -0
- package/alert-dialog/lib/brn-alert-dialog-title.directive.d.ts +6 -0
- package/alert-dialog/lib/brn-alert-dialog-trigger.directive.d.ts +8 -0
- package/alert-dialog/lib/brn-alert-dialog.component.d.ts +7 -0
- package/avatar/README.md +3 -0
- package/avatar/index.d.ts +17 -0
- package/avatar/lib/brn-avatar.component.d.ts +7 -0
- package/avatar/lib/fallback/brn-avatar-fallback.directive.d.ts +11 -0
- package/avatar/lib/fallback/index.d.ts +1 -0
- package/avatar/lib/image/brn-avatar-image.directive.d.ts +9 -0
- package/avatar/lib/image/index.d.ts +1 -0
- package/avatar/lib/util/hex-color-for.d.ts +1 -0
- package/avatar/lib/util/index.d.ts +3 -0
- package/avatar/lib/util/initials.pipe.d.ts +7 -0
- package/avatar/lib/util/is-bright.d.ts +1 -0
- package/calendar/README.md +3 -0
- package/calendar/index.d.ts +36 -0
- package/calendar/lib/brn-calendar-cell-button.directive.d.ts +59 -0
- package/calendar/lib/brn-calendar-cell.directive.d.ts +5 -0
- package/calendar/lib/brn-calendar-grid.directive.d.ts +7 -0
- package/calendar/lib/brn-calendar-header.directive.d.ts +7 -0
- package/calendar/lib/brn-calendar-next-button.directive.d.ts +13 -0
- package/calendar/lib/brn-calendar-previous-button.directive.d.ts +13 -0
- package/calendar/lib/brn-calendar-week.directive.d.ts +25 -0
- package/calendar/lib/brn-calendar-weekday.directive.d.ts +25 -0
- package/calendar/lib/brn-calendar.directive.d.ts +55 -0
- package/calendar/lib/brn-calendar.token.d.ts +8 -0
- package/calendar/lib/i18n/calendar-i18n.d.ts +17 -0
- package/checkbox/lib/brn-checkbox.component.d.ts +1 -1
- package/collapsible/README.md +3 -0
- package/collapsible/index.d.ts +16 -0
- package/collapsible/lib/brn-collapsible-content.component.d.ts +19 -0
- package/collapsible/lib/brn-collapsible-trigger.directive.d.ts +12 -0
- package/collapsible/lib/brn-collapsible.component.d.ts +11 -0
- package/command/README.md +3 -0
- package/command/index.d.ts +33 -0
- package/command/lib/brn-command-empty.directive.d.ts +6 -0
- package/command/lib/brn-command-group.component.d.ts +6 -0
- package/command/lib/brn-command-input.directive.d.ts +6 -0
- package/command/lib/brn-command-item.directive.d.ts +6 -0
- package/command/lib/brn-command-list.component.d.ts +6 -0
- package/command/lib/brn-command-loader.directive.d.ts +6 -0
- package/command/lib/brn-command-separator.component.d.ts +6 -0
- package/command/lib/brn-command.component.d.ts +6 -0
- package/date-time/README.md +3 -0
- package/date-time/index.d.ts +2 -0
- package/date-time/lib/date-adapter.d.ts +176 -0
- package/date-time/lib/native-date-adapter.d.ts +103 -0
- package/date-time-luxon/README.md +3 -0
- package/date-time-luxon/index.d.ts +1 -0
- package/date-time-luxon/lib/date-adapter.d.ts +29 -0
- package/dialog/README.md +3 -0
- package/dialog/index.d.ts +33 -0
- package/dialog/lib/brn-dialog-close.directive.d.ts +10 -0
- package/dialog/lib/brn-dialog-content.directive.d.ts +12 -0
- package/dialog/lib/brn-dialog-description.directive.d.ts +8 -0
- package/dialog/lib/brn-dialog-options.d.ts +26 -0
- package/dialog/lib/brn-dialog-overlay.component.d.ts +8 -0
- package/dialog/lib/brn-dialog-ref.d.ts +24 -0
- package/dialog/lib/brn-dialog-state.d.ts +1 -0
- package/dialog/lib/brn-dialog-title.directive.d.ts +8 -0
- package/dialog/lib/brn-dialog-trigger.directive.d.ts +16 -0
- package/dialog/lib/brn-dialog-utils.d.ts +1 -0
- package/dialog/lib/brn-dialog.component.d.ts +56 -0
- package/dialog/lib/brn-dialog.service.d.ts +22 -0
- package/esm2022/accordion/index.mjs +31 -0
- package/esm2022/accordion/lib/brn-accordion-content.component.mjs +50 -0
- package/esm2022/accordion/lib/brn-accordion.directive.mjs +180 -0
- package/esm2022/accordion/spartan-ng-brain-accordion.mjs +5 -0
- package/esm2022/alert-dialog/index.mjs +45 -0
- package/esm2022/alert-dialog/lib/brn-alert-dialog-content.directive.mjs +17 -0
- package/esm2022/alert-dialog/lib/brn-alert-dialog-description.directive.mjs +18 -0
- package/esm2022/alert-dialog/lib/brn-alert-dialog-overlay.component.mjs +20 -0
- package/esm2022/alert-dialog/lib/brn-alert-dialog-title.directive.mjs +18 -0
- package/esm2022/alert-dialog/lib/brn-alert-dialog-trigger.directive.mjs +27 -0
- package/esm2022/alert-dialog/lib/brn-alert-dialog.component.mjs +40 -0
- package/esm2022/alert-dialog/spartan-ng-brain-alert-dialog.mjs +5 -0
- package/esm2022/avatar/index.mjs +23 -0
- package/esm2022/avatar/lib/brn-avatar.component.mjs +31 -0
- package/esm2022/avatar/lib/fallback/brn-avatar-fallback.directive.mjs +21 -0
- package/esm2022/avatar/lib/fallback/index.mjs +2 -0
- package/esm2022/avatar/lib/image/brn-avatar-image.directive.mjs +29 -0
- package/esm2022/avatar/lib/image/index.mjs +2 -0
- package/esm2022/avatar/lib/util/hex-color-for.mjs +22 -0
- package/esm2022/avatar/lib/util/index.mjs +4 -0
- package/esm2022/avatar/lib/util/initials.pipe.mjs +27 -0
- package/esm2022/avatar/lib/util/is-bright.mjs +12 -0
- package/esm2022/avatar/spartan-ng-brain-avatar.mjs +5 -0
- package/esm2022/calendar/index.mjs +62 -0
- package/esm2022/calendar/lib/brn-calendar-cell-button.directive.mjs +160 -0
- package/esm2022/calendar/lib/brn-calendar-cell.directive.mjs +17 -0
- package/esm2022/calendar/lib/brn-calendar-grid.directive.mjs +21 -0
- package/esm2022/calendar/lib/brn-calendar-header.directive.mjs +22 -0
- package/esm2022/calendar/lib/brn-calendar-next-button.directive.mjs +42 -0
- package/esm2022/calendar/lib/brn-calendar-previous-button.directive.mjs +42 -0
- package/esm2022/calendar/lib/brn-calendar-week.directive.mjs +64 -0
- package/esm2022/calendar/lib/brn-calendar-weekday.directive.mjs +48 -0
- package/esm2022/calendar/lib/brn-calendar.directive.mjs +154 -0
- package/esm2022/calendar/lib/brn-calendar.token.mjs +12 -0
- package/esm2022/calendar/lib/i18n/calendar-i18n.mjs +33 -0
- package/esm2022/calendar/spartan-ng-brain-calendar.mjs +5 -0
- package/esm2022/checkbox/lib/brn-checkbox.component.mjs +1 -1
- package/esm2022/collapsible/index.mjs +30 -0
- package/esm2022/collapsible/lib/brn-collapsible-content.component.mjs +61 -0
- package/esm2022/collapsible/lib/brn-collapsible-trigger.directive.mjs +35 -0
- package/esm2022/collapsible/lib/brn-collapsible.component.mjs +33 -0
- package/esm2022/collapsible/spartan-ng-brain-collapsible.mjs +5 -0
- package/esm2022/command/index.mjs +64 -0
- package/esm2022/command/lib/brn-command-empty.directive.mjs +29 -0
- package/esm2022/command/lib/brn-command-group.component.mjs +45 -0
- package/esm2022/command/lib/brn-command-input.directive.mjs +29 -0
- package/esm2022/command/lib/brn-command-item.directive.mjs +36 -0
- package/esm2022/command/lib/brn-command-list.component.mjs +35 -0
- package/esm2022/command/lib/brn-command-loader.directive.mjs +29 -0
- package/esm2022/command/lib/brn-command-separator.component.mjs +30 -0
- package/esm2022/command/lib/brn-command.component.mjs +21 -0
- package/esm2022/command/spartan-ng-brain-command.mjs +5 -0
- package/esm2022/date-time/index.mjs +3 -0
- package/esm2022/date-time/lib/date-adapter.mjs +16 -0
- package/esm2022/date-time/lib/native-date-adapter.mjs +155 -0
- package/esm2022/date-time/spartan-ng-brain-date-time.mjs +5 -0
- package/esm2022/date-time-luxon/index.mjs +2 -0
- package/esm2022/date-time-luxon/lib/date-adapter.mjs +85 -0
- package/esm2022/date-time-luxon/spartan-ng-brain-date-time-luxon.mjs +5 -0
- package/esm2022/dialog/index.mjs +55 -0
- package/esm2022/dialog/lib/brn-dialog-close.directive.mjs +29 -0
- package/esm2022/dialog/lib/brn-dialog-content.directive.mjs +41 -0
- package/esm2022/dialog/lib/brn-dialog-description.directive.mjs +25 -0
- package/esm2022/dialog/lib/brn-dialog-options.mjs +19 -0
- package/esm2022/dialog/lib/brn-dialog-overlay.component.mjs +29 -0
- package/esm2022/dialog/lib/brn-dialog-ref.mjs +53 -0
- package/esm2022/dialog/lib/brn-dialog-state.mjs +2 -0
- package/esm2022/dialog/lib/brn-dialog-title.directive.mjs +25 -0
- package/esm2022/dialog/lib/brn-dialog-trigger.directive.mjs +39 -0
- package/esm2022/dialog/lib/brn-dialog-utils.mjs +12 -0
- package/esm2022/dialog/lib/brn-dialog.component.mjs +208 -0
- package/esm2022/dialog/lib/brn-dialog.service.mjs +127 -0
- package/esm2022/dialog/spartan-ng-brain-dialog.mjs +5 -0
- package/esm2022/form-field/index.mjs +2 -0
- package/esm2022/form-field/lib/brn-form-field-control.mjs +14 -0
- package/esm2022/form-field/spartan-ng-brain-form-field.mjs +5 -0
- package/esm2022/forms/index.mjs +4 -0
- package/esm2022/forms/lib/control-value-accessor.mjs +2 -0
- package/esm2022/forms/lib/error-options.mjs +26 -0
- package/esm2022/forms/lib/error-state-tracker.mjs +29 -0
- package/esm2022/forms/spartan-ng-brain-forms.mjs +5 -0
- package/esm2022/hover-card/index.mjs +29 -0
- package/esm2022/hover-card/lib/brn-hover-card-content.service.mjs +205 -0
- package/esm2022/hover-card/lib/brn-hover-card.component.mjs +34 -0
- package/esm2022/hover-card/lib/createHoverObservable.mjs +19 -0
- package/esm2022/hover-card/spartan-ng-brain-hover-card.mjs +5 -0
- package/esm2022/label/index.mjs +17 -0
- package/esm2022/label/lib/brn-label.directive.mjs +49 -0
- package/esm2022/label/spartan-ng-brain-label.mjs +5 -0
- package/esm2022/menu/index.mjs +100 -0
- package/esm2022/menu/lib/brn-context-menu-trigger.directive.mjs +40 -0
- package/esm2022/menu/lib/brn-menu-align.mjs +15 -0
- package/esm2022/menu/lib/brn-menu-bar.directive.mjs +17 -0
- package/esm2022/menu/lib/brn-menu-group.directive.mjs +17 -0
- package/esm2022/menu/lib/brn-menu-item-checkbox.directive.mjs +30 -0
- package/esm2022/menu/lib/brn-menu-item-radio.directive.mjs +30 -0
- package/esm2022/menu/lib/brn-menu-item.directive.mjs +27 -0
- package/esm2022/menu/lib/brn-menu-trigger.directive.mjs +36 -0
- package/esm2022/menu/lib/brn-menu.directive.mjs +50 -0
- package/esm2022/menu/spartan-ng-brain-menu.mjs +5 -0
- package/esm2022/popover/index.mjs +35 -0
- package/esm2022/popover/lib/brn-popover-close.directive.mjs +15 -0
- package/esm2022/popover/lib/brn-popover-content.directive.mjs +17 -0
- package/esm2022/popover/lib/brn-popover-trigger.directive.mjs +37 -0
- package/esm2022/popover/lib/brn-popover.component.mjs +81 -0
- package/esm2022/popover/spartan-ng-brain-popover.mjs +5 -0
- package/esm2022/progress/index.mjs +21 -0
- package/esm2022/progress/lib/brn-progress-indicator.component.mjs +22 -0
- package/esm2022/progress/lib/brn-progress.component.mjs +61 -0
- package/esm2022/progress/lib/brn-progress.token.mjs +9 -0
- package/esm2022/progress/spartan-ng-brain-progress.mjs +5 -0
- package/esm2022/radio-group/index.mjs +20 -0
- package/esm2022/radio-group/lib/brn-radio-group.component.mjs +90 -0
- package/esm2022/radio-group/lib/brn-radio-group.token.mjs +9 -0
- package/esm2022/radio-group/lib/brn-radio.component.mjs +185 -0
- package/esm2022/radio-group/spartan-ng-brain-radio-group.mjs +5 -0
- package/esm2022/select/index.mjs +56 -0
- package/esm2022/select/lib/brn-select-content.component.mjs +204 -0
- package/esm2022/select/lib/brn-select-group.directive.mjs +19 -0
- package/esm2022/select/lib/brn-select-label.directive.mjs +23 -0
- package/esm2022/select/lib/brn-select-option.directive.mjs +65 -0
- package/esm2022/select/lib/brn-select-value.component.mjs +46 -0
- package/esm2022/select/lib/brn-select.component.mjs +358 -0
- package/esm2022/select/lib/brn-select.service.mjs +197 -0
- package/esm2022/select/spartan-ng-brain-select.mjs +5 -0
- package/esm2022/separator/index.mjs +17 -0
- package/esm2022/separator/lib/brn-separator.component.mjs +24 -0
- package/esm2022/separator/spartan-ng-brain-separator.mjs +5 -0
- package/esm2022/sheet/index.mjs +50 -0
- package/esm2022/sheet/lib/brn-sheet-close.directive.mjs +15 -0
- package/esm2022/sheet/lib/brn-sheet-content.directive.mjs +25 -0
- package/esm2022/sheet/lib/brn-sheet-description.directive.mjs +18 -0
- package/esm2022/sheet/lib/brn-sheet-overlay.component.mjs +20 -0
- package/esm2022/sheet/lib/brn-sheet-title.directive.mjs +18 -0
- package/esm2022/sheet/lib/brn-sheet-trigger.directive.mjs +26 -0
- package/esm2022/sheet/lib/brn-sheet.component.mjs +55 -0
- package/esm2022/sheet/spartan-ng-brain-sheet.mjs +5 -0
- package/esm2022/slider/index.mjs +13 -0
- package/esm2022/slider/lib/brn-slider-thumb.directive.mjs +41 -0
- package/esm2022/slider/lib/brn-slider-tick-mark.directive.mjs +37 -0
- package/esm2022/slider/lib/brn-slider-track-active-fill.directive.mjs +29 -0
- package/esm2022/slider/lib/brn-slider-track.directive.mjs +290 -0
- package/esm2022/slider/spartan-ng-brain-slider.mjs +5 -0
- package/esm2022/switch/index.mjs +20 -0
- package/esm2022/switch/lib/brn-switch-thumb.component.mjs +16 -0
- package/esm2022/switch/lib/brn-switch.component.mjs +236 -0
- package/esm2022/switch/spartan-ng-brain-switch.mjs +5 -0
- package/esm2022/table/index.mjs +47 -0
- package/esm2022/table/lib/brn-cell-def.directive.mjs +22 -0
- package/esm2022/table/lib/brn-column-def.component.mjs +82 -0
- package/esm2022/table/lib/brn-column-manager.mjs +61 -0
- package/esm2022/table/lib/brn-footer-def.directive.mjs +22 -0
- package/esm2022/table/lib/brn-header-def.directive.mjs +22 -0
- package/esm2022/table/lib/brn-paginator.directive.mjs +109 -0
- package/esm2022/table/lib/brn-table.component.mjs +169 -0
- package/esm2022/table/spartan-ng-brain-table.mjs +5 -0
- package/esm2022/tabs/index.mjs +32 -0
- package/esm2022/tabs/lib/brn-tabs-list.directive.mjs +65 -0
- package/esm2022/tabs/lib/brn-tabs-paginated-list.directive.mjs +525 -0
- package/esm2022/tabs/lib/brn-tabs-trigger.directive.mjs +134 -0
- package/esm2022/tabs/spartan-ng-brain-tabs.mjs +5 -0
- package/esm2022/toggle/index.mjs +31 -0
- package/esm2022/toggle/lib/brn-toggle-group.component.mjs +159 -0
- package/esm2022/toggle/lib/brn-toggle-group.token.mjs +9 -0
- package/esm2022/toggle/lib/brn-toggle.directive.mjs +65 -0
- package/esm2022/toggle/spartan-ng-brain-toggle.mjs +5 -0
- package/esm2022/tooltip/index.mjs +35 -0
- package/esm2022/tooltip/lib/brn-tooltip-content.component.mjs +228 -0
- package/esm2022/tooltip/lib/brn-tooltip-content.directive.mjs +22 -0
- package/esm2022/tooltip/lib/brn-tooltip-trigger.directive.mjs +689 -0
- package/esm2022/tooltip/lib/brn-tooltip.directive.mjs +15 -0
- package/esm2022/tooltip/spartan-ng-brain-tooltip.mjs +5 -0
- package/fesm2022/spartan-ng-brain-accordion.mjs +259 -0
- package/fesm2022/spartan-ng-brain-accordion.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-alert-dialog.mjs +162 -0
- package/fesm2022/spartan-ng-brain-alert-dialog.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-avatar.mjs +156 -0
- package/fesm2022/spartan-ng-brain-avatar.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-calendar.mjs +629 -0
- package/fesm2022/spartan-ng-brain-calendar.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-checkbox.mjs.map +1 -1
- package/fesm2022/spartan-ng-brain-collapsible.mjs +152 -0
- package/fesm2022/spartan-ng-brain-collapsible.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-command.mjs +284 -0
- package/fesm2022/spartan-ng-brain-command.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-date-time-luxon.mjs +92 -0
- package/fesm2022/spartan-ng-brain-date-time-luxon.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-date-time.mjs +177 -0
- package/fesm2022/spartan-ng-brain-date-time.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-dialog.mjs +617 -0
- package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-form-field.mjs +21 -0
- package/fesm2022/spartan-ng-brain-form-field.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-forms.mjs +61 -0
- package/fesm2022/spartan-ng-brain-forms.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-hover-card.mjs +274 -0
- package/fesm2022/spartan-ng-brain-hover-card.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-label.mjs +69 -0
- package/fesm2022/spartan-ng-brain-label.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-menu.mjs +316 -0
- package/fesm2022/spartan-ng-brain-menu.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-popover.mjs +173 -0
- package/fesm2022/spartan-ng-brain-popover.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-progress.mjs +108 -0
- package/fesm2022/spartan-ng-brain-progress.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-radio-group.mjs +299 -0
- package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-select.mjs +928 -0
- package/fesm2022/spartan-ng-brain-select.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-separator.mjs +44 -0
- package/fesm2022/spartan-ng-brain-separator.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-sheet.mjs +197 -0
- package/fesm2022/spartan-ng-brain-sheet.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-slider.mjs +399 -0
- package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-switch.mjs +271 -0
- package/fesm2022/spartan-ng-brain-switch.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-table.mjs +506 -0
- package/fesm2022/spartan-ng-brain-table.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-tabs.mjs +748 -0
- package/fesm2022/spartan-ng-brain-tabs.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-toggle.mjs +260 -0
- package/fesm2022/spartan-ng-brain-toggle.mjs.map +1 -0
- package/fesm2022/spartan-ng-brain-tooltip.mjs +975 -0
- package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -0
- package/form-field/README.md +3 -0
- package/form-field/index.d.ts +1 -0
- package/form-field/lib/brn-form-field-control.d.ts +11 -0
- package/forms/README.md +3 -0
- package/forms/index.d.ts +3 -0
- package/forms/lib/control-value-accessor.d.ts +2 -0
- package/forms/lib/error-options.d.ts +14 -0
- package/forms/lib/error-state-tracker.d.ts +15 -0
- package/hover-card/README.md +3 -0
- package/hover-card/index.d.ts +14 -0
- package/hover-card/lib/brn-hover-card-content.service.d.ts +65 -0
- package/hover-card/lib/brn-hover-card.component.d.ts +9 -0
- package/hover-card/lib/createHoverObservable.d.ts +4 -0
- package/label/README.md +3 -0
- package/label/index.d.ts +8 -0
- package/label/lib/brn-label.directive.d.ts +15 -0
- package/menu/README.md +3 -0
- package/menu/index.d.ts +49 -0
- package/menu/lib/brn-context-menu-trigger.directive.d.ts +13 -0
- package/menu/lib/brn-menu-align.d.ts +3 -0
- package/menu/lib/brn-menu-bar.directive.d.ts +6 -0
- package/menu/lib/brn-menu-group.directive.d.ts +6 -0
- package/menu/lib/brn-menu-item-checkbox.directive.d.ts +11 -0
- package/menu/lib/brn-menu-item-radio.directive.d.ts +11 -0
- package/menu/lib/brn-menu-item.directive.d.ts +10 -0
- package/menu/lib/brn-menu-trigger.directive.d.ts +10 -0
- package/menu/lib/brn-menu.directive.d.ts +11 -0
- package/package.json +182 -9
- package/popover/README.md +3 -0
- package/popover/index.d.ts +19 -0
- package/popover/lib/brn-popover-close.directive.d.ts +6 -0
- package/popover/lib/brn-popover-content.directive.d.ts +6 -0
- package/popover/lib/brn-popover-trigger.directive.d.ts +10 -0
- package/popover/lib/brn-popover.component.d.ts +14 -0
- package/progress/README.md +3 -0
- package/progress/index.d.ts +14 -0
- package/progress/lib/brn-progress-indicator.component.d.ts +6 -0
- package/progress/lib/brn-progress.component.d.ts +15 -0
- package/progress/lib/brn-progress.token.d.ts +4 -0
- package/radio-group/README.md +3 -0
- package/radio-group/index.d.ts +13 -0
- package/radio-group/lib/brn-radio-group.component.d.ts +57 -0
- package/radio-group/lib/brn-radio-group.token.d.ts +4 -0
- package/radio-group/lib/brn-radio.component.d.ts +58 -0
- package/select/README.md +3 -0
- package/select/index.d.ts +28 -0
- package/select/lib/brn-select-content.component.d.ts +50 -0
- package/select/lib/brn-select-group.directive.d.ts +6 -0
- package/select/lib/brn-select-label.directive.d.ts +9 -0
- package/select/lib/brn-select-option.directive.d.ts +25 -0
- package/select/lib/brn-select-value.component.d.ts +11 -0
- package/select/lib/brn-select.component.d.ts +82 -0
- package/select/lib/brn-select.service.d.ts +67 -0
- package/separator/README.md +3 -0
- package/separator/index.d.ts +8 -0
- package/separator/lib/brn-separator.component.d.ts +11 -0
- package/sheet/README.md +3 -0
- package/sheet/index.d.ts +28 -0
- package/sheet/lib/brn-sheet-close.directive.d.ts +6 -0
- package/sheet/lib/brn-sheet-content.directive.d.ts +8 -0
- package/sheet/lib/brn-sheet-description.directive.d.ts +6 -0
- package/sheet/lib/brn-sheet-overlay.component.d.ts +6 -0
- package/sheet/lib/brn-sheet-title.directive.d.ts +6 -0
- package/sheet/lib/brn-sheet-trigger.directive.d.ts +9 -0
- package/sheet/lib/brn-sheet.component.d.ts +9 -0
- package/slider/README.md +3 -0
- package/slider/index.d.ts +7 -0
- package/slider/lib/brn-slider-thumb.directive.d.ts +17 -0
- package/slider/lib/brn-slider-tick-mark.directive.d.ts +15 -0
- package/slider/lib/brn-slider-track-active-fill.directive.d.ts +10 -0
- package/slider/lib/brn-slider-track.directive.d.ts +139 -0
- package/switch/README.md +3 -0
- package/switch/index.d.ts +13 -0
- package/switch/lib/brn-switch-thumb.component.d.ts +5 -0
- package/switch/lib/brn-switch.component.d.ts +58 -0
- package/table/README.md +3 -0
- package/table/index.d.ts +26 -0
- package/table/lib/brn-cell-def.directive.d.ts +9 -0
- package/table/lib/brn-column-def.component.d.ts +18 -0
- package/table/lib/brn-column-manager.d.ts +26 -0
- package/table/lib/brn-footer-def.directive.d.ts +9 -0
- package/table/lib/brn-header-def.directive.d.ts +9 -0
- package/table/lib/brn-paginator.directive.d.ts +41 -0
- package/table/lib/brn-table.component.d.ts +37 -0
- package/tabs/README.md +3 -0
- package/tabs/index.d.ts +14 -0
- package/tabs/lib/brn-tabs-list.directive.d.ts +17 -0
- package/tabs/lib/brn-tabs-paginated-list.directive.d.ts +196 -0
- package/tabs/lib/brn-tabs-trigger.directive.d.ts +61 -0
- package/toggle/README.md +3 -0
- package/toggle/index.d.ts +15 -0
- package/toggle/lib/brn-toggle-group.component.d.ts +68 -0
- package/toggle/lib/brn-toggle-group.token.d.ts +4 -0
- package/toggle/lib/brn-toggle.directive.d.ts +25 -0
- package/tooltip/README.md +3 -0
- package/tooltip/index.d.ts +19 -0
- package/tooltip/lib/brn-tooltip-content.component.d.ts +73 -0
- package/tooltip/lib/brn-tooltip-content.directive.d.ts +8 -0
- package/tooltip/lib/brn-tooltip-trigger.directive.d.ts +177 -0
- package/tooltip/lib/brn-tooltip.directive.d.ts +7 -0
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, ElementRef, input, computed, Directive, HostListener, ViewContainerRef, ChangeDetectorRef, TemplateRef, effect, Injector, booleanAttribute, model, numberAttribute, contentChild, contentChildren, signal, afterNextRender, NgModule } from '@angular/core';
|
|
3
|
+
import { injectDateAdapter } from '@spartan-ng/brain/date-time';
|
|
4
|
+
|
|
5
|
+
const BrnCalendarToken = new InjectionToken('BrnCalendarToken');
|
|
6
|
+
function provideBrnCalendar(instance) {
|
|
7
|
+
return { provide: BrnCalendarToken, useExisting: instance };
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Inject the calendar component.
|
|
11
|
+
*/
|
|
12
|
+
function injectBrnCalendar() {
|
|
13
|
+
return inject(BrnCalendarToken);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
class BrnCalendarCellButtonDirective {
|
|
17
|
+
/** Access the date adapter */
|
|
18
|
+
dateAdapter = injectDateAdapter();
|
|
19
|
+
/** Access the calendar component */
|
|
20
|
+
calendar = injectBrnCalendar();
|
|
21
|
+
/** Access the element ref */
|
|
22
|
+
_elementRef = inject(ElementRef);
|
|
23
|
+
/** The date this cell represents */
|
|
24
|
+
date = input.required();
|
|
25
|
+
/** Whether this date is currently selected */
|
|
26
|
+
selected = computed(() => {
|
|
27
|
+
const selectedDate = this.calendar.date();
|
|
28
|
+
return selectedDate && this.dateAdapter.isSameDay(this.date(), selectedDate);
|
|
29
|
+
});
|
|
30
|
+
/** Whether this date is focusable */
|
|
31
|
+
focusable = computed(() => this.dateAdapter.isSameDay(this.calendar.focusedDate(), this.date()));
|
|
32
|
+
outside = computed(() => {
|
|
33
|
+
const focusedDate = this.calendar.focusedDate();
|
|
34
|
+
return !this.dateAdapter.isSameMonth(this.date(), focusedDate);
|
|
35
|
+
});
|
|
36
|
+
/** Whether this date is today */
|
|
37
|
+
today = computed(() => this.dateAdapter.isSameDay(this.date(), this.dateAdapter.now()));
|
|
38
|
+
/** Whether this date is disabled */
|
|
39
|
+
disabled = computed(() => this.calendar.isDateDisabled(this.date()) || this.calendar.disabled());
|
|
40
|
+
/**
|
|
41
|
+
* Focus the previous cell.
|
|
42
|
+
*/
|
|
43
|
+
focusPrevious(event) {
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
event.stopPropagation();
|
|
46
|
+
// in rtl, the arrow keys are reversed.
|
|
47
|
+
const targetDate = this.dateAdapter.add(this.calendar.focusedDate(), {
|
|
48
|
+
days: this.getDirection() === 'rtl' ? 1 : -1,
|
|
49
|
+
});
|
|
50
|
+
this.calendar.setFocusedDate(targetDate);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Focus the next cell.
|
|
54
|
+
*/
|
|
55
|
+
focusNext(event) {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
const targetDate = this.dateAdapter.add(this.calendar.focusedDate(), {
|
|
59
|
+
days: this.getDirection() === 'rtl' ? -1 : 1,
|
|
60
|
+
});
|
|
61
|
+
this.calendar.setFocusedDate(targetDate);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Focus the above cell.
|
|
65
|
+
*/
|
|
66
|
+
focusAbove(event) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
event.stopPropagation();
|
|
69
|
+
this.calendar.setFocusedDate(this.dateAdapter.subtract(this.calendar.focusedDate(), { days: 7 }));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Focus the below cell.
|
|
73
|
+
*/
|
|
74
|
+
focusBelow(event) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
this.calendar.setFocusedDate(this.dateAdapter.add(this.calendar.focusedDate(), { days: 7 }));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Focus the first date of the month.
|
|
81
|
+
*/
|
|
82
|
+
focusFirst(event) {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
this.calendar.setFocusedDate(this.dateAdapter.startOfMonth(this.calendar.focusedDate()));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Focus the last date of the month.
|
|
89
|
+
*/
|
|
90
|
+
focusLast(event) {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
this.calendar.setFocusedDate(this.dateAdapter.endOfMonth(this.calendar.focusedDate()));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Focus the same date in the previous month.
|
|
97
|
+
*/
|
|
98
|
+
focusPreviousMonth(event) {
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
event.stopPropagation();
|
|
101
|
+
const date = this.dateAdapter.getDate(this.calendar.focusedDate());
|
|
102
|
+
let previousMonthTarget = this.dateAdapter.startOfMonth(this.calendar.focusedDate());
|
|
103
|
+
previousMonthTarget = this.dateAdapter.subtract(previousMonthTarget, { months: 1 });
|
|
104
|
+
const lastDay = this.dateAdapter.endOfMonth(previousMonthTarget);
|
|
105
|
+
// if we are on a date that does not exist in the previous month, we should focus the last day of the month.
|
|
106
|
+
if (date > this.dateAdapter.getDate(lastDay)) {
|
|
107
|
+
this.calendar.setFocusedDate(lastDay);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.calendar.setFocusedDate(this.dateAdapter.set(previousMonthTarget, { day: date }));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Focus the same date in the next month.
|
|
115
|
+
*/
|
|
116
|
+
focusNextMonth(event) {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
event.stopPropagation();
|
|
119
|
+
const date = this.dateAdapter.getDate(this.calendar.focusedDate());
|
|
120
|
+
let nextMonthTarget = this.dateAdapter.startOfMonth(this.calendar.focusedDate());
|
|
121
|
+
nextMonthTarget = this.dateAdapter.add(nextMonthTarget, { months: 1 });
|
|
122
|
+
const lastDay = this.dateAdapter.endOfMonth(nextMonthTarget);
|
|
123
|
+
// if we are on a date that does not exist in the next month, we should focus the last day of the month.
|
|
124
|
+
if (date > this.dateAdapter.getDate(lastDay)) {
|
|
125
|
+
this.calendar.setFocusedDate(lastDay);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.calendar.setFocusedDate(this.dateAdapter.set(nextMonthTarget, { day: date }));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get the direction of the element.
|
|
133
|
+
*/
|
|
134
|
+
getDirection() {
|
|
135
|
+
return getComputedStyle(this._elementRef.nativeElement).direction === 'rtl' ? 'rtl' : 'ltr';
|
|
136
|
+
}
|
|
137
|
+
focus() {
|
|
138
|
+
this._elementRef.nativeElement.focus();
|
|
139
|
+
}
|
|
140
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarCellButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
141
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnCalendarCellButtonDirective, isStandalone: true, selector: "button[brnCalendarCellButton]", inputs: { date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: true, transformFunction: null } }, host: { attributes: { "role": "gridcell", "type": "button" }, listeners: { "click": "calendar.selectDate(date())", "keydown.arrowLeft": "focusPrevious($event)", "keydown.arrowRight": "focusNext($event)", "keydown.arrowUp": "focusAbove($event)", "keydown.arrowDown": "focusBelow($event)", "keydown.home": "focusFirst($event)", "keydown.end": "focusLast($event)", "keydown.pageUp": "focusPreviousMonth($event)", "keydown.pageDown": "focusNextMonth($event)" }, properties: { "tabindex": "focusable() ? 0 : -1", "attr.data-outside": "outside() ? '' : null", "attr.data-today": "today() && !selected() ? '' : null", "attr.data-selected": "selected() ? '' : null", "attr.data-disabled": "disabled() ? '' : null", "attr.aria-selected": "selected() ? 'true' : null", "attr.aria-disabled": "disabled() ? 'true' : null", "disabled": "disabled()" } }, ngImport: i0 });
|
|
142
|
+
}
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarCellButtonDirective, decorators: [{
|
|
144
|
+
type: Directive,
|
|
145
|
+
args: [{
|
|
146
|
+
selector: 'button[brnCalendarCellButton]',
|
|
147
|
+
standalone: true,
|
|
148
|
+
host: {
|
|
149
|
+
role: 'gridcell',
|
|
150
|
+
'[tabindex]': 'focusable() ? 0 : -1',
|
|
151
|
+
type: 'button',
|
|
152
|
+
'[attr.data-outside]': "outside() ? '' : null",
|
|
153
|
+
'[attr.data-today]': "today() && !selected() ? '' : null",
|
|
154
|
+
'[attr.data-selected]': "selected() ? '' : null",
|
|
155
|
+
'[attr.data-disabled]': "disabled() ? '' : null",
|
|
156
|
+
'[attr.aria-selected]': "selected() ? 'true' : null",
|
|
157
|
+
'[attr.aria-disabled]': "disabled() ? 'true' : null",
|
|
158
|
+
'[disabled]': 'disabled()',
|
|
159
|
+
'(click)': 'calendar.selectDate(date())',
|
|
160
|
+
'(keydown.arrowLeft)': 'focusPrevious($event)',
|
|
161
|
+
'(keydown.arrowRight)': 'focusNext($event)',
|
|
162
|
+
'(keydown.arrowUp)': 'focusAbove($event)',
|
|
163
|
+
'(keydown.arrowDown)': 'focusBelow($event)',
|
|
164
|
+
'(keydown.home)': 'focusFirst($event)',
|
|
165
|
+
'(keydown.end)': 'focusLast($event)',
|
|
166
|
+
'(keydown.pageUp)': 'focusPreviousMonth($event)',
|
|
167
|
+
'(keydown.pageDown)': 'focusNextMonth($event)',
|
|
168
|
+
},
|
|
169
|
+
}]
|
|
170
|
+
}] });
|
|
171
|
+
|
|
172
|
+
class BrnCalendarCellDirective {
|
|
173
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarCellDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
174
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnCalendarCellDirective, isStandalone: true, selector: "[brnCalendarCell]", host: { attributes: { "role": "presentation" } }, ngImport: i0 });
|
|
175
|
+
}
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarCellDirective, decorators: [{
|
|
177
|
+
type: Directive,
|
|
178
|
+
args: [{
|
|
179
|
+
selector: '[brnCalendarCell]',
|
|
180
|
+
standalone: true,
|
|
181
|
+
host: {
|
|
182
|
+
role: 'presentation',
|
|
183
|
+
},
|
|
184
|
+
}]
|
|
185
|
+
}] });
|
|
186
|
+
|
|
187
|
+
class BrnCalendarGridDirective {
|
|
188
|
+
/** Access the calendar component */
|
|
189
|
+
calendar = injectBrnCalendar();
|
|
190
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarGridDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
191
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnCalendarGridDirective, isStandalone: true, selector: "[brnCalendarGrid]", host: { attributes: { "role": "grid" }, properties: { "attr.aria-labelledby": "calendar.header()?.id()" } }, ngImport: i0 });
|
|
192
|
+
}
|
|
193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarGridDirective, decorators: [{
|
|
194
|
+
type: Directive,
|
|
195
|
+
args: [{
|
|
196
|
+
selector: '[brnCalendarGrid]',
|
|
197
|
+
standalone: true,
|
|
198
|
+
host: {
|
|
199
|
+
role: 'grid',
|
|
200
|
+
'[attr.aria-labelledby]': 'calendar.header()?.id()',
|
|
201
|
+
},
|
|
202
|
+
}]
|
|
203
|
+
}] });
|
|
204
|
+
|
|
205
|
+
let uniqueId = 0;
|
|
206
|
+
class BrnCalendarHeaderDirective {
|
|
207
|
+
/** The unique id for the header */
|
|
208
|
+
id = input(`brn-calendar-header-${uniqueId++}`);
|
|
209
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
210
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.5", type: BrnCalendarHeaderDirective, isStandalone: true, selector: "[brnCalendarHeader]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-live": "polite", "role": "presentation" }, properties: { "id": "id()" } }, ngImport: i0 });
|
|
211
|
+
}
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarHeaderDirective, decorators: [{
|
|
213
|
+
type: Directive,
|
|
214
|
+
args: [{
|
|
215
|
+
selector: '[brnCalendarHeader]',
|
|
216
|
+
standalone: true,
|
|
217
|
+
host: {
|
|
218
|
+
'[id]': 'id()',
|
|
219
|
+
'aria-live': 'polite',
|
|
220
|
+
role: 'presentation',
|
|
221
|
+
},
|
|
222
|
+
}]
|
|
223
|
+
}] });
|
|
224
|
+
|
|
225
|
+
const BrnCalendarI18nToken = new InjectionToken('BrnCalendarI18nToken');
|
|
226
|
+
/**
|
|
227
|
+
* Provide the calendar i18n configuration.
|
|
228
|
+
*/
|
|
229
|
+
function provideBrnCalendarI18n(configuration) {
|
|
230
|
+
return { provide: BrnCalendarI18nToken, useValue: configuration };
|
|
231
|
+
}
|
|
232
|
+
const defaultCalendarI18n = {
|
|
233
|
+
formatWeekdayName: (index) => {
|
|
234
|
+
const weekdays = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'];
|
|
235
|
+
return weekdays[index];
|
|
236
|
+
},
|
|
237
|
+
formatHeader: (month, year) => {
|
|
238
|
+
return new Date(year, month).toLocaleDateString(undefined, {
|
|
239
|
+
month: 'long',
|
|
240
|
+
year: 'numeric',
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
labelPrevious: () => 'Go to the previous month',
|
|
244
|
+
labelNext: () => 'Go to the next month',
|
|
245
|
+
labelWeekday: (index) => {
|
|
246
|
+
const weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
247
|
+
return weekdays[index];
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Inject the calendar i18n configuration.
|
|
252
|
+
*/
|
|
253
|
+
function injectBrnCalendarI18n() {
|
|
254
|
+
return inject(BrnCalendarI18nToken, { optional: true }) ?? defaultCalendarI18n;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
class BrnCalendarNextButtonDirective {
|
|
258
|
+
/** Access the calendar */
|
|
259
|
+
_calendar = injectBrnCalendar();
|
|
260
|
+
/** Access the date adapter */
|
|
261
|
+
_dateAdapter = injectDateAdapter();
|
|
262
|
+
/** Access the calendar i18n */
|
|
263
|
+
i18n = injectBrnCalendarI18n();
|
|
264
|
+
/** Focus the previous month */
|
|
265
|
+
focusPreviousMonth() {
|
|
266
|
+
const targetDate = this._dateAdapter.add(this._calendar.state().focusedDate(), { months: 1 });
|
|
267
|
+
// if the date is disabled, but there are available dates in the month, focus the last day of the month.
|
|
268
|
+
const possibleDate = this._calendar.constrainDate(targetDate);
|
|
269
|
+
if (this._dateAdapter.isSameMonth(possibleDate, targetDate)) {
|
|
270
|
+
// if this date is within the same month, then focus it
|
|
271
|
+
this._calendar.state().focusedDate.set(possibleDate);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
this._calendar.state().focusedDate.set(targetDate);
|
|
275
|
+
}
|
|
276
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarNextButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
277
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnCalendarNextButtonDirective, isStandalone: true, selector: "[brnCalendarNextButton]", host: { attributes: { "type": "button" }, listeners: { "click": "focusPreviousMonth()" }, properties: { "attr.aria-label": "i18n.labelNext()" } }, ngImport: i0 });
|
|
278
|
+
}
|
|
279
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarNextButtonDirective, decorators: [{
|
|
280
|
+
type: Directive,
|
|
281
|
+
args: [{
|
|
282
|
+
selector: '[brnCalendarNextButton]',
|
|
283
|
+
standalone: true,
|
|
284
|
+
host: {
|
|
285
|
+
type: 'button',
|
|
286
|
+
'[attr.aria-label]': 'i18n.labelNext()',
|
|
287
|
+
},
|
|
288
|
+
}]
|
|
289
|
+
}], propDecorators: { focusPreviousMonth: [{
|
|
290
|
+
type: HostListener,
|
|
291
|
+
args: ['click']
|
|
292
|
+
}] } });
|
|
293
|
+
|
|
294
|
+
class BrnCalendarPreviousButtonDirective {
|
|
295
|
+
/** Access the calendar */
|
|
296
|
+
_calendar = injectBrnCalendar();
|
|
297
|
+
/** Access the date adapter */
|
|
298
|
+
_dateAdapter = injectDateAdapter();
|
|
299
|
+
/** Access the calendar i18n */
|
|
300
|
+
i18n = injectBrnCalendarI18n();
|
|
301
|
+
/** Focus the previous month */
|
|
302
|
+
focusPreviousMonth() {
|
|
303
|
+
const targetDate = this._dateAdapter.subtract(this._calendar.state().focusedDate(), { months: 1 });
|
|
304
|
+
// if the date is disabled, but there are available dates in the month, focus the last day of the month.
|
|
305
|
+
const possibleDate = this._calendar.constrainDate(targetDate);
|
|
306
|
+
if (this._dateAdapter.isSameMonth(possibleDate, targetDate)) {
|
|
307
|
+
// if this date is within the same month, then focus it
|
|
308
|
+
this._calendar.state().focusedDate.set(possibleDate);
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
this._calendar.state().focusedDate.set(targetDate);
|
|
312
|
+
}
|
|
313
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarPreviousButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
314
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnCalendarPreviousButtonDirective, isStandalone: true, selector: "[brnCalendarPreviousButton]", host: { attributes: { "type": "button" }, listeners: { "click": "focusPreviousMonth()" }, properties: { "attr.aria-label": "i18n.labelPrevious()" } }, ngImport: i0 });
|
|
315
|
+
}
|
|
316
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarPreviousButtonDirective, decorators: [{
|
|
317
|
+
type: Directive,
|
|
318
|
+
args: [{
|
|
319
|
+
selector: '[brnCalendarPreviousButton]',
|
|
320
|
+
standalone: true,
|
|
321
|
+
host: {
|
|
322
|
+
type: 'button',
|
|
323
|
+
'[attr.aria-label]': 'i18n.labelPrevious()',
|
|
324
|
+
},
|
|
325
|
+
}]
|
|
326
|
+
}], propDecorators: { focusPreviousMonth: [{
|
|
327
|
+
type: HostListener,
|
|
328
|
+
args: ['click']
|
|
329
|
+
}] } });
|
|
330
|
+
|
|
331
|
+
class BrnCalendarWeekDirective {
|
|
332
|
+
/** Access the calendar */
|
|
333
|
+
_calendar = injectBrnCalendar();
|
|
334
|
+
/** Access the view container ref */
|
|
335
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
336
|
+
/** Access the change detector */
|
|
337
|
+
_changeDetector = inject(ChangeDetectorRef);
|
|
338
|
+
/** Access the template ref */
|
|
339
|
+
_templateRef = inject(TemplateRef);
|
|
340
|
+
// get the weeks to display.
|
|
341
|
+
weeks = computed(() => {
|
|
342
|
+
const days = this._calendar.days();
|
|
343
|
+
const weeks = [];
|
|
344
|
+
for (let i = 0; i < days.length; i += 7) {
|
|
345
|
+
weeks.push(days.slice(i, i + 7));
|
|
346
|
+
}
|
|
347
|
+
return weeks;
|
|
348
|
+
});
|
|
349
|
+
/** Store the view refs */
|
|
350
|
+
_viewRefs = [];
|
|
351
|
+
// Make sure the template checker knows the type of the context with which the
|
|
352
|
+
// template of this directive will be rendered
|
|
353
|
+
static ngTemplateContextGuard(_, ctx) {
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
constructor() {
|
|
357
|
+
// this should use `afterRenderEffect` but it's not available in the current version
|
|
358
|
+
effect(() => this.renderWeek(), { allowSignalWrites: true });
|
|
359
|
+
}
|
|
360
|
+
renderWeek() {
|
|
361
|
+
// Destroy all the views when the directive is destroyed
|
|
362
|
+
for (const viewRef of this._viewRefs) {
|
|
363
|
+
viewRef.destroy();
|
|
364
|
+
}
|
|
365
|
+
this._viewRefs.length = 0;
|
|
366
|
+
// Create a new view for each week
|
|
367
|
+
for (const week of this.weeks()) {
|
|
368
|
+
const viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, {
|
|
369
|
+
$implicit: week,
|
|
370
|
+
});
|
|
371
|
+
this._viewRefs.push(viewRef);
|
|
372
|
+
}
|
|
373
|
+
this._changeDetector.detectChanges();
|
|
374
|
+
}
|
|
375
|
+
ngOnDestroy() {
|
|
376
|
+
// Destroy all the views when the directive is destroyed
|
|
377
|
+
for (const viewRef of this._viewRefs) {
|
|
378
|
+
viewRef.destroy();
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarWeekDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
382
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnCalendarWeekDirective, isStandalone: true, selector: "[brnCalendarWeek]", ngImport: i0 });
|
|
383
|
+
}
|
|
384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarWeekDirective, decorators: [{
|
|
385
|
+
type: Directive,
|
|
386
|
+
args: [{
|
|
387
|
+
standalone: true,
|
|
388
|
+
selector: '[brnCalendarWeek]',
|
|
389
|
+
}]
|
|
390
|
+
}], ctorParameters: () => [] });
|
|
391
|
+
|
|
392
|
+
class BrnCalendarWeekdayDirective {
|
|
393
|
+
/** Access the calendar */
|
|
394
|
+
_calendar = injectBrnCalendar();
|
|
395
|
+
/** Access the date time adapter */
|
|
396
|
+
_dateAdapter = injectDateAdapter();
|
|
397
|
+
/** Access the view container ref */
|
|
398
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
399
|
+
/** Access the template ref */
|
|
400
|
+
_templateRef = inject(TemplateRef);
|
|
401
|
+
/** Get the days of the week to display in the header. */
|
|
402
|
+
weekdays = computed(() => this._calendar.days().slice(0, 7));
|
|
403
|
+
/** Store the view refs */
|
|
404
|
+
_viewRefs = [];
|
|
405
|
+
// Make sure the template checker knows the type of the context with which the
|
|
406
|
+
// template of this directive will be rendered
|
|
407
|
+
static ngTemplateContextGuard(_, ctx) {
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
constructor() {
|
|
411
|
+
// Create a new view for each day
|
|
412
|
+
for (const day of this.weekdays()) {
|
|
413
|
+
const viewRef = this._viewContainerRef.createEmbeddedView(this._templateRef, {
|
|
414
|
+
$implicit: this._dateAdapter.getDay(day),
|
|
415
|
+
});
|
|
416
|
+
this._viewRefs.push(viewRef);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
ngOnDestroy() {
|
|
420
|
+
// Destroy all the views when the directive is destroyed
|
|
421
|
+
for (const viewRef of this._viewRefs) {
|
|
422
|
+
viewRef.destroy();
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarWeekdayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
426
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.5", type: BrnCalendarWeekdayDirective, isStandalone: true, selector: "[brnCalendarWeekday]", ngImport: i0 });
|
|
427
|
+
}
|
|
428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarWeekdayDirective, decorators: [{
|
|
429
|
+
type: Directive,
|
|
430
|
+
args: [{
|
|
431
|
+
standalone: true,
|
|
432
|
+
selector: '[brnCalendarWeekday]',
|
|
433
|
+
}]
|
|
434
|
+
}], ctorParameters: () => [] });
|
|
435
|
+
|
|
436
|
+
class BrnCalendarDirective {
|
|
437
|
+
/** Access the date adapter */
|
|
438
|
+
dateAdapter = injectDateAdapter();
|
|
439
|
+
/** Access the change detector */
|
|
440
|
+
_changeDetector = inject(ChangeDetectorRef);
|
|
441
|
+
/** Access the injector */
|
|
442
|
+
_injector = inject(Injector);
|
|
443
|
+
/** The minimum date that can be selected.*/
|
|
444
|
+
min = input();
|
|
445
|
+
/* * The maximum date that can be selected. */
|
|
446
|
+
max = input();
|
|
447
|
+
/** Determine if the date picker is disabled. */
|
|
448
|
+
disabled = input(false, {
|
|
449
|
+
transform: booleanAttribute,
|
|
450
|
+
});
|
|
451
|
+
/** The selected value. */
|
|
452
|
+
date = model();
|
|
453
|
+
/** Whether a specific date is disabled. */
|
|
454
|
+
dateDisabled = input(() => false);
|
|
455
|
+
/** The day the week starts on */
|
|
456
|
+
weekStartsOn = input(0, {
|
|
457
|
+
transform: (v) => numberAttribute(v),
|
|
458
|
+
});
|
|
459
|
+
/** The default focused date. */
|
|
460
|
+
defaultFocusedDate = input();
|
|
461
|
+
/** @internal Access the header */
|
|
462
|
+
header = contentChild(BrnCalendarHeaderDirective);
|
|
463
|
+
/** Store the cells */
|
|
464
|
+
cells = contentChildren(BrnCalendarCellButtonDirective, {
|
|
465
|
+
descendants: true,
|
|
466
|
+
});
|
|
467
|
+
/**
|
|
468
|
+
* @internal
|
|
469
|
+
* The internal state of the component.
|
|
470
|
+
*/
|
|
471
|
+
state = computed(() => ({
|
|
472
|
+
focusedDate: signal(this.constrainDate(this.defaultFocusedDate() ?? this.date() ?? this.dateAdapter.now())),
|
|
473
|
+
}));
|
|
474
|
+
/**
|
|
475
|
+
* The focused date.
|
|
476
|
+
*/
|
|
477
|
+
focusedDate = computed(() => this.state().focusedDate());
|
|
478
|
+
/**
|
|
479
|
+
* Get all the days to display, this is the days of the current month
|
|
480
|
+
* and the days of the previous and next month to fill the grid.
|
|
481
|
+
*/
|
|
482
|
+
days = computed(() => {
|
|
483
|
+
const weekStartsOn = this.weekStartsOn();
|
|
484
|
+
const month = this.state().focusedDate();
|
|
485
|
+
const days = [];
|
|
486
|
+
// Get the first and last day of the month.
|
|
487
|
+
let firstDay = this.dateAdapter.startOfMonth(month);
|
|
488
|
+
let lastDay = this.dateAdapter.endOfMonth(month);
|
|
489
|
+
// we need to subtract until we get the to starting day before or on the start of the month.
|
|
490
|
+
while (this.dateAdapter.getDay(firstDay) !== weekStartsOn) {
|
|
491
|
+
firstDay = this.dateAdapter.subtract(firstDay, { days: 1 });
|
|
492
|
+
}
|
|
493
|
+
const weekEndsOn = (weekStartsOn + 6) % 7;
|
|
494
|
+
// we need to add until we get to the ending day after or on the end of the month.
|
|
495
|
+
while (this.dateAdapter.getDay(lastDay) !== weekEndsOn) {
|
|
496
|
+
lastDay = this.dateAdapter.add(lastDay, { days: 1 });
|
|
497
|
+
}
|
|
498
|
+
// collect all the days to display.
|
|
499
|
+
while (firstDay <= lastDay) {
|
|
500
|
+
days.push(firstDay);
|
|
501
|
+
firstDay = this.dateAdapter.add(firstDay, { days: 1 });
|
|
502
|
+
}
|
|
503
|
+
return days;
|
|
504
|
+
});
|
|
505
|
+
/** @internal Constrain a date to the min and max boundaries */
|
|
506
|
+
constrainDate(date) {
|
|
507
|
+
const min = this.min();
|
|
508
|
+
const max = this.max();
|
|
509
|
+
// If there is no min or max, return the date.
|
|
510
|
+
if (!min && !max) {
|
|
511
|
+
return date;
|
|
512
|
+
}
|
|
513
|
+
// If there is a min and the date is before the min, return the min.
|
|
514
|
+
if (min && this.dateAdapter.isBefore(date, this.dateAdapter.startOfDay(min))) {
|
|
515
|
+
return min;
|
|
516
|
+
}
|
|
517
|
+
// If there is a max and the date is after the max, return the max.
|
|
518
|
+
if (max && this.dateAdapter.isAfter(date, this.dateAdapter.endOfDay(max))) {
|
|
519
|
+
return max;
|
|
520
|
+
}
|
|
521
|
+
// Return the date.
|
|
522
|
+
return date;
|
|
523
|
+
}
|
|
524
|
+
/** @internal Determine if a date is disabled */
|
|
525
|
+
isDateDisabled(date) {
|
|
526
|
+
// if the calendar is disabled we can't select this date
|
|
527
|
+
if (this.disabled()) {
|
|
528
|
+
return true;
|
|
529
|
+
}
|
|
530
|
+
// if the date is outside the min and max range
|
|
531
|
+
const min = this.min();
|
|
532
|
+
const max = this.max();
|
|
533
|
+
if (min && this.dateAdapter.isBefore(date, this.dateAdapter.startOfDay(min))) {
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
if (max && this.dateAdapter.isAfter(date, this.dateAdapter.endOfDay(max))) {
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
// if this specific date is disabled
|
|
540
|
+
const disabledFn = this.dateDisabled();
|
|
541
|
+
if (disabledFn(date)) {
|
|
542
|
+
return true;
|
|
543
|
+
}
|
|
544
|
+
return false;
|
|
545
|
+
}
|
|
546
|
+
selectDate(date) {
|
|
547
|
+
this.date.set(date);
|
|
548
|
+
this.state().focusedDate.set(date);
|
|
549
|
+
}
|
|
550
|
+
/** @internal Set the focused date */
|
|
551
|
+
setFocusedDate(date) {
|
|
552
|
+
// check if the date is disabled.
|
|
553
|
+
if (this.isDateDisabled(date)) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
this.state().focusedDate.set(date);
|
|
557
|
+
// wait until the cells have all updated
|
|
558
|
+
afterNextRender({
|
|
559
|
+
write: () => {
|
|
560
|
+
// focus the cell with the target date.
|
|
561
|
+
const cell = this.cells().find((c) => this.dateAdapter.isSameDay(c.date(), date));
|
|
562
|
+
if (cell) {
|
|
563
|
+
cell.focus();
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
}, {
|
|
567
|
+
injector: this._injector,
|
|
568
|
+
});
|
|
569
|
+
// we must update the view to ensure the focused cell is visible.
|
|
570
|
+
this._changeDetector.detectChanges();
|
|
571
|
+
}
|
|
572
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
573
|
+
/** @nocollapse */ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "18.2.5", type: BrnCalendarDirective, isStandalone: true, selector: "[brnCalendar]", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, dateDisabled: { classPropertyName: "dateDisabled", publicName: "dateDisabled", isSignal: true, isRequired: false, transformFunction: null }, weekStartsOn: { classPropertyName: "weekStartsOn", publicName: "weekStartsOn", isSignal: true, isRequired: false, transformFunction: null }, defaultFocusedDate: { classPropertyName: "defaultFocusedDate", publicName: "defaultFocusedDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { date: "dateChange" }, providers: [provideBrnCalendar(BrnCalendarDirective)], queries: [{ propertyName: "header", first: true, predicate: BrnCalendarHeaderDirective, descendants: true, isSignal: true }, { propertyName: "cells", predicate: BrnCalendarCellButtonDirective, descendants: true, isSignal: true }], ngImport: i0 });
|
|
574
|
+
}
|
|
575
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarDirective, decorators: [{
|
|
576
|
+
type: Directive,
|
|
577
|
+
args: [{
|
|
578
|
+
selector: '[brnCalendar]',
|
|
579
|
+
standalone: true,
|
|
580
|
+
providers: [provideBrnCalendar(BrnCalendarDirective)],
|
|
581
|
+
}]
|
|
582
|
+
}] });
|
|
583
|
+
|
|
584
|
+
const BrnCalendarImports = [
|
|
585
|
+
BrnCalendarCellButtonDirective,
|
|
586
|
+
BrnCalendarGridDirective,
|
|
587
|
+
BrnCalendarHeaderDirective,
|
|
588
|
+
BrnCalendarNextButtonDirective,
|
|
589
|
+
BrnCalendarPreviousButtonDirective,
|
|
590
|
+
BrnCalendarWeekDirective,
|
|
591
|
+
BrnCalendarWeekdayDirective,
|
|
592
|
+
BrnCalendarDirective,
|
|
593
|
+
BrnCalendarCellDirective,
|
|
594
|
+
];
|
|
595
|
+
class BrnCalendarModule {
|
|
596
|
+
/** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
597
|
+
/** @nocollapse */ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarModule, imports: [BrnCalendarCellButtonDirective,
|
|
598
|
+
BrnCalendarGridDirective,
|
|
599
|
+
BrnCalendarHeaderDirective,
|
|
600
|
+
BrnCalendarNextButtonDirective,
|
|
601
|
+
BrnCalendarPreviousButtonDirective,
|
|
602
|
+
BrnCalendarWeekDirective,
|
|
603
|
+
BrnCalendarWeekdayDirective,
|
|
604
|
+
BrnCalendarDirective,
|
|
605
|
+
BrnCalendarCellDirective], exports: [BrnCalendarCellButtonDirective,
|
|
606
|
+
BrnCalendarGridDirective,
|
|
607
|
+
BrnCalendarHeaderDirective,
|
|
608
|
+
BrnCalendarNextButtonDirective,
|
|
609
|
+
BrnCalendarPreviousButtonDirective,
|
|
610
|
+
BrnCalendarWeekDirective,
|
|
611
|
+
BrnCalendarWeekdayDirective,
|
|
612
|
+
BrnCalendarDirective,
|
|
613
|
+
BrnCalendarCellDirective] });
|
|
614
|
+
/** @nocollapse */ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarModule });
|
|
615
|
+
}
|
|
616
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: BrnCalendarModule, decorators: [{
|
|
617
|
+
type: NgModule,
|
|
618
|
+
args: [{
|
|
619
|
+
imports: [...BrnCalendarImports],
|
|
620
|
+
exports: [...BrnCalendarImports],
|
|
621
|
+
}]
|
|
622
|
+
}] });
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Generated bundle index. Do not edit.
|
|
626
|
+
*/
|
|
627
|
+
|
|
628
|
+
export { BrnCalendarCellButtonDirective, BrnCalendarCellDirective, BrnCalendarDirective, BrnCalendarGridDirective, BrnCalendarHeaderDirective, BrnCalendarI18nToken, BrnCalendarImports, BrnCalendarModule, BrnCalendarNextButtonDirective, BrnCalendarPreviousButtonDirective, BrnCalendarToken, BrnCalendarWeekDirective, BrnCalendarWeekdayDirective, injectBrnCalendar, injectBrnCalendarI18n, provideBrnCalendar, provideBrnCalendarI18n };
|
|
629
|
+
//# sourceMappingURL=spartan-ng-brain-calendar.mjs.map
|