@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9
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/card/README.md +2 -1
- package/command/README.md +29 -0
- package/data/README.md +15 -3
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +517 -184
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +62 -17
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +301 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1221 -479
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +97 -16
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1496 -499
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +236 -61
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +364 -93
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2040 -1046
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +955 -125
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +1293 -89
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +997 -453
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1794 -1265
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +151 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +37 -1
- package/package.json +20 -7
- package/popover/README.md +58 -2
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +11 -8
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +28 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +205 -28
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +345 -48
- package/types/cngx-common-command.d.ts +50 -10
- package/types/cngx-common-data.d.ts +743 -92
- package/types/cngx-common-dialog.d.ts +161 -10
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +910 -226
- package/types/cngx-common-layout.d.ts +603 -32
- package/types/cngx-common-popover.d.ts +612 -49
- package/types/cngx-common-stepper.d.ts +526 -237
- package/types/cngx-common-tabs.d.ts +358 -75
- package/types/cngx-common-timeline.d.ts +108 -22
|
@@ -40,12 +40,12 @@ interface CngxCommand {
|
|
|
40
40
|
/**
|
|
41
41
|
* A named cluster of commands. The palette renders grouped results (Recents on
|
|
42
42
|
* an empty query, then categories) and the consumer's async result source is a
|
|
43
|
-
* `CngxAsyncState<
|
|
43
|
+
* `CngxAsyncState<CngxCommandGroup[]>`.
|
|
44
44
|
*
|
|
45
45
|
* @category common/command
|
|
46
46
|
* @since 0.1.0
|
|
47
47
|
*/
|
|
48
|
-
interface
|
|
48
|
+
interface CngxCommandGroup {
|
|
49
49
|
/** Stable identity for the group header slot and change detection. */
|
|
50
50
|
readonly id: string;
|
|
51
51
|
/** Header label rendered above the group's commands. */
|
|
@@ -53,6 +53,14 @@ interface CommandGroup {
|
|
|
53
53
|
/** The commands in this group, in render order. */
|
|
54
54
|
readonly commands: readonly CngxCommand[];
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use {@link CngxCommandGroup}. Published under the unprefixed
|
|
58
|
+
* name by mistake; the alias remains for compatibility and will be removed in
|
|
59
|
+
* a future major.
|
|
60
|
+
* @category common/command
|
|
61
|
+
* @since 0.1.0
|
|
62
|
+
*/
|
|
63
|
+
type CommandGroup = CngxCommandGroup;
|
|
56
64
|
|
|
57
65
|
/**
|
|
58
66
|
* A command contribution. Either a static list or a reactive `Signal` of
|
|
@@ -67,7 +75,14 @@ type CngxCommandSource = Signal<readonly CngxCommand[]> | readonly CngxCommand[]
|
|
|
67
75
|
* Multi-token every `provideCommands` call contributes to. App parts register
|
|
68
76
|
* command sets against it without a central list, mirroring `provideCngxMenu`.
|
|
69
77
|
* The generic is the collected array (as with Angular's `HTTP_INTERCEPTORS`),
|
|
70
|
-
* so `inject(CNGX_COMMAND_SOURCE)` returns
|
|
78
|
+
* so `inject(CNGX_COMMAND_SOURCE)` returns the sources of the nearest level
|
|
79
|
+
* that provides it.
|
|
80
|
+
*
|
|
81
|
+
* This is the low-level form. Register through `provideCommands`, which also
|
|
82
|
+
* carries a level's sources into every scope below it. A raw multi-provider on
|
|
83
|
+
* this token is carried down only from a level that also calls
|
|
84
|
+
* `provideCommands`; on any other level it is read only when that level is the
|
|
85
|
+
* one `injectCommands` resolves as nearest.
|
|
71
86
|
*
|
|
72
87
|
* @category common/command
|
|
73
88
|
* @since 0.1.0
|
|
@@ -83,9 +98,18 @@ declare const CNGX_COMMAND_SOURCE: InjectionToken<readonly CngxCommandSource[]>;
|
|
|
83
98
|
* `viewProviders` - letting a route or component contribute a scoped command
|
|
84
99
|
* set without reaching for the raw {@link CNGX_COMMAND_SOURCE} multi-provider.
|
|
85
100
|
*
|
|
101
|
+
* A scoped call adds to the sets above it and never hides them, across route
|
|
102
|
+
* and component scopes: root and route scopes come first (outer to inner), then
|
|
103
|
+
* component scopes outer to inner. The same source reference registered at two
|
|
104
|
+
* levels is listed once. Command ids are unique in the merged list: a command
|
|
105
|
+
* whose `id` is already registered further out replaces that command in place,
|
|
106
|
+
* so a scope can swap a global command for its own version.
|
|
107
|
+
*
|
|
86
108
|
* ```ts
|
|
87
109
|
* // app root
|
|
88
110
|
* bootstrapApplication(AppComponent, { providers: [provideCommands(fileCommands)] });
|
|
111
|
+
* // a lazy route adds its set; its pages see fileCommands + reportCommands
|
|
112
|
+
* { path: 'reports', providers: [provideCommands(reportCommands)], component: Reports }
|
|
89
113
|
* // or component scope
|
|
90
114
|
* @Component({ viewProviders: [provideCommands(editorCommands)] })
|
|
91
115
|
* ```
|
|
@@ -95,7 +119,8 @@ declare const CNGX_COMMAND_SOURCE: InjectionToken<readonly CngxCommandSource[]>;
|
|
|
95
119
|
*/
|
|
96
120
|
declare function provideCommands(...sources: CngxCommandSource[]): Provider[];
|
|
97
121
|
/**
|
|
98
|
-
* Merges
|
|
122
|
+
* Merges the command sources registered at this injector level and every level
|
|
123
|
+
* above it - route and component scopes alike - into one reactive
|
|
99
124
|
* `Signal<readonly CngxCommand[]>`. The merge carries an explicit `equal`
|
|
100
125
|
* (length + per-command identity) so re-emitting an identical set - the same
|
|
101
126
|
* command references in the same order - does not produce a fresh array and
|
|
@@ -116,12 +141,20 @@ declare function injectCommands(): Signal<readonly CngxCommand[]>;
|
|
|
116
141
|
* @category common/command
|
|
117
142
|
* @since 0.1.0
|
|
118
143
|
*/
|
|
119
|
-
interface
|
|
144
|
+
interface CngxRankedCommand {
|
|
120
145
|
/** The matched command. */
|
|
121
146
|
readonly command: CngxCommand;
|
|
122
147
|
/** Relevance score for the query; higher ranks first. `0` for an empty query. */
|
|
123
148
|
readonly score: number;
|
|
124
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated Use {@link CngxRankedCommand}. Published under the unprefixed
|
|
152
|
+
* name by mistake; the alias remains for compatibility and will be removed in
|
|
153
|
+
* a future major.
|
|
154
|
+
* @category common/command
|
|
155
|
+
* @since 0.1.0
|
|
156
|
+
*/
|
|
157
|
+
type RankedCommand = CngxRankedCommand;
|
|
125
158
|
/**
|
|
126
159
|
* Ranks and filters a command set against a query and optional scope. Swappable
|
|
127
160
|
* via {@link CNGX_COMMAND_MATCH_FACTORY} - a consumer drops in Levenshtein or a
|
|
@@ -130,7 +163,7 @@ interface RankedCommand {
|
|
|
130
163
|
* @category common/command
|
|
131
164
|
* @since 0.1.0
|
|
132
165
|
*/
|
|
133
|
-
type CngxCommandMatcher = (commands: readonly CngxCommand[], term: string, scope?: string) => readonly
|
|
166
|
+
type CngxCommandMatcher = (commands: readonly CngxCommand[], term: string, scope?: string) => readonly CngxRankedCommand[];
|
|
134
167
|
/**
|
|
135
168
|
* Builds the default matcher: a pure label/keyword ranker. An empty query
|
|
136
169
|
* returns every (scoped) command at score `0` in registration order; a
|
|
@@ -138,14 +171,21 @@ type CngxCommandMatcher = (commands: readonly CngxCommand[], term: string, scope
|
|
|
138
171
|
* label-exact > label-prefix > label-substring > keyword. The optional scope
|
|
139
172
|
* filters to commands whose `group` equals it.
|
|
140
173
|
*
|
|
174
|
+
* Query, labels and keywords are compared case- and accent-tolerant
|
|
175
|
+
* ({@link foldForMatching}): `uber` finds `Über`. Pass the app locale (the
|
|
176
|
+
* default `CNGX_COMMAND_MATCH_FACTORY` passes `injectLocale()`) so case folds
|
|
177
|
+
* by its rules, e.g. Turkish `I` / `ı`; read inside a `computed()`, a locale
|
|
178
|
+
* switch re-ranks.
|
|
179
|
+
*
|
|
141
180
|
* @category common/command
|
|
142
181
|
* @since 0.1.0
|
|
143
182
|
*/
|
|
144
|
-
declare function createDefaultCommandMatcher(): CngxCommandMatcher;
|
|
183
|
+
declare function createDefaultCommandMatcher(locale?: Signal<string>): CngxCommandMatcher;
|
|
145
184
|
|
|
146
185
|
/**
|
|
147
186
|
* Factory producing a {@link CngxCommandMatcher}. The exact signature is
|
|
148
|
-
* captured so an override matches it precisely.
|
|
187
|
+
* captured so an override matches it precisely. The panel calls it in an
|
|
188
|
+
* injection context, so a factory may `inject()` what its matcher needs.
|
|
149
189
|
*
|
|
150
190
|
* @category common/command
|
|
151
191
|
* @since 0.1.0
|
|
@@ -153,7 +193,7 @@ declare function createDefaultCommandMatcher(): CngxCommandMatcher;
|
|
|
153
193
|
type CngxCommandMatchFactory = () => CngxCommandMatcher;
|
|
154
194
|
/**
|
|
155
195
|
* Swappable match-strategy seam. Defaults to {@link createDefaultCommandMatcher}
|
|
156
|
-
* (pure label/keyword ranking). Override it - app-wide via `providers` or
|
|
196
|
+
* (pure label/keyword ranking, case- and accent-tolerant in the app locale). Override it - app-wide via `providers` or
|
|
157
197
|
* per-component via `viewProviders` - to drop in a fuzzy/Levenshtein ranker
|
|
158
198
|
* without touching the panel. The fuzzy engine stays a consumer swap; the
|
|
159
199
|
* default bundle ships only the pure ranker.
|
|
@@ -164,4 +204,4 @@ type CngxCommandMatchFactory = () => CngxCommandMatcher;
|
|
|
164
204
|
declare const CNGX_COMMAND_MATCH_FACTORY: InjectionToken<CngxCommandMatchFactory>;
|
|
165
205
|
|
|
166
206
|
export { CNGX_COMMAND_MATCH_FACTORY, CNGX_COMMAND_SOURCE, createDefaultCommandMatcher, injectCommands, provideCommands };
|
|
167
|
-
export type { CngxCommand, CngxCommandMatchFactory, CngxCommandMatcher, CngxCommandSource, CommandGroup, RankedCommand };
|
|
207
|
+
export type { CngxCommand, CngxCommandGroup, CngxCommandMatchFactory, CngxCommandMatcher, CngxCommandSource, CngxRankedCommand, CommandGroup, RankedCommand };
|