@cngx/ui 0.1.0-rc.9 → 0.3.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/README.md +118 -59
- package/action-button/README.md +170 -53
- package/breadcrumb/README.md +5 -6
- package/collection/README.md +1 -1
- package/command-palette/README.md +4 -3
- package/data-grid-accordion/README.md +1 -1
- package/empty-state/README.md +2 -3
- package/feedback/README.md +1 -1
- package/fesm2022/cngx-ui-a11y.mjs +13 -23
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +44 -66
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +213 -335
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +60 -80
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +18 -31
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +28 -44
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +29 -51
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +78 -83
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +52 -74
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +17 -44
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +589 -467
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +17 -13
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +3 -5
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +5 -9
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +6 -9
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +71 -68
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-nav-rail.mjs +440 -0
- package/fesm2022/cngx-ui-nav-rail.mjs.map +1 -0
- package/fesm2022/cngx-ui-overlay.mjs +9 -10
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +149 -171
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +858 -721
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +17 -19
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +21 -74
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +39 -62
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +207 -90
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +71 -32
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +21 -27
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +27 -40
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +5 -5
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-tabs/README.md +28 -14
- package/mat-tabs/styles/mat-tabs.css +233 -258
- package/nav-rail/README.md +325 -0
- package/package.json +10 -5
- package/paginator/README.md +10 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/sidenav/README.md +150 -55
- package/skeleton/README.md +1 -1
- package/speak/README.md +1 -2
- package/stepper/README.md +20 -5
- package/tabs/README.md +13 -0
- package/timeline/README.md +1 -1
- package/toc/README.md +1 -1
- package/types/cngx-ui-a11y.d.ts +20 -38
- package/types/cngx-ui-accordion.d.ts +45 -77
- package/types/cngx-ui-action-button.d.ts +113 -151
- package/types/cngx-ui-breadcrumb.d.ts +58 -94
- package/types/cngx-ui-chart-panel.d.ts +22 -40
- package/types/cngx-ui-collection.d.ts +30 -53
- package/types/cngx-ui-command-palette.d.ts +40 -64
- package/types/cngx-ui-context-menu.d.ts +67 -44
- package/types/cngx-ui-data-grid-accordion.d.ts +49 -77
- package/types/cngx-ui-empty-state.d.ts +18 -8
- package/types/cngx-ui-feedback.d.ts +264 -289
- package/types/cngx-ui-layout.d.ts +4 -12
- package/types/cngx-ui-mat-accordion.d.ts +2 -3
- package/types/cngx-ui-mat-paginator.d.ts +4 -10
- package/types/cngx-ui-mat-stepper.d.ts +5 -10
- package/types/cngx-ui-mat-tabs.d.ts +43 -69
- package/types/cngx-ui-nav-rail.d.ts +416 -0
- package/types/cngx-ui-overlay.d.ts +4 -13
- package/types/cngx-ui-paginator.d.ts +164 -154
- package/types/cngx-ui-sidenav.d.ts +557 -437
- package/types/cngx-ui-skeleton.d.ts +7 -13
- package/types/cngx-ui-speak.d.ts +40 -24
- package/types/cngx-ui-stat-card.d.ts +45 -36
- package/types/cngx-ui-stepper.d.ts +183 -62
- package/types/cngx-ui-tabs.d.ts +101 -27
- package/types/cngx-ui-timeline.d.ts +20 -48
- package/types/cngx-ui-toc.d.ts +30 -51
- package/types/cngx-ui.d.ts +1 -1
|
@@ -3,11 +3,13 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { inject, TemplateRef, Directive, InjectionToken, signal, computed, contentChild, linkedSignal, ViewEncapsulation, ChangeDetectionStrategy, Component, input, ElementRef, DestroyRef, effect, untracked, output } from '@angular/core';
|
|
4
4
|
import { outputToObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
5
|
import * as i1$1 from '@cngx/common/interactive';
|
|
6
|
-
import { CngxMenu, CNGX_SUBMENU_TRY_FALLBACKS, createContextMenuTriggerCore, CNGX_MENU_FOCUS_STACK_FACTORY, CNGX_MENU_NAV_STRATEGY, CNGX_MENU_ANNOUNCER_FACTORY, CNGX_MENU_DISMISS_HANDLER_FACTORY, injectMenuConfig, connectSubmenuHoverToFocusStack, CngxMenuItemIcon, CngxMenuItem, CngxMenuItemLabel, CngxMenuItemKbd, CngxMenuItemSuffix, CNGX_MENU_SUBMENU_WIRING, CngxMenuItemSubmenu, CngxMenuSeparator, CngxMenuItemCheckbox, CngxMenuItemRadio } from '@cngx/common/interactive';
|
|
6
|
+
import { CngxMenu, CNGX_SUBMENU_TRY_FALLBACKS, createContextMenuTriggerCore, CNGX_MENU_FOCUS_STACK_FACTORY, CNGX_MENU_NAV_STRATEGY, CNGX_MENU_ANNOUNCER_FACTORY, CNGX_MENU_DISMISS_HANDLER_FACTORY, injectMenuConfig, connectSubmenuHoverToFocusStack, CngxMenuItemIcon, CngxMenuItem, CngxMenuItemLabel, CngxMenuItemKbd, CngxMenuItemSuffix, CNGX_MENU_SUBMENU_WIRING, CngxMenuItemSubmenu, CngxMenuSeparator, CngxMenuItemCheckbox, CNGX_MENU_ITEM_OWN_INDICATOR, CngxMenuItemRadio } from '@cngx/common/interactive';
|
|
7
7
|
import * as i1 from '@cngx/common/popover';
|
|
8
8
|
import { CngxPopover } from '@cngx/common/popover';
|
|
9
9
|
import { injectDirection } from '@cngx/core';
|
|
10
10
|
import { CngxActiveDescendant } from '@cngx/common/a11y';
|
|
11
|
+
import { CngxIconSvg } from '@cngx/common/display';
|
|
12
|
+
import { CNGX_ICON_CHEVRON_RIGHT, CNGX_ICON_CHECK, CNGX_ICON_DOT } from '@cngx/utils';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Lazy content slot for {@link CngxContextMenu}. The template renders only
|
|
@@ -23,12 +25,11 @@ import { CngxActiveDescendant } from '@cngx/common/a11y';
|
|
|
23
25
|
* </cngx-context-menu>
|
|
24
26
|
* ```
|
|
25
27
|
*
|
|
26
|
-
* <example-url
|
|
27
|
-
* <example-url
|
|
28
|
-
* @category ui/context-menu
|
|
28
|
+
* <example-url>/#/ui/context-menu/grid/delegated-resolver</example-url>
|
|
29
|
+
* <example-url>/#/ui/context-menu/table/row-context-data</example-url>
|
|
29
30
|
* @wcag AA
|
|
30
31
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-content.directive.ts
|
|
31
|
-
* @since 0.
|
|
32
|
+
* @since 0.3.0
|
|
32
33
|
* @relatedTo CngxContextMenu, CngxContextMenuFor
|
|
33
34
|
*/
|
|
34
35
|
class CngxContextMenuContent {
|
|
@@ -94,17 +95,16 @@ const CNGX_CONTEXT_MENU_PANEL = new InjectionToken('CNGX_CONTEXT_MENU_PANEL');
|
|
|
94
95
|
* </cngx-context-menu>
|
|
95
96
|
* ```
|
|
96
97
|
*
|
|
97
|
-
* <example-url
|
|
98
|
-
* <example-url
|
|
99
|
-
* <example-url
|
|
100
|
-
* <example-url
|
|
101
|
-
* @category ui/context-menu
|
|
102
|
-
* @docsKind primary
|
|
98
|
+
* <example-url>/#/ui/context-menu/basic/static-items</example-url>
|
|
99
|
+
* <example-url>/#/ui/context-menu/grid/delegated-resolver</example-url>
|
|
100
|
+
* <example-url>/#/ui/context-menu/submenu/nested-export-menu</example-url>
|
|
101
|
+
* <example-url>/#/ui/context-menu/selection/checkbox-radio-items</example-url>
|
|
103
102
|
* @wcag AA
|
|
104
103
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu.component.ts
|
|
105
|
-
* @since 0.
|
|
104
|
+
* @since 0.3.0
|
|
106
105
|
* @relatedTo CngxContextMenuFor, CngxContextMenuItem, CngxContextMenuContent, CngxMenu, CngxPopover
|
|
107
106
|
* @slot cngxContextMenuContent Replaces the projected items with lazy content rendered only while the menu is open; gets the trigger's per-open datum as $implicit (let-row).
|
|
107
|
+
* @axis level organism
|
|
108
108
|
*/
|
|
109
109
|
class CngxContextMenu {
|
|
110
110
|
/** The popover surface this panel drives. Consumed by the trigger core. */
|
|
@@ -270,7 +270,7 @@ class CngxContextMenu {
|
|
|
270
270
|
this.routeKeydown(event);
|
|
271
271
|
}
|
|
272
272
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxContextMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
273
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxContextMenu, isStandalone: true, selector: "cngx-context-menu", host: { listeners: { "keydown": "handleKeydown($event)" } }, providers: [{ provide: CNGX_CONTEXT_MENU_PANEL, useExisting: CngxContextMenu }], queries: [{ propertyName: "contentTemplate", first: true, predicate: CngxContextMenuContent, descendants: true, isSignal: true }], exportAs: ["cngxContextMenu"], hostDirectives: [{ directive: i1.CngxPopover, inputs: ["offset", "offset", "closeOnEscape", "closeOnEscape"] }, { directive: i1$1.CngxMenu, inputs: ["label", "ariaLabel"] }], ngImport: i0, template: `
|
|
273
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxContextMenu, isStandalone: true, selector: "cngx-context-menu", host: { listeners: { "keydown": "handleKeydown($event)" } }, providers: [{ provide: CNGX_CONTEXT_MENU_PANEL, useExisting: CngxContextMenu }], queries: [{ propertyName: "contentTemplate", first: true, predicate: CngxContextMenuContent, descendants: true, isSignal: true }], exportAs: ["cngxContextMenu"], hostDirectives: [{ directive: i1.CngxPopover, inputs: ["offset", "offset", "closeOnEscape", "closeOnEscape"], outputs: ["opened", "opened", "closed", "closed"] }, { directive: i1$1.CngxMenu, inputs: ["label", "ariaLabel"] }], ngImport: i0, template: `
|
|
274
274
|
@if (contentTemplate(); as content) {
|
|
275
275
|
@if (popover.isVisible()) {
|
|
276
276
|
<ng-container *ngTemplateOutlet="content.templateRef; context: { $implicit: context() }" />
|
|
@@ -278,14 +278,14 @@ class CngxContextMenu {
|
|
|
278
278
|
} @else {
|
|
279
279
|
<ng-content />
|
|
280
280
|
}
|
|
281
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-context-menu-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-context-menu-border{syntax: \"*\"; inherits: true; initial-value: 1px solid oklch(.88 .005 250);}@property --cngx-context-menu-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-shadow{syntax: \"*\"; inherits: true; initial-value: 0 4px 16px oklch(0 0 0 / .12);}@property --cngx-context-menu-padding{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-separator-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-context-menu-separator-inset{syntax: \"<length>\"; inherits: false; initial-value: 4px;}:root{--cngx-context-menu-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-context-menu-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-context-menu-border: 1px solid var(--cngx-color-border, oklch(.88 .005 250));--cngx-context-menu-shadow: var(--cngx-shadow-md, 0 4px 16px oklch(0 0 0 / .12));--cngx-context-menu-separator-color: var(--cngx-color-border, oklch(.88 .005 250))}
|
|
281
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-context-menu-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-context-menu-border{syntax: \"*\"; inherits: true; initial-value: 1px solid oklch(.88 .005 250);}@property --cngx-context-menu-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-shadow{syntax: \"*\"; inherits: true; initial-value: 0 4px 16px oklch(0 0 0 / .12);}@property --cngx-context-menu-padding{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-separator-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-context-menu-separator-inset{syntax: \"<length>\"; inherits: false; initial-value: 4px;}:root{--cngx-context-menu-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-context-menu-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-context-menu-border: 1px solid var(--cngx-color-border, oklch(.88 .005 250));--cngx-context-menu-shadow: var(--cngx-shadow-md, 0 4px 16px oklch(0 0 0 / .12));--cngx-context-menu-separator-color: var(--cngx-color-border, oklch(.88 .005 250))}cngx-context-menu-divider,hr[cngxContextMenuDivider]{--cngx-context-menu-separator-inset: var(--cngx-space-xs)}}@layer cngx.components{cngx-context-menu{--cngx-context-menu-padding: var(--cngx-space-xs);box-sizing:border-box;position:fixed;inset:unset;min-inline-size:max-content;background:var(--cngx-context-menu-surface);color:var(--cngx-context-menu-color);border:var(--cngx-context-menu-border, 1px solid oklch(.88 .005 250));border-radius:var(--cngx-context-menu-radius, 8px);box-shadow:var(--cngx-context-menu-shadow, 0 4px 16px oklch(0 0 0 / .12));padding:var(--cngx-context-menu-padding, 4px);outline:none;transition:opacity var(--cngx-duration-base, .2s) var(--cngx-easing-standard, cubic-bezier(.4, 0, .2, 1)),transform var(--cngx-duration-base, .2s) var(--cngx-easing-standard, cubic-bezier(.4, 0, .2, 1))}cngx-context-menu:popover-open{display:flex;flex-direction:column}cngx-context-menu.cngx-popover--opening,cngx-context-menu.cngx-popover--closing{opacity:0;transform:translateY(4px) scale(.98)}cngx-context-menu.cngx-popover--open{opacity:1;transform:translateY(0) scale(1)}@media(prefers-reduced-motion:reduce){cngx-context-menu{transition:none}}cngx-context-menu:focus-visible{outline:2px solid var(--cngx-color-primary, oklch(.66 .19 50));outline-offset:-2px}cngx-context-menu-divider,hr[cngxContextMenuDivider]{display:block;block-size:1px;border:0;margin-block:var(--cngx-context-menu-separator-inset, 4px);margin-inline:var(--cngx-space-sm, 8px);background:var(--cngx-context-menu-separator-color)}}@media(forced-colors:active){cngx-context-menu-divider,hr[cngxContextMenuDivider]{background:CanvasText}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
282
282
|
}
|
|
283
283
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxContextMenu, decorators: [{
|
|
284
284
|
type: Component,
|
|
285
285
|
args: [{ selector: 'cngx-context-menu', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'cngxContextMenu', providers: [{ provide: CNGX_CONTEXT_MENU_PANEL, useExisting: CngxContextMenu }], host: {
|
|
286
286
|
'(keydown)': 'handleKeydown($event)',
|
|
287
287
|
}, hostDirectives: [
|
|
288
|
-
{ directive: CngxPopover, inputs: ['offset', 'closeOnEscape'] },
|
|
288
|
+
{ directive: CngxPopover, inputs: ['offset', 'closeOnEscape'], outputs: ['opened', 'closed'] },
|
|
289
289
|
{ directive: CngxMenu, inputs: ['label: ariaLabel'] },
|
|
290
290
|
], template: `
|
|
291
291
|
@if (contentTemplate(); as content) {
|
|
@@ -295,7 +295,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
295
295
|
} @else {
|
|
296
296
|
<ng-content />
|
|
297
297
|
}
|
|
298
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-context-menu-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-context-menu-border{syntax: \"*\"; inherits: true; initial-value: 1px solid oklch(.88 .005 250);}@property --cngx-context-menu-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-shadow{syntax: \"*\"; inherits: true; initial-value: 0 4px 16px oklch(0 0 0 / .12);}@property --cngx-context-menu-padding{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-separator-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-context-menu-separator-inset{syntax: \"<length>\"; inherits: false; initial-value: 4px;}:root{--cngx-context-menu-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-context-menu-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-context-menu-border: 1px solid var(--cngx-color-border, oklch(.88 .005 250));--cngx-context-menu-shadow: var(--cngx-shadow-md, 0 4px 16px oklch(0 0 0 / .12));--cngx-context-menu-separator-color: var(--cngx-color-border, oklch(.88 .005 250))}
|
|
298
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-surface{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-context-menu-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.2 .01 250);}@property --cngx-context-menu-border{syntax: \"*\"; inherits: true; initial-value: 1px solid oklch(.88 .005 250);}@property --cngx-context-menu-radius{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-shadow{syntax: \"*\"; inherits: true; initial-value: 0 4px 16px oklch(0 0 0 / .12);}@property --cngx-context-menu-padding{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-separator-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-context-menu-separator-inset{syntax: \"<length>\"; inherits: false; initial-value: 4px;}:root{--cngx-context-menu-surface: var(--cngx-color-surface, oklch(1 0 0));--cngx-context-menu-color: var(--cngx-color-text, oklch(.2 .01 250));--cngx-context-menu-border: 1px solid var(--cngx-color-border, oklch(.88 .005 250));--cngx-context-menu-shadow: var(--cngx-shadow-md, 0 4px 16px oklch(0 0 0 / .12));--cngx-context-menu-separator-color: var(--cngx-color-border, oklch(.88 .005 250))}cngx-context-menu-divider,hr[cngxContextMenuDivider]{--cngx-context-menu-separator-inset: var(--cngx-space-xs)}}@layer cngx.components{cngx-context-menu{--cngx-context-menu-padding: var(--cngx-space-xs);box-sizing:border-box;position:fixed;inset:unset;min-inline-size:max-content;background:var(--cngx-context-menu-surface);color:var(--cngx-context-menu-color);border:var(--cngx-context-menu-border, 1px solid oklch(.88 .005 250));border-radius:var(--cngx-context-menu-radius, 8px);box-shadow:var(--cngx-context-menu-shadow, 0 4px 16px oklch(0 0 0 / .12));padding:var(--cngx-context-menu-padding, 4px);outline:none;transition:opacity var(--cngx-duration-base, .2s) var(--cngx-easing-standard, cubic-bezier(.4, 0, .2, 1)),transform var(--cngx-duration-base, .2s) var(--cngx-easing-standard, cubic-bezier(.4, 0, .2, 1))}cngx-context-menu:popover-open{display:flex;flex-direction:column}cngx-context-menu.cngx-popover--opening,cngx-context-menu.cngx-popover--closing{opacity:0;transform:translateY(4px) scale(.98)}cngx-context-menu.cngx-popover--open{opacity:1;transform:translateY(0) scale(1)}@media(prefers-reduced-motion:reduce){cngx-context-menu{transition:none}}cngx-context-menu:focus-visible{outline:2px solid var(--cngx-color-primary, oklch(.66 .19 50));outline-offset:-2px}cngx-context-menu-divider,hr[cngxContextMenuDivider]{display:block;block-size:1px;border:0;margin-block:var(--cngx-context-menu-separator-inset, 4px);margin-inline:var(--cngx-space-sm, 8px);background:var(--cngx-context-menu-separator-color)}}@media(forced-colors:active){cngx-context-menu-divider,hr[cngxContextMenuDivider]{background:CanvasText}}\n"] }]
|
|
299
299
|
}], ctorParameters: () => [], propDecorators: { contentTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxContextMenuContent), { isSignal: true }] }] } });
|
|
300
300
|
|
|
301
301
|
/**
|
|
@@ -330,12 +330,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
330
330
|
* <cngx-context-menu #menu ariaLabel="Row actions">…</cngx-context-menu>
|
|
331
331
|
* ```
|
|
332
332
|
*
|
|
333
|
-
* <example-url
|
|
334
|
-
* <example-url
|
|
335
|
-
* @category ui/context-menu
|
|
333
|
+
* <example-url>/#/ui/context-menu/grid/delegated-resolver</example-url>
|
|
334
|
+
* <example-url>/#/ui/context-menu/basic/static-items</example-url>
|
|
336
335
|
* @wcag AA
|
|
337
336
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-for.directive.ts
|
|
338
|
-
* @since 0.
|
|
337
|
+
* @since 0.3.0
|
|
339
338
|
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxContextMenuTrigger
|
|
340
339
|
*/
|
|
341
340
|
class CngxContextMenuFor {
|
|
@@ -525,9 +524,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
525
524
|
* `public-api.ts`. Extracting it keeps `CngxContextMenuItem`'s class body a
|
|
526
525
|
* thin shell (reference_atomic_decompose rule 1).
|
|
527
526
|
*
|
|
528
|
-
* @
|
|
527
|
+
* @internal
|
|
529
528
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-item-submenu-facade.ts
|
|
530
|
-
* @since 0.
|
|
529
|
+
* @since 0.3.0
|
|
531
530
|
*/
|
|
532
531
|
function createContextMenuItemSubmenuFacade(target, open) {
|
|
533
532
|
return {
|
|
@@ -544,30 +543,6 @@ function createContextMenuItemSubmenuFacade(target, open) {
|
|
|
544
543
|
};
|
|
545
544
|
}
|
|
546
545
|
|
|
547
|
-
/**
|
|
548
|
-
* Default single-character glyphs for the context-menu item skin. Plain
|
|
549
|
-
* `as const` (not `TemplateRef`, not a `Directive`) so the strings stay inline
|
|
550
|
-
* at their `aria-hidden` call sites and tree-shake when unused. Consolidates
|
|
551
|
-
* the trailing submenu caret and the checkbox / radio checked indicators into
|
|
552
|
-
* one source, mirroring `CNGX_SELECT_GLYPHS`.
|
|
553
|
-
*
|
|
554
|
-
* Internal to this organism: not exported from `public-api.ts`, not a consumer
|
|
555
|
-
* override surface (that tier stays deferred, menu-accepted-debt §2). Lives
|
|
556
|
-
* here rather than in `@cngx/common/interactive` because the base menu
|
|
557
|
-
* directives hardcode none of these glyphs, so the organism is the only
|
|
558
|
-
* consumer today; hoisting to the brain lib waits for a second menu consumer.
|
|
559
|
-
*
|
|
560
|
-
* @internal
|
|
561
|
-
*/
|
|
562
|
-
const CNGX_MENU_GLYPHS = {
|
|
563
|
-
/** Trailing caret on an item that opens a submenu. */
|
|
564
|
-
submenuCaret: '▸',
|
|
565
|
-
/** Leading indicator on a checked `menuitemcheckbox`. */
|
|
566
|
-
checkboxChecked: '✓',
|
|
567
|
-
/** Leading indicator on a checked `menuitemradio`. */
|
|
568
|
-
radioChecked: '●',
|
|
569
|
-
};
|
|
570
|
-
|
|
571
546
|
/**
|
|
572
547
|
* A single actionable context-menu item. Thin shell over `CngxMenuItem`: the
|
|
573
548
|
* brain owns `role="menuitem"`, the active-descendant registration, the
|
|
@@ -598,13 +573,12 @@ const CNGX_MENU_GLYPHS = {
|
|
|
598
573
|
* </cngx-context-menu>
|
|
599
574
|
* ```
|
|
600
575
|
*
|
|
601
|
-
* <example-url
|
|
602
|
-
* <example-url
|
|
603
|
-
* <example-url
|
|
604
|
-
* @category ui/context-menu
|
|
576
|
+
* <example-url>/#/ui/context-menu/basic/static-items</example-url>
|
|
577
|
+
* <example-url>/#/ui/context-menu/submenu/nested-export-menu</example-url>
|
|
578
|
+
* <example-url>/#/ui/context-menu/attribute-form/native-buttons</example-url>
|
|
605
579
|
* @wcag AA
|
|
606
580
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-item.component.ts
|
|
607
|
-
* @since 0.
|
|
581
|
+
* @since 0.3.0
|
|
608
582
|
* @relatedTo CngxContextMenu, CngxContextMenuDivider, CngxMenuItem, CngxMenuItemSubmenu
|
|
609
583
|
*/
|
|
610
584
|
class CngxContextMenuItem {
|
|
@@ -631,9 +605,9 @@ class CngxContextMenuItem {
|
|
|
631
605
|
/** Fires when this item is activated by click or Enter/Space. */
|
|
632
606
|
select = output();
|
|
633
607
|
/** @internal Decorative caret rendered while `submenu` is set. RTL flip is
|
|
634
|
-
* a CSS concern (`.cngx-menu-item__suffix` under
|
|
608
|
+
* a CSS concern (`.cngx-menu-item__suffix` under `:dir(rtl)`), not a
|
|
635
609
|
* swapped glyph. */
|
|
636
|
-
|
|
610
|
+
caretIcon = CNGX_ICON_CHEVRON_RIGHT;
|
|
637
611
|
parentPanel = inject(CNGX_CONTEXT_MENU_PANEL, { optional: true });
|
|
638
612
|
/**
|
|
639
613
|
* Facade the submenu brain drives instead of a `[cngxMenuItemSubmenu]`
|
|
@@ -704,13 +678,13 @@ class CngxContextMenuItem {
|
|
|
704
678
|
<span cngxMenuItemKbd>{{ shortcut }}</span>
|
|
705
679
|
}
|
|
706
680
|
@if (submenu()) {
|
|
707
|
-
<span cngxMenuItemSuffix
|
|
681
|
+
<span cngxMenuItemSuffix><svg [cngxIconSvg]="caretIcon"></svg></span>
|
|
708
682
|
}
|
|
709
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color, var(--cngx-
|
|
683
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color)}cngx-context-menu-item .cngx-menu-item__suffix>.cngx-icon-svg,button[cngxContextMenuItem] .cngx-menu-item__suffix>.cngx-icon-svg{display:block;--cngx-icon-svg-size: max(.75em, var(--cngx-icon-svg-micro-floor, .75rem))}cngx-context-menu-item:dir(rtl) .cngx-menu-item__suffix,button[cngxContextMenuItem]:dir(rtl) .cngx-menu-item__suffix{transform:scaleX(-1)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check{position:relative;flex:none;align-self:stretch;inline-size:1.25rem;color:var(--cngx-context-menu-item-check-color)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{position:absolute;left:50%;top:50%;translate:-50% -50%}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 1rem}:is(cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 2.19em }}@media(forced-colors:active){:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]).cngx-menu-item--highlighted>.cngx-menu-item__check,:is(cngx-context-menu-item,button[cngxContextMenuItem]).cngx-menu-item--highlighted .cngx-menu-item__suffix{color:var(--_cngx-forced-ink, currentColor)}}\n"], dependencies: [{ kind: "component", type: CngxIconSvg, selector: "svg[cngxIconSvg]", inputs: ["cngxIconSvg"] }, { kind: "directive", type: CngxMenuItemIcon, selector: "[cngxMenuItemIcon]", exportAs: ["cngxMenuItemIcon"] }, { kind: "directive", type: CngxMenuItemLabel, selector: "[cngxMenuItemLabel]", exportAs: ["cngxMenuItemLabel"] }, { kind: "directive", type: CngxMenuItemKbd, selector: "[cngxMenuItemKbd]", exportAs: ["cngxMenuItemKbd"] }, { kind: "directive", type: CngxMenuItemSuffix, selector: "[cngxMenuItemSuffix]", exportAs: ["cngxMenuItemSuffix"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
710
684
|
}
|
|
711
685
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxContextMenuItem, decorators: [{
|
|
712
686
|
type: Component,
|
|
713
|
-
args: [{ selector: 'cngx-context-menu-item, button[cngxContextMenuItem]', standalone: true, imports: [CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd, CngxMenuItemSuffix], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'cngxContextMenuItem', providers: [{ provide: CNGX_MENU_SUBMENU_WIRING, useExisting: CngxContextMenuItem }], hostDirectives: [
|
|
687
|
+
args: [{ selector: 'cngx-context-menu-item, button[cngxContextMenuItem]', standalone: true, imports: [CngxIconSvg, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd, CngxMenuItemSuffix], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'cngxContextMenuItem', providers: [{ provide: CNGX_MENU_SUBMENU_WIRING, useExisting: CngxContextMenuItem }], hostDirectives: [
|
|
714
688
|
{ directive: CngxMenuItem, inputs: ['disabled', 'value'] },
|
|
715
689
|
CngxMenuItemSubmenu,
|
|
716
690
|
], template: `
|
|
@@ -723,9 +697,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
723
697
|
<span cngxMenuItemKbd>{{ shortcut }}</span>
|
|
724
698
|
}
|
|
725
699
|
@if (submenu()) {
|
|
726
|
-
<span cngxMenuItemSuffix
|
|
700
|
+
<span cngxMenuItemSuffix><svg [cngxIconSvg]="caretIcon"></svg></span>
|
|
727
701
|
}
|
|
728
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color, var(--cngx-
|
|
702
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color)}cngx-context-menu-item .cngx-menu-item__suffix>.cngx-icon-svg,button[cngxContextMenuItem] .cngx-menu-item__suffix>.cngx-icon-svg{display:block;--cngx-icon-svg-size: max(.75em, var(--cngx-icon-svg-micro-floor, .75rem))}cngx-context-menu-item:dir(rtl) .cngx-menu-item__suffix,button[cngxContextMenuItem]:dir(rtl) .cngx-menu-item__suffix{transform:scaleX(-1)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check{position:relative;flex:none;align-self:stretch;inline-size:1.25rem;color:var(--cngx-context-menu-item-check-color)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{position:absolute;left:50%;top:50%;translate:-50% -50%}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 1rem}:is(cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 2.19em }}@media(forced-colors:active){:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]).cngx-menu-item--highlighted>.cngx-menu-item__check,:is(cngx-context-menu-item,button[cngxContextMenuItem]).cngx-menu-item--highlighted .cngx-menu-item__suffix{color:var(--_cngx-forced-ink, currentColor)}}\n"] }]
|
|
729
703
|
}], ctorParameters: () => [], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], projectedIcon: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxMenuItemIcon), { isSignal: true }] }], kbd: [{ type: i0.Input, args: [{ isSignal: true, alias: "kbd", required: false }] }], submenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "submenu", required: false }] }], select: [{ type: i0.Output, args: ["select"] }] } });
|
|
730
704
|
|
|
731
705
|
/**
|
|
@@ -739,12 +713,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
739
713
|
* <hr cngxContextMenuDivider />
|
|
740
714
|
* ```
|
|
741
715
|
*
|
|
742
|
-
* <example-url
|
|
743
|
-
* <example-url
|
|
744
|
-
* @category ui/context-menu
|
|
716
|
+
* <example-url>/#/ui/context-menu/basic/static-items</example-url>
|
|
717
|
+
* <example-url>/#/ui/context-menu/attribute-form/native-buttons</example-url>
|
|
745
718
|
* @wcag AA
|
|
746
719
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-divider.component.ts
|
|
747
|
-
* @since 0.
|
|
720
|
+
* @since 0.3.0
|
|
748
721
|
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxMenuSeparator
|
|
749
722
|
*/
|
|
750
723
|
class CngxContextMenuDivider {
|
|
@@ -775,11 +748,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
775
748
|
* <cngx-context-menu-item-checkbox [(checked)]="wrap">Word wrap</cngx-context-menu-item-checkbox>
|
|
776
749
|
* ```
|
|
777
750
|
*
|
|
778
|
-
* <example-url
|
|
779
|
-
* @category ui/context-menu
|
|
751
|
+
* <example-url>/#/ui/context-menu/selection/checkbox-radio-items</example-url>
|
|
780
752
|
* @wcag AA
|
|
781
753
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-item-checkbox.component.ts
|
|
782
|
-
* @since 0.
|
|
754
|
+
* @since 0.3.0
|
|
783
755
|
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxContextMenuItemRadio, CngxMenuItemCheckbox
|
|
784
756
|
*/
|
|
785
757
|
class CngxContextMenuItemCheckbox {
|
|
@@ -798,11 +770,18 @@ class CngxContextMenuItemCheckbox {
|
|
|
798
770
|
* string `[icon]` shorthand off so the projected icon is the only one drawn.
|
|
799
771
|
*/
|
|
800
772
|
projectedIcon = contentChild(CngxMenuItemIcon, ...(ngDevMode ? [{ debugName: "projectedIcon" }] : /* istanbul ignore next */ []));
|
|
801
|
-
/** @internal
|
|
802
|
-
|
|
803
|
-
|
|
773
|
+
/** @internal The brain host directive; its `checked()` gates the indicator. */
|
|
774
|
+
brain = inject(CngxMenuItemCheckbox, { host: true });
|
|
775
|
+
/** @internal Leading checked indicator, drawn in an always-present gutter so
|
|
776
|
+
* the label does not shift when the item is checked or unchecked. */
|
|
777
|
+
checkIcon = CNGX_ICON_CHECK;
|
|
804
778
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxContextMenuItemCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
805
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxContextMenuItemCheckbox, isStandalone: true, selector: "cngx-context-menu-item-checkbox, button[cngxContextMenuItemCheckbox]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, kbd: { classPropertyName: "kbd", publicName: "kbd", isSignal: true, isRequired: false, transformFunction: null } },
|
|
779
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxContextMenuItemCheckbox, isStandalone: true, selector: "cngx-context-menu-item-checkbox, button[cngxContextMenuItemCheckbox]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, kbd: { classPropertyName: "kbd", publicName: "kbd", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: CNGX_MENU_ITEM_OWN_INDICATOR, useValue: true }], queries: [{ propertyName: "projectedIcon", first: true, predicate: CngxMenuItemIcon, descendants: true, isSignal: true }], exportAs: ["cngxContextMenuItemCheckbox"], hostDirectives: [{ directive: i1$1.CngxMenuItemCheckbox, inputs: ["disabled", "disabled", "value", "value", "checked", "checked", "label", "label"], outputs: ["checkedChange", "checkedChange"] }], ngImport: i0, template: `
|
|
780
|
+
<span class="cngx-menu-item__check" aria-hidden="true">
|
|
781
|
+
@if (brain.checked()) {
|
|
782
|
+
<svg [cngxIconSvg]="checkIcon"></svg>
|
|
783
|
+
}
|
|
784
|
+
</span>
|
|
806
785
|
<ng-content select="[cngxMenuItemIcon]" />
|
|
807
786
|
@if (!projectedIcon() && icon(); as glyph) {
|
|
808
787
|
<span cngxMenuItemIcon>{{ glyph }}</span>
|
|
@@ -811,17 +790,22 @@ class CngxContextMenuItemCheckbox {
|
|
|
811
790
|
@if (kbd(); as shortcut) {
|
|
812
791
|
<span cngxMenuItemKbd>{{ shortcut }}</span>
|
|
813
792
|
}
|
|
814
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color, var(--cngx-
|
|
793
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color)}cngx-context-menu-item .cngx-menu-item__suffix>.cngx-icon-svg,button[cngxContextMenuItem] .cngx-menu-item__suffix>.cngx-icon-svg{display:block;--cngx-icon-svg-size: max(.75em, var(--cngx-icon-svg-micro-floor, .75rem))}cngx-context-menu-item:dir(rtl) .cngx-menu-item__suffix,button[cngxContextMenuItem]:dir(rtl) .cngx-menu-item__suffix{transform:scaleX(-1)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check{position:relative;flex:none;align-self:stretch;inline-size:1.25rem;color:var(--cngx-context-menu-item-check-color)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{position:absolute;left:50%;top:50%;translate:-50% -50%}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 1rem}:is(cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 2.19em }}@media(forced-colors:active){:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]).cngx-menu-item--highlighted>.cngx-menu-item__check,:is(cngx-context-menu-item,button[cngxContextMenuItem]).cngx-menu-item--highlighted .cngx-menu-item__suffix{color:var(--_cngx-forced-ink, currentColor)}}\n"], dependencies: [{ kind: "component", type: CngxIconSvg, selector: "svg[cngxIconSvg]", inputs: ["cngxIconSvg"] }, { kind: "directive", type: CngxMenuItemIcon, selector: "[cngxMenuItemIcon]", exportAs: ["cngxMenuItemIcon"] }, { kind: "directive", type: CngxMenuItemLabel, selector: "[cngxMenuItemLabel]", exportAs: ["cngxMenuItemLabel"] }, { kind: "directive", type: CngxMenuItemKbd, selector: "[cngxMenuItemKbd]", exportAs: ["cngxMenuItemKbd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
815
794
|
}
|
|
816
795
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxContextMenuItemCheckbox, decorators: [{
|
|
817
796
|
type: Component,
|
|
818
|
-
args: [{ selector: 'cngx-context-menu-item-checkbox, button[cngxContextMenuItemCheckbox]', standalone: true, imports: [CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'cngxContextMenuItemCheckbox',
|
|
797
|
+
args: [{ selector: 'cngx-context-menu-item-checkbox, button[cngxContextMenuItemCheckbox]', standalone: true, imports: [CngxIconSvg, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'cngxContextMenuItemCheckbox', providers: [{ provide: CNGX_MENU_ITEM_OWN_INDICATOR, useValue: true }], hostDirectives: [
|
|
819
798
|
{
|
|
820
799
|
directive: CngxMenuItemCheckbox,
|
|
821
800
|
inputs: ['disabled', 'value', 'checked', 'label'],
|
|
822
801
|
outputs: ['checkedChange'],
|
|
823
802
|
},
|
|
824
803
|
], template: `
|
|
804
|
+
<span class="cngx-menu-item__check" aria-hidden="true">
|
|
805
|
+
@if (brain.checked()) {
|
|
806
|
+
<svg [cngxIconSvg]="checkIcon"></svg>
|
|
807
|
+
}
|
|
808
|
+
</span>
|
|
825
809
|
<ng-content select="[cngxMenuItemIcon]" />
|
|
826
810
|
@if (!projectedIcon() && icon(); as glyph) {
|
|
827
811
|
<span cngxMenuItemIcon>{{ glyph }}</span>
|
|
@@ -830,7 +814,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
830
814
|
@if (kbd(); as shortcut) {
|
|
831
815
|
<span cngxMenuItemKbd>{{ shortcut }}</span>
|
|
832
816
|
}
|
|
833
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color, var(--cngx-
|
|
817
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color)}cngx-context-menu-item .cngx-menu-item__suffix>.cngx-icon-svg,button[cngxContextMenuItem] .cngx-menu-item__suffix>.cngx-icon-svg{display:block;--cngx-icon-svg-size: max(.75em, var(--cngx-icon-svg-micro-floor, .75rem))}cngx-context-menu-item:dir(rtl) .cngx-menu-item__suffix,button[cngxContextMenuItem]:dir(rtl) .cngx-menu-item__suffix{transform:scaleX(-1)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check{position:relative;flex:none;align-self:stretch;inline-size:1.25rem;color:var(--cngx-context-menu-item-check-color)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{position:absolute;left:50%;top:50%;translate:-50% -50%}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 1rem}:is(cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 2.19em }}@media(forced-colors:active){:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]).cngx-menu-item--highlighted>.cngx-menu-item__check,:is(cngx-context-menu-item,button[cngxContextMenuItem]).cngx-menu-item--highlighted .cngx-menu-item__suffix{color:var(--_cngx-forced-ink, currentColor)}}\n"] }]
|
|
834
818
|
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], kbd: [{ type: i0.Input, args: [{ isSignal: true, alias: "kbd", required: false }] }], projectedIcon: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxMenuItemIcon), { isSignal: true }] }] } });
|
|
835
819
|
|
|
836
820
|
/**
|
|
@@ -847,11 +831,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
847
831
|
* </div>
|
|
848
832
|
* ```
|
|
849
833
|
*
|
|
850
|
-
* <example-url
|
|
851
|
-
* @category ui/context-menu
|
|
834
|
+
* <example-url>/#/ui/context-menu/selection/checkbox-radio-items</example-url>
|
|
852
835
|
* @wcag AA
|
|
853
836
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/context-menu/context-menu-item-radio.component.ts
|
|
854
|
-
* @since 0.
|
|
837
|
+
* @since 0.3.0
|
|
855
838
|
* @relatedTo CngxContextMenu, CngxContextMenuItem, CngxContextMenuItemCheckbox, CngxMenuItemRadio, CngxMenuGroup
|
|
856
839
|
*/
|
|
857
840
|
class CngxContextMenuItemRadio {
|
|
@@ -870,11 +853,18 @@ class CngxContextMenuItemRadio {
|
|
|
870
853
|
* string `[icon]` shorthand off so the projected icon is the only one drawn.
|
|
871
854
|
*/
|
|
872
855
|
projectedIcon = contentChild(CngxMenuItemIcon, ...(ngDevMode ? [{ debugName: "projectedIcon" }] : /* istanbul ignore next */ []));
|
|
873
|
-
/** @internal
|
|
874
|
-
|
|
875
|
-
|
|
856
|
+
/** @internal The brain host directive; its `checked()` gates the indicator. */
|
|
857
|
+
brain = inject(CngxMenuItemRadio, { host: true });
|
|
858
|
+
/** @internal Leading checked indicator, drawn in an always-present gutter so
|
|
859
|
+
* the label does not shift when the item is checked or unchecked. */
|
|
860
|
+
checkIcon = CNGX_ICON_DOT;
|
|
876
861
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxContextMenuItemRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
877
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxContextMenuItemRadio, isStandalone: true, selector: "cngx-context-menu-item-radio, button[cngxContextMenuItemRadio]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, kbd: { classPropertyName: "kbd", publicName: "kbd", isSignal: true, isRequired: false, transformFunction: null } },
|
|
862
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxContextMenuItemRadio, isStandalone: true, selector: "cngx-context-menu-item-radio, button[cngxContextMenuItemRadio]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, kbd: { classPropertyName: "kbd", publicName: "kbd", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{ provide: CNGX_MENU_ITEM_OWN_INDICATOR, useValue: true }], queries: [{ propertyName: "projectedIcon", first: true, predicate: CngxMenuItemIcon, descendants: true, isSignal: true }], exportAs: ["cngxContextMenuItemRadio"], hostDirectives: [{ directive: i1$1.CngxMenuItemRadio, inputs: ["disabled", "disabled", "value", "value", "label", "label"] }], ngImport: i0, template: `
|
|
863
|
+
<span class="cngx-menu-item__check" aria-hidden="true">
|
|
864
|
+
@if (brain.checked()) {
|
|
865
|
+
<svg [cngxIconSvg]="checkIcon"></svg>
|
|
866
|
+
}
|
|
867
|
+
</span>
|
|
878
868
|
<ng-content select="[cngxMenuItemIcon]" />
|
|
879
869
|
@if (!projectedIcon() && icon(); as glyph) {
|
|
880
870
|
<span cngxMenuItemIcon>{{ glyph }}</span>
|
|
@@ -883,11 +873,16 @@ class CngxContextMenuItemRadio {
|
|
|
883
873
|
@if (kbd(); as shortcut) {
|
|
884
874
|
<span cngxMenuItemKbd>{{ shortcut }}</span>
|
|
885
875
|
}
|
|
886
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color, var(--cngx-
|
|
876
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color)}cngx-context-menu-item .cngx-menu-item__suffix>.cngx-icon-svg,button[cngxContextMenuItem] .cngx-menu-item__suffix>.cngx-icon-svg{display:block;--cngx-icon-svg-size: max(.75em, var(--cngx-icon-svg-micro-floor, .75rem))}cngx-context-menu-item:dir(rtl) .cngx-menu-item__suffix,button[cngxContextMenuItem]:dir(rtl) .cngx-menu-item__suffix{transform:scaleX(-1)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check{position:relative;flex:none;align-self:stretch;inline-size:1.25rem;color:var(--cngx-context-menu-item-check-color)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{position:absolute;left:50%;top:50%;translate:-50% -50%}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 1rem}:is(cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 2.19em }}@media(forced-colors:active){:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]).cngx-menu-item--highlighted>.cngx-menu-item__check,:is(cngx-context-menu-item,button[cngxContextMenuItem]).cngx-menu-item--highlighted .cngx-menu-item__suffix{color:var(--_cngx-forced-ink, currentColor)}}\n"], dependencies: [{ kind: "component", type: CngxIconSvg, selector: "svg[cngxIconSvg]", inputs: ["cngxIconSvg"] }, { kind: "directive", type: CngxMenuItemIcon, selector: "[cngxMenuItemIcon]", exportAs: ["cngxMenuItemIcon"] }, { kind: "directive", type: CngxMenuItemLabel, selector: "[cngxMenuItemLabel]", exportAs: ["cngxMenuItemLabel"] }, { kind: "directive", type: CngxMenuItemKbd, selector: "[cngxMenuItemKbd]", exportAs: ["cngxMenuItemKbd"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
887
877
|
}
|
|
888
878
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxContextMenuItemRadio, decorators: [{
|
|
889
879
|
type: Component,
|
|
890
|
-
args: [{ selector: 'cngx-context-menu-item-radio, button[cngxContextMenuItemRadio]', standalone: true, imports: [CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'cngxContextMenuItemRadio',
|
|
880
|
+
args: [{ selector: 'cngx-context-menu-item-radio, button[cngxContextMenuItemRadio]', standalone: true, imports: [CngxIconSvg, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'cngxContextMenuItemRadio', providers: [{ provide: CNGX_MENU_ITEM_OWN_INDICATOR, useValue: true }], hostDirectives: [{ directive: CngxMenuItemRadio, inputs: ['disabled', 'value', 'label'] }], template: `
|
|
881
|
+
<span class="cngx-menu-item__check" aria-hidden="true">
|
|
882
|
+
@if (brain.checked()) {
|
|
883
|
+
<svg [cngxIconSvg]="checkIcon"></svg>
|
|
884
|
+
}
|
|
885
|
+
</span>
|
|
891
886
|
<ng-content select="[cngxMenuItemIcon]" />
|
|
892
887
|
@if (!projectedIcon() && icon(); as glyph) {
|
|
893
888
|
<span cngxMenuItemIcon>{{ glyph }}</span>
|
|
@@ -896,11 +891,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
896
891
|
@if (kbd(); as shortcut) {
|
|
897
892
|
<span cngxMenuItemKbd>{{ shortcut }}</span>
|
|
898
893
|
}
|
|
899
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color, var(--cngx-
|
|
894
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-context-menu-item-padding{syntax: \"*\"; inherits: false; initial-value: 6px 10px;}@property --cngx-context-menu-item-gap{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-context-menu-item-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-context-menu-item-caret-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .01 250);}@property --cngx-context-menu-item-check-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}:root{--cngx-context-menu-item-caret-color: var(--cngx-color-text-muted, oklch(.5 .01 250));--cngx-context-menu-item-check-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{cngx-context-menu-item,button[cngxContextMenuItem],cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]{--cngx-context-menu-item-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-context-menu-item-gap: var(--cngx-space-sm);display:flex;align-items:center;gap:var(--cngx-context-menu-item-gap, 8px);padding:var(--cngx-context-menu-item-padding, 6px 10px);border-radius:var(--cngx-context-menu-item-radius, 4px);cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;min-block-size:var(--cngx-target-min, 0px)}cngx-context-menu-item .cngx-menu-item__suffix,button[cngxContextMenuItem] .cngx-menu-item__suffix{color:var(--cngx-context-menu-item-caret-color)}cngx-context-menu-item .cngx-menu-item__suffix>.cngx-icon-svg,button[cngxContextMenuItem] .cngx-menu-item__suffix>.cngx-icon-svg{display:block;--cngx-icon-svg-size: max(.75em, var(--cngx-icon-svg-micro-floor, .75rem))}cngx-context-menu-item:dir(rtl) .cngx-menu-item__suffix,button[cngxContextMenuItem]:dir(rtl) .cngx-menu-item__suffix{transform:scaleX(-1)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check{position:relative;flex:none;align-self:stretch;inline-size:1.25rem;color:var(--cngx-context-menu-item-check-color)}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{position:absolute;left:50%;top:50%;translate:-50% -50%}:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 1rem}:is(cngx-context-menu-item-radio,button[cngxContextMenuItemRadio])>.cngx-menu-item__check>.cngx-icon-svg{--cngx-icon-svg-size: 2.19em }}@media(forced-colors:active){:is(cngx-context-menu-item-checkbox,button[cngxContextMenuItemCheckbox],cngx-context-menu-item-radio,button[cngxContextMenuItemRadio]).cngx-menu-item--highlighted>.cngx-menu-item__check,:is(cngx-context-menu-item,button[cngxContextMenuItem]).cngx-menu-item--highlighted .cngx-menu-item__suffix{color:var(--_cngx-forced-ink, currentColor)}}\n"] }]
|
|
900
895
|
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], kbd: [{ type: i0.Input, args: [{ isSignal: true, alias: "kbd", required: false }] }], projectedIcon: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxMenuItemIcon), { isSignal: true }] }] } });
|
|
901
896
|
|
|
902
897
|
/**
|
|
903
|
-
* @module
|
|
898
|
+
* @module `@cngx/ui/context-menu`
|
|
904
899
|
*/
|
|
905
900
|
|
|
906
901
|
/**
|