ng-primitives 0.46.0 → 0.48.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/a11y/active-descendant/active-descendant.d.ts +5 -1
- package/combobox/combobox/combobox-state.d.ts +1 -1
- package/combobox/combobox/combobox.d.ts +1 -1
- package/combobox/combobox-button/combobox-button.d.ts +2 -2
- package/combobox/combobox-dropdown/combobox-dropdown.d.ts +2 -3
- package/combobox/combobox-input/combobox-input.d.ts +2 -6
- package/combobox/combobox-option/combobox-option.d.ts +1 -1
- package/example-theme/index.css +1 -1
- package/fesm2022/ng-primitives-a11y.mjs +32 -10
- package/fesm2022/ng-primitives-a11y.mjs.map +1 -1
- package/fesm2022/ng-primitives-combobox.mjs +26 -23
- package/fesm2022/ng-primitives-combobox.mjs.map +1 -1
- package/fesm2022/ng-primitives-file-upload.mjs +6 -1
- package/fesm2022/ng-primitives-file-upload.mjs.map +1 -1
- package/fesm2022/ng-primitives-input.mjs +4 -1
- package/fesm2022/ng-primitives-input.mjs.map +1 -1
- package/fesm2022/ng-primitives-internal.mjs +61 -41
- package/fesm2022/ng-primitives-internal.mjs.map +1 -1
- package/fesm2022/ng-primitives-menu.mjs +39 -42
- package/fesm2022/ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/ng-primitives-popover.mjs +5 -6
- package/fesm2022/ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/ng-primitives-portal.mjs +145 -12
- package/fesm2022/ng-primitives-portal.mjs.map +1 -1
- package/fesm2022/ng-primitives-switch.mjs +7 -6
- package/fesm2022/ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/ng-primitives-tooltip.mjs +3 -6
- package/fesm2022/ng-primitives-tooltip.mjs.map +1 -1
- package/file-upload/file-upload/file-upload-state.d.ts +1 -0
- package/file-upload/file-upload/file-upload.d.ts +4 -0
- package/internal/exit-animation/exit-animation.d.ts +14 -5
- package/internal/index.d.ts +1 -1
- package/internal/style-injector/style-injector.d.ts +4 -0
- package/menu/menu/menu.d.ts +5 -7
- package/menu/submenu-trigger/submenu-trigger-state.d.ts +1 -23
- package/menu/submenu-trigger/submenu-trigger.d.ts +2 -4
- package/package.json +5 -5
- package/popover/popover/popover.d.ts +1 -2
- package/portal/index.d.ts +1 -0
- package/portal/portal.d.ts +2 -0
- package/portal/scroll-strategy.d.ts +23 -0
- package/schematics/ng-generate/schema.d.ts +1 -0
- package/schematics/ng-generate/schema.json +1 -0
- package/schematics/ng-generate/templates/combobox/combobox.__fileSuffix@dasherize__.ts.template +16 -20
- package/schematics/ng-generate/templates/listbox/listbox.__fileSuffix@dasherize__.ts.template +1 -0
- package/schematics/ng-generate/templates/menu/menu-item.__fileSuffix@dasherize__.ts.template +40 -0
- package/schematics/ng-generate/templates/menu/menu.__fileSuffix@dasherize__.ts.template +53 -0
- package/switch/switch/switch-state.d.ts +1 -1
- package/switch/switch/switch.d.ts +2 -3
- package/switch/switch-thumb/switch-thumb.d.ts +1 -1
- package/tooltip/tooltip/tooltip.d.ts +1 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { NgpMenuItem } from 'ng-primitives/menu';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'button[<%= prefix %>-menu-item]',
|
|
6
|
+
hostDirectives: [NgpMenuItem],
|
|
7
|
+
template: `
|
|
8
|
+
<ng-content />
|
|
9
|
+
`,
|
|
10
|
+
styles: `
|
|
11
|
+
/* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
padding: 6px 8px 6px 14px;
|
|
18
|
+
border: none;
|
|
19
|
+
background: none;
|
|
20
|
+
cursor: pointer;
|
|
21
|
+
transition: background-color 0.2s;
|
|
22
|
+
border-radius: 4px;
|
|
23
|
+
min-width: 120px;
|
|
24
|
+
text-align: start;
|
|
25
|
+
outline: none;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host[data-hover] {
|
|
31
|
+
background-color: var(--ngp-background-active);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host[data-focus-visible] {
|
|
35
|
+
outline: 2px solid var(--ngp-focus-ring);
|
|
36
|
+
z-index: 1;
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
})
|
|
40
|
+
export class MenuItem<%= componentSuffix %> {}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { NgpMenu } from 'ng-primitives/menu';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: '<%= prefix %>-menu',
|
|
6
|
+
hostDirectives: [NgpMenu],
|
|
7
|
+
template: `
|
|
8
|
+
<ng-content />
|
|
9
|
+
`,
|
|
10
|
+
styles: `
|
|
11
|
+
/* These styles rely on CSS variables that can be imported from ng-primitives/example-theme/index.css in your global styles */
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
position: fixed;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
width: max-content;
|
|
18
|
+
background: var(--ngp-background);
|
|
19
|
+
border: 1px solid var(--ngp-border);
|
|
20
|
+
box-shadow: var(--ngp-shadow);
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
padding: 4px;
|
|
23
|
+
animation: menu-show 300ms ease-out;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host[data-exit] {
|
|
27
|
+
animation: menu-hide 300ms ease-out;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@keyframes menu-show {
|
|
31
|
+
0% {
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transform: scale(0.9);
|
|
34
|
+
}
|
|
35
|
+
100% {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
transform: scale(1);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@keyframes menu-hide {
|
|
42
|
+
0% {
|
|
43
|
+
opacity: 1;
|
|
44
|
+
transform: scale(1);
|
|
45
|
+
}
|
|
46
|
+
100% {
|
|
47
|
+
opacity: 0;
|
|
48
|
+
transform: scale(0.9);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
`,
|
|
52
|
+
})
|
|
53
|
+
export class Menu<%= componentSuffix %> {}
|
|
@@ -18,7 +18,7 @@ export declare const injectSwitchState: <U = {
|
|
|
18
18
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
19
19
|
readonly state: import("ng-primitives/state").CreatedState<NgpSwitch>;
|
|
20
20
|
toggle: () => void;
|
|
21
|
-
onKeyDown: () => void;
|
|
21
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
22
22
|
}>(injectOptions?: import("@angular/core").InjectOptions) => import("@angular/core").Signal<import("ng-primitives/state").State<U>>;
|
|
23
23
|
/**
|
|
24
24
|
* The Switch state registration function.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BooleanInput } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
import * as i1 from "ng-primitives/form-field";
|
|
4
3
|
/**
|
|
5
4
|
* Apply the `ngpSwitch` directive to an element to manage the checked state.
|
|
6
5
|
*/
|
|
@@ -40,7 +39,7 @@ export declare class NgpSwitch {
|
|
|
40
39
|
/**
|
|
41
40
|
* Handle the keydown event.
|
|
42
41
|
*/
|
|
43
|
-
protected onKeyDown(): void;
|
|
42
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
44
43
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSwitch, never>;
|
|
45
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSwitch, "[ngpSwitch]", ["ngpSwitch"], { "checked": { "alias": "ngpSwitchChecked"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSwitchDisabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "ngpSwitchCheckedChange"; }, never, never, true,
|
|
44
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpSwitch, "[ngpSwitch]", ["ngpSwitch"], { "checked": { "alias": "ngpSwitchChecked"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSwitchDisabled"; "required": false; "isSignal": true; }; }, { "checkedChange": "ngpSwitchCheckedChange"; }, never, never, true, never>;
|
|
46
45
|
}
|
|
@@ -14,7 +14,7 @@ export declare class NgpSwitchThumb {
|
|
|
14
14
|
readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, import("@angular/cdk/coercion").BooleanInput>;
|
|
15
15
|
readonly state: import("ng-primitives/state").CreatedState<import("ng-primitives/switch").NgpSwitch>;
|
|
16
16
|
toggle: () => void;
|
|
17
|
-
onKeyDown: () => void;
|
|
17
|
+
onKeyDown: (event: KeyboardEvent) => void;
|
|
18
18
|
}>>;
|
|
19
19
|
constructor();
|
|
20
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpSwitchThumb, never>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "ng-primitives/internal";
|
|
3
2
|
/**
|
|
4
3
|
* Apply the `ngpTooltip` directive to an element that represents the tooltip. This typically would be a `div` inside an `ng-template`.
|
|
5
4
|
*/
|
|
@@ -9,5 +8,5 @@ export declare class NgpTooltip {
|
|
|
9
8
|
*/
|
|
10
9
|
protected readonly overlay: import("ng-primitives/portal").NgpOverlay<unknown>;
|
|
11
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgpTooltip, never>;
|
|
12
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltip, "[ngpTooltip]", ["ngpTooltip"], {}, {}, never, never, true,
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgpTooltip, "[ngpTooltip]", ["ngpTooltip"], {}, {}, never, never, true, never>;
|
|
13
12
|
}
|