@cngx/common 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/a11y/README.md +15 -2
- package/button/README.md +258 -0
- package/command/README.md +19 -8
- package/data/README.md +10 -10
- package/fesm2022/cngx-common-a11y.mjs +701 -263
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +83 -64
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-button.mjs +1084 -0
- package/fesm2022/cngx-common-button.mjs.map +1 -0
- package/fesm2022/cngx-common-card.mjs +135 -76
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +749 -296
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +51 -29
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +695 -405
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +112 -112
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +668 -308
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +7066 -2739
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +2121 -492
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-menu-button.mjs +557 -0
- package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
- package/fesm2022/cngx-common-popover.mjs +1207 -569
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +256 -261
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +202 -262
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +28 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +10 -10
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +30 -19
- package/layout/README.md +1 -1
- package/menu-button/README.md +234 -0
- package/package.json +14 -4
- package/popover/README.md +42 -5
- package/popover/tooltip-indicator.scss +52 -0
- package/schematics/ng-add/index.js +7 -7
- package/schematics/ng-add/schema.json +5 -0
- package/stepper/README.md +0 -1
- package/theming/components/cngx-accordion.css +36 -7
- package/theming/components/cngx-async.css +185 -37
- package/theming/components/cngx-backdrop.css +3 -1
- package/theming/components/cngx-badge.css +20 -5
- package/theming/components/cngx-bottom-sheet.css +2 -0
- package/theming/components/cngx-breadcrumb.css +3 -1
- package/theming/components/cngx-button-group.css +325 -0
- package/theming/components/cngx-button-toggle.css +55 -23
- package/theming/components/cngx-button.css +975 -0
- package/theming/components/cngx-data-grid.css +2 -0
- package/theming/components/cngx-dialog.css +3 -1
- package/theming/components/cngx-divider.css +24 -9
- package/theming/components/cngx-drawer.css +153 -0
- package/theming/components/cngx-icon-glyph.css +76 -0
- package/theming/components/cngx-listbox.css +79 -25
- package/theming/components/cngx-menu.css +112 -52
- package/theming/components/cngx-nav.css +1220 -0
- package/theming/components/cngx-popover-sheet.css +43 -11
- package/theming/components/cngx-popover.css +37 -13
- package/theming/components/cngx-recycler-placeholder.css +2 -0
- package/theming/components/cngx-ripple.css +74 -16
- package/theming/components/cngx-sidebar.css +71 -0
- package/theming/components/cngx-slider.css +3 -1
- package/theming/components/cngx-tooltip.css +2 -0
- package/timeline/README.md +2 -2
- package/types/cngx-common-a11y.d.ts +343 -120
- package/types/cngx-common-audio.d.ts +60 -88
- package/types/cngx-common-button.d.ts +698 -0
- package/types/cngx-common-card.d.ts +104 -78
- package/types/cngx-common-chart.d.ts +671 -384
- package/types/cngx-common-command.d.ts +44 -47
- package/types/cngx-common-data.d.ts +350 -342
- package/types/cngx-common-dialog.d.ts +91 -120
- package/types/cngx-common-display.d.ts +475 -300
- package/types/cngx-common-interactive.d.ts +4350 -1723
- package/types/cngx-common-layout.d.ts +1365 -286
- package/types/cngx-common-menu-button.d.ts +382 -0
- package/types/cngx-common-popover.d.ts +671 -289
- package/types/cngx-common-stepper.d.ts +217 -347
- package/types/cngx-common-tabs.d.ts +173 -386
- package/types/cngx-common-timeline.d.ts +25 -104
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Signal,
|
|
1
|
+
import { Signal, Provider, InjectionToken } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A single registrable command - a labelled action the command palette can
|
|
@@ -10,8 +10,7 @@ import { Signal, InjectionToken, Provider } from '@angular/core';
|
|
|
10
10
|
* parameter: a payload rides on `data` as `unknown` and the row slot narrows
|
|
11
11
|
* it at the use-site.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
14
|
-
* @since 0.1.0
|
|
13
|
+
* @since 0.3.0
|
|
15
14
|
*/
|
|
16
15
|
interface CngxCommand {
|
|
17
16
|
/** Stable identity. Drives the merge `equal` and the `aria-activedescendant` id. */
|
|
@@ -42,8 +41,7 @@ interface CngxCommand {
|
|
|
42
41
|
* an empty query, then categories) and the consumer's async result source is a
|
|
43
42
|
* `CngxAsyncState<CngxCommandGroup[]>`.
|
|
44
43
|
*
|
|
45
|
-
* @
|
|
46
|
-
* @since 0.1.0
|
|
44
|
+
* @since 0.3.0
|
|
47
45
|
*/
|
|
48
46
|
interface CngxCommandGroup {
|
|
49
47
|
/** Stable identity for the group header slot and change detection. */
|
|
@@ -57,8 +55,7 @@ interface CngxCommandGroup {
|
|
|
57
55
|
* @deprecated Use {@link CngxCommandGroup}. Published under the unprefixed
|
|
58
56
|
* name by mistake; the alias remains for compatibility and will be removed in
|
|
59
57
|
* a future major.
|
|
60
|
-
* @
|
|
61
|
-
* @since 0.1.0
|
|
58
|
+
* @since 0.3.0
|
|
62
59
|
*/
|
|
63
60
|
type CommandGroup = CngxCommandGroup;
|
|
64
61
|
|
|
@@ -67,36 +64,44 @@ type CommandGroup = CngxCommandGroup;
|
|
|
67
64
|
* commands - a signal source lets a contributor add or remove commands (or
|
|
68
65
|
* flip a command's `disabled`) live, and `injectCommands` tracks it.
|
|
69
66
|
*
|
|
70
|
-
* @
|
|
71
|
-
* @since 0.1.0
|
|
67
|
+
* @since 0.3.0
|
|
72
68
|
*/
|
|
73
69
|
type CngxCommandSource = Signal<readonly CngxCommand[]> | readonly CngxCommand[];
|
|
74
70
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* @
|
|
88
|
-
* @since 0.1.0
|
|
71
|
+
* A source that needs injection. `provideCommands` runs it once, as a provider
|
|
72
|
+
* factory in the injection context of the level it is registered at, so it can
|
|
73
|
+
* call `inject()`. It is not a `computed`: a factory returning a plain array is
|
|
74
|
+
* frozen at that first call. Return a `Signal` to stay reactive. A factory that
|
|
75
|
+
* returns anything else contributes no commands and warns in dev mode
|
|
76
|
+
* ([`CNGX1070`](/error-codes/cngx1070.md)).
|
|
77
|
+
*
|
|
78
|
+
* The factory must not call `injectCommands()`, directly or through a service
|
|
79
|
+
* it injects at the same level: that reads the registry the factory is still
|
|
80
|
+
* building, and Angular throws a circular-dependency error (NG0200).
|
|
81
|
+
*
|
|
82
|
+
* @relatedTo provideCommands
|
|
83
|
+
* @since 0.3.0
|
|
89
84
|
*/
|
|
90
|
-
|
|
85
|
+
type CngxCommandSourceFactory = () => CngxCommandSource;
|
|
91
86
|
/**
|
|
92
|
-
* Registers one or more command sources.
|
|
93
|
-
*
|
|
94
|
-
* and `injectCommands` merges all of them.
|
|
87
|
+
* Registers one or more command sources. Call `provideCommands` from several
|
|
88
|
+
* app parts and `injectCommands` merges all of them, without a central list.
|
|
95
89
|
*
|
|
96
90
|
* Returns `Provider[]` (not `EnvironmentProviders`), so it registers at any
|
|
97
91
|
* injector scope - app root, a lazy route, or a component's `providers` /
|
|
98
92
|
* `viewProviders` - letting a route or component contribute a scoped command
|
|
99
|
-
* set
|
|
93
|
+
* set.
|
|
94
|
+
*
|
|
95
|
+
* A source is a static list, a `Signal` of commands, or a
|
|
96
|
+
* {@link CngxCommandSourceFactory} for a source that needs injection. The
|
|
97
|
+
* factory runs once in the injection context of the level it is registered
|
|
98
|
+
* at. Return a `Signal` from it to stay reactive: a factory returning a plain
|
|
99
|
+
* array (`() => store.items()`) is read at that first call and never again.
|
|
100
|
+
*
|
|
101
|
+
* ```ts
|
|
102
|
+
* // a source owned by a service
|
|
103
|
+
* { path: 'editor', providers: [provideCommands(() => inject(EditorStore).commands)] }
|
|
104
|
+
* ```
|
|
100
105
|
*
|
|
101
106
|
* A scoped call adds to the sets above it and never hides them, across route
|
|
102
107
|
* and component scopes: root and route scopes come first (outer to inner), then
|
|
@@ -114,10 +119,9 @@ declare const CNGX_COMMAND_SOURCE: InjectionToken<readonly CngxCommandSource[]>;
|
|
|
114
119
|
* @Component({ viewProviders: [provideCommands(editorCommands)] })
|
|
115
120
|
* ```
|
|
116
121
|
*
|
|
117
|
-
* @
|
|
118
|
-
* @since 0.1.0
|
|
122
|
+
* @since 0.3.0
|
|
119
123
|
*/
|
|
120
|
-
declare function provideCommands(...sources: CngxCommandSource[]): Provider[];
|
|
124
|
+
declare function provideCommands(...sources: (CngxCommandSource | CngxCommandSourceFactory)[]): Provider[];
|
|
121
125
|
/**
|
|
122
126
|
* Merges the command sources registered at this injector level and every level
|
|
123
127
|
* above it - route and component scopes alike - into one reactive
|
|
@@ -128,8 +132,7 @@ declare function provideCommands(...sources: CngxCommandSource[]): Provider[];
|
|
|
128
132
|
*
|
|
129
133
|
* Must run in an injection context.
|
|
130
134
|
*
|
|
131
|
-
* @
|
|
132
|
-
* @since 0.1.0
|
|
135
|
+
* @since 0.3.0
|
|
133
136
|
*/
|
|
134
137
|
declare function injectCommands(): Signal<readonly CngxCommand[]>;
|
|
135
138
|
|
|
@@ -138,8 +141,7 @@ declare function injectCommands(): Signal<readonly CngxCommand[]>;
|
|
|
138
141
|
* first. The palette renders these in order; the row slot reads `command` and
|
|
139
142
|
* the term to highlight.
|
|
140
143
|
*
|
|
141
|
-
* @
|
|
142
|
-
* @since 0.1.0
|
|
144
|
+
* @since 0.3.0
|
|
143
145
|
*/
|
|
144
146
|
interface CngxRankedCommand {
|
|
145
147
|
/** The matched command. */
|
|
@@ -151,8 +153,7 @@ interface CngxRankedCommand {
|
|
|
151
153
|
* @deprecated Use {@link CngxRankedCommand}. Published under the unprefixed
|
|
152
154
|
* name by mistake; the alias remains for compatibility and will be removed in
|
|
153
155
|
* a future major.
|
|
154
|
-
* @
|
|
155
|
-
* @since 0.1.0
|
|
156
|
+
* @since 0.3.0
|
|
156
157
|
*/
|
|
157
158
|
type RankedCommand = CngxRankedCommand;
|
|
158
159
|
/**
|
|
@@ -160,8 +161,7 @@ type RankedCommand = CngxRankedCommand;
|
|
|
160
161
|
* via {@link CNGX_COMMAND_MATCH_FACTORY} - a consumer drops in Levenshtein or a
|
|
161
162
|
* fuzzy engine without touching the panel.
|
|
162
163
|
*
|
|
163
|
-
* @
|
|
164
|
-
* @since 0.1.0
|
|
164
|
+
* @since 0.3.0
|
|
165
165
|
*/
|
|
166
166
|
type CngxCommandMatcher = (commands: readonly CngxCommand[], term: string, scope?: string) => readonly CngxRankedCommand[];
|
|
167
167
|
/**
|
|
@@ -177,8 +177,7 @@ type CngxCommandMatcher = (commands: readonly CngxCommand[], term: string, scope
|
|
|
177
177
|
* by its rules, e.g. Turkish `I` / `ı`; read inside a `computed()`, a locale
|
|
178
178
|
* switch re-ranks.
|
|
179
179
|
*
|
|
180
|
-
* @
|
|
181
|
-
* @since 0.1.0
|
|
180
|
+
* @since 0.3.0
|
|
182
181
|
*/
|
|
183
182
|
declare function createDefaultCommandMatcher(locale?: Signal<string>): CngxCommandMatcher;
|
|
184
183
|
|
|
@@ -187,8 +186,7 @@ declare function createDefaultCommandMatcher(locale?: Signal<string>): CngxComma
|
|
|
187
186
|
* captured so an override matches it precisely. The panel calls it in an
|
|
188
187
|
* injection context, so a factory may `inject()` what its matcher needs.
|
|
189
188
|
*
|
|
190
|
-
* @
|
|
191
|
-
* @since 0.1.0
|
|
189
|
+
* @since 0.3.0
|
|
192
190
|
*/
|
|
193
191
|
type CngxCommandMatchFactory = () => CngxCommandMatcher;
|
|
194
192
|
/**
|
|
@@ -198,10 +196,9 @@ type CngxCommandMatchFactory = () => CngxCommandMatcher;
|
|
|
198
196
|
* without touching the panel. The fuzzy engine stays a consumer swap; the
|
|
199
197
|
* default bundle ships only the pure ranker.
|
|
200
198
|
*
|
|
201
|
-
* @
|
|
202
|
-
* @since 0.1.0
|
|
199
|
+
* @since 0.3.0
|
|
203
200
|
*/
|
|
204
201
|
declare const CNGX_COMMAND_MATCH_FACTORY: InjectionToken<CngxCommandMatchFactory>;
|
|
205
202
|
|
|
206
|
-
export { CNGX_COMMAND_MATCH_FACTORY,
|
|
207
|
-
export type { CngxCommand, CngxCommandGroup, CngxCommandMatchFactory, CngxCommandMatcher, CngxCommandSource, CngxRankedCommand, CommandGroup, RankedCommand };
|
|
203
|
+
export { CNGX_COMMAND_MATCH_FACTORY, createDefaultCommandMatcher, injectCommands, provideCommands };
|
|
204
|
+
export type { CngxCommand, CngxCommandGroup, CngxCommandMatchFactory, CngxCommandMatcher, CngxCommandSource, CngxCommandSourceFactory, CngxRankedCommand, CommandGroup, RankedCommand };
|