@ngutil/aria 0.0.80 → 0.0.82
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/fesm2022/ngutil-aria.mjs +88 -65
- package/fesm2022/ngutil-aria.mjs.map +1 -1
- package/focus/focus-state.directive.d.ts +1 -2
- package/focus/focus.service.d.ts +1 -1
- package/focus/focusable.directive.d.ts +0 -1
- package/package.json +7 -9
- package/ui-state/abstract.d.ts +1 -1
- package/ui-state/dirty.directive.d.ts +9 -0
- package/ui-state/index.d.ts +5 -3
- package/ui-state/progress-state.d.ts +1 -1
- package/esm2022/activity/activity.service.mjs +0 -49
- package/esm2022/activity/index.mjs +0 -2
- package/esm2022/focus/focus-state.directive.mjs +0 -63
- package/esm2022/focus/focus-trap.directive.mjs +0 -25
- package/esm2022/focus/focus.service.mjs +0 -145
- package/esm2022/focus/focusable.directive.mjs +0 -52
- package/esm2022/focus/index.mjs +0 -5
- package/esm2022/gestures/gesture-drag.mjs +0 -81
- package/esm2022/gestures/gesture-event.mjs +0 -44
- package/esm2022/gestures/gesture-longtap.mjs +0 -34
- package/esm2022/gestures/gesture-tap.mjs +0 -37
- package/esm2022/gestures/gesture.mjs +0 -66
- package/esm2022/gestures/gesture.service.mjs +0 -279
- package/esm2022/gestures/index.mjs +0 -7
- package/esm2022/index.mjs +0 -6
- package/esm2022/keystroke/index.mjs +0 -2
- package/esm2022/keystroke/keystroke.service.mjs +0 -92
- package/esm2022/ngutil-aria.mjs +0 -5
- package/esm2022/ui-state/abstract.mjs +0 -41
- package/esm2022/ui-state/busy.directive.mjs +0 -27
- package/esm2022/ui-state/disabled.directive.mjs +0 -28
- package/esm2022/ui-state/index.mjs +0 -25
- package/esm2022/ui-state/progress-state.mjs +0 -141
- package/esm2022/ui-state/readonly.directive.mjs +0 -27
- package/esm2022/ui-state/selector.mjs +0 -308
- package/esm2022/ui-state/ui-state.mjs +0 -91
package/fesm2022/ngutil-aria.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, NgZone, Injectable, ElementRef,
|
|
4
|
-
import { merge, fromEvent, map, share, filter, shareReplay, startWith, throttleTime, switchMap, timer, take, distinctUntilChanged, BehaviorSubject, connect, Subject, tap, finalize, combineLatest, Observable, of,
|
|
3
|
+
import { inject, NgZone, Injectable, ElementRef, Directive, input, computed, signal, untracked, effect, NgModule } from '@angular/core';
|
|
4
|
+
import { merge, fromEvent, map, share, filter, shareReplay, startWith, throttleTime, switchMap, timer, take, distinctUntilChanged, BehaviorSubject, connect, Subject, tap, finalize, combineLatest, Observable, of, EMPTY, from, debounceTime, scan, takeWhile, animationFrames } from 'rxjs';
|
|
5
5
|
import { FocusTrapFactory } from '@angular/cdk/a11y';
|
|
6
6
|
import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';
|
|
7
|
-
import { isEqual, clamp } from '
|
|
7
|
+
import { isEqual, clamp } from 'es-toolkit';
|
|
8
8
|
import { focusable, isFocusable } from 'tabbable';
|
|
9
9
|
import { coerceElement, Destructible, isElementInput, __zone_symbol__, isFalsy, isTruthy, deepClone, coerceBoolAttr } from '@ngutil/common';
|
|
10
10
|
|
|
@@ -45,10 +45,10 @@ class ActivityService {
|
|
|
45
45
|
watchInactvity(timeout) {
|
|
46
46
|
return this.events$.pipe(startWith(null), throttleTime(timeout / 2), switchMap(() => timer(0, timeout).pipe(take(2))), map(v => v !== 0), distinctUntilChanged(), shareReplay(1));
|
|
47
47
|
}
|
|
48
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
49
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ActivityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
49
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ActivityService, providedIn: "root" }); }
|
|
50
50
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ActivityService, decorators: [{
|
|
52
52
|
type: Injectable,
|
|
53
53
|
args: [{ providedIn: "root" }]
|
|
54
54
|
}] });
|
|
@@ -94,6 +94,7 @@ class FocusService {
|
|
|
94
94
|
overrides: this.#originOverrides
|
|
95
95
|
}).pipe(takeUntilDestroyed(), map(({ activity, focus, blur, overrides }) => {
|
|
96
96
|
const override = overrides.get(focus);
|
|
97
|
+
// console.log({ activity, focus, blur, overrides })
|
|
97
98
|
// If focus in with alt+tab
|
|
98
99
|
if (blur === document && activity.origin === "keyboard") {
|
|
99
100
|
return { origin: override || "program", element: focus };
|
|
@@ -103,7 +104,7 @@ class FocusService {
|
|
|
103
104
|
}
|
|
104
105
|
// If press tab button, first fire the event in the currently focused element
|
|
105
106
|
if (focus === blur) {
|
|
106
|
-
return null;
|
|
107
|
+
return { origin: null, element: focus };
|
|
107
108
|
}
|
|
108
109
|
// When press tab, the activity is on the current fucesd element,
|
|
109
110
|
// so when blur is changed to it, the focus change is completed
|
|
@@ -156,19 +157,24 @@ class FocusService {
|
|
|
156
157
|
#setOrigin(el, origin) {
|
|
157
158
|
const target = coerceElement(el);
|
|
158
159
|
const map = this.#originOverrides.value;
|
|
159
|
-
map.
|
|
160
|
-
|
|
160
|
+
const old = map.get(target);
|
|
161
|
+
if (old !== origin) {
|
|
162
|
+
map.set(target, origin);
|
|
163
|
+
this.#originOverrides.next(map);
|
|
164
|
+
}
|
|
161
165
|
}
|
|
162
166
|
#delOrigin(el) {
|
|
163
167
|
const target = coerceElement(el);
|
|
164
168
|
const map = this.#originOverrides.value;
|
|
165
|
-
map.
|
|
166
|
-
|
|
169
|
+
if (map.has(target)) {
|
|
170
|
+
map.delete(target);
|
|
171
|
+
this.#originOverrides.next(map);
|
|
172
|
+
}
|
|
167
173
|
}
|
|
168
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
169
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
174
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FocusService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
175
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FocusService, providedIn: "root" }); }
|
|
170
176
|
}
|
|
171
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FocusService, decorators: [{
|
|
172
178
|
type: Injectable,
|
|
173
179
|
args: [{ providedIn: "root" }]
|
|
174
180
|
}] });
|
|
@@ -226,14 +232,14 @@ class FocusState {
|
|
|
226
232
|
this.#self = this.#focus.watch(this.#el).pipe(takeUntilDestroyed(), shareReplay(1));
|
|
227
233
|
this.#connected = new BehaviorSubject([]);
|
|
228
234
|
this.#connEvent = this.#connected.pipe(switchMap(values => (values.length === 0 ? of([]) : combineLatest(values))), takeUntilDestroyed(), map(values => values.filter(v => v.origin != null)), map(values => values[0] || this.#default), shareReplay(1));
|
|
229
|
-
this.event$ = combineLatest([this.#self, this.#connEvent]).pipe(
|
|
235
|
+
this.event$ = combineLatest([this.#self, this.#connEvent]).pipe(
|
|
236
|
+
// debounceTime(100), // TODO: miért volt ez itt?
|
|
237
|
+
map(values => values.find(v => v.origin != null) || this.#default), shareReplay(1));
|
|
230
238
|
this.origin$ = this.event$.pipe(map(event => event.origin));
|
|
231
239
|
this.within$ = this.event$.pipe(map(event => (event.element !== this.#el.nativeElement ? event.origin : null)));
|
|
232
240
|
this.event = toSignal(this.event$, { rejectErrors: true, manualCleanup: true });
|
|
233
241
|
this.origin = toSignal(this.origin$, { rejectErrors: true, manualCleanup: true });
|
|
234
242
|
this.within = toSignal(this.within$, { rejectErrors: true, manualCleanup: true });
|
|
235
|
-
// TODO: miért kell ez?, ha nincs itt akkor nem frissül
|
|
236
|
-
effect(() => this.origin(), { allowSignalWrites: false });
|
|
237
243
|
this.#parent?.connect(this).pipe(takeUntilDestroyed()).subscribe();
|
|
238
244
|
}
|
|
239
245
|
connect(value) {
|
|
@@ -251,14 +257,13 @@ class FocusState {
|
|
|
251
257
|
};
|
|
252
258
|
});
|
|
253
259
|
}
|
|
254
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
255
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
260
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FocusState, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
261
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: FocusState, isStandalone: true, host: { properties: { "attr.focus": "origin()", "attr.focusWithin": "within()" } }, ngImport: i0 }); }
|
|
256
262
|
}
|
|
257
263
|
_a$1 = FocusState;
|
|
258
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: FocusState, decorators: [{
|
|
259
265
|
type: Directive,
|
|
260
266
|
args: [{
|
|
261
|
-
standalone: true,
|
|
262
267
|
host: {
|
|
263
268
|
"[attr.focus]": "origin()",
|
|
264
269
|
"[attr.focusWithin]": "within()"
|
|
@@ -286,8 +291,6 @@ class Focusable {
|
|
|
286
291
|
}
|
|
287
292
|
return 0;
|
|
288
293
|
});
|
|
289
|
-
// TODO: miért kell ez?, ha nincs itt akkor nem frissül
|
|
290
|
-
effect(() => this._tabindex(), { allowSignalWrites: false });
|
|
291
294
|
}
|
|
292
295
|
connect(value) {
|
|
293
296
|
if (value instanceof FocusState || isElementInput(value)) {
|
|
@@ -297,13 +300,12 @@ class Focusable {
|
|
|
297
300
|
return this.state.connect(value.state);
|
|
298
301
|
}
|
|
299
302
|
}
|
|
300
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
301
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: Focusable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
304
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: Focusable, isStandalone: true, selector: "[nuFocusable]", inputs: { focusable: { classPropertyName: "focusable", publicName: "nuFocusable", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.tabindex": "_tabindex()" } }, exportAs: ["nuFocusable"], hostDirectives: [{ directive: FocusState }], ngImport: i0 }); }
|
|
302
305
|
}
|
|
303
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: Focusable, decorators: [{
|
|
304
307
|
type: Directive,
|
|
305
308
|
args: [{
|
|
306
|
-
standalone: true,
|
|
307
309
|
selector: "[nuFocusable]",
|
|
308
310
|
exportAs: "nuFocusable",
|
|
309
311
|
host: {
|
|
@@ -311,7 +313,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
311
313
|
},
|
|
312
314
|
hostDirectives: [FocusState]
|
|
313
315
|
}]
|
|
314
|
-
}]
|
|
316
|
+
}] });
|
|
315
317
|
|
|
316
318
|
class KeystrokeService {
|
|
317
319
|
#document = inject(DOCUMENT);
|
|
@@ -368,10 +370,10 @@ class KeystrokeService {
|
|
|
368
370
|
#focusActivation(element) {
|
|
369
371
|
return this.#focusEvent.pipe(map(focused => focused === element || element.contains(focused)));
|
|
370
372
|
}
|
|
371
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
372
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
373
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: KeystrokeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
374
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: KeystrokeService, providedIn: "root" }); }
|
|
373
375
|
}
|
|
374
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: KeystrokeService, decorators: [{
|
|
375
377
|
type: Injectable,
|
|
376
378
|
args: [{ providedIn: "root" }]
|
|
377
379
|
}] });
|
|
@@ -868,10 +870,10 @@ class GestureService {
|
|
|
868
870
|
this.#lastTouchAction = undefined;
|
|
869
871
|
}
|
|
870
872
|
};
|
|
871
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
872
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
873
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: GestureService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
874
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: GestureService, providedIn: "root" }); }
|
|
873
875
|
}
|
|
874
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: GestureService, decorators: [{
|
|
875
877
|
type: Injectable,
|
|
876
878
|
args: [{ providedIn: "root" }]
|
|
877
879
|
}], ctorParameters: () => [] });
|
|
@@ -1311,13 +1313,13 @@ class UiState {
|
|
|
1311
1313
|
isInert() {
|
|
1312
1314
|
return this.is(this.inertSelector());
|
|
1313
1315
|
}
|
|
1314
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1315
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1316
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UiState, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1317
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: UiState, isStandalone: true, ngImport: i0 }); }
|
|
1316
1318
|
}
|
|
1317
1319
|
_a = UiState;
|
|
1318
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UiState, decorators: [{
|
|
1319
1321
|
type: Directive,
|
|
1320
|
-
args: [{
|
|
1322
|
+
args: [{}]
|
|
1321
1323
|
}] });
|
|
1322
1324
|
|
|
1323
1325
|
const NOTSET = Symbol("NOTSET");
|
|
@@ -1350,10 +1352,10 @@ class AbstractUiState {
|
|
|
1350
1352
|
wrap(observable, source) {
|
|
1351
1353
|
return this.state.wrap(observable, this.name, source);
|
|
1352
1354
|
}
|
|
1353
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1354
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1355
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AbstractUiState, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1356
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: AbstractUiState, isStandalone: true, ngImport: i0 }); }
|
|
1355
1357
|
}
|
|
1356
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: AbstractUiState, decorators: [{
|
|
1357
1359
|
type: Directive
|
|
1358
1360
|
}], ctorParameters: () => [{ type: undefined }] });
|
|
1359
1361
|
|
|
@@ -1363,15 +1365,14 @@ class BusyDirective extends AbstractUiState {
|
|
|
1363
1365
|
this.input = input(NOTSET, { alias: "nuBusy" });
|
|
1364
1366
|
this.when = input(NOTSET, { alias: "nuBusyWhen" });
|
|
1365
1367
|
}
|
|
1366
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1367
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1368
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BusyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1369
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: BusyDirective, isStandalone: true, selector: "[nuBusy], [nuBusyWhen]", inputs: { input: { classPropertyName: "input", publicName: "nuBusy", isSignal: true, isRequired: false, transformFunction: null }, when: { classPropertyName: "when", publicName: "nuBusyWhen", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-busy": "yes() ? 'true' : 'false'", "attr.inert": "state.isInert() ? '' : null" } }, providers: [UiState], exportAs: ["busy"], usesInheritance: true, ngImport: i0 }); }
|
|
1368
1370
|
}
|
|
1369
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1371
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: BusyDirective, decorators: [{
|
|
1370
1372
|
type: Directive,
|
|
1371
1373
|
args: [{
|
|
1372
1374
|
selector: "[nuBusy], [nuBusyWhen]",
|
|
1373
1375
|
exportAs: "busy",
|
|
1374
|
-
standalone: true,
|
|
1375
1376
|
host: {
|
|
1376
1377
|
"[attr.aria-busy]": "yes() ? 'true' : 'false'",
|
|
1377
1378
|
"[attr.inert]": "state.isInert() ? '' : null"
|
|
@@ -1380,21 +1381,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
1380
1381
|
}]
|
|
1381
1382
|
}], ctorParameters: () => [] });
|
|
1382
1383
|
|
|
1384
|
+
class DirtyDirective extends AbstractUiState {
|
|
1385
|
+
constructor() {
|
|
1386
|
+
super("dirty");
|
|
1387
|
+
this.input = input(NOTSET, { alias: "nuDirty" });
|
|
1388
|
+
this.when = input(NOTSET, { alias: "nuDirtyWhen" });
|
|
1389
|
+
}
|
|
1390
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DirtyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1391
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: DirtyDirective, isStandalone: true, selector: "[nuDirty], [nuDirtyWhen]", inputs: { input: { classPropertyName: "input", publicName: "nuDirty", isSignal: true, isRequired: false, transformFunction: null }, when: { classPropertyName: "when", publicName: "nuDirtyWhen", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.dirty": "yes() ? '' : null" } }, providers: [UiState], exportAs: ["dirty"], usesInheritance: true, ngImport: i0 }); }
|
|
1392
|
+
}
|
|
1393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DirtyDirective, decorators: [{
|
|
1394
|
+
type: Directive,
|
|
1395
|
+
args: [{
|
|
1396
|
+
selector: "[nuDirty], [nuDirtyWhen]",
|
|
1397
|
+
exportAs: "dirty",
|
|
1398
|
+
host: {
|
|
1399
|
+
"[attr.dirty]": "yes() ? '' : null"
|
|
1400
|
+
},
|
|
1401
|
+
providers: [UiState]
|
|
1402
|
+
}]
|
|
1403
|
+
}], ctorParameters: () => [] });
|
|
1404
|
+
|
|
1383
1405
|
class DisabledDirective extends AbstractUiState {
|
|
1384
1406
|
constructor() {
|
|
1385
1407
|
super("disabled");
|
|
1386
1408
|
this.input = input(NOTSET, { alias: "nuDisabled" });
|
|
1387
1409
|
this.when = input(NOTSET, { alias: "nuDisabledWhen" });
|
|
1388
1410
|
}
|
|
1389
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1390
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1411
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DisabledDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1412
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: DisabledDirective, isStandalone: true, selector: "[nuDisabled], [nuDisabledWhen]", inputs: { input: { classPropertyName: "input", publicName: "nuDisabled", isSignal: true, isRequired: false, transformFunction: null }, when: { classPropertyName: "when", publicName: "nuDisabledWhen", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-disabled": "yes() ? 'true' : 'false'", "attr.disabled": "yes() ? '' : null", "attr.inert": "state.isInert() ? '' : null" } }, providers: [UiState], exportAs: ["disabled"], usesInheritance: true, ngImport: i0 }); }
|
|
1391
1413
|
}
|
|
1392
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: DisabledDirective, decorators: [{
|
|
1393
1415
|
type: Directive,
|
|
1394
1416
|
args: [{
|
|
1395
1417
|
selector: "[nuDisabled], [nuDisabledWhen]",
|
|
1396
1418
|
exportAs: "disabled",
|
|
1397
|
-
standalone: true,
|
|
1398
1419
|
host: {
|
|
1399
1420
|
"[attr.aria-disabled]": "yes() ? 'true' : 'false'",
|
|
1400
1421
|
"[attr.disabled]": "yes() ? '' : null",
|
|
@@ -1410,15 +1431,14 @@ class ReadonlyDirective extends AbstractUiState {
|
|
|
1410
1431
|
this.input = input(NOTSET, { alias: "nuReadonly" });
|
|
1411
1432
|
this.when = input(NOTSET, { alias: "nuReadonlyWhen" });
|
|
1412
1433
|
}
|
|
1413
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1414
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1434
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ReadonlyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1435
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.8", type: ReadonlyDirective, isStandalone: true, selector: "[nuReadonly], [nuReadonlyWhen]", inputs: { input: { classPropertyName: "input", publicName: "nuReadonly", isSignal: true, isRequired: false, transformFunction: null }, when: { classPropertyName: "when", publicName: "nuReadonlyWhen", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-readonly": "yes() ? 'true' : 'false'", "attr.readonly": "yes() ? '' : null" } }, providers: [UiState], exportAs: ["readonly"], usesInheritance: true, ngImport: i0 }); }
|
|
1415
1436
|
}
|
|
1416
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ReadonlyDirective, decorators: [{
|
|
1417
1438
|
type: Directive,
|
|
1418
1439
|
args: [{
|
|
1419
1440
|
selector: "[nuReadonly], [nuReadonlyWhen]",
|
|
1420
1441
|
exportAs: "readonly",
|
|
1421
|
-
standalone: true,
|
|
1422
1442
|
host: {
|
|
1423
1443
|
"[attr.aria-readonly]": "yes() ? 'true' : 'false'",
|
|
1424
1444
|
"[attr.readonly]": "yes() ? '' : null"
|
|
@@ -1485,9 +1505,12 @@ class ProgressState {
|
|
|
1485
1505
|
}), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1486
1506
|
this.value$ = this.#state;
|
|
1487
1507
|
this.value = toSignal(this.value$);
|
|
1488
|
-
this.percent$ = this.value$.pipe(map(value =>
|
|
1489
|
-
|
|
1490
|
-
|
|
1508
|
+
this.percent$ = this.value$.pipe(map(value => {
|
|
1509
|
+
if (value == null) {
|
|
1510
|
+
return 0;
|
|
1511
|
+
}
|
|
1512
|
+
return clamp(Object.values(value).reduce((a, b) => a + b.share, 0), 0, 1);
|
|
1513
|
+
}), shareReplay({ bufferSize: 1, refCount: true }));
|
|
1491
1514
|
this.percent = toSignal(this.percent$);
|
|
1492
1515
|
}
|
|
1493
1516
|
#segments;
|
|
@@ -1521,10 +1544,10 @@ class ProgressState {
|
|
|
1521
1544
|
return res;
|
|
1522
1545
|
}, {});
|
|
1523
1546
|
}
|
|
1524
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1525
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1547
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ProgressState, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1548
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.8", type: ProgressState, isStandalone: true, ngImport: i0 }); }
|
|
1526
1549
|
}
|
|
1527
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: ProgressState, decorators: [{
|
|
1528
1551
|
type: Directive
|
|
1529
1552
|
}] });
|
|
1530
1553
|
class ProgressSegmentRef {
|
|
@@ -1563,13 +1586,13 @@ class ProgressSegmentRef {
|
|
|
1563
1586
|
}
|
|
1564
1587
|
}
|
|
1565
1588
|
|
|
1566
|
-
const entries = [BusyDirective, DisabledDirective, ReadonlyDirective];
|
|
1589
|
+
const entries = [BusyDirective, DirtyDirective, DisabledDirective, ReadonlyDirective];
|
|
1567
1590
|
class UiStateModule {
|
|
1568
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1569
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1570
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1591
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UiStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1592
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.8", ngImport: i0, type: UiStateModule, imports: [BusyDirective, DirtyDirective, DisabledDirective, ReadonlyDirective], exports: [BusyDirective, DirtyDirective, DisabledDirective, ReadonlyDirective] }); }
|
|
1593
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UiStateModule }); }
|
|
1571
1594
|
}
|
|
1572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.8", ngImport: i0, type: UiStateModule, decorators: [{
|
|
1573
1596
|
type: NgModule,
|
|
1574
1597
|
args: [{
|
|
1575
1598
|
imports: entries,
|
|
@@ -1581,5 +1604,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
1581
1604
|
* Generated bundle index. Do not edit.
|
|
1582
1605
|
*/
|
|
1583
1606
|
|
|
1584
|
-
export { AbstractUiState, ActivityService, BusyDirective, DisabledDirective, FocusService, FocusState, FocusTrap, Focusable, Gesture, GestureDrag, GestureDragHorizontal, GestureDragImpl, GestureDragVertical, GestureLongTap, GestureLongTapImpl, GestureService, GestureTap, GestureTapImpl, KeystrokeService, Listeners, NOTSET, ProgressSegmentRef, ProgressState, ReadonlyDirective, UiState, UiStateModule, gestureDrag, gestureLongTap, gestureTap };
|
|
1607
|
+
export { AbstractUiState, ActivityService, BusyDirective, DirtyDirective, DisabledDirective, FocusService, FocusState, FocusTrap, Focusable, Gesture, GestureDrag, GestureDragHorizontal, GestureDragImpl, GestureDragVertical, GestureLongTap, GestureLongTapImpl, GestureService, GestureTap, GestureTapImpl, KeystrokeService, Listeners, NOTSET, ProgressSegmentRef, ProgressState, ReadonlyDirective, UiState, UiStateModule, gestureDrag, gestureLongTap, gestureTap };
|
|
1585
1608
|
//# sourceMappingURL=ngutil-aria.mjs.map
|