@radix-ng/primitives 0.32.4 → 0.33.1
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/core/index.d.ts +1 -0
- package/core/src/focus-initial.directive.d.ts +9 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +19 -19
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +22 -22
- package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +3 -3
- package/fesm2022/radix-ng-primitives-avatar.mjs +16 -16
- package/fesm2022/radix-ng-primitives-checkbox.mjs +16 -16
- package/fesm2022/radix-ng-primitives-collapsible.mjs +9 -9
- package/fesm2022/radix-ng-primitives-config.mjs +3 -3
- package/fesm2022/radix-ng-primitives-context-menu.mjs +34 -34
- package/fesm2022/radix-ng-primitives-core.mjs +26 -7
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dialog.mjs +25 -25
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +34 -34
- package/fesm2022/radix-ng-primitives-hover-card.mjs +28 -29
- package/fesm2022/radix-ng-primitives-hover-card.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +3 -3
- package/fesm2022/radix-ng-primitives-menu.mjs +37 -37
- package/fesm2022/radix-ng-primitives-menubar.mjs +31 -31
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs +1771 -0
- package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-pagination.mjs +28 -28
- package/fesm2022/radix-ng-primitives-popover.mjs +50 -32
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +10 -10
- package/fesm2022/radix-ng-primitives-radio.mjs +12 -12
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +6 -6
- package/fesm2022/radix-ng-primitives-select.mjs +34 -34
- package/fesm2022/radix-ng-primitives-separator.mjs +3 -3
- package/fesm2022/radix-ng-primitives-slider.mjs +31 -31
- package/fesm2022/radix-ng-primitives-stepper.mjs +25 -25
- package/fesm2022/radix-ng-primitives-switch.mjs +13 -13
- package/fesm2022/radix-ng-primitives-tabs.mjs +16 -16
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +9 -9
- package/fesm2022/radix-ng-primitives-toggle.mjs +6 -6
- package/fesm2022/radix-ng-primitives-toolbar.mjs +22 -22
- package/fesm2022/radix-ng-primitives-tooltip.mjs +28 -29
- package/fesm2022/radix-ng-primitives-tooltip.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs +31 -19
- package/fesm2022/radix-ng-primitives-visually-hidden.mjs.map +1 -1
- package/hover-card/src/hover-card-content.directive.d.ts +2 -2
- package/hover-card/src/hover-card-root.directive.d.ts +4 -4
- package/navigation-menu/README.md +3 -0
- package/navigation-menu/index.d.ts +28 -0
- package/navigation-menu/src/navigation-menu-a11y.component.d.ts +15 -0
- package/navigation-menu/src/navigation-menu-content.directive.d.ts +31 -0
- package/navigation-menu/src/navigation-menu-indicator.directive.d.ts +29 -0
- package/navigation-menu/src/navigation-menu-item.directive.d.ts +44 -0
- package/navigation-menu/src/navigation-menu-link.directive.d.ts +17 -0
- package/navigation-menu/src/navigation-menu-list.directive.d.ts +38 -0
- package/navigation-menu/src/navigation-menu-sub.directive.d.ts +19 -0
- package/navigation-menu/src/navigation-menu-trigger.directive.d.ts +33 -0
- package/navigation-menu/src/navigation-menu-viewport.directive.d.ts +61 -0
- package/navigation-menu/src/navigation-menu.directive.d.ts +72 -0
- package/navigation-menu/src/navigation-menu.token.d.ts +36 -0
- package/navigation-menu/src/navigation-menu.types.d.ts +13 -0
- package/navigation-menu/src/utils.d.ts +44 -0
- package/package.json +11 -7
- package/popover/src/popover-content-attributes.component.d.ts +7 -1
- package/popover/src/popover-content.directive.d.ts +2 -2
- package/popover/src/popover-root.directive.d.ts +4 -4
- package/tooltip/src/tooltip-content.directive.d.ts +2 -2
- package/tooltip/src/tooltip-root.directive.d.ts +4 -4
- package/visually-hidden/src/visually-hidden-input-bubble.directive.d.ts +4 -2
- package/visually-hidden/src/visually-hidden.directive.d.ts +2 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-visually-hidden.mjs","sources":["../../../packages/primitives/visually-hidden/src/visually-hidden.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input-bubble.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input.directive.ts","../../../packages/primitives/visually-hidden/radix-ng-primitives-visually-hidden.ts"],"sourcesContent":["import { Directive, input } from '@angular/core';\n\n/**\n *\n * <span rdxVisuallyHidden [feature]=\"'fully-hidden'\">\n * <ng-content></ng-content>\n * </span>\n *\n * <button (click)=\"directiveInstance.feature.set('focusable')\">Make Focusable</button>\n * <button (click)=\"directiveInstance.feature.set('fully-hidden')\">Hide</button>\n */\n@Directive({\n selector: '[rdxVisuallyHidden]',\n standalone: true,\n host: {\n '[attr.aria-hidden]': 'feature() === \"focusable\" ? \"true\" : null',\n '[hidden]': 'feature() === \"fully-hidden\" ? true : null',\n '[attr.tabindex]': 'feature() === \"fully-hidden\" ? \"-1\" : null',\n '[style.position]': '\"absolute\"',\n '[style.border]': '\"0\"',\n '[style.width]': '\"1px\"',\n '[style.display]': 'feature() === \"focusable\" ? \"inline-block\" : \"none\"',\n '[style.height]': '\"1px\"',\n '[style.padding]': '\"0\"',\n '[style.margin]': '\"-1px\"',\n '[style.overflow]': '\"hidden\"',\n '[style.clip]': '\"rect(0, 0, 0, 0)\"',\n '[style.white-space]': '\"nowrap\"',\n '[style.word-wrap]': '\"normal\"'\n }\n})\nexport class RdxVisuallyHiddenDirective {\n readonly feature = input<'focusable' | 'fully-hidden'>('focusable');\n}\n","import { Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from './visually-hidden.directive';\n\n/**\n *\n */\n@Directive({\n selector: '[rdxVisuallyHiddenInputBubble]',\n standalone: true,\n hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ['feature: feature'] }],\n host: {\n '[attr.name]': 'name()',\n '[attr.required]': 'required()',\n '[attr.disabled]': 'disabled()',\n '[attr.checked]': 'checked()',\n '[value]': 'value()',\n '(change)': 'onChange()'\n }\n})\nexport class RdxVisuallyHiddenInputBubbleDirective<T> {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | null>(null);\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<string>('fully-hidden');\n\n constructor() {\n effect(() => {\n this.updateInputValue();\n });\n }\n\n protected onChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n let valueChanged = false;\n let checkedChanged = false;\n\n // Check if the value has changed before applying the update\n const currentValue = this.inputElement.value;\n const newValue = String(this.value());\n\n if (currentValue !== newValue) {\n this.inputElement.value = newValue;\n valueChanged = true;\n }\n\n if (this.inputElement.type === 'checkbox' || this.inputElement.type === 'radio') {\n const currentChecked = this.inputElement.checked;\n const newChecked = !!this.checked();\n\n if (currentChecked !== newChecked) {\n this.inputElement.checked = newChecked;\n checkedChanged = true;\n }\n }\n\n if (valueChanged || checkedChanged) {\n this.dispatchInputEvents();\n }\n }\n\n private get inputElement() {\n return this.elementRef.nativeElement;\n }\n\n private dispatchInputEvents() {\n const inputEvent = new Event('input', { bubbles: true });\n const changeEvent = new Event('change', { bubbles: true });\n\n this.inputElement.dispatchEvent(inputEvent);\n this.inputElement.dispatchEvent(changeEvent);\n }\n}\n","// Implementation from https://github.com/unovue/radix-vue\n\nimport { Directive, ElementRef, OnInit, computed, inject, input } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from './visually-hidden-input-bubble.directive';\n\n@Directive({\n selector: '[rdxVisuallyHiddenInput]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: [\n 'feature: feature',\n 'name: name ',\n 'value: value',\n 'checked: checked',\n 'disabled: disabled',\n 'required: required'\n ]\n }\n ]\n})\nexport class RdxVisuallyHiddenInputDirective<T> implements OnInit {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | string>();\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<'focusable' | 'fully-hidden'>('fully-hidden');\n\n readonly parsedValue = computed<{ name: string; value: any }[]>(() => {\n const value = this.value();\n const name = this.name();\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return [{ name, value }];\n }\n\n if (Array.isArray(value)) {\n return value.flatMap((obj, index) => {\n if (typeof obj === 'object') {\n return Object.entries(obj).map(([key, val]) => ({\n name: `[${name}][${index}][${key}]`,\n value: val\n }));\n } else {\n return { name: `[${name}][${index}]`, value: obj };\n }\n });\n }\n\n if (value !== null && typeof value === 'object') {\n return Object.entries(value).map(([key, val]) => ({\n name: `[${name}][${key}]`,\n value: val\n }));\n }\n\n return [];\n });\n\n ngOnInit() {\n const parsedValues = this.parsedValue();\n\n parsedValues.forEach((parsed) => {\n const inputElement = this.elementRef.nativeElement;\n inputElement.setAttribute('name', parsed.name);\n inputElement.setAttribute('value', parsed.value);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.RdxVisuallyHiddenDirective","i1.RdxVisuallyHiddenInputBubbleDirective"],"mappings":";;;AAEA;;;;;;;;AAQG;MAqBU,0BAA0B,CAAA;AApBvC,IAAA,WAAA,GAAA;AAqBa,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA+B,WAAW,CAAC;AACtE;8GAFY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QA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,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,0BAA0B;AACpC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,cAAc,EAAE;AACZ,wBAAA;AACI,4BAAA,SAAS,EAAE,qCAAqC;AAChD,4BAAA,MAAM,EAAE;gCACJ,kBAAkB;gCAClB,aAAa;gCACb,cAAc;gCACd,kBAAkB;gCAClB,oBAAoB;gCACpB;AACH;AACJ;AACJ;AACJ,iBAAA;;;ACrBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-visually-hidden.mjs","sources":["../../../packages/primitives/visually-hidden/src/visually-hidden.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input-bubble.directive.ts","../../../packages/primitives/visually-hidden/src/visually-hidden-input.directive.ts","../../../packages/primitives/visually-hidden/radix-ng-primitives-visually-hidden.ts"],"sourcesContent":["import { Directive, input, linkedSignal } from '@angular/core';\n\n/**\n *\n * <span rdxVisuallyHidden [feature]=\"'fully-hidden'\">\n * <ng-content></ng-content>\n * </span>\n *\n * <button (click)=\"directiveInstance.feature.set('focusable')\">Make Focusable</button>\n * <button (click)=\"directiveInstance.feature.set('fully-hidden')\">Hide</button>\n */\n@Directive({\n selector: '[rdxVisuallyHidden]',\n host: {\n '[attr.aria-hidden]': 'feature() === \"focusable\" ? \"true\" : undefined',\n '[hidden]': 'feature() === \"fully-hidden\" ? true : undefined',\n '[attr.tabindex]': 'feature() === \"fully-hidden\" ? \"-1\" : undefined',\n '[style.position]': '\"absolute\"',\n '[style.border]': '\"0\"',\n '[style.display]': 'feature() === \"focusable\" ? \"inline-block\" : \"none\"',\n '[style.width]': '\"1px\"',\n '[style.height]': '\"1px\"',\n '[style.padding]': '\"0\"',\n '[style.margin]': '\"-1px\"',\n '[style.overflow]': '\"hidden\"',\n '[style.clip]': '\"rect(0, 0, 0, 0)\"',\n '[style.clipPath]': '\"inset(50%)\"',\n '[style.white-space]': '\"nowrap\"',\n '[style.word-wrap]': '\"normal\"'\n }\n})\nexport class RdxVisuallyHiddenDirective {\n readonly feature = input<'focusable' | 'fully-hidden'>('focusable');\n\n protected readonly featureEffect = linkedSignal({\n source: this.feature,\n computation: (feature: 'focusable' | 'fully-hidden') => feature\n });\n\n updateFeature(feature: 'focusable' | 'fully-hidden') {\n this.featureEffect.set(feature);\n }\n}\n","import { Directive, effect, ElementRef, inject, input, linkedSignal } from '@angular/core';\nimport { RdxVisuallyHiddenDirective } from './visually-hidden.directive';\n\n/**\n *\n */\n@Directive({\n selector: 'input[rdxVisuallyHiddenInputBubble]',\n hostDirectives: [{ directive: RdxVisuallyHiddenDirective, inputs: ['feature: feature'] }],\n host: {\n '[attr.name]': 'name()',\n '[attr.required]': 'required()',\n '[attr.disabled]': 'disabled()',\n '[attr.checked]': 'checked()',\n '[value]': 'value()',\n '(change)': 'onChange()'\n }\n})\nexport class RdxVisuallyHiddenInputBubbleDirective<T> {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | string | null>();\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<string>('fully-hidden');\n\n protected readonly valueEffect = linkedSignal({\n source: this.value,\n computation: (value: NoInfer<string | T | null | undefined>) => value\n });\n\n constructor() {\n effect(() => {\n this.updateInputValue();\n });\n }\n\n updateValue(value: string) {\n this.valueEffect.set(value);\n }\n\n protected onChange() {\n this.updateInputValue();\n }\n\n private updateInputValue() {\n let valueChanged = false;\n let checkedChanged = false;\n\n // Check if the value has changed before applying the update\n const currentValue = this.inputElement.value;\n const newValue = String(this.value());\n\n if (currentValue !== newValue) {\n this.inputElement.value = newValue;\n valueChanged = true;\n }\n\n if (this.inputElement.type === 'checkbox' || this.inputElement.type === 'radio') {\n const currentChecked = this.inputElement.checked;\n const newChecked = !!this.checked();\n\n if (currentChecked !== newChecked) {\n this.inputElement.checked = newChecked;\n checkedChanged = true;\n }\n }\n\n if (valueChanged || checkedChanged) {\n this.dispatchInputEvents();\n }\n }\n\n private get inputElement() {\n return this.elementRef.nativeElement;\n }\n\n private dispatchInputEvents() {\n const inputEvent = new Event('input', { bubbles: true });\n const changeEvent = new Event('change', { bubbles: true });\n\n this.inputElement.dispatchEvent(inputEvent);\n this.inputElement.dispatchEvent(changeEvent);\n }\n}\n","// Implementation from https://github.com/unovue/radix-vue\n\nimport { Directive, ElementRef, OnInit, computed, inject, input } from '@angular/core';\nimport { RdxVisuallyHiddenInputBubbleDirective } from './visually-hidden-input-bubble.directive';\n\n@Directive({\n selector: '[rdxVisuallyHiddenInput]',\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputBubbleDirective,\n inputs: [\n 'feature: feature',\n 'name: name ',\n 'value: value',\n 'checked: checked',\n 'disabled: disabled',\n 'required: required'\n ]\n }\n ]\n})\nexport class RdxVisuallyHiddenInputDirective<T> implements OnInit {\n private readonly elementRef = inject(ElementRef);\n\n readonly name = input<string>('');\n readonly value = input<T | string>();\n readonly checked = input<boolean | undefined>(undefined);\n readonly required = input<boolean | undefined>(undefined);\n readonly disabled = input<boolean | undefined>(undefined);\n readonly feature = input<'focusable' | 'fully-hidden'>('fully-hidden');\n\n readonly parsedValue = computed<{ name: string; value: any }[]>(() => {\n const value = this.value();\n const name = this.name();\n\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n return [{ name, value }];\n }\n\n if (Array.isArray(value)) {\n return value.flatMap((obj, index) => {\n if (typeof obj === 'object') {\n return Object.entries(obj).map(([key, val]) => ({\n name: `[${name}][${index}][${key}]`,\n value: val\n }));\n } else {\n return { name: `[${name}][${index}]`, value: obj };\n }\n });\n }\n\n if (value !== null && typeof value === 'object') {\n return Object.entries(value).map(([key, val]) => ({\n name: `[${name}][${key}]`,\n value: val\n }));\n }\n\n return [];\n });\n\n ngOnInit() {\n const parsedValues = this.parsedValue();\n\n parsedValues.forEach((parsed) => {\n const inputElement = this.elementRef.nativeElement;\n inputElement.setAttribute('name', parsed.name);\n inputElement.setAttribute('value', parsed.value);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.RdxVisuallyHiddenDirective","i1.RdxVisuallyHiddenInputBubbleDirective"],"mappings":";;;AAEA;;;;;;;;AAQG;MAqBU,0BAA0B,CAAA;AApBvC,IAAA,WAAA,GAAA;AAqBa,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAA+B,WAAW,CAAC;QAEhD,IAAa,CAAA,aAAA,GAAG,YAAY,CAAC;YAC5C,MAAM,EAAE,IAAI,CAAC,OAAO;AACpB,YAAA,WAAW,EAAE,CAAC,OAAqC,KAAK;AAC3D,SAAA,CAAC;AAKL;AAHG,IAAA,aAAa,CAAC,OAAqC,EAAA;AAC/C,QAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC;;8GAT1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,oDAAA,EAAA,QAAA,EAAA,mDAAA,EAAA,eAAA,EAAA,qDAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,cAAA,EAAA,OAAA,EAAA,eAAA,EAAA,2DAAA,EAAA,aAAA,EAAA,SAAA,EAAA,cAAA,EAAA,SAAA,EAAA,eAAA,EAAA,OAAA,EAAA,cAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,sBAAA,EAAA,gBAAA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overCardContentDirective implements OnInit {
|
|
64
64
|
*/
|
65
65
|
readonly onClosed: import("@angular/core").OutputEmitterRef<void>;
|
66
66
|
/** @ingore */
|
67
|
-
readonly positions: import("@angular/core").Signal<import("@angular/cdk/overlay").
|
67
|
+
readonly positions: import("@angular/core").Signal<import("@angular/cdk/overlay-module.d-2b07cfa6").C[]>;
|
68
68
|
constructor();
|
69
69
|
/** @ignore */
|
70
70
|
ngOnInit(): void;
|
@@ -73,7 +73,7 @@ export declare class RdxHoverCardContentDirective implements OnInit {
|
|
73
73
|
/** @ignore */
|
74
74
|
close(): void;
|
75
75
|
/** @ignore */
|
76
|
-
positionChange(): import("rxjs").Observable<import("@angular/cdk/overlay").
|
76
|
+
positionChange(): import("rxjs").Observable<import("@angular/cdk/overlay-module.d-2b07cfa6").n>;
|
77
77
|
/** @ignore */
|
78
78
|
private connectKeydownEscape;
|
79
79
|
/** @ignore */
|
@@ -79,7 +79,7 @@ export declare class RdxHoverCardRootDirective {
|
|
79
79
|
window: Window & typeof globalThis;
|
80
80
|
primitiveConfigs?: import("./utils/types").PrimitiveConfigs;
|
81
81
|
onDestroyCallbacks: Set<() => void>;
|
82
|
-
"__#
|
82
|
+
"__#8179@#clickDomRootEventCallbacks": Set<(event: MouseEvent) => void>;
|
83
83
|
registerPrimitive<T extends object>(primitiveInstance: T): void;
|
84
84
|
deregisterPrimitive<T extends object>(primitiveInstance: T): void;
|
85
85
|
preventPrimitiveFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): void;
|
@@ -90,9 +90,9 @@ export declare class RdxHoverCardRootDirective {
|
|
90
90
|
primitivePreventedFromCdkEvent<T extends object>(primitiveInstance: T, eventType: import("./utils/types").EventType): boolean | undefined;
|
91
91
|
addClickDomRootEventCallback(callback: (event: MouseEvent) => void): void;
|
92
92
|
removeClickDomRootEventCallback(callback: (event: MouseEvent) => void): boolean;
|
93
|
-
"__#
|
94
|
-
"__#
|
95
|
-
"__#
|
93
|
+
"__#8179@#setPreventPrimitiveFromCdkEvent"<T extends object, R extends import("./utils/types").EventType, K extends import("./utils/types").PrimitiveConfig[`prevent${Capitalize<R>}`]>(primitiveInstance: T, eventType: R, value: K): void;
|
94
|
+
"__#8179@#registerOnDestroyCallbacks"(): void;
|
95
|
+
"__#8179@#listenToClickDomRootEvent"(): void;
|
96
96
|
} | null;
|
97
97
|
/** @ignore */
|
98
98
|
readonly destroyRef: DestroyRef;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "./src/navigation-menu.directive";
|
3
|
+
import * as i2 from "./src/navigation-menu-sub.directive";
|
4
|
+
import * as i3 from "./src/navigation-menu-list.directive";
|
5
|
+
import * as i4 from "./src/navigation-menu-item.directive";
|
6
|
+
import * as i5 from "./src/navigation-menu-trigger.directive";
|
7
|
+
import * as i6 from "./src/navigation-menu-link.directive";
|
8
|
+
import * as i7 from "./src/navigation-menu-indicator.directive";
|
9
|
+
import * as i8 from "./src/navigation-menu-content.directive";
|
10
|
+
import * as i9 from "./src/navigation-menu-viewport.directive";
|
11
|
+
import * as i10 from "./src/navigation-menu-a11y.component";
|
12
|
+
export * from './src/navigation-menu-a11y.component';
|
13
|
+
export * from './src/navigation-menu-content.directive';
|
14
|
+
export * from './src/navigation-menu-indicator.directive';
|
15
|
+
export * from './src/navigation-menu-item.directive';
|
16
|
+
export * from './src/navigation-menu-link.directive';
|
17
|
+
export * from './src/navigation-menu-list.directive';
|
18
|
+
export * from './src/navigation-menu-sub.directive';
|
19
|
+
export * from './src/navigation-menu-trigger.directive';
|
20
|
+
export * from './src/navigation-menu-viewport.directive';
|
21
|
+
export * from './src/navigation-menu.directive';
|
22
|
+
export * from './src/navigation-menu.token';
|
23
|
+
export * from './src/navigation-menu.types';
|
24
|
+
export declare class RdxNavigationMenuModule {
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuModule, never>;
|
26
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxNavigationMenuModule, never, [typeof i1.RdxNavigationMenuDirective, typeof i2.RdxNavigationMenuSubDirective, typeof i3.RdxNavigationMenuListDirective, typeof i4.RdxNavigationMenuItemDirective, typeof i5.RdxNavigationMenuTriggerDirective, typeof i6.RdxNavigationMenuLinkDirective, typeof i7.RdxNavigationMenuIndicatorDirective, typeof i8.RdxNavigationMenuContentDirective, typeof i9.RdxNavigationMenuViewportDirective, typeof i10.RdxNavigationMenuFocusProxyComponent, typeof i10.RdxNavigationMenuAriaOwnsComponent], [typeof i1.RdxNavigationMenuDirective, typeof i2.RdxNavigationMenuSubDirective, typeof i3.RdxNavigationMenuListDirective, typeof i4.RdxNavigationMenuItemDirective, typeof i5.RdxNavigationMenuTriggerDirective, typeof i6.RdxNavigationMenuLinkDirective, typeof i7.RdxNavigationMenuIndicatorDirective, typeof i8.RdxNavigationMenuContentDirective, typeof i9.RdxNavigationMenuViewportDirective, typeof i10.RdxNavigationMenuFocusProxyComponent, typeof i10.RdxNavigationMenuAriaOwnsComponent]>;
|
27
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RdxNavigationMenuModule>;
|
28
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class RdxNavigationMenuFocusProxyComponent {
|
4
|
+
triggerElement: HTMLElement | null;
|
5
|
+
contentElement: HTMLElement | null;
|
6
|
+
proxyFocus: EventEmitter<"start" | "end">;
|
7
|
+
onFocus(event: FocusEvent): void;
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuFocusProxyComponent, never>;
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RdxNavigationMenuFocusProxyComponent, "rdx-navigation-menu-focus-proxy", never, { "triggerElement": { "alias": "triggerElement"; "required": false; }; "contentElement": { "alias": "contentElement"; "required": false; }; }, { "proxyFocus": "proxyFocus"; }, never, never, true, never>;
|
10
|
+
}
|
11
|
+
export declare class RdxNavigationMenuAriaOwnsComponent {
|
12
|
+
contentId: string;
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuAriaOwnsComponent, never>;
|
14
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RdxNavigationMenuAriaOwnsComponent, "rdx-navigation-menu-aria-owns", never, { "contentId": { "alias": "contentId"; "required": false; }; }, {}, never, never, true, never>;
|
15
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class RdxNavigationMenuContentDirective implements OnInit, OnDestroy {
|
4
|
+
private readonly elementRef;
|
5
|
+
private readonly ngZone;
|
6
|
+
private readonly template;
|
7
|
+
private readonly document;
|
8
|
+
private readonly item;
|
9
|
+
private readonly context;
|
10
|
+
set rdxNavigationMenuContent(value: boolean);
|
11
|
+
/**
|
12
|
+
* Used to keep the content rendered and available in the DOM, even when closed.
|
13
|
+
* Useful for animations or SEO.
|
14
|
+
* @default false
|
15
|
+
*/
|
16
|
+
readonly forceMount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
17
|
+
/** @ignore */
|
18
|
+
readonly contentId: string;
|
19
|
+
/** @ignore */
|
20
|
+
readonly triggerId: string;
|
21
|
+
private escapeHandler;
|
22
|
+
/** @ignore */
|
23
|
+
ngOnInit(): void;
|
24
|
+
/** @ignore */
|
25
|
+
ngOnDestroy(): void;
|
26
|
+
/** @ignore - Compute motion attribute for animations */
|
27
|
+
getMotionAttribute(): string | null;
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuContentDirective, never>;
|
29
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuContentDirective, "[rdxNavigationMenuContent]", never, { "rdxNavigationMenuContent": { "alias": "rdxNavigationMenuContent"; "required": false; }; "forceMount": { "alias": "forceMount"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
30
|
+
static ngAcceptInputType_rdxNavigationMenuContent: unknown;
|
31
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class RdxNavigationMenuIndicatorDirective implements OnDestroy {
|
4
|
+
private readonly context;
|
5
|
+
private readonly elementRef;
|
6
|
+
private readonly renderer;
|
7
|
+
/**
|
8
|
+
* Used to keep the indicator rendered and available in the DOM, even when hidden.
|
9
|
+
* Useful for animations.
|
10
|
+
* @default false
|
11
|
+
*/
|
12
|
+
readonly forceMount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
13
|
+
/** @ignore */
|
14
|
+
private readonly _position;
|
15
|
+
/** @ignore */
|
16
|
+
private readonly _activeTrigger;
|
17
|
+
/** @ignore */
|
18
|
+
private readonly _resizeObserver;
|
19
|
+
readonly isVisible: import("@angular/core").Signal<boolean>;
|
20
|
+
constructor();
|
21
|
+
/** @ignore */
|
22
|
+
ngOnDestroy(): void;
|
23
|
+
/** @ignore */
|
24
|
+
private findAndSetActiveTrigger;
|
25
|
+
/** @ignore */
|
26
|
+
private updatePosition;
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuIndicatorDirective, never>;
|
28
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuIndicatorDirective, "[rdxNavigationMenuIndicator]", never, { "forceMount": { "alias": "forceMount"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
29
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { FocusableOption } from '@angular/cdk/a11y';
|
2
|
+
import { ElementRef, Signal } from '@angular/core';
|
3
|
+
import { RdxNavigationMenuFocusableOption } from './navigation-menu.types';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare class RdxNavigationMenuItemDirective implements FocusableOption {
|
6
|
+
readonly elementRef: ElementRef<any>;
|
7
|
+
private readonly context;
|
8
|
+
readonly value: import("@angular/core").InputSignal<string>;
|
9
|
+
/**
|
10
|
+
* @ignore
|
11
|
+
*/
|
12
|
+
readonly triggerOrLink: Signal<RdxNavigationMenuFocusableOption | undefined>;
|
13
|
+
readonly triggerRef: import("@angular/core").WritableSignal<HTMLElement | null>;
|
14
|
+
readonly contentRef: import("@angular/core").WritableSignal<HTMLElement | null>;
|
15
|
+
readonly focusProxyRef: import("@angular/core").WritableSignal<HTMLElement | null>;
|
16
|
+
readonly wasEscapeCloseRef: import("@angular/core").WritableSignal<boolean>;
|
17
|
+
private readonly _restoreContentTabOrderRef;
|
18
|
+
get restoreContentTabOrderRef(): Signal<(() => void) | null>;
|
19
|
+
/**
|
20
|
+
* Handle keyboard entry into content from trigger
|
21
|
+
*/
|
22
|
+
onEntryKeyDown(): void;
|
23
|
+
focus(): void;
|
24
|
+
/**
|
25
|
+
* Ensure elements are in the tab order by restoring any previously removed tabindex values
|
26
|
+
*/
|
27
|
+
private ensureTabOrder;
|
28
|
+
/**
|
29
|
+
* Handle focus coming from the focus proxy element
|
30
|
+
* @param side Which side the focus is coming from (start = from trigger, end = from after content)
|
31
|
+
*/
|
32
|
+
onFocusProxyEnter(side?: 'start' | 'end'): void;
|
33
|
+
/**
|
34
|
+
* Handle focus moving outside of the content
|
35
|
+
* Remove elements from tab order when not focused
|
36
|
+
*/
|
37
|
+
onContentFocusOutside(): void;
|
38
|
+
/**
|
39
|
+
* Handle content being closed from root menu
|
40
|
+
*/
|
41
|
+
onRootContentClose(): void;
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuItemDirective, never>;
|
43
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuItemDirective, "[rdxNavigationMenuItem]", ["rdxNavigationMenuItem"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, {}, ["triggerOrLink"], never, true, never>;
|
44
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { ElementRef, OnInit } from '@angular/core';
|
2
|
+
import { RdxNavigationMenuFocusableOption } from './navigation-menu.types';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@radix-ng/primitives/roving-focus";
|
5
|
+
export declare class RdxNavigationMenuLinkDirective extends RdxNavigationMenuFocusableOption implements OnInit {
|
6
|
+
private readonly rovingFocusItem;
|
7
|
+
private readonly uniqueId;
|
8
|
+
readonly active: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
9
|
+
readonly onSelect: import("@angular/core").InputSignal<((event: Event) => void) | undefined>;
|
10
|
+
readonly elementRef: ElementRef<any>;
|
11
|
+
ngOnInit(): void;
|
12
|
+
focus(): void;
|
13
|
+
onClick(event: MouseEvent): void;
|
14
|
+
onKeydown(event: KeyboardEvent): void;
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuLinkDirective, never>;
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuLinkDirective, "[rdxNavigationMenuLink]", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "onSelect": { "alias": "onSelect"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusItemDirective; inputs: { "focusable": "focusable"; }; outputs: {}; }]>;
|
17
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { FocusKeyManager } from '@angular/cdk/a11y';
|
2
|
+
import { AfterContentInit, AfterViewInit } from '@angular/core';
|
3
|
+
import { RdxNavigationMenuItemDirective } from './navigation-menu-item.directive';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
import * as i1 from "@radix-ng/primitives/roving-focus";
|
6
|
+
export declare class RdxNavigationMenuListDirective implements AfterContentInit, AfterViewInit {
|
7
|
+
private readonly context;
|
8
|
+
private readonly elementRef;
|
9
|
+
private readonly renderer;
|
10
|
+
private readonly rovingFocusGroup;
|
11
|
+
/**
|
12
|
+
* @private
|
13
|
+
* @ignore
|
14
|
+
*/
|
15
|
+
readonly items: import("@angular/core").Signal<readonly any[]>;
|
16
|
+
/**
|
17
|
+
* @ignore
|
18
|
+
*/
|
19
|
+
protected keyManager: FocusKeyManager<RdxNavigationMenuItemDirective>;
|
20
|
+
/**
|
21
|
+
* @ignore
|
22
|
+
*/
|
23
|
+
ngAfterContentInit(): void;
|
24
|
+
/**
|
25
|
+
* @ignore
|
26
|
+
*/
|
27
|
+
ngAfterViewInit(): void;
|
28
|
+
/**
|
29
|
+
* @ignore
|
30
|
+
*/
|
31
|
+
onKeydown(event: KeyboardEvent): void;
|
32
|
+
/**
|
33
|
+
* @ignore
|
34
|
+
*/
|
35
|
+
setActiveItem(item: RdxNavigationMenuItemDirective): void;
|
36
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuListDirective, never>;
|
37
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuListDirective, "[rdxNavigationMenuList]", never, {}, {}, ["items"], never, true, [{ directive: typeof i1.RdxRovingFocusGroupDirective; inputs: {}; outputs: {}; }]>;
|
38
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class RdxNavigationMenuSubDirective {
|
3
|
+
readonly orientation: import("@angular/core").InputSignal<"horizontal" | "vertical">;
|
4
|
+
set defaultValue(val: string);
|
5
|
+
readonly valueChange: import("@angular/core").OutputEmitterRef<string>;
|
6
|
+
readonly value: import("@angular/core").WritableSignal<string>;
|
7
|
+
readonly previousValue: import("@angular/core").WritableSignal<string>;
|
8
|
+
readonly baseId: string;
|
9
|
+
readonly isRootMenu = false;
|
10
|
+
private readonly parent;
|
11
|
+
get dir(): 'ltr' | 'rtl';
|
12
|
+
get rootNavigationMenu(): HTMLElement | null;
|
13
|
+
onTriggerEnter(itemValue: string): void;
|
14
|
+
onItemSelect(itemValue: string): void;
|
15
|
+
onItemDismiss(): void;
|
16
|
+
private setValue;
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuSubDirective, never>;
|
18
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuSubDirective, "[rdxNavigationMenuSub]", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
19
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
2
|
+
import { RdxNavigationMenuFocusableOption } from './navigation-menu.types';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@radix-ng/primitives/roving-focus";
|
5
|
+
export declare class RdxNavigationMenuTriggerDirective extends RdxNavigationMenuFocusableOption implements OnInit, OnDestroy {
|
6
|
+
private readonly context;
|
7
|
+
private readonly item;
|
8
|
+
private readonly list;
|
9
|
+
private readonly rovingFocusItem;
|
10
|
+
private readonly elementRef;
|
11
|
+
private readonly viewContainerRef;
|
12
|
+
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
13
|
+
readonly triggerId: string;
|
14
|
+
readonly contentId: string;
|
15
|
+
readonly open: import("@angular/core").Signal<boolean>;
|
16
|
+
private focusProxyRef;
|
17
|
+
private ariaOwnsRef;
|
18
|
+
private hasPointerMoveOpened;
|
19
|
+
private wasClickClose;
|
20
|
+
constructor();
|
21
|
+
ngOnInit(): void;
|
22
|
+
ngOnDestroy(): void;
|
23
|
+
focus(): void;
|
24
|
+
private createAccessibilityComponents;
|
25
|
+
private removeAccessibilityComponents;
|
26
|
+
onPointerEnter(): void;
|
27
|
+
onPointerMove(event: PointerEvent): void;
|
28
|
+
onPointerLeave(event: PointerEvent): void;
|
29
|
+
onClick(): void;
|
30
|
+
onKeydown(event: KeyboardEvent): void;
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuTriggerDirective, never>;
|
32
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuTriggerDirective, "[rdxNavigationMenuTrigger]", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.RdxRovingFocusItemDirective; inputs: {}; outputs: {}; }]>;
|
33
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export declare class RdxNavigationMenuViewportDirective implements OnInit, OnDestroy {
|
4
|
+
private readonly context;
|
5
|
+
private readonly document;
|
6
|
+
private readonly window;
|
7
|
+
private readonly elementRef;
|
8
|
+
private readonly viewContainerRef;
|
9
|
+
private readonly renderer;
|
10
|
+
private readonly zone;
|
11
|
+
private readonly destroyRef;
|
12
|
+
/**
|
13
|
+
* Used to keep the viewport rendered and available in the DOM, even when closed.
|
14
|
+
* Useful for animations.
|
15
|
+
* @default false
|
16
|
+
*/
|
17
|
+
readonly forceMount: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
18
|
+
private readonly _contentNodes;
|
19
|
+
private readonly _activeContentNode;
|
20
|
+
private readonly _leavingContentNode;
|
21
|
+
private readonly _viewportSize;
|
22
|
+
readonly activeContentValue: import("@angular/core").Signal<string | null>;
|
23
|
+
readonly isOpen: import("@angular/core").Signal<boolean>;
|
24
|
+
readonly dataState: import("@angular/core").Signal<"open" | "closed">;
|
25
|
+
readonly viewportSize: import("@angular/core").Signal<{
|
26
|
+
width: number;
|
27
|
+
height: number;
|
28
|
+
} | null>;
|
29
|
+
private readonly _resizeObserver;
|
30
|
+
constructor();
|
31
|
+
ngOnInit(): void;
|
32
|
+
ngOnDestroy(): void;
|
33
|
+
onKeydown(event: KeyboardEvent): void;
|
34
|
+
onPointerEnter(): void;
|
35
|
+
onPointerLeave(): void;
|
36
|
+
private setupViewportEffect;
|
37
|
+
private getOrCreateContentNode;
|
38
|
+
private addNodeToDOM;
|
39
|
+
private removeNodeFromDOM;
|
40
|
+
private setNodeState;
|
41
|
+
private applyA11yAttributes;
|
42
|
+
private startLeaveTransition;
|
43
|
+
/**
|
44
|
+
* Cleanup function called after leave animation finishes
|
45
|
+
* @param node The node that is leaving
|
46
|
+
*/
|
47
|
+
private cleanupAfterLeave;
|
48
|
+
/**
|
49
|
+
* Cancels an ongoing leave transition (e.g., if user hovers back)
|
50
|
+
* @param node The node that is leaving
|
51
|
+
*/
|
52
|
+
private cancelLeaveTransition;
|
53
|
+
/**
|
54
|
+
* Force completes a leave transition (e.g., if another leave starts)
|
55
|
+
* @param node The node that is leaving
|
56
|
+
*/
|
57
|
+
private forceCompleteLeaveTransition;
|
58
|
+
private updateSize;
|
59
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuViewportDirective, never>;
|
60
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuViewportDirective, "[rdxNavigationMenuViewport]", never, { "forceMount": { "alias": "forceMount"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
61
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import { OnDestroy, WritableSignal } from '@angular/core';
|
2
|
+
import { Subject } from 'rxjs';
|
3
|
+
import { RdxNavigationMenuAnimationStatus } from './navigation-menu.types';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare enum RdxNavigationMenuAction {
|
6
|
+
OPEN = "open",
|
7
|
+
CLOSE = "close"
|
8
|
+
}
|
9
|
+
export declare class RdxNavigationMenuDirective implements OnDestroy {
|
10
|
+
#private;
|
11
|
+
private readonly elementRef;
|
12
|
+
private readonly document;
|
13
|
+
private readonly window;
|
14
|
+
readonly baseId: string;
|
15
|
+
userDismissedByClick: () => boolean;
|
16
|
+
resetUserDismissed: () => void;
|
17
|
+
private openTimerRef;
|
18
|
+
private closeTimerRef;
|
19
|
+
private skipDelayTimerRef;
|
20
|
+
private documentMouseLeaveHandler;
|
21
|
+
readonly actionSubject$: Subject<{
|
22
|
+
action: RdxNavigationMenuAction;
|
23
|
+
itemValue?: string;
|
24
|
+
}>;
|
25
|
+
orientation: 'horizontal' | 'vertical';
|
26
|
+
dir: 'ltr' | 'rtl';
|
27
|
+
delayDuration: number;
|
28
|
+
skipDelayDuration: number;
|
29
|
+
loop: boolean;
|
30
|
+
cssAnimation: boolean;
|
31
|
+
cssOpeningAnimation: boolean;
|
32
|
+
cssClosingAnimation: boolean;
|
33
|
+
readonly isRootMenu = true;
|
34
|
+
readonly cssAnimationStatus: WritableSignal<RdxNavigationMenuAnimationStatus | null>;
|
35
|
+
value: () => string;
|
36
|
+
previousValue: () => string;
|
37
|
+
rootNavigationMenu: () => HTMLElement | null;
|
38
|
+
indicatorTrack: () => HTMLElement | null;
|
39
|
+
viewport: () => HTMLElement | null;
|
40
|
+
viewportContent: () => Map<string, any>;
|
41
|
+
setTriggerPointerState: (isOver: boolean) => void;
|
42
|
+
setContentPointerState: (isOver: boolean) => void;
|
43
|
+
isPointerInSystem: () => boolean;
|
44
|
+
getCssAnimation: () => boolean;
|
45
|
+
getCssOpeningAnimation: () => boolean;
|
46
|
+
getCssClosingAnimation: () => boolean;
|
47
|
+
constructor();
|
48
|
+
ngOnDestroy(): void;
|
49
|
+
onIndicatorTrackChange(track: HTMLElement | null): void;
|
50
|
+
onViewportChange(viewport: HTMLElement | null): void;
|
51
|
+
onTriggerEnter(itemValue: string): void;
|
52
|
+
onTriggerLeave(): void;
|
53
|
+
onContentEnter(): void;
|
54
|
+
onContentLeave(): void;
|
55
|
+
handleClose(): void;
|
56
|
+
onItemSelect(itemValue: string): void;
|
57
|
+
onItemDismiss(): void;
|
58
|
+
onViewportContentChange(contentValue: string, contentData: any): void;
|
59
|
+
onViewportContentRemove(contentValue: string): void;
|
60
|
+
private setValue;
|
61
|
+
private startCloseTimer;
|
62
|
+
private handleOpen;
|
63
|
+
private handleDelayedOpen;
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxNavigationMenuDirective, never>;
|
65
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxNavigationMenuDirective, "[rdxNavigationMenu]", ["rdxNavigationMenu"], { "orientation": { "alias": "orientation"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "delayDuration": { "alias": "delayDuration"; "required": false; }; "skipDelayDuration": { "alias": "skipDelayDuration"; "required": false; }; "loop": { "alias": "loop"; "required": false; }; "cssAnimation": { "alias": "cssAnimation"; "required": false; }; "cssOpeningAnimation": { "alias": "cssOpeningAnimation"; "required": false; }; "cssClosingAnimation": { "alias": "cssClosingAnimation"; "required": false; }; }, {}, never, never, true, never>;
|
66
|
+
static ngAcceptInputType_delayDuration: unknown;
|
67
|
+
static ngAcceptInputType_skipDelayDuration: unknown;
|
68
|
+
static ngAcceptInputType_loop: unknown;
|
69
|
+
static ngAcceptInputType_cssAnimation: unknown;
|
70
|
+
static ngAcceptInputType_cssOpeningAnimation: unknown;
|
71
|
+
static ngAcceptInputType_cssClosingAnimation: unknown;
|
72
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { InjectionToken, Provider, Type } from '@angular/core';
|
2
|
+
import { RdxNavigationMenuSubDirective } from './navigation-menu-sub.directive';
|
3
|
+
import { RdxNavigationMenuDirective } from './navigation-menu.directive';
|
4
|
+
export interface NavigationMenuContext {
|
5
|
+
isRootMenu: boolean;
|
6
|
+
value: () => string;
|
7
|
+
previousValue: () => string;
|
8
|
+
baseId: string;
|
9
|
+
dir: 'ltr' | 'rtl';
|
10
|
+
orientation: 'horizontal' | 'vertical';
|
11
|
+
loop: boolean;
|
12
|
+
rootNavigationMenu: () => HTMLElement | null;
|
13
|
+
indicatorTrack?: () => HTMLElement | null;
|
14
|
+
onIndicatorTrackChange?: (track: HTMLElement | null) => void;
|
15
|
+
userDismissedByClick?: () => boolean;
|
16
|
+
resetUserDismissed?: () => void;
|
17
|
+
viewport?: () => HTMLElement | null;
|
18
|
+
onViewportChange?: (viewport: HTMLElement | null) => void;
|
19
|
+
viewportContent?: () => Map<string, any>;
|
20
|
+
onViewportContentChange?: (contentValue: string, contentData: any) => void;
|
21
|
+
onViewportContentRemove?: (contentValue: string) => void;
|
22
|
+
onTriggerEnter?: (itemValue: string) => void;
|
23
|
+
onTriggerLeave?: () => void;
|
24
|
+
onContentEnter?: () => void;
|
25
|
+
onContentLeave?: () => void;
|
26
|
+
onItemSelect?: (itemValue: string) => void;
|
27
|
+
onItemDismiss?: () => void;
|
28
|
+
handleClose?: (force?: boolean) => void;
|
29
|
+
setTriggerPointerState?: (isOver: boolean) => void;
|
30
|
+
setContentPointerState?: (isOver: boolean) => void;
|
31
|
+
isPointerInSystem?: () => boolean;
|
32
|
+
}
|
33
|
+
export declare const RDX_NAVIGATION_MENU_TOKEN: InjectionToken<NavigationMenuContext>;
|
34
|
+
export declare function injectNavigationMenu(): NavigationMenuContext;
|
35
|
+
export declare function isRootNavigationMenu(context: NavigationMenuContext): boolean;
|
36
|
+
export declare function provideNavigationMenuContext(provider: Type<RdxNavigationMenuDirective | RdxNavigationMenuSubDirective>): Provider;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { FocusableOption } from '@angular/cdk/a11y';
|
2
|
+
export declare enum RdxNavigationMenuAnimationStatus {
|
3
|
+
OPEN_STARTED = "open_started",
|
4
|
+
OPEN_ENDED = "open_ended",
|
5
|
+
CLOSED_STARTED = "closed_started",
|
6
|
+
CLOSED_ENDED = "closed_ended"
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* A stub class solely used to query a single type of focusable element in the navigation menu.
|
10
|
+
*/
|
11
|
+
export declare abstract class RdxNavigationMenuFocusableOption implements FocusableOption {
|
12
|
+
focus(): void;
|
13
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
export type NavigationMenuOrientation = 'horizontal' | 'vertical';
|
2
|
+
export type NavigationMenuDirection = 'ltr' | 'rtl';
|
3
|
+
export type MotionAttribute = 'to-start' | 'to-end' | 'from-start' | 'from-end';
|
4
|
+
export declare const ROOT_CONTENT_DISMISS = "navigationMenu.rootContentDismiss";
|
5
|
+
/**
|
6
|
+
* Generate a unique ID
|
7
|
+
*/
|
8
|
+
export declare function generateId(): string;
|
9
|
+
/**
|
10
|
+
* Get the open state for data-state attribute
|
11
|
+
*/
|
12
|
+
export declare function getOpenStateLabel(open: boolean): 'open' | 'closed';
|
13
|
+
/**
|
14
|
+
* Create a trigger ID from base ID and value
|
15
|
+
*/
|
16
|
+
export declare function makeTriggerId(baseId: string, value: string): string;
|
17
|
+
/**
|
18
|
+
* Create a content ID from base ID and value
|
19
|
+
*/
|
20
|
+
export declare function makeContentId(baseId: string, value: string): string;
|
21
|
+
/**
|
22
|
+
* Get the motion attribute for animations
|
23
|
+
*/
|
24
|
+
export declare function getMotionAttribute(currentValue: string | null, previousValue: string | null, itemValue: string, itemValues: string[], dir: NavigationMenuDirection): MotionAttribute | null;
|
25
|
+
/**
|
26
|
+
* Focus the first element in a list of candidates
|
27
|
+
* @param candidates Array of elements that can receive focus
|
28
|
+
* @param preventScroll Whether to prevent scrolling when focusing
|
29
|
+
* @param activateKeyboardNav Whether to dispatch a dummy keydown event to activate keyboard navigation handlers
|
30
|
+
* @returns Whether focus was successfully moved
|
31
|
+
*/
|
32
|
+
export declare function focusFirst(candidates: HTMLElement[], preventScroll?: boolean, activateKeyboardNav?: boolean): boolean;
|
33
|
+
/**
|
34
|
+
* Get all tabbable candidates in a container
|
35
|
+
*/
|
36
|
+
export declare function getTabbableCandidates(container: HTMLElement): HTMLElement[];
|
37
|
+
/**
|
38
|
+
* Remove elements from tab order and return a function to restore them
|
39
|
+
*/
|
40
|
+
export declare function removeFromTabOrder(candidates: HTMLElement[]): () => void;
|
41
|
+
/**
|
42
|
+
* Wrap array around itself at given start index
|
43
|
+
*/
|
44
|
+
export declare function wrapArray<T>(array: T[], startIndex: number): T[];
|