@radix-ng/primitives 0.42.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordion/index.d.ts +160 -15
- package/alert-dialog/index.d.ts +54 -14
- package/arrow/README.md +1 -0
- package/arrow/index.d.ts +11 -0
- package/aspect-ratio/index.d.ts +35 -1
- package/avatar/index.d.ts +81 -11
- package/calendar/index.d.ts +310 -29
- package/checkbox/index.d.ts +163 -15
- package/collapsible/index.d.ts +82 -11
- package/config/index.d.ts +35 -2
- package/context-menu/index.d.ts +126 -23
- package/core/index.d.ts +898 -27
- package/cropper/index.d.ts +134 -14
- package/date-field/index.d.ts +209 -10
- package/dialog/index.d.ts +202 -20
- package/dismissable-layer/README.md +1 -0
- package/dismissable-layer/index.d.ts +126 -0
- package/dropdown-menu/index.d.ts +168 -23
- package/editable/index.d.ts +70 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +36 -36
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +28 -28
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-arrow.mjs +38 -0
- package/fesm2022/radix-ng-primitives-arrow.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +5 -5
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +20 -20
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-calendar.mjs +110 -95
- package/fesm2022/radix-ng-primitives-calendar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +219 -209
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +27 -27
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-config.mjs +5 -5
- package/fesm2022/radix-ng-primitives-config.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-context-menu.mjs +34 -34
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +72 -24
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-cropper.mjs +51 -51
- package/fesm2022/radix-ng-primitives-cropper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-date-field.mjs +48 -48
- package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +33 -33
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs +418 -0
- package/fesm2022/radix-ng-primitives-dismissable-layer.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +37 -37
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-editable.mjs +21 -21
- package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-focus-guards.mjs +53 -0
- package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-focus-scope.mjs +17 -9
- package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-hover-card.mjs +74 -74
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +8 -8
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +65 -65
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +31 -31
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +91 -88
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-number-field.mjs +56 -43
- package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-pagination.mjs +45 -45
- package/fesm2022/radix-ng-primitives-pagination.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +68 -68
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popper.mjs +418 -0
- package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-portal.mjs +51 -0
- package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-presence.mjs +4 -4
- package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +15 -15
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +30 -30
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +179 -163
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-select.mjs +37 -37
- package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +16 -14
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-slider.mjs +75 -75
- package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-stepper.mjs +45 -45
- package/fesm2022/radix-ng-primitives-stepper.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +28 -28
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +33 -33
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-time-field.mjs +78 -66
- package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +22 -22
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +9 -9
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toolbar.mjs +28 -28
- package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip.mjs +74 -74
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tooltip2.mjs +740 -0
- package/fesm2022/radix-ng-primitives-tooltip2.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +93 -98
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives.mjs.map +1 -1
- package/focus-guards/README.md +1 -0
- package/focus-guards/index.d.ts +15 -0
- package/focus-scope/index.d.ts +65 -1
- package/hover-card/index.d.ts +471 -19
- package/index.d.ts +2 -1
- package/label/index.d.ts +27 -1
- package/menu/index.d.ts +136 -26
- package/menubar/index.d.ts +53 -21
- package/navigation-menu/index.d.ts +402 -25
- package/number-field/index.d.ts +202 -16
- package/package.json +26 -5
- package/pagination/index.d.ts +96 -20
- package/popover/index.d.ts +402 -19
- package/popper/README.md +3 -0
- package/popper/index.d.ts +206 -0
- package/portal/README.md +1 -0
- package/portal/index.d.ts +22 -0
- package/presence/index.d.ts +103 -5
- package/progress/index.d.ts +76 -8
- package/radio/index.d.ts +118 -4
- package/roving-focus/index.d.ts +174 -3
- package/select/index.d.ts +211 -23
- package/separator/index.d.ts +63 -1
- package/slider/index.d.ts +262 -17
- package/stepper/index.d.ts +122 -21
- package/switch/index.d.ts +102 -9
- package/tabs/index.d.ts +111 -13
- package/time-field/index.d.ts +211 -10
- package/toggle/index.d.ts +75 -3
- package/toggle-group/index.d.ts +194 -5
- package/toolbar/index.d.ts +52 -16
- package/tooltip/index.d.ts +432 -19
- package/tooltip2/README.md +3 -0
- package/tooltip2/index.d.ts +325 -0
- package/visually-hidden/index.d.ts +65 -3
- package/accordion/src/accordion-content-presence.directive.d.ts +0 -6
- package/accordion/src/accordion-content.directive.d.ts +0 -8
- package/accordion/src/accordion-header.directive.d.ts +0 -7
- package/accordion/src/accordion-item.directive.d.ts +0 -43
- package/accordion/src/accordion-root.directive.d.ts +0 -83
- package/accordion/src/accordion-trigger.directive.d.ts +0 -10
- package/alert-dialog/src/alert-dialog-cancel.directive.d.ts +0 -7
- package/alert-dialog/src/alert-dialog-content.directive.d.ts +0 -9
- package/alert-dialog/src/alert-dialog-root.directive.d.ts +0 -9
- package/alert-dialog/src/alert-dialog-title.directive.d.ts +0 -5
- package/alert-dialog/src/alert-dialog-trigger.directive.d.ts +0 -7
- package/alert-dialog/src/alert-dialog.service.d.ts +0 -14
- package/aspect-ratio/src/aspect-ratio.directive.d.ts +0 -32
- package/avatar/src/avatar-context.token.d.ts +0 -7
- package/avatar/src/avatar-fallback.directive.d.ts +0 -20
- package/avatar/src/avatar-image.directive.d.ts +0 -29
- package/avatar/src/avatar-root.directive.d.ts +0 -8
- package/avatar/src/avatar.config.d.ts +0 -13
- package/avatar/src/types.d.ts +0 -2
- package/calendar/src/calendar-cell-trigger.directive.d.ts +0 -54
- package/calendar/src/calendar-cell.directive.d.ts +0 -11
- package/calendar/src/calendar-grid-body.directive.d.ts +0 -5
- package/calendar/src/calendar-grid-head.directive.d.ts +0 -5
- package/calendar/src/calendar-grid-row.directive.d.ts +0 -5
- package/calendar/src/calendar-grid.directive.d.ts +0 -8
- package/calendar/src/calendar-head-cell.directive.d.ts +0 -5
- package/calendar/src/calendar-header.directive.d.ts +0 -5
- package/calendar/src/calendar-heading.directive.d.ts +0 -7
- package/calendar/src/calendar-next.directive.d.ts +0 -16
- package/calendar/src/calendar-prev.directive.d.ts +0 -16
- package/calendar/src/calendar-root.directive.d.ts +0 -148
- package/calendar/src/calendar.d.ts +0 -44
- package/calendar/src//321/201alendar-/321/201ontext.token.d.ts +0 -24
- package/checkbox/src/checkbox-button.directive.d.ts +0 -8
- package/checkbox/src/checkbox-indicator.directive.d.ts +0 -6
- package/checkbox/src/checkbox-input.directive.d.ts +0 -10
- package/checkbox/src/checkbox.directive.d.ts +0 -86
- package/checkbox/src/checkbox.token.d.ts +0 -4
- package/collapsible/src/collapsible-content-presence.directive.d.ts +0 -6
- package/collapsible/src/collapsible-content.directive.d.ts +0 -18
- package/collapsible/src/collapsible-root.directive.d.ts +0 -44
- package/collapsible/src/collapsible-trigger.directive.d.ts +0 -6
- package/config/src/config.d.ts +0 -21
- package/config/src/config.provider.d.ts +0 -10
- package/context-menu/src/context-menu-content.directive.d.ts +0 -15
- package/context-menu/src/context-menu-item-checkbox.directive.d.ts +0 -9
- package/context-menu/src/context-menu-item-indicator.directive.d.ts +0 -7
- package/context-menu/src/context-menu-item-radio-group.directive.d.ts +0 -12
- package/context-menu/src/context-menu-item-radio.directive.d.ts +0 -19
- package/context-menu/src/context-menu-item-selectable.d.ts +0 -12
- package/context-menu/src/context-menu-item.directive.d.ts +0 -17
- package/context-menu/src/context-menu-label.directive.d.ts +0 -5
- package/context-menu/src/context-menu-separator.directive.d.ts +0 -6
- package/context-menu/src/context-menu-trigger.directive.d.ts +0 -31
- package/core/src/accessor/control-value-accessor.d.ts +0 -67
- package/core/src/accessor/provide-value-accessor.d.ts +0 -12
- package/core/src/auto-focus.directive.d.ts +0 -14
- package/core/src/chunk.d.ts +0 -12
- package/core/src/clamp.d.ts +0 -38
- package/core/src/create-context.d.ts +0 -10
- package/core/src/date-time/calendar.d.ts +0 -33
- package/core/src/date-time/comparators.d.ts +0 -98
- package/core/src/date-time/formatter.d.ts +0 -30
- package/core/src/date-time/index.d.ts +0 -9
- package/core/src/date-time/parser.d.ts +0 -37
- package/core/src/date-time/parts.d.ts +0 -12
- package/core/src/date-time/placeholders.d.ts +0 -8
- package/core/src/date-time/segment.d.ts +0 -4
- package/core/src/date-time/types.d.ts +0 -58
- package/core/src/date-time/useDateField.d.ts +0 -142
- package/core/src/date-time/utils.d.ts +0 -7
- package/core/src/document.d.ts +0 -1
- package/core/src/focus-initial.directive.d.ts +0 -9
- package/core/src/getActiveElement.d.ts +0 -1
- package/core/src/id-generator.d.ts +0 -12
- package/core/src/inject-ng-control.d.ts +0 -8
- package/core/src/is-client.d.ts +0 -1
- package/core/src/is-equal.d.ts +0 -7
- package/core/src/is-inside-form.d.ts +0 -2
- package/core/src/is-nullish.d.ts +0 -1
- package/core/src/is-number.d.ts +0 -1
- package/core/src/isValueEqualOrExist.d.ts +0 -10
- package/core/src/kbd-constants.d.ts +0 -41
- package/core/src/positioning/constants.d.ts +0 -3
- package/core/src/positioning/types.d.ts +0 -42
- package/core/src/positioning/utils.d.ts +0 -12
- package/core/src/provide-token.d.ts +0 -22
- package/core/src/serialize.d.ts +0 -11
- package/core/src/types.d.ts +0 -25
- package/core/src/useArrowNavigation.d.ts +0 -65
- package/core/src/useResizeObserver.d.ts +0 -15
- package/core/src/watch.d.ts +0 -41
- package/core/src/window.d.ts +0 -3
- package/cropper/src/cropper-context.token.d.ts +0 -12
- package/cropper/src/cropper-crop-area.directive.d.ts +0 -6
- package/cropper/src/cropper-description.directive.d.ts +0 -6
- package/cropper/src/cropper-image.component.d.ts +0 -10
- package/cropper/src/cropper-root.directive.d.ts +0 -91
- package/date-field/src/date-field-context.token.d.ts +0 -19
- package/date-field/src/date-field-input.directive.d.ts +0 -53
- package/date-field/src/date-field-root.directive.d.ts +0 -131
- package/dialog/src/dialog-close.directive.d.ts +0 -7
- package/dialog/src/dialog-content.directive.d.ts +0 -21
- package/dialog/src/dialog-description.directive.d.ts +0 -5
- package/dialog/src/dialog-dismiss.directive.d.ts +0 -7
- package/dialog/src/dialog-ref.d.ts +0 -40
- package/dialog/src/dialog-title.directive.d.ts +0 -5
- package/dialog/src/dialog-trigger.directive.d.ts +0 -28
- package/dialog/src/dialog.config.d.ts +0 -41
- package/dialog/src/dialog.injectors.d.ts +0 -4
- package/dialog/src/dialog.providers.d.ts +0 -19
- package/dialog/src/dialog.service.d.ts +0 -26
- package/dismissible-layer/README.md +0 -1
- package/dismissible-layer/index.d.ts +0 -1
- package/dismissible-layer/src/utils.d.ts +0 -38
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +0 -15
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.d.ts +0 -9
- package/dropdown-menu/src/dropdown-menu-item-indicator.directive.d.ts +0 -7
- package/dropdown-menu/src/dropdown-menu-item-radio-group.directive.d.ts +0 -12
- package/dropdown-menu/src/dropdown-menu-item-radio.directive.d.ts +0 -19
- package/dropdown-menu/src/dropdown-menu-item-selectable.d.ts +0 -12
- package/dropdown-menu/src/dropdown-menu-item.directive.d.ts +0 -17
- package/dropdown-menu/src/dropdown-menu-label.directive.d.ts +0 -6
- package/dropdown-menu/src/dropdown-menu-separator.directive.d.ts +0 -6
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +0 -73
- package/editable/src/editable-root.d.ts +0 -67
- package/fesm2022/radix-ng-primitives-dismissible-layer.mjs +0 -211
- package/fesm2022/radix-ng-primitives-dismissible-layer.mjs.map +0 -1
- package/focus-scope/src/focus-scope.d.ts +0 -53
- package/focus-scope/src/stack.d.ts +0 -13
- package/focus-scope/src/utils.d.ts +0 -46
- package/hover-card/src/hover-card-anchor.directive.d.ts +0 -28
- package/hover-card/src/hover-card-anchor.token.d.ts +0 -3
- package/hover-card/src/hover-card-arrow.directive.d.ts +0 -45
- package/hover-card/src/hover-card-arrow.token.d.ts +0 -3
- package/hover-card/src/hover-card-close.directive.d.ts +0 -18
- package/hover-card/src/hover-card-close.token.d.ts +0 -3
- package/hover-card/src/hover-card-content-attributes.component.d.ts +0 -25
- package/hover-card/src/hover-card-content-attributes.token.d.ts +0 -3
- package/hover-card/src/hover-card-content.directive.d.ts +0 -124
- package/hover-card/src/hover-card-root.directive.d.ts +0 -182
- package/hover-card/src/hover-card-root.inject.d.ts +0 -3
- package/hover-card/src/hover-card-trigger.directive.d.ts +0 -26
- package/hover-card/src/hover-card.types.d.ts +0 -18
- package/hover-card/src/utils/cdk-event.service.d.ts +0 -30
- package/hover-card/src/utils/constants.d.ts +0 -1
- package/hover-card/src/utils/types.d.ts +0 -7
- package/label/src/label.directive.d.ts +0 -24
- package/menu/src/menu-content.directive.d.ts +0 -6
- package/menu/src/menu-directive.d.ts +0 -6
- package/menu/src/menu-group.directive.d.ts +0 -6
- package/menu/src/menu-item-checkbox.directive.d.ts +0 -21
- package/menu/src/menu-item-indicator.directive.d.ts +0 -10
- package/menu/src/menu-item-radio.directive.d.ts +0 -20
- package/menu/src/menu-item.directive.d.ts +0 -18
- package/menu/src/menu-label.directive.d.ts +0 -5
- package/menu/src/menu-radio-group.directive.d.ts +0 -6
- package/menu/src/menu-separator.directive.d.ts +0 -5
- package/menu/src/menu-trigger.directive.d.ts +0 -35
- package/menu/src/utils.d.ts +0 -3
- package/menubar/src/menubar-content.directive.d.ts +0 -6
- package/menubar/src/menubar-item-checkbox.directive.d.ts +0 -6
- package/menubar/src/menubar-item-indicator.directive.d.ts +0 -6
- package/menubar/src/menubar-item-radio.directive.d.ts +0 -6
- package/menubar/src/menubar-item.directive.d.ts +0 -6
- package/menubar/src/menubar-radio-group.directive.d.ts +0 -6
- package/menubar/src/menubar-root.directive.d.ts +0 -6
- package/menubar/src/menubar-separator.directive.d.ts +0 -6
- package/menubar/src/menubar-trigger.directive.d.ts +0 -6
- package/navigation-menu/src/navigation-menu-a11y.component.d.ts +0 -15
- package/navigation-menu/src/navigation-menu-content.directive.d.ts +0 -31
- package/navigation-menu/src/navigation-menu-indicator.directive.d.ts +0 -29
- package/navigation-menu/src/navigation-menu-item.directive.d.ts +0 -44
- package/navigation-menu/src/navigation-menu-link.directive.d.ts +0 -17
- package/navigation-menu/src/navigation-menu-list.directive.d.ts +0 -38
- package/navigation-menu/src/navigation-menu-sub.directive.d.ts +0 -19
- package/navigation-menu/src/navigation-menu-trigger.directive.d.ts +0 -33
- package/navigation-menu/src/navigation-menu-viewport.directive.d.ts +0 -61
- package/navigation-menu/src/navigation-menu.directive.d.ts +0 -76
- package/navigation-menu/src/navigation-menu.token.d.ts +0 -36
- package/navigation-menu/src/navigation-menu.types.d.ts +0 -13
- package/navigation-menu/src/utils.d.ts +0 -44
- package/number-field/src/number-field-context.token.d.ts +0 -24
- package/number-field/src/number-field-decrement.directive.d.ts +0 -23
- package/number-field/src/number-field-increment.directive.d.ts +0 -23
- package/number-field/src/number-field-input.directive.d.ts +0 -22
- package/number-field/src/number-field-root.directive.d.ts +0 -86
- package/number-field/src/types.d.ts +0 -1
- package/number-field/src/utils.d.ts +0 -18
- package/pagination/src/pagination-context.token.d.ts +0 -11
- package/pagination/src/pagination-ellipsis.directive.d.ts +0 -5
- package/pagination/src/pagination-first.directive.d.ts +0 -8
- package/pagination/src/pagination-last.directive.d.ts +0 -8
- package/pagination/src/pagination-list-item.directive.d.ts +0 -10
- package/pagination/src/pagination-list.directive.d.ts +0 -12
- package/pagination/src/pagination-next.directive.d.ts +0 -8
- package/pagination/src/pagination-prev.directive.d.ts +0 -8
- package/pagination/src/pagination-root.directive.d.ts +0 -18
- package/pagination/src/utils.d.ts +0 -9
- package/popover/src/popover-anchor.directive.d.ts +0 -28
- package/popover/src/popover-anchor.token.d.ts +0 -3
- package/popover/src/popover-arrow.directive.d.ts +0 -40
- package/popover/src/popover-arrow.token.d.ts +0 -3
- package/popover/src/popover-close.directive.d.ts +0 -15
- package/popover/src/popover-close.token.d.ts +0 -3
- package/popover/src/popover-content-attributes.component.d.ts +0 -23
- package/popover/src/popover-content-attributes.token.d.ts +0 -3
- package/popover/src/popover-content.directive.d.ts +0 -104
- package/popover/src/popover-root.directive.d.ts +0 -155
- package/popover/src/popover-root.inject.d.ts +0 -3
- package/popover/src/popover-trigger.directive.d.ts +0 -18
- package/popover/src/popover.types.d.ts +0 -14
- package/popover/src/utils/cdk-event.service.d.ts +0 -30
- package/popover/src/utils/constants.d.ts +0 -1
- package/popover/src/utils/types.d.ts +0 -7
- package/presence/src/presence.d.ts +0 -42
- package/presence/src/presence.directive.d.ts +0 -27
- package/presence/src/transitions/transition.collapse.d.ts +0 -15
- package/presence/src/transitions/transition.toast.d.ts +0 -3
- package/presence/src/types.d.ts +0 -15
- package/presence/src/utils.d.ts +0 -42
- package/progress/src/progress-indicator.directive.d.ts +0 -15
- package/progress/src/progress-root.directive.d.ts +0 -54
- package/radio/src/radio-indicator.directive.d.ts +0 -9
- package/radio/src/radio-item-input.directive.d.ts +0 -12
- package/radio/src/radio-item.directive.d.ts +0 -30
- package/radio/src/radio-root.directive.d.ts +0 -57
- package/radio/src/radio-tokens.d.ts +0 -14
- package/roving-focus/src/roving-focus-group.directive.d.ts +0 -50
- package/roving-focus/src/roving-focus-item.directive.d.ts +0 -50
- package/roving-focus/src/utils.d.ts +0 -19
- package/select/src/select-content.directive.d.ts +0 -20
- package/select/src/select-group.directive.d.ts +0 -5
- package/select/src/select-icon.directive.d.ts +0 -5
- package/select/src/select-item-indicator.directive.d.ts +0 -7
- package/select/src/select-item.directive.d.ts +0 -53
- package/select/src/select-label.directive.d.ts +0 -5
- package/select/src/select-separator.directive.d.ts +0 -5
- package/select/src/select-trigger.directive.d.ts +0 -17
- package/select/src/select-value.directive.d.ts +0 -8
- package/select/src/select.component.d.ts +0 -98
- package/separator/src/separator.directive.d.ts +0 -60
- package/slider/src/slider-horizontal.component.d.ts +0 -28
- package/slider/src/slider-impl.directive.d.ts +0 -17
- package/slider/src/slider-orientation-context.service.d.ts +0 -14
- package/slider/src/slider-range.component.d.ts +0 -13
- package/slider/src/slider-root.component.d.ts +0 -123
- package/slider/src/slider-thumb-impl.directive.d.ts +0 -27
- package/slider/src/slider-thumb.component.d.ts +0 -6
- package/slider/src/slider-track.component.d.ts +0 -7
- package/slider/src/slider-vertical.component.d.ts +0 -28
- package/slider/src/utils.d.ts +0 -52
- package/stepper/src/stepper-description.directive.d.ts +0 -6
- package/stepper/src/stepper-indicator.directive.d.ts +0 -6
- package/stepper/src/stepper-item-context.token.d.ts +0 -13
- package/stepper/src/stepper-item.directive.d.ts +0 -21
- package/stepper/src/stepper-root-context.token.d.ts +0 -12
- package/stepper/src/stepper-root.directive.d.ts +0 -33
- package/stepper/src/stepper-separator.directive.d.ts +0 -10
- package/stepper/src/stepper-title.directive.d.ts +0 -6
- package/stepper/src/stepper-trigger.directive.d.ts +0 -14
- package/stepper/src/types.d.ts +0 -1
- package/switch/src/switch-input.directive.d.ts +0 -11
- package/switch/src/switch-root.directive.d.ts +0 -74
- package/switch/src/switch-thumb.directive.d.ts +0 -9
- package/tabs/src/tabs-content.directive.d.ts +0 -13
- package/tabs/src/tabs-list.directive.d.ts +0 -10
- package/tabs/src/tabs-root.directive.d.ts +0 -53
- package/tabs/src/tabs-trigger.directive.d.ts +0 -29
- package/tabs/src/utils.d.ts +0 -2
- package/time-field/src/time-field-context.token.d.ts +0 -20
- package/time-field/src/time-field-input.directive.d.ts +0 -53
- package/time-field/src/time-field-root.directive.d.ts +0 -130
- package/toggle/src/toggle-visually-hidden-input.directive.d.ts +0 -6
- package/toggle/src/toggle.directive.d.ts +0 -65
- package/toggle-group/src/toggle-group-item.directive.d.ts +0 -37
- package/toggle-group/src/toggle-group-item.token.d.ts +0 -4
- package/toggle-group/src/toggle-group-without-focus.directive.d.ts +0 -69
- package/toggle-group/src/toggle-group.directive.d.ts +0 -74
- package/toggle-group/src/toggle-group.token.d.ts +0 -10
- package/toolbar/src/toolbar-button.directive.d.ts +0 -11
- package/toolbar/src/toolbar-link.directive.d.ts +0 -7
- package/toolbar/src/toolbar-root.directive.d.ts +0 -8
- package/toolbar/src/toolbar-root.token.d.ts +0 -5
- package/toolbar/src/toolbar-separator.directive.d.ts +0 -6
- package/toolbar/src/toolbar-toggle-group.directive.d.ts +0 -6
- package/toolbar/src/toolbar-toggle-item.directive.d.ts +0 -6
- package/tooltip/src/tooltip-anchor.directive.d.ts +0 -28
- package/tooltip/src/tooltip-anchor.token.d.ts +0 -3
- package/tooltip/src/tooltip-arrow.directive.d.ts +0 -40
- package/tooltip/src/tooltip-arrow.token.d.ts +0 -3
- package/tooltip/src/tooltip-close.directive.d.ts +0 -18
- package/tooltip/src/tooltip-close.token.d.ts +0 -3
- package/tooltip/src/tooltip-content-attributes.component.d.ts +0 -25
- package/tooltip/src/tooltip-content-attributes.token.d.ts +0 -3
- package/tooltip/src/tooltip-content.directive.d.ts +0 -104
- package/tooltip/src/tooltip-root.directive.d.ts +0 -168
- package/tooltip/src/tooltip-root.inject.d.ts +0 -3
- package/tooltip/src/tooltip-trigger.directive.d.ts +0 -26
- package/tooltip/src/tooltip.types.d.ts +0 -18
- package/tooltip/src/utils/cdk-event.service.d.ts +0 -30
- package/tooltip/src/utils/constants.d.ts +0 -1
- package/tooltip/src/utils/types.d.ts +0 -7
- package/visually-hidden/src/visually-hidden-input-bubble.directive.d.ts +0 -23
- package/visually-hidden/src/visually-hidden-input.directive.d.ts +0 -19
- package/visually-hidden/src/visually-hidden.directive.d.ts +0 -17
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
+
import { inject, PLATFORM_ID, ElementRef, input, booleanAttribute, model, output, linkedSignal, signal, effect, Directive, DestroyRef, computed } from '@angular/core';
|
|
4
|
+
import { createContext } from '@radix-ng/primitives/core';
|
|
3
5
|
|
|
4
6
|
const ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';
|
|
5
7
|
const EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
@@ -48,45 +50,113 @@ function generateId() {
|
|
|
48
50
|
return `rf-item-${Math.random().toString(36).slice(2, 11)}`;
|
|
49
51
|
}
|
|
50
52
|
|
|
53
|
+
const rootContext = () => {
|
|
54
|
+
const rovingFocusGroup = inject(RdxRovingFocusGroupDirective);
|
|
55
|
+
return {
|
|
56
|
+
loop: rovingFocusGroup.loop,
|
|
57
|
+
dir: rovingFocusGroup.dir,
|
|
58
|
+
orientation: rovingFocusGroup.orientation,
|
|
59
|
+
currentTabStopId: rovingFocusGroup.currentTabStopId,
|
|
60
|
+
focusableItems: rovingFocusGroup.focusableItems,
|
|
61
|
+
onItemFocus: (tabStopId) => {
|
|
62
|
+
rovingFocusGroup.currentTabStopId.set(tabStopId);
|
|
63
|
+
},
|
|
64
|
+
onItemShiftTab: () => {
|
|
65
|
+
rovingFocusGroup.isTabbingBackOut.set(true);
|
|
66
|
+
},
|
|
67
|
+
onFocusableItemAdd: () => {
|
|
68
|
+
rovingFocusGroup.focusableItemsCount.update((count) => count + 1);
|
|
69
|
+
},
|
|
70
|
+
onFocusableItemRemove: () => {
|
|
71
|
+
rovingFocusGroup.focusableItemsCount.update((count) => Math.max(0, count - 1));
|
|
72
|
+
},
|
|
73
|
+
registerItem: (item) => {
|
|
74
|
+
const currentItems = rovingFocusGroup.focusableItems();
|
|
75
|
+
rovingFocusGroup.focusableItems.set([...currentItems, item]);
|
|
76
|
+
},
|
|
77
|
+
unregisterItem: (item) => {
|
|
78
|
+
const currentItems = rovingFocusGroup.focusableItems();
|
|
79
|
+
rovingFocusGroup.focusableItems.set(currentItems.filter((el) => el !== item));
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const [injectRovingFocusGroupContext, provideRovingFocusGroupContext] = createContext('RovingFocusGroupContext');
|
|
84
|
+
/**
|
|
85
|
+
* @group Components
|
|
86
|
+
*/
|
|
51
87
|
class RdxRovingFocusGroupDirective {
|
|
52
88
|
constructor() {
|
|
53
|
-
this.
|
|
89
|
+
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
54
90
|
this.elementRef = inject(ElementRef);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
this.
|
|
91
|
+
/**
|
|
92
|
+
* The orientation of the group. Mainly so arrow navigation is done accordingly (left & right vs. up & down)
|
|
93
|
+
*/
|
|
94
|
+
this.orientationInput = input('horizontal', ...(ngDevMode ? [{ debugName: "orientationInput", alias: 'orientation' }] : [{ alias: 'orientation' }]));
|
|
95
|
+
/**
|
|
96
|
+
* The direction of navigation between items.
|
|
97
|
+
*/
|
|
98
|
+
this.dirInput = input('ltr', ...(ngDevMode ? [{ debugName: "dirInput", alias: 'dir' }] : [{ alias: 'dir' }]));
|
|
99
|
+
/**
|
|
100
|
+
* Whether keyboard navigation should loop around
|
|
101
|
+
*/
|
|
102
|
+
this.loopInput = input(true, ...(ngDevMode ? [{ debugName: "loopInput", transform: booleanAttribute, alias: 'loop' }] : [{ transform: booleanAttribute, alias: 'loop' }]));
|
|
103
|
+
/**
|
|
104
|
+
* When `true`, will prevent scrolling to the focus item when focused.
|
|
105
|
+
* @group Props
|
|
106
|
+
*/
|
|
107
|
+
this.preventScrollOnEntryFocus = input(false, ...(ngDevMode ? [{ debugName: "preventScrollOnEntryFocus", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
108
|
+
/**
|
|
109
|
+
* The value of the current stop item.
|
|
110
|
+
*
|
|
111
|
+
* Use when you do not need to control the state of the stop item.
|
|
112
|
+
* @group Props
|
|
113
|
+
*/
|
|
114
|
+
this.defaultCurrentTabStopId = input(undefined, ...(ngDevMode ? [{ debugName: "defaultCurrentTabStopId" }] : []));
|
|
115
|
+
/**
|
|
116
|
+
* The controlled value of the current stop item. Can be binded as `model`.
|
|
117
|
+
* @group Props
|
|
118
|
+
*/
|
|
119
|
+
this.currentTabStopId = model(undefined, ...(ngDevMode ? [{ debugName: "currentTabStopId" }] : []));
|
|
120
|
+
/**
|
|
121
|
+
* Event handler called when container is being focused. Can be prevented.
|
|
122
|
+
* @group Emits
|
|
123
|
+
*/
|
|
124
|
+
this.entryFocus = output();
|
|
125
|
+
this._orientation = linkedSignal(() => this.orientationInput(), ...(ngDevMode ? [{ debugName: "_orientation" }] : []));
|
|
126
|
+
this.orientation = this._orientation.asReadonly();
|
|
127
|
+
this._dir = linkedSignal(() => this.dirInput(), ...(ngDevMode ? [{ debugName: "_dir" }] : []));
|
|
128
|
+
this.dir = this._dir.asReadonly();
|
|
129
|
+
this._loop = linkedSignal(() => this.loopInput(), ...(ngDevMode ? [{ debugName: "_loop" }] : []));
|
|
130
|
+
this.loop = this._loop.asReadonly();
|
|
131
|
+
this.focusableItems = signal([], ...(ngDevMode ? [{ debugName: "focusableItems" }] : []));
|
|
132
|
+
this.isClickFocus = signal(false, ...(ngDevMode ? [{ debugName: "isClickFocus" }] : []));
|
|
133
|
+
this.isTabbingBackOut = signal(false, ...(ngDevMode ? [{ debugName: "isTabbingBackOut" }] : []));
|
|
134
|
+
this.focusableItemsCount = signal(0, ...(ngDevMode ? [{ debugName: "focusableItemsCount" }] : []));
|
|
135
|
+
effect(() => {
|
|
136
|
+
if (this.currentTabStopId() === undefined) {
|
|
137
|
+
const def = this.defaultCurrentTabStopId();
|
|
138
|
+
if (def !== undefined) {
|
|
139
|
+
this.currentTabStopId.set(def);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
67
143
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return this.orientation || 'horizontal';
|
|
144
|
+
setOrientation(value) {
|
|
145
|
+
this._orientation.set(value);
|
|
71
146
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return this.isTabbingBackOut() || this.getFocusableItemsCount() === 0 ? -1 : 0;
|
|
147
|
+
setDir(value) {
|
|
148
|
+
this._dir.set(value);
|
|
75
149
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this.isTabbingBackOut.set(false);
|
|
150
|
+
setLoop(value) {
|
|
151
|
+
this._loop.set(value);
|
|
79
152
|
}
|
|
80
153
|
/** @ignore */
|
|
81
154
|
handleMouseUp() {
|
|
155
|
+
if (!this.isBrowser)
|
|
156
|
+
return;
|
|
82
157
|
// reset `isClickFocus` after 1 tick because handleFocus might not triggered due to focused element
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Promise.resolve().then(() => {
|
|
86
|
-
this.ngZone.run(() => {
|
|
87
|
-
this.isClickFocus.set(false);
|
|
88
|
-
});
|
|
89
|
-
});
|
|
158
|
+
requestAnimationFrame(() => {
|
|
159
|
+
this.isClickFocus.set(false);
|
|
90
160
|
});
|
|
91
161
|
}
|
|
92
162
|
/** @ignore */
|
|
@@ -106,141 +176,98 @@ class RdxRovingFocusGroupDirective {
|
|
|
106
176
|
if (!entryFocusEvent.defaultPrevented) {
|
|
107
177
|
const items = this.focusableItems().filter((item) => item.dataset['disabled'] !== '');
|
|
108
178
|
const activeItem = items.find((item) => item.getAttribute('data-active') === 'true');
|
|
179
|
+
const highlightedItem = items.find((item) => item.getAttribute('data-highlighted') === '');
|
|
109
180
|
const currentItem = items.find((item) => item.id === this.currentTabStopId());
|
|
110
|
-
const candidateItems = [activeItem, currentItem, ...items].filter(Boolean);
|
|
111
|
-
focusFirst(candidateItems, this.preventScrollOnEntryFocus);
|
|
181
|
+
const candidateItems = [activeItem, highlightedItem, currentItem, ...items].filter(Boolean);
|
|
182
|
+
focusFirst(candidateItems, this.preventScrollOnEntryFocus());
|
|
112
183
|
}
|
|
113
184
|
}
|
|
114
185
|
this.isClickFocus.set(false);
|
|
115
186
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this.isClickFocus.set(true);
|
|
119
|
-
}
|
|
120
|
-
/** @ignore */
|
|
121
|
-
onItemFocus(tabStopId) {
|
|
122
|
-
this.currentTabStopId.set(tabStopId);
|
|
123
|
-
this.currentTabStopIdChange.emit(tabStopId);
|
|
124
|
-
}
|
|
125
|
-
/** @ignore */
|
|
126
|
-
onItemShiftTab() {
|
|
127
|
-
this.isTabbingBackOut.set(true);
|
|
128
|
-
}
|
|
129
|
-
/** @ignore */
|
|
130
|
-
onFocusableItemAdd() {
|
|
131
|
-
this.focusableItemsCount.update((count) => count + 1);
|
|
132
|
-
}
|
|
133
|
-
/** @ignore */
|
|
134
|
-
onFocusableItemRemove() {
|
|
135
|
-
this.focusableItemsCount.update((count) => Math.max(0, count - 1));
|
|
136
|
-
}
|
|
137
|
-
/** @ignore */
|
|
138
|
-
registerItem(item) {
|
|
139
|
-
const currentItems = this.focusableItems();
|
|
140
|
-
this.focusableItems.set([...currentItems, item]);
|
|
141
|
-
}
|
|
142
|
-
/** @ignore */
|
|
143
|
-
unregisterItem(item) {
|
|
144
|
-
const currentItems = this.focusableItems();
|
|
145
|
-
this.focusableItems.set(currentItems.filter((el) => el !== item));
|
|
146
|
-
}
|
|
147
|
-
/** @ignore */
|
|
148
|
-
getFocusableItemsCount() {
|
|
149
|
-
return this.focusableItemsCount();
|
|
150
|
-
}
|
|
151
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.4", ngImport: i0, type: RdxRovingFocusGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
152
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.4", type: RdxRovingFocusGroupDirective, isStandalone: true, selector: "[rdxRovingFocusGroup]", inputs: { orientation: "orientation", dir: "dir", loop: ["loop", "loop", booleanAttribute], preventScrollOnEntryFocus: ["preventScrollOnEntryFocus", "preventScrollOnEntryFocus", booleanAttribute] }, outputs: { entryFocus: "entryFocus", currentTabStopIdChange: "currentTabStopIdChange" }, host: { listeners: { "focus": "handleFocus($event)", "blur": "handleBlur()", "mouseup": "handleMouseUp()", "mousedown": "handleMouseDown()" }, properties: { "attr.data-orientation": "dataOrientation", "attr.tabindex": "tabIndex", "attr.dir": "dir" }, styleAttribute: "outline: none;" }, ngImport: i0 }); }
|
|
187
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxRovingFocusGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
188
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.3", type: RdxRovingFocusGroupDirective, isStandalone: true, selector: "[rdxRovingFocusGroup]", inputs: { orientationInput: { classPropertyName: "orientationInput", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loopInput: { classPropertyName: "loopInput", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, preventScrollOnEntryFocus: { classPropertyName: "preventScrollOnEntryFocus", publicName: "preventScrollOnEntryFocus", isSignal: true, isRequired: false, transformFunction: null }, defaultCurrentTabStopId: { classPropertyName: "defaultCurrentTabStopId", publicName: "defaultCurrentTabStopId", isSignal: true, isRequired: false, transformFunction: null }, currentTabStopId: { classPropertyName: "currentTabStopId", publicName: "currentTabStopId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentTabStopId: "currentTabStopIdChange", entryFocus: "entryFocus" }, host: { listeners: { "focus": "handleFocus($event)", "blur": "isTabbingBackOut.set(false)", "mouseup": "handleMouseUp()", "mousedown": "isClickFocus.set(true)" }, properties: { "attr.data-orientation": "orientation()", "attr.tabindex": "isTabbingBackOut() || focusableItemsCount() === 0 ? -1 : 0", "attr.dir": "dir()" }, styleAttribute: "outline: none;" }, providers: [provideRovingFocusGroupContext(rootContext)], ngImport: i0 }); }
|
|
153
189
|
}
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxRovingFocusGroupDirective, decorators: [{
|
|
155
191
|
type: Directive,
|
|
156
192
|
args: [{
|
|
157
193
|
selector: '[rdxRovingFocusGroup]',
|
|
158
|
-
|
|
194
|
+
providers: [provideRovingFocusGroupContext(rootContext)],
|
|
159
195
|
host: {
|
|
160
|
-
'[attr.data-orientation]': '
|
|
161
|
-
'[attr.tabindex]': '
|
|
162
|
-
'[attr.dir]': 'dir',
|
|
196
|
+
'[attr.data-orientation]': 'orientation()',
|
|
197
|
+
'[attr.tabindex]': 'isTabbingBackOut() || focusableItemsCount() === 0 ? -1 : 0',
|
|
198
|
+
'[attr.dir]': 'dir()',
|
|
163
199
|
'(focus)': 'handleFocus($event)',
|
|
164
|
-
'(blur)': '
|
|
200
|
+
'(blur)': 'isTabbingBackOut.set(false)',
|
|
165
201
|
'(mouseup)': 'handleMouseUp()',
|
|
166
|
-
'(mousedown)': '
|
|
202
|
+
'(mousedown)': 'isClickFocus.set(true)',
|
|
167
203
|
style: 'outline: none;'
|
|
168
204
|
}
|
|
169
205
|
}]
|
|
170
|
-
}],
|
|
171
|
-
type: Input
|
|
172
|
-
}], dir: [{
|
|
173
|
-
type: Input
|
|
174
|
-
}], loop: [{
|
|
175
|
-
type: Input,
|
|
176
|
-
args: [{ transform: booleanAttribute }]
|
|
177
|
-
}], preventScrollOnEntryFocus: [{
|
|
178
|
-
type: Input,
|
|
179
|
-
args: [{ transform: booleanAttribute }]
|
|
180
|
-
}], entryFocus: [{
|
|
181
|
-
type: Output
|
|
182
|
-
}], currentTabStopIdChange: [{
|
|
183
|
-
type: Output
|
|
184
|
-
}] } });
|
|
206
|
+
}], ctorParameters: () => [] });
|
|
185
207
|
|
|
208
|
+
/**
|
|
209
|
+
* @group Components
|
|
210
|
+
*/
|
|
186
211
|
class RdxRovingFocusItemDirective {
|
|
187
212
|
constructor() {
|
|
213
|
+
this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
214
|
+
this.destroyRef = inject(DestroyRef);
|
|
188
215
|
this.elementRef = inject(ElementRef);
|
|
189
|
-
this.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this.
|
|
195
|
-
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
216
|
+
this.rootContext = injectRovingFocusGroupContext();
|
|
217
|
+
/**
|
|
218
|
+
* When false, item will not be focusable.
|
|
219
|
+
* @group Props
|
|
220
|
+
*/
|
|
221
|
+
this.focusableInput = input(true, ...(ngDevMode ? [{ debugName: "focusableInput", transform: booleanAttribute, alias: 'focusable' }] : [{ transform: booleanAttribute, alias: 'focusable' }]));
|
|
222
|
+
/**
|
|
223
|
+
* When `true`, item will be initially focused.
|
|
224
|
+
* @group Props
|
|
225
|
+
*/
|
|
226
|
+
this.activeInput = input(true, ...(ngDevMode ? [{ debugName: "activeInput", transform: booleanAttribute, alias: 'active' }] : [{ transform: booleanAttribute, alias: 'active' }]));
|
|
227
|
+
/**
|
|
228
|
+
* @group Props
|
|
229
|
+
*/
|
|
230
|
+
this.tabStopIdInput = input(undefined, ...(ngDevMode ? [{ debugName: "tabStopIdInput", alias: 'tabStopId' }] : [{ alias: 'tabStopId' }]));
|
|
231
|
+
/**
|
|
232
|
+
* When true, shift + arrow key will allow focusing on next/previous item.
|
|
233
|
+
* @group Props
|
|
234
|
+
*/
|
|
235
|
+
this.allowShiftKey = input(false, ...(ngDevMode ? [{ debugName: "allowShiftKey", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
236
|
+
this.id = computed(() => this.tabStopId() || generateId(), ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
237
|
+
this.isCurrentTabStop = computed(() => this.rootContext.currentTabStopId() === this.id(), ...(ngDevMode ? [{ debugName: "isCurrentTabStop" }] : []));
|
|
238
|
+
this.focusable = linkedSignal(() => this.focusableInput(), ...(ngDevMode ? [{ debugName: "focusable" }] : []));
|
|
239
|
+
this.active = linkedSignal(() => this.activeInput(), ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
240
|
+
this.tabStopId = linkedSignal(() => this.tabStopIdInput(), ...(ngDevMode ? [{ debugName: "tabStopId" }] : []));
|
|
241
|
+
if (this.focusable()) {
|
|
242
|
+
this.rootContext.registerItem(this.elementRef.nativeElement);
|
|
243
|
+
this.rootContext.onFocusableItemAdd();
|
|
244
|
+
this.destroyRef.onDestroy(() => {
|
|
245
|
+
this.rootContext.unregisterItem(this.elementRef.nativeElement);
|
|
246
|
+
this.rootContext.onFocusableItemRemove();
|
|
247
|
+
});
|
|
207
248
|
}
|
|
208
249
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
* Unregisters the element from the parent roving focus group if it is focusable.
|
|
212
|
-
* @ignore
|
|
213
|
-
*/
|
|
214
|
-
ngOnDestroy() {
|
|
215
|
-
if (this.focusable) {
|
|
216
|
-
this.parent.unregisterItem(this.elementRef.nativeElement);
|
|
217
|
-
this.parent.onFocusableItemRemove();
|
|
218
|
-
}
|
|
250
|
+
setFocusable(value) {
|
|
251
|
+
this.focusable.set(value);
|
|
219
252
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
get tabIndex() {
|
|
226
|
-
return this.isCurrentTabStop() ? 0 : -1;
|
|
253
|
+
setActive(value) {
|
|
254
|
+
this.active.set(value);
|
|
255
|
+
}
|
|
256
|
+
setTabStopId(value) {
|
|
257
|
+
this.tabStopId.set(value);
|
|
227
258
|
}
|
|
228
259
|
/** @ignore */
|
|
229
260
|
handleMouseDown(event) {
|
|
230
|
-
if (!this.focusable) {
|
|
261
|
+
if (!this.focusable()) {
|
|
231
262
|
// We prevent focusing non-focusable items on `mousedown`.
|
|
232
263
|
// Even though the item has tabIndex={-1}, that only means take it out of the tab order.
|
|
233
264
|
event.preventDefault();
|
|
234
265
|
}
|
|
235
266
|
else {
|
|
236
267
|
// Safari doesn't focus a button when clicked so we run our logic on mousedown also
|
|
237
|
-
this.
|
|
268
|
+
this.rootContext.onItemFocus(this.id());
|
|
238
269
|
}
|
|
239
270
|
}
|
|
240
|
-
/** @ignore */
|
|
241
|
-
onFocus() {
|
|
242
|
-
this.parent.onItemFocus(this.id());
|
|
243
|
-
}
|
|
244
271
|
/**
|
|
245
272
|
* Handles the `keydown` event for keyboard navigation within the roving focus group.
|
|
246
273
|
* Supports navigation based on orientation and direction, and focuses appropriate elements.
|
|
@@ -250,18 +277,18 @@ class RdxRovingFocusItemDirective {
|
|
|
250
277
|
*/
|
|
251
278
|
handleKeydown(event) {
|
|
252
279
|
if (event.key === 'Tab' && event.shiftKey) {
|
|
253
|
-
this.
|
|
280
|
+
this.rootContext.onItemShiftTab();
|
|
254
281
|
return;
|
|
255
282
|
}
|
|
256
283
|
if (event.target !== this.elementRef.nativeElement)
|
|
257
284
|
return;
|
|
258
|
-
const focusIntent = getFocusIntent(event, this.
|
|
285
|
+
const focusIntent = getFocusIntent(event, this.rootContext.orientation(), this.rootContext.dir());
|
|
259
286
|
if (focusIntent !== undefined) {
|
|
260
|
-
if (event.metaKey || event.ctrlKey || event.altKey || (this.allowShiftKey ? false : event.shiftKey)) {
|
|
287
|
+
if (event.metaKey || event.ctrlKey || event.altKey || (this.allowShiftKey() ? false : event.shiftKey)) {
|
|
261
288
|
return;
|
|
262
289
|
}
|
|
263
290
|
event.preventDefault();
|
|
264
|
-
let candidateNodes = this.
|
|
291
|
+
let candidateNodes = this.rootContext.focusableItems().filter((item) => item.dataset['disabled'] !== '');
|
|
265
292
|
if (focusIntent === 'last') {
|
|
266
293
|
candidateNodes.reverse();
|
|
267
294
|
}
|
|
@@ -269,52 +296,41 @@ class RdxRovingFocusItemDirective {
|
|
|
269
296
|
if (focusIntent === 'prev')
|
|
270
297
|
candidateNodes.reverse();
|
|
271
298
|
const currentIndex = candidateNodes.indexOf(this.elementRef.nativeElement);
|
|
272
|
-
candidateNodes = this.
|
|
299
|
+
candidateNodes = this.rootContext.loop()
|
|
273
300
|
? wrapArray(candidateNodes, currentIndex + 1)
|
|
274
301
|
: candidateNodes.slice(currentIndex + 1);
|
|
275
302
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
Promise.resolve().then(() => {
|
|
303
|
+
queueMicrotask(() => {
|
|
304
|
+
if (this.isBrowser) {
|
|
279
305
|
focusFirst(candidateNodes, false, this.elementRef.nativeElement);
|
|
280
|
-
}
|
|
306
|
+
}
|
|
281
307
|
});
|
|
282
308
|
}
|
|
283
309
|
}
|
|
284
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
285
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
310
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxRovingFocusItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
311
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.3", type: RdxRovingFocusItemDirective, isStandalone: true, selector: "[rdxRovingFocusItem]", inputs: { focusableInput: { classPropertyName: "focusableInput", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, activeInput: { classPropertyName: "activeInput", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, tabStopIdInput: { classPropertyName: "tabStopIdInput", publicName: "tabStopId", isSignal: true, isRequired: false, transformFunction: null }, allowShiftKey: { classPropertyName: "allowShiftKey", publicName: "allowShiftKey", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "handleMouseDown($event)", "keydown": "handleKeydown($event)", "focus": "rootContext.onItemFocus(id())" }, properties: { "attr.tabindex": "isCurrentTabStop() ? 0 : -1", "attr.data-orientation": "rootContext.orientation", "attr.data-active": "active()", "attr.data-disabled": "!focusable() ? \"\" : undefined" } }, ngImport: i0 }); }
|
|
286
312
|
}
|
|
287
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: RdxRovingFocusItemDirective, decorators: [{
|
|
288
314
|
type: Directive,
|
|
289
315
|
args: [{
|
|
290
316
|
selector: '[rdxRovingFocusItem]',
|
|
291
|
-
standalone: true,
|
|
292
317
|
host: {
|
|
293
|
-
'[attr.tabindex]': '
|
|
294
|
-
'[attr.data-orientation]': '
|
|
295
|
-
'[attr.data-active]': 'active',
|
|
296
|
-
'[attr.data-disabled]': '!focusable ? "" : undefined',
|
|
318
|
+
'[attr.tabindex]': 'isCurrentTabStop() ? 0 : -1',
|
|
319
|
+
'[attr.data-orientation]': 'rootContext.orientation',
|
|
320
|
+
'[attr.data-active]': 'active()',
|
|
321
|
+
'[attr.data-disabled]': '!focusable() ? "" : undefined',
|
|
297
322
|
'(mousedown)': 'handleMouseDown($event)',
|
|
298
323
|
'(keydown)': 'handleKeydown($event)',
|
|
299
|
-
'(focus)': '
|
|
324
|
+
'(focus)': 'rootContext.onItemFocus(id())'
|
|
300
325
|
}
|
|
301
326
|
}]
|
|
302
|
-
}],
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}], active: [{
|
|
306
|
-
type: Input,
|
|
307
|
-
args: [{ transform: booleanAttribute }]
|
|
308
|
-
}], tabStopId: [{
|
|
309
|
-
type: Input
|
|
310
|
-
}], allowShiftKey: [{
|
|
311
|
-
type: Input,
|
|
312
|
-
args: [{ transform: booleanAttribute }]
|
|
313
|
-
}] } });
|
|
327
|
+
}], ctorParameters: () => [] });
|
|
328
|
+
|
|
329
|
+
const rovingFocusImports = [RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective];
|
|
314
330
|
|
|
315
331
|
/**
|
|
316
332
|
* Generated bundle index. Do not edit.
|
|
317
333
|
*/
|
|
318
334
|
|
|
319
|
-
export { RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective };
|
|
335
|
+
export { RdxRovingFocusGroupDirective, RdxRovingFocusItemDirective, injectRovingFocusGroupContext, provideRovingFocusGroupContext, rovingFocusImports };
|
|
320
336
|
//# sourceMappingURL=radix-ng-primitives-roving-focus.mjs.map
|