@cngx/common 0.1.0-rc.8 → 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/command/README.md +29 -0
- package/data/README.md +5 -2
- package/fesm2022/cngx-common-a11y.mjs +403 -84
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +16 -13
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +4 -3
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +55 -36
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +60 -6
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +185 -37
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +86 -48
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +27 -23
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +324 -122
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +129 -26
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +947 -33
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +300 -166
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +251 -80
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +16 -10
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/layout/README.md +16 -0
- package/package.json +20 -7
- package/popover/README.md +40 -0
- 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 +5 -4
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +10 -6
- package/types/cngx-common-a11y.d.ts +167 -14
- package/types/cngx-common-chart.d.ts +8 -7
- package/types/cngx-common-command.d.ts +19 -2
- package/types/cngx-common-data.d.ts +164 -26
- package/types/cngx-common-dialog.d.ts +3 -7
- package/types/cngx-common-interactive.d.ts +52 -17
- package/types/cngx-common-layout.d.ts +37 -5
- package/types/cngx-common-popover.d.ts +353 -13
- package/types/cngx-common-stepper.d.ts +168 -129
- package/types/cngx-common-tabs.d.ts +149 -30
- package/types/cngx-common-timeline.d.ts +27 -7
|
@@ -443,12 +443,21 @@ declare class CngxFilterChip<TItem = unknown, TValue = unknown> {
|
|
|
443
443
|
* <example-url>http://localhost:4200/#/common/data/filter-chips/custom-chip-decoration-via-cngxfilterchip</example-url>
|
|
444
444
|
* <example-url>http://localhost:4200/#/common/data/filter-chips/multi-role-filter-wired-to-a-list</example-url>
|
|
445
445
|
*/
|
|
446
|
-
declare class CngxFilterChips<TItem = unknown, TValue = unknown> {
|
|
446
|
+
declare class CngxFilterChips<TItem = unknown, TValue = unknown, TListItem = TItem> {
|
|
447
447
|
readonly label: _angular_core.InputSignal<string>;
|
|
448
448
|
readonly options: _angular_core.InputSignal<readonly TItem[]>;
|
|
449
449
|
readonly optionLabel: _angular_core.InputSignal<(item: TItem) => string>;
|
|
450
450
|
readonly optionValue: _angular_core.InputSignal<(item: TItem) => TValue>;
|
|
451
|
-
readonly filterRef: _angular_core.InputSignal<CngxFilter<
|
|
451
|
+
readonly filterRef: _angular_core.InputSignal<CngxFilter<TListItem>>;
|
|
452
|
+
/**
|
|
453
|
+
* Extracts the comparable value from a filtered list item, when the list
|
|
454
|
+
* is shaped unlike the chip options: role options `{ id, label }` filtering
|
|
455
|
+
* an employee list by `employee.roleId`. Return an array for an item that
|
|
456
|
+
* carries several values (`employee.tags`); it matches when any of them is
|
|
457
|
+
* selected. Unbound, the predicate applies `optionValue` to the list items,
|
|
458
|
+
* which fits a list shaped like the options.
|
|
459
|
+
*/
|
|
460
|
+
readonly itemValue: _angular_core.InputSignal<((item: TListItem) => TValue | readonly TValue[]) | undefined>;
|
|
452
461
|
readonly filterKey: _angular_core.InputSignal<string>;
|
|
453
462
|
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
454
463
|
/**
|
|
@@ -485,14 +494,14 @@ declare class CngxFilterChips<TItem = unknown, TValue = unknown> {
|
|
|
485
494
|
/**
|
|
486
495
|
* Build the slot context for a given chip option. `optionValue` is
|
|
487
496
|
* invoked here per option for the chip rendering pass; the predicate
|
|
488
|
-
* closure invokes it again per LIST item for membership filtering
|
|
489
|
-
* Both invocations are necessary
|
|
490
|
-
* pool) and filtered list items (the
|
|
491
|
-
* separate data paths - they
|
|
492
|
-
*
|
|
493
|
-
* across the two paths without conflating them. Consumers
|
|
494
|
-
* keep `optionValue` cheap (typically a property lookup);
|
|
495
|
-
* `[itemValue]`
|
|
497
|
+
* closure invokes it again per LIST item for membership filtering
|
|
498
|
+
* while `[itemValue]` is unbound. Both invocations are necessary
|
|
499
|
+
* because option items (the chip pool) and filtered list items (the
|
|
500
|
+
* consumer's filtered data) are separate data paths - they share a
|
|
501
|
+
* shape only when `[itemValue]` is unbound, and the bridge cannot
|
|
502
|
+
* memoise across the two paths without conflating them. Consumers
|
|
503
|
+
* should keep `optionValue` cheap (typically a property lookup); bind
|
|
504
|
+
* `[itemValue]` when the list is shaped unlike the options.
|
|
496
505
|
*/
|
|
497
506
|
protected readonly chipContext: (option: TItem) => CngxFilterChipContext<TItem, TValue>;
|
|
498
507
|
/**
|
|
@@ -504,8 +513,9 @@ declare class CngxFilterChips<TItem = unknown, TValue = unknown> {
|
|
|
504
513
|
*/
|
|
505
514
|
readonly selectedValues: _angular_core.ModelSignal<TValue[]>;
|
|
506
515
|
constructor();
|
|
507
|
-
|
|
508
|
-
static
|
|
516
|
+
private itemKeys;
|
|
517
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxFilterChips<any, any, any>, never>;
|
|
518
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxFilterChips<any, any, any>, "cngx-filter-chips", ["cngxFilterChips"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; "options": { "alias": "options"; "required": true; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": true; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": true; "isSignal": true; }; "filterRef": { "alias": "filterRef"; "required": true; "isSignal": true; }; "itemValue": { "alias": "itemValue"; "required": false; "isSignal": true; }; "filterKey": { "alias": "filterKey"; "required": true; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "keyFn": { "alias": "keyFn"; "required": false; "isSignal": true; }; "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; "selectedValues": "selectedValuesChange"; }, ["chipTemplate"], never, true, never>;
|
|
509
519
|
}
|
|
510
520
|
|
|
511
521
|
/**
|
|
@@ -1101,6 +1111,16 @@ interface ManualAsyncState<T> extends CngxAsyncState<T> {
|
|
|
1101
1111
|
setSuccess(data: T): void;
|
|
1102
1112
|
/** Transition to `error`. */
|
|
1103
1113
|
setError(error: unknown): void;
|
|
1114
|
+
/**
|
|
1115
|
+
* Transition to `idle` without dropping what the state already holds.
|
|
1116
|
+
*
|
|
1117
|
+
* Clears `error` and `progress`; keeps `data`, `lastUpdated` and the
|
|
1118
|
+
* first-load flag. Use it when an operation ends without changing
|
|
1119
|
+
* anything (a commit the action refused): nothing was replaced, so
|
|
1120
|
+
* nothing is dropped, and no `success` edge is published that a
|
|
1121
|
+
* feedback bridge would report. `reset()` is the full wipe.
|
|
1122
|
+
*/
|
|
1123
|
+
setIdle(): void;
|
|
1104
1124
|
/** Set progress (0–100). */
|
|
1105
1125
|
setProgress(value: number | undefined): void;
|
|
1106
1126
|
/** Reset to `idle`, clear data, error, and progress. */
|
|
@@ -1406,21 +1426,32 @@ declare class CngxAsyncBoundary implements CngxStateful<readonly unknown[]> {
|
|
|
1406
1426
|
*/
|
|
1407
1427
|
declare function fromResource<T>(ref: Resource<T>): CngxAsyncState<T>;
|
|
1408
1428
|
|
|
1429
|
+
/**
|
|
1430
|
+
* Structural subset of Angular's `HttpProgressEvent` - the byte counts the
|
|
1431
|
+
* bridge reads. `total` is absent when the server sends no length.
|
|
1432
|
+
*/
|
|
1433
|
+
interface HttpProgressLike {
|
|
1434
|
+
readonly loaded: number;
|
|
1435
|
+
readonly total?: number;
|
|
1436
|
+
}
|
|
1409
1437
|
/**
|
|
1410
1438
|
* Shape of an `HttpResourceRef` - only the signals we need.
|
|
1411
1439
|
*
|
|
1412
1440
|
* Declared here to avoid a hard dependency on `@angular/common/http`.
|
|
1413
|
-
* The consumer passes the actual `httpResource()` return value
|
|
1414
|
-
*
|
|
1441
|
+
* The consumer passes the actual `httpResource()` return value, whose
|
|
1442
|
+
* `progress` signal carries the latest `HttpProgressEvent`.
|
|
1415
1443
|
*/
|
|
1416
1444
|
interface HttpResourceLike<T> extends Resource<T> {
|
|
1417
|
-
progress: () =>
|
|
1445
|
+
progress: () => HttpProgressLike | undefined;
|
|
1418
1446
|
}
|
|
1419
1447
|
/**
|
|
1420
1448
|
* Bridge that projects an Angular `httpResource()` ref onto `CngxAsyncState<T>`.
|
|
1421
1449
|
*
|
|
1422
1450
|
* Identical to `fromResource` but additionally maps the HTTP progress
|
|
1423
|
-
* signal to `CngxAsyncState.progress` (0
|
|
1451
|
+
* signal to `CngxAsyncState.progress` (0-100 scale): `loaded / total`,
|
|
1452
|
+
* rounded and clamped. With an unknown or zero `total` the progress is
|
|
1453
|
+
* `undefined` (indeterminate). Angular only emits progress events when the
|
|
1454
|
+
* request sets `reportProgress: true`.
|
|
1424
1455
|
*
|
|
1425
1456
|
* Must be called in an injection context.
|
|
1426
1457
|
*
|
|
@@ -1428,10 +1459,11 @@ interface HttpResourceLike<T> extends Resource<T> {
|
|
|
1428
1459
|
* private readonly res = httpResource<Item[]>(() => ({
|
|
1429
1460
|
* url: '/api/items',
|
|
1430
1461
|
* params: { q: this.filter() },
|
|
1462
|
+
* reportProgress: true,
|
|
1431
1463
|
* }));
|
|
1432
1464
|
*
|
|
1433
1465
|
* readonly items = fromHttpResource(this.res);
|
|
1434
|
-
* // items.progress() tracks
|
|
1466
|
+
* // items.progress() tracks download progress 0-100
|
|
1435
1467
|
* // <cngx-progress [state]="items"> - auto-wired progress bar
|
|
1436
1468
|
* ```
|
|
1437
1469
|
*
|
|
@@ -1522,7 +1554,8 @@ declare function tapAsyncProgress<E>(state: Pick<AsyncStateSink<unknown>, 'setPr
|
|
|
1522
1554
|
* 5. Call `setError(err)` on error
|
|
1523
1555
|
*
|
|
1524
1556
|
* The output Observable emits the **response body** (not HttpEvents).
|
|
1525
|
-
* Throws if the response body is
|
|
1557
|
+
* Throws a `CngxRuntimeError` with code `CNGX1054` if the response body is
|
|
1558
|
+
* `null`; the sink receives it through `setError(err)`.
|
|
1526
1559
|
*
|
|
1527
1560
|
* ```typescript
|
|
1528
1561
|
* readonly upload = createManualState<UploadResult>();
|
|
@@ -3046,8 +3079,8 @@ interface CngxCommitHandle {
|
|
|
3046
3079
|
readonly cancel: () => void;
|
|
3047
3080
|
}
|
|
3048
3081
|
/**
|
|
3049
|
-
* Action runner contract. Receives the controller's success/error
|
|
3050
|
-
* routes and returns a cancel handle. The runner is opaque to the
|
|
3082
|
+
* Action runner contract. Receives the controller's success / error /
|
|
3083
|
+
* refused routes and returns a cancel handle. The runner is opaque to the
|
|
3051
3084
|
* controller - it can wrap any async source (Observable, Promise,
|
|
3052
3085
|
* sync value) and any cancellation primitive.
|
|
3053
3086
|
*
|
|
@@ -3056,22 +3089,31 @@ interface CngxCommitHandle {
|
|
|
3056
3089
|
* runner adapts a `CngxStepperCommitAction`); the controller has no
|
|
3057
3090
|
* knowledge of the variant-specific action shape.
|
|
3058
3091
|
*
|
|
3092
|
+
* `onRefused` is for an action that declined on purpose (a `false`
|
|
3093
|
+
* answer): nothing changed, so the controller stores no error. A runner
|
|
3094
|
+
* whose action shape has no refusal (the select family) never calls it.
|
|
3095
|
+
*
|
|
3059
3096
|
* @category common/data/commit
|
|
3060
3097
|
*/
|
|
3061
3098
|
type CngxCommitRunner<T> = (handlers: {
|
|
3062
3099
|
readonly onSuccess: (committed: T | undefined) => void;
|
|
3063
3100
|
readonly onError: (err: unknown) => void;
|
|
3101
|
+
readonly onRefused: () => void;
|
|
3064
3102
|
}) => CngxCommitHandle;
|
|
3065
3103
|
/**
|
|
3066
3104
|
* Outcome handlers passed to `controller.begin(...)`. The controller
|
|
3067
|
-
* invokes exactly one of `onSuccess` / `onError`
|
|
3068
|
-
* (unless the commit is superseded, in which case
|
|
3105
|
+
* invokes exactly one of `onSuccess` / `onError` / `onRefused` per
|
|
3106
|
+
* commit lifecycle (unless the commit is superseded, in which case none
|
|
3107
|
+
* fires). `onRefused` is optional because only families whose action can
|
|
3108
|
+
* refuse (the stepper) route it; when it is omitted a refusal still
|
|
3109
|
+
* settles the state slot.
|
|
3069
3110
|
*
|
|
3070
3111
|
* @category common/data/commit
|
|
3071
3112
|
*/
|
|
3072
3113
|
interface CngxCommitBeginHandlers<T> {
|
|
3073
3114
|
readonly onSuccess: (committed: T | undefined) => void;
|
|
3074
3115
|
readonly onError: (err: unknown, previous: T | undefined) => void;
|
|
3116
|
+
readonly onRefused?: (previous: T | undefined) => void;
|
|
3075
3117
|
}
|
|
3076
3118
|
/**
|
|
3077
3119
|
* Encapsulated state machine for the async-commit lifecycle shared by
|
|
@@ -3085,6 +3127,15 @@ interface CngxCommitBeginHandlers<T> {
|
|
|
3085
3127
|
* - the "intended value" signal that drives the pending-spinner on
|
|
3086
3128
|
* the specific row / step the user just clicked.
|
|
3087
3129
|
*
|
|
3130
|
+
* Three outcomes settle a commit. Success stores the committed value.
|
|
3131
|
+
* Failure stores the error (`'error'`). A refusal - the action answered
|
|
3132
|
+
* `false` - goes back to `'idle'` through `setIdle()`: the error and the
|
|
3133
|
+
* intended value are cleared, while `data`, `lastUpdated` and
|
|
3134
|
+
* `isFirstLoad()` keep what the last success left, because a refusal
|
|
3135
|
+
* changed nothing. A custom controller (`CNGX_COMMIT_CONTROLLER_FACTORY`)
|
|
3136
|
+
* must hand the runner an `onRefused` route and forward it to
|
|
3137
|
+
* `handlers.onRefused`.
|
|
3138
|
+
*
|
|
3088
3139
|
* The controller is intentionally **not** an Angular service or
|
|
3089
3140
|
* provider. It's a plain factory so it works in any injection context
|
|
3090
3141
|
* (including outside Angular, for headless tests).
|
|
@@ -3111,8 +3162,8 @@ interface CngxCommitController<T> {
|
|
|
3111
3162
|
* @param runner variant-specific action runner (closes over the
|
|
3112
3163
|
* action and the intended value)
|
|
3113
3164
|
* @param intended the value the user clicked
|
|
3114
|
-
* @param previous the value to roll back to on error
|
|
3115
|
-
* @param handlers success/error routes - the controller only
|
|
3165
|
+
* @param previous the value to roll back to on error or refusal
|
|
3166
|
+
* @param handlers success/error/refused routes - the controller only
|
|
3116
3167
|
* updates its own state and calls these; it does
|
|
3117
3168
|
* NOT touch external value signals, panel open
|
|
3118
3169
|
* state, or component outputs.
|
|
@@ -3144,6 +3195,93 @@ interface CngxCommitController<T> {
|
|
|
3144
3195
|
*/
|
|
3145
3196
|
declare function createCommitController<T>(): CngxCommitController<T>;
|
|
3146
3197
|
|
|
3198
|
+
/**
|
|
3199
|
+
* How a commit-gated transition (a step change, a tab switch) ended when
|
|
3200
|
+
* it did not land.
|
|
3201
|
+
*
|
|
3202
|
+
* Modelled on the router: a guard answering `false` cancels a navigation
|
|
3203
|
+
* (`NavigationCancel`), only a throw is a `NavigationError`. Here a
|
|
3204
|
+
* `commitAction` answering `false` is `'refused'` - the action decided to
|
|
3205
|
+
* keep the user where they are, nothing failed and no error is stored -
|
|
3206
|
+
* while a throw, a rejected promise or an erroring observable is
|
|
3207
|
+
* `'failed'`. Both roll the transition back; only `'failed'` leaves the
|
|
3208
|
+
* commit state at `'error'`.
|
|
3209
|
+
*
|
|
3210
|
+
* `index` is the target the transition was refused or failed for (the
|
|
3211
|
+
* position the user did not reach). `sequence` is a per-host counter bumped exactly
|
|
3212
|
+
* once per settled refusal or failure, so two identical outcomes in a row
|
|
3213
|
+
* are still two events; a host that only moves the index (a closed tab
|
|
3214
|
+
* before the origin) copies the sequence instead of bumping it, so
|
|
3215
|
+
* nothing downstream treats the shift as a new outcome.
|
|
3216
|
+
*
|
|
3217
|
+
* @category common/data/commit
|
|
3218
|
+
*/
|
|
3219
|
+
interface CngxTransitionOutcome {
|
|
3220
|
+
readonly kind: 'refused' | 'failed';
|
|
3221
|
+
readonly index: number;
|
|
3222
|
+
readonly sequence: number;
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3225
|
+
/**
|
|
3226
|
+
* Options for {@link createRefusedPhrase}. Every field is a plain
|
|
3227
|
+
* reactive read, so the factory stays independent of any host type.
|
|
3228
|
+
*
|
|
3229
|
+
* @category common/data/commit
|
|
3230
|
+
* @since 0.1.0
|
|
3231
|
+
*/
|
|
3232
|
+
interface CngxRefusedPhraseOptions {
|
|
3233
|
+
/** The host's last refused or failed outcome, `undefined` once cleared. */
|
|
3234
|
+
readonly outcome: () => CngxTransitionOutcome | undefined;
|
|
3235
|
+
/** Commit status of the host; any change spends an armed phrase. */
|
|
3236
|
+
readonly status: () => unknown;
|
|
3237
|
+
/** Active index of the host; any move spends an armed phrase. */
|
|
3238
|
+
readonly activeIndex: () => number | undefined;
|
|
3239
|
+
/**
|
|
3240
|
+
* Copy voiced for a new refusal. Read untracked at arm time only, so a
|
|
3241
|
+
* language switch never re-speaks a phrase that was already voiced.
|
|
3242
|
+
*/
|
|
3243
|
+
readonly copy: () => string;
|
|
3244
|
+
/**
|
|
3245
|
+
* Optional extra expiry trigger: a changed value (compared with
|
|
3246
|
+
* `!==`) spends an armed phrase, e.g. a newer close announcement that
|
|
3247
|
+
* must not be masked by a stale refusal.
|
|
3248
|
+
*/
|
|
3249
|
+
readonly extraSpend?: () => unknown;
|
|
3250
|
+
}
|
|
3251
|
+
/**
|
|
3252
|
+
* Live-region phrase for a refused commit-gated transition (a step
|
|
3253
|
+
* change or tab switch whose `commitAction` answered `false`).
|
|
3254
|
+
*
|
|
3255
|
+
* A refusal settles the commit status back to `'idle'`, so no status
|
|
3256
|
+
* edge can voice it. This phrase arms on each new refused outcome (a new
|
|
3257
|
+
* `sequence`) and is spent by the next commit status change, an
|
|
3258
|
+
* active-index move, a cleared outcome or, when given, a changed
|
|
3259
|
+
* `extraSpend` value. A failed outcome never arms it. Arm wins over
|
|
3260
|
+
* spend in the same flush, so an optimistic rollback that moves the
|
|
3261
|
+
* active index still voices the refusal.
|
|
3262
|
+
*
|
|
3263
|
+
* Built on {@link createAnnouncementPhrase}: fully derived, no `effect`.
|
|
3264
|
+
* The same eager-read caveat applies - read the phrase before branching
|
|
3265
|
+
* on another arm of the live announcement, otherwise a spend transition
|
|
3266
|
+
* can be skipped.
|
|
3267
|
+
*
|
|
3268
|
+
* ```ts
|
|
3269
|
+
* const refusedPhrase = createRefusedPhrase({
|
|
3270
|
+
* outcome: () => presenter.lastOutcome(),
|
|
3271
|
+
* status: () => presenter.commitTransition.current(),
|
|
3272
|
+
* activeIndex: () => presenter.activeIndex(),
|
|
3273
|
+
* copy: () => i18n().commitRefusedGeneric,
|
|
3274
|
+
* });
|
|
3275
|
+
* ```
|
|
3276
|
+
*
|
|
3277
|
+
* @category common/data/commit
|
|
3278
|
+
* @wcag AA
|
|
3279
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/data/commit/refused-phrase.ts
|
|
3280
|
+
* @since 0.1.0
|
|
3281
|
+
* @relatedTo CngxTransitionOutcome, createAnnouncementPhrase
|
|
3282
|
+
*/
|
|
3283
|
+
declare function createRefusedPhrase(options: CngxRefusedPhraseOptions): Signal<string>;
|
|
3284
|
+
|
|
3147
3285
|
/**
|
|
3148
3286
|
* Factory signature for producing {@link CngxCommitController}
|
|
3149
3287
|
* instances. Consumers override the DI token
|
|
@@ -3382,5 +3520,5 @@ declare module '@cngx/core/i18n' {
|
|
|
3382
3520
|
}
|
|
3383
3521
|
}
|
|
3384
3522
|
|
|
3385
|
-
export { CNGX_ASYNC_LABEL, CNGX_ASYNC_SKIP, CNGX_BUCKET_PAGINATE_HOST, CNGX_COMMIT_CONTROLLER_FACTORY, CNGX_KPI_I18N, CNGX_KPI_LANGUAGE_EN, CNGX_RECYCLER_I18N, CNGX_RECYCLER_LANGUAGE_EN, CNGX_RECYCLER_PLACEHOLDER_ROW, CNGX_STAT, CngxAsync, CngxAsyncBoundary, CngxAsyncRegistry, CngxBucketPaginate, CngxDataSource, CngxDelta, CngxFilter, CngxFilterChip, CngxFilterChips, CngxGoal, CngxMeasure, CngxMetric, CngxPaginate, CngxPaginateResetOn, CngxPaginateRouting, CngxRecyclerAnnouncer, CngxRecyclerPlaceholder, CngxRecyclerRow, CngxSmartDataSource, CngxSort, CngxSortHeader, CngxStat, CngxStatCaption, CngxStatCoordinator, CngxStatDelta, CngxStatLabel, CngxStatValue, CngxTrend, CngxVirtualItem, cngxAsyncInterceptor, connectPaginateEmit, connectPaginateResetOn, connectRecyclerToActiveDescendant, connectRecyclerToRoving, createAsyncState, createCommitController, createForwardedAsyncState, createManualState, createMaterialBidirectionalSync, createSortHeaderState, fromHttpResource, fromResource, injectAsyncRegistry, injectAsyncState, injectDataSource, injectKpiI18n, injectLatencyProbe, injectRecycler, injectSmartDataSource, provideAsyncHttpObservability, provideAsyncRegistry, provideKpiI18n, provideRecyclerI18n, provideRecyclerPlaceholderRow, resolveAsyncView, tapAsyncProgress, tapAsyncState, tapHttpAsyncState, withAsyncLabel, withAsyncSkip, withKpiI18nLabels, withRecyclerI18nLabels };
|
|
3386
|
-
export type { AggregateFailure, AggregateSource, AsyncView, CngxAsyncContext, CngxAsyncOperation, CngxBucket, CngxBucketPaginateHost, CngxBucketPaginateView, CngxCommitBeginHandlers, CngxCommitController, CngxCommitControllerFactory, CngxCommitHandle, CngxCommitRunner, CngxFilterChipContext, CngxKpiI18n, CngxKpiI18nFeature, CngxKpiLanguageSection, CngxMaterialBidirectionalSyncHandle, CngxMaterialBidirectionalSyncOptions, CngxPaginateEmitHandlers, CngxRecycler, CngxRecyclerI18nFeature, CngxRecyclerLanguageSection, CngxRecyclerRowContext, CngxSmartDataSourceOptions, CngxStatRegistry, CngxStatSlotKind, CreateAsyncStateOptions, DeltaDirection, DeltaMode, DeltaPolarity, DeltaSentiment, InjectAsyncStateOptions, ManualAsyncState, MutableAsyncState, ReactiveAsyncState, RecyclerConfig, RecyclerI18n, SortEntry, SortHeaderState };
|
|
3523
|
+
export { CNGX_ASYNC_LABEL, CNGX_ASYNC_SKIP, CNGX_BUCKET_PAGINATE_HOST, CNGX_COMMIT_CONTROLLER_FACTORY, CNGX_KPI_I18N, CNGX_KPI_LANGUAGE_EN, CNGX_RECYCLER_I18N, CNGX_RECYCLER_LANGUAGE_EN, CNGX_RECYCLER_PLACEHOLDER_ROW, CNGX_STAT, CngxAsync, CngxAsyncBoundary, CngxAsyncRegistry, CngxBucketPaginate, CngxDataSource, CngxDelta, CngxFilter, CngxFilterChip, CngxFilterChips, CngxGoal, CngxMeasure, CngxMetric, CngxPaginate, CngxPaginateResetOn, CngxPaginateRouting, CngxRecyclerAnnouncer, CngxRecyclerPlaceholder, CngxRecyclerRow, CngxSmartDataSource, CngxSort, CngxSortHeader, CngxStat, CngxStatCaption, CngxStatCoordinator, CngxStatDelta, CngxStatLabel, CngxStatValue, CngxTrend, CngxVirtualItem, cngxAsyncInterceptor, connectPaginateEmit, connectPaginateResetOn, connectRecyclerToActiveDescendant, connectRecyclerToRoving, createAsyncState, createCommitController, createForwardedAsyncState, createManualState, createMaterialBidirectionalSync, createRefusedPhrase, createSortHeaderState, fromHttpResource, fromResource, injectAsyncRegistry, injectAsyncState, injectDataSource, injectKpiI18n, injectLatencyProbe, injectRecycler, injectSmartDataSource, provideAsyncHttpObservability, provideAsyncRegistry, provideKpiI18n, provideRecyclerI18n, provideRecyclerPlaceholderRow, resolveAsyncView, tapAsyncProgress, tapAsyncState, tapHttpAsyncState, withAsyncLabel, withAsyncSkip, withKpiI18nLabels, withRecyclerI18nLabels };
|
|
3524
|
+
export type { AggregateFailure, AggregateSource, AsyncView, CngxAsyncContext, CngxAsyncOperation, CngxBucket, CngxBucketPaginateHost, CngxBucketPaginateView, CngxCommitBeginHandlers, CngxCommitController, CngxCommitControllerFactory, CngxCommitHandle, CngxCommitRunner, CngxFilterChipContext, CngxKpiI18n, CngxKpiI18nFeature, CngxKpiLanguageSection, CngxMaterialBidirectionalSyncHandle, CngxMaterialBidirectionalSyncOptions, CngxPaginateEmitHandlers, CngxRecycler, CngxRecyclerI18nFeature, CngxRecyclerLanguageSection, CngxRecyclerRowContext, CngxRefusedPhraseOptions, CngxSmartDataSourceOptions, CngxStatRegistry, CngxStatSlotKind, CngxTransitionOutcome, CreateAsyncStateOptions, DeltaDirection, DeltaMode, DeltaPolarity, DeltaSentiment, InjectAsyncStateOptions, ManualAsyncState, MutableAsyncState, ReactiveAsyncState, RecyclerConfig, RecyclerI18n, SortEntry, SortHeaderState };
|
|
@@ -327,6 +327,8 @@ declare class CngxDialog<T = unknown> implements DialogRef<T>, CngxDialogAriaReg
|
|
|
327
327
|
protected readonly ariaDescribedBy: Signal<string | null>;
|
|
328
328
|
protected readonly backdropOpacity: Signal<"0" | "1">;
|
|
329
329
|
private liveRegion;
|
|
330
|
+
/** The title text the open announcement reads; `''` when there is none. */
|
|
331
|
+
private currentTitleText;
|
|
330
332
|
/**
|
|
331
333
|
* The modal mode latched at `open()`. Everything that depends on how the
|
|
332
334
|
* dialog actually opened derives from this - scroll-lock release, stack
|
|
@@ -421,13 +423,6 @@ declare class CngxDialog<T = unknown> implements DialogRef<T>, CngxDialogAriaReg
|
|
|
421
423
|
private scrollLockRelease;
|
|
422
424
|
private acquireScrollLock;
|
|
423
425
|
private releaseScrollLock;
|
|
424
|
-
/**
|
|
425
|
-
* The registry is single-slot per kind, so a second live registration
|
|
426
|
-
* silently wins - surface the authoring error instead of letting the
|
|
427
|
-
* two open paths resolve different labelling.
|
|
428
|
-
*/
|
|
429
|
-
private warnDoubleRegistration;
|
|
430
|
-
private warnNonModalA11y;
|
|
431
426
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDialog<any>, never>;
|
|
432
427
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxDialog<any>, "dialog[cngxDialog]", ["cngxDialog"], { "modal": { "alias": "modal"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "focusFallback": { "alias": "focusFallback"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "submitAction": { "alias": "submitAction"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; }, {}, ["titleDirective", "descriptionDirective"], never, true, never>;
|
|
433
428
|
}
|
|
@@ -1045,6 +1040,7 @@ declare class CngxDialogOpener {
|
|
|
1045
1040
|
*/
|
|
1046
1041
|
closeAll(): void;
|
|
1047
1042
|
private cleanup;
|
|
1043
|
+
private discardOutlet;
|
|
1048
1044
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDialogOpener, never>;
|
|
1049
1045
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CngxDialogOpener>;
|
|
1050
1046
|
}
|
|
@@ -3212,8 +3212,8 @@ declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMulti
|
|
|
3212
3212
|
* `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (multi, toolbar) - never the
|
|
3213
3213
|
* concrete group class - both with `{ optional: true }`.
|
|
3214
3214
|
*
|
|
3215
|
-
* Exactly one parent must be present; the constructor throws
|
|
3216
|
-
* neither resolve. The resolved parent is stored as a discriminated
|
|
3215
|
+
* Exactly one parent must be present; the constructor throws a
|
|
3216
|
+
* `CngxRuntimeError` when both (`CNGX1052`) or neither (`CNGX1053`) resolve. The resolved parent is stored as a discriminated
|
|
3217
3217
|
* union (`{ mode: 'single' | 'multi'; group }`) so every downstream
|
|
3218
3218
|
* branch narrows without non-null assertions.
|
|
3219
3219
|
*
|
|
@@ -3553,8 +3553,8 @@ declare class CngxRadio<T = unknown> {
|
|
|
3553
3553
|
/**
|
|
3554
3554
|
* Parent contract every chip-group molecule (`CngxChipGroup` single,
|
|
3555
3555
|
* `CngxMultiChipGroup` multi) provides via `useExisting`.
|
|
3556
|
-
* `CngxChipInGroup` leaves inject this token
|
|
3557
|
-
* the concrete group class - so the leaf stays decompose-ready and
|
|
3556
|
+
* `CngxChipInGroup` leaves inject this token through
|
|
3557
|
+
* `injectChipGroupHost()` - never the concrete group class - so the leaf stays decompose-ready and
|
|
3558
3558
|
* free of cyclic type dependencies, and the Phase 5 split between
|
|
3559
3559
|
* single + multi groups can share the same leaf implementation.
|
|
3560
3560
|
*
|
|
@@ -3585,10 +3585,9 @@ interface CngxChipGroupHost<T = unknown> {
|
|
|
3585
3585
|
* DI token a `CngxChipInGroup` leaf injects to find its parent chip
|
|
3586
3586
|
* group. Always provided via
|
|
3587
3587
|
* `{ provide: CNGX_CHIP_GROUP_HOST, useExisting: <Self> }` - never
|
|
3588
|
-
* via concrete-class injection. Required
|
|
3589
|
-
*
|
|
3590
|
-
*
|
|
3591
|
-
* worse).
|
|
3588
|
+
* via concrete-class injection. Required on the leaf side: a leaf
|
|
3589
|
+
* without a parent throws `CNGX1068` at construction (fail-fast -
|
|
3590
|
+
* silent dual-source-of-truth would be worse).
|
|
3592
3591
|
*
|
|
3593
3592
|
* Standalone chips outside any group use `[cngxChipInteraction]`
|
|
3594
3593
|
* instead, which provides `CNGX_CONTROL_VALUE` directly without ever
|
|
@@ -3756,7 +3755,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
3756
3755
|
* `@cngx/common/display` and wires `role="option"` semantics that
|
|
3757
3756
|
* defer all selection mutations to the surrounding chip-group via
|
|
3758
3757
|
* `CNGX_CHIP_GROUP_HOST`. Required parent (NOT optional): a
|
|
3759
|
-
* `[cngxChipInGroup]` outside any group throws `
|
|
3758
|
+
* `[cngxChipInGroup]` outside any group throws `CNGX1068`
|
|
3760
3759
|
* at construction. Standalone interactive chips use
|
|
3761
3760
|
* `[cngxChipInteraction]` instead.
|
|
3762
3761
|
*
|
|
@@ -3828,7 +3827,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
3828
3827
|
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
3829
3828
|
*/
|
|
3830
3829
|
declare class CngxChipInGroup<T = unknown> {
|
|
3831
|
-
protected readonly parent: CngxChipGroupHost<T>;
|
|
3830
|
+
protected readonly parent: _cngx_common_interactive.CngxChipGroupHost<T>;
|
|
3832
3831
|
readonly value: _angular_core.InputSignal<T>;
|
|
3833
3832
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
3834
3833
|
readonly describedBy: _angular_core.InputSignal<string | null>;
|
|
@@ -4212,7 +4211,8 @@ interface CngxTreeControllerOptions<T> {
|
|
|
4212
4211
|
* rather than a positional fallback.
|
|
4213
4212
|
*
|
|
4214
4213
|
* Resolution: per-options > app-wide `provideTreeConfig` default >
|
|
4215
|
-
*
|
|
4214
|
+
* `CngxRuntimeError` `CNGX1051`. At least one source must provide the
|
|
4215
|
+
* function.
|
|
4216
4216
|
*/
|
|
4217
4217
|
readonly nodeIdFn?: (value: T, path: readonly number[]) => string;
|
|
4218
4218
|
/**
|
|
@@ -5247,8 +5247,6 @@ declare class CngxReorder<T = unknown> {
|
|
|
5247
5247
|
constructor();
|
|
5248
5248
|
private wirePointer;
|
|
5249
5249
|
private wireKeyboard;
|
|
5250
|
-
private wireDevModeCheck;
|
|
5251
|
-
private parseIndex;
|
|
5252
5250
|
private modifierMatches;
|
|
5253
5251
|
private isReorderKey;
|
|
5254
5252
|
private emitMove;
|
|
@@ -5493,6 +5491,8 @@ declare class CngxSearch {
|
|
|
5493
5491
|
private readonly el;
|
|
5494
5492
|
private readonly renderer;
|
|
5495
5493
|
private readonly destroyRef;
|
|
5494
|
+
/** `clear()` notifier: switches the pipeline away from a pending debounce. */
|
|
5495
|
+
private readonly cleared;
|
|
5496
5496
|
constructor();
|
|
5497
5497
|
/** Clears the search term and resets the input element value. */
|
|
5498
5498
|
clear(): void;
|
|
@@ -5884,6 +5884,13 @@ declare const CNGX_OPTION_STATUS_HOST: InjectionToken<CngxOptionStatusHost>;
|
|
|
5884
5884
|
* Click highlights + activates, `pointerenter` highlights only. Provides a stable
|
|
5885
5885
|
* unique id on the host element for `aria-activedescendant` resolution.
|
|
5886
5886
|
*
|
|
5887
|
+
* An option never takes DOM focus. A mouse press keeps focus where it is: on
|
|
5888
|
+
* the external owner (a select trigger, a combobox or search input), or on the
|
|
5889
|
+
* enclosing `role="listbox"` when that listbox is its own tab stop
|
|
5890
|
+
* (`tabindex="0"`), which the press focuses if focus is elsewhere. Focusable
|
|
5891
|
+
* content inside an option, or a `tabindex` placed on the option itself, does
|
|
5892
|
+
* not receive focus from a click.
|
|
5893
|
+
*
|
|
5887
5894
|
* Selection state (`isSelected`) is driven externally by the enclosing listbox.
|
|
5888
5895
|
* In V1 of the stack, `CngxListbox` reads `value()` via the AD item list and
|
|
5889
5896
|
* exposes its own selection through `CngxOption.isSelected()`.
|
|
@@ -5987,6 +5994,7 @@ declare class CngxOption implements CngxAdItemHandle {
|
|
|
5987
5994
|
/** @internal Used by `CngxListbox` to sync selection state. */
|
|
5988
5995
|
markSelected(selected: boolean): void;
|
|
5989
5996
|
protected handleClick(): void;
|
|
5997
|
+
protected handleMouseDown(event: MouseEvent): void;
|
|
5990
5998
|
protected handlePointerEnter(): void;
|
|
5991
5999
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxOption, never>;
|
|
5992
6000
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxOption, "[cngxOption]", ["cngxOption"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "labelInput": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
@@ -6385,7 +6393,7 @@ declare class CngxListbox<T = unknown> {
|
|
|
6385
6393
|
private hasOption;
|
|
6386
6394
|
private handleActivation;
|
|
6387
6395
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxListbox<any>, never>;
|
|
6388
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxListbox<any>, "[cngxListbox]", ["cngxListbox"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "cngxSearchRef": { "alias": "cngxSearchRef"; "required": false; "isSignal": true; }; "externalActivation": { "alias": "externalActivation"; "required": false; "isSignal": true; }; "explicitOptions": { "alias": "explicitOptions"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "selectedValues": "selectedValuesChange"; }, ["contentOptions"], never, true, [{ directive: typeof i1.CngxActiveDescendant; inputs: { "items": "items"; "orientation": "orientation"; "loop": "loop"; "typeahead": "typeahead"; "autoHighlightFirst": "autoHighlightFirst"; "virtualCount": "virtualCount"; "windowStart": "windowStart"; }; outputs: { "activated": "activated"; }; }]>;
|
|
6396
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxListbox<any>, "[cngxListbox]", ["cngxListbox"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "cngxSearchRef": { "alias": "cngxSearchRef"; "required": false; "isSignal": true; }; "externalActivation": { "alias": "externalActivation"; "required": false; "isSignal": true; }; "explicitOptions": { "alias": "explicitOptions"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "selectedValues": "selectedValuesChange"; }, ["contentOptions"], never, true, [{ directive: typeof i1.CngxActiveDescendant; inputs: { "items": "items"; "orientation": "orientation"; "loop": "loop"; "typeahead": "typeahead"; "autoHighlightFirst": "autoHighlightFirst"; "virtualCount": "virtualCount"; "windowStart": "windowStart"; "compareWith": "compareWith"; }; outputs: { "activated": "activated"; }; }]>;
|
|
6389
6397
|
}
|
|
6390
6398
|
|
|
6391
6399
|
/**
|
|
@@ -6398,6 +6406,11 @@ interface PopoverController$1 {
|
|
|
6398
6406
|
readonly isVisible: () => boolean;
|
|
6399
6407
|
show(): void;
|
|
6400
6408
|
hide(): void;
|
|
6409
|
+
/**
|
|
6410
|
+
* Escape policy of the popover (`CngxPopover.closeOnEscape`). When it
|
|
6411
|
+
* reports `false` the trigger leaves Escape alone.
|
|
6412
|
+
*/
|
|
6413
|
+
readonly closeOnEscape?: () => boolean;
|
|
6401
6414
|
}
|
|
6402
6415
|
/**
|
|
6403
6416
|
* Trigger atom for listbox dropdowns.
|
|
@@ -6416,6 +6429,22 @@ interface PopoverController$1 {
|
|
|
6416
6429
|
* | open | Enter / Space | activate; close if `closeOnSelect()` |
|
|
6417
6430
|
* | any | Escape | close and restore focus to trigger |
|
|
6418
6431
|
*
|
|
6432
|
+
* On an `<input>` host with a co-located `CngxListboxSearch` (a combobox),
|
|
6433
|
+
* Space, Home and End are text-editing keys: they reach the input, open or
|
|
6434
|
+
* closed. Enter still activates and the arrows still navigate.
|
|
6435
|
+
*
|
|
6436
|
+
* Keys from an interactive descendant of the host (a chip remove button)
|
|
6437
|
+
* are left to that element.
|
|
6438
|
+
*
|
|
6439
|
+
* Pair it with `CngxPopoverTrigger` on the same element: that directive is
|
|
6440
|
+
* the one writer of `aria-haspopup`, `aria-expanded` and `aria-controls`.
|
|
6441
|
+
* This trigger writes none of them.
|
|
6442
|
+
*
|
|
6443
|
+
* The trigger keeps DOM focus, so it carries `aria-activedescendant`: the
|
|
6444
|
+
* listbox's active option id while the popover is open, no attribute while
|
|
6445
|
+
* closed (ARIA 1.2 combobox). It is the only writer of the attribute on
|
|
6446
|
+
* the trigger host; the listbox keeps its own for focus-in-listbox setups.
|
|
6447
|
+
*
|
|
6419
6448
|
* @category common/interactive/listbox
|
|
6420
6449
|
* @docsKind primary
|
|
6421
6450
|
* @wcag AA
|
|
@@ -6431,8 +6460,10 @@ declare class CngxListboxTrigger<T = unknown> {
|
|
|
6431
6460
|
readonly popover: _angular_core.InputSignal<PopoverController$1>;
|
|
6432
6461
|
/** Whether activating an option closes the popover. */
|
|
6433
6462
|
readonly closeOnSelect: _angular_core.InputSignal<boolean>;
|
|
6434
|
-
/** Mirrors `CngxPopover.isVisible()` for
|
|
6463
|
+
/** Mirrors `CngxPopover.isVisible()` for external read. */
|
|
6435
6464
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
6465
|
+
/** Active option id while open, `null` while closed. */
|
|
6466
|
+
protected readonly activeDescendant: _angular_core.Signal<string | null>;
|
|
6436
6467
|
/**
|
|
6437
6468
|
* Fires when the user presses Backspace on an empty input. Only
|
|
6438
6469
|
* emitted when the host element is an `<input>` with a co-located
|
|
@@ -6881,9 +6912,13 @@ declare class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {
|
|
|
6881
6912
|
/**
|
|
6882
6913
|
* Recommended `position-try-fallbacks` chain for menu submenu popovers.
|
|
6883
6914
|
*
|
|
6884
|
-
*
|
|
6915
|
+
* A template cannot read a module constant, so expose it as a component
|
|
6916
|
+
* field and bind that field on the submenu's `cngxPopover` element:
|
|
6917
|
+
* ```ts
|
|
6918
|
+
* protected readonly submenuFallbacks = CNGX_SUBMENU_TRY_FALLBACKS;
|
|
6919
|
+
* ```
|
|
6885
6920
|
* ```html
|
|
6886
|
-
* <div cngxPopover [positionTryFallbacks]="
|
|
6921
|
+
* <div cngxPopover [positionTryFallbacks]="submenuFallbacks">
|
|
6887
6922
|
* <!-- submenu items -->
|
|
6888
6923
|
* </div>
|
|
6889
6924
|
* ```
|
|
@@ -800,6 +800,37 @@ declare class CngxScrollLock {
|
|
|
800
800
|
* @relatedTo CngxScrollLock, CngxDialog
|
|
801
801
|
*/
|
|
802
802
|
declare function createScrollLock(html: HTMLElement): () => void;
|
|
803
|
+
/**
|
|
804
|
+
* Acquire a ref-counted scroll lock that pins the page body in place, for
|
|
805
|
+
* overlays that must hold on iOS Safari.
|
|
806
|
+
*
|
|
807
|
+
* `overflow: hidden` on the root does not stop iOS Safari from scrolling a
|
|
808
|
+
* page that was already scrolled, and the visual viewport drifts with it, so
|
|
809
|
+
* a bottom-fixed overlay ends above the visible bottom. The first pin saves
|
|
810
|
+
* the body's inline `position`, `top`, `inset-inline` and `overflow` and the
|
|
811
|
+
* scroll position, fixes the body at `top: -scrollY`, and acquires
|
|
812
|
+
* {@link createScrollLock} on the root. The last
|
|
813
|
+
* release restores the body, releases the root lock and scrolls back to the
|
|
814
|
+
* saved position. The returned release function is idempotent.
|
|
815
|
+
*
|
|
816
|
+
* `CngxDialog` and `CngxScrollLock` keep {@link createScrollLock}; reach for
|
|
817
|
+
* this one when the overlay is pinned to the viewport bottom on touch devices.
|
|
818
|
+
*
|
|
819
|
+
* ```typescript
|
|
820
|
+
* const release = createPinnedScrollLock(document.documentElement);
|
|
821
|
+
* // ... sheet open ...
|
|
822
|
+
* release();
|
|
823
|
+
* ```
|
|
824
|
+
*
|
|
825
|
+
* @param html - The document root (`document.documentElement`) to lock.
|
|
826
|
+
* @returns Release function for this acquisition. Idempotent.
|
|
827
|
+
*
|
|
828
|
+
* @category common/layout
|
|
829
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/layout/scroll/scroll-lock-core.ts
|
|
830
|
+
* @since 0.1.0
|
|
831
|
+
* @relatedTo createScrollLock, CngxPopoverSheet
|
|
832
|
+
*/
|
|
833
|
+
declare function createPinnedScrollLock(html: HTMLElement): () => void;
|
|
803
834
|
|
|
804
835
|
/**
|
|
805
836
|
* Reports which edges of a scrollport still hide content and reflects them as
|
|
@@ -1152,10 +1183,11 @@ declare class CngxStickyHeader {
|
|
|
1152
1183
|
/**
|
|
1153
1184
|
* The nearest ancestor that is a scroll container in the block axis - the scrollport
|
|
1154
1185
|
* `position: sticky` resolves against. Walks up from the host's parent to the first
|
|
1155
|
-
* ancestor whose computed `overflow-y` is
|
|
1156
|
-
* ancestor, i.e. the header sticks to the viewport.
|
|
1157
|
-
*
|
|
1158
|
-
*
|
|
1186
|
+
* ancestor whose computed `overflow-y` is `auto`, `scroll` or `hidden`; `null` means
|
|
1187
|
+
* no such ancestor, i.e. the header sticks to the viewport. `clip` clips without
|
|
1188
|
+
* creating a scroll container, so it is skipped. A used `overflow-x` of `auto`,
|
|
1189
|
+
* `scroll` or `hidden` coerces the computed `overflow-y` to `auto`, so this also
|
|
1190
|
+
* catches a horizontal scroll container (e.g. a data grid that scrolls sideways).
|
|
1159
1191
|
*/
|
|
1160
1192
|
private resolveScrollParent;
|
|
1161
1193
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxStickyHeader, never>;
|
|
@@ -1567,5 +1599,5 @@ declare function provideLayoutI18n(...features: readonly CngxLayoutI18nFeature[]
|
|
|
1567
1599
|
*/
|
|
1568
1600
|
declare function injectLayoutI18n(): Signal<CngxLayoutI18n>;
|
|
1569
1601
|
|
|
1570
|
-
export { CNGX_CONTAINER_SIZE, CNGX_LAYOUT_I18N, CNGX_LAYOUT_LANGUAGE_EN, CngxBackdrop, CngxContainer, CngxDrawer, CngxDrawerContent, CngxDrawerPanel, CngxExpandableText, CngxExpandableToggle, CngxHighlight, CngxInfiniteScroll, CngxIntersectionObserver, CngxMediaQuery, CngxResizeObserver, CngxScrollEdges, CngxScrollLock, CngxScrollSpy, CngxSkeleton, CngxStickyHeader, CngxTruncate, createContainerSize, createResizeSignal, createScrollEdges, createScrollLock, injectContainerSize, injectLayoutI18n, injectMediaQuery, injectQueryParamSync, observeResize, provideLayoutI18n, withLayoutI18nLabels };
|
|
1602
|
+
export { CNGX_CONTAINER_SIZE, CNGX_LAYOUT_I18N, CNGX_LAYOUT_LANGUAGE_EN, CngxBackdrop, CngxContainer, CngxDrawer, CngxDrawerContent, CngxDrawerPanel, CngxExpandableText, CngxExpandableToggle, CngxHighlight, CngxInfiniteScroll, CngxIntersectionObserver, CngxMediaQuery, CngxResizeObserver, CngxScrollEdges, CngxScrollLock, CngxScrollSpy, CngxSkeleton, CngxStickyHeader, CngxTruncate, createContainerSize, createPinnedScrollLock, createResizeSignal, createScrollEdges, createScrollLock, injectContainerSize, injectLayoutI18n, injectMediaQuery, injectQueryParamSync, observeResize, provideLayoutI18n, withLayoutI18nLabels };
|
|
1571
1603
|
export type { CngxContainerSize, CngxExpandableToggleContext, CngxLayoutI18n, CngxLayoutI18nFeature, CngxLayoutLanguageSection, CngxScrollEdgesState, DrawerMode, DrawerPosition, QueryParamSyncOptions, ResizeObserverHost, ScrollEdgesHost };
|