abledom 0.5.0 → 0.6.1
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/dist/esm/index.js +614 -32
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.cts +62 -4
- package/dist/index.d.ts +62 -4
- package/dist/index.js +617 -32
- package/dist/index.js.map +1 -1
- package/dist/ts3.9/index.d.ts +56 -4
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -69,12 +69,13 @@ interface AbleDOMProps {
|
|
|
69
69
|
headless?: boolean;
|
|
70
70
|
callbacks?: {
|
|
71
71
|
onIssueAdded?(element: HTMLElement | null, rule: ValidationRule, issue: ValidationIssue): void;
|
|
72
|
-
onIssueUpdated?(element: HTMLElement
|
|
73
|
-
onIssueRemoved?(element: HTMLElement
|
|
72
|
+
onIssueUpdated?(element: HTMLElement, rule: ValidationRule, issue: ValidationIssue): void;
|
|
73
|
+
onIssueRemoved?(element: HTMLElement, rule: ValidationRule): void;
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
declare class AbleDOM {
|
|
77
77
|
private _win;
|
|
78
|
+
private _isDisposed;
|
|
78
79
|
private _props;
|
|
79
80
|
private _observer;
|
|
80
81
|
private _clearValidationTimeout;
|
|
@@ -87,19 +88,30 @@ declare class AbleDOM {
|
|
|
87
88
|
private _startFunc;
|
|
88
89
|
private _isStarted;
|
|
89
90
|
private _issuesUI;
|
|
91
|
+
private _elementHighlighter;
|
|
90
92
|
private _idlePromise;
|
|
91
93
|
private _idleResolve;
|
|
94
|
+
private _currentAnchoredIssues;
|
|
95
|
+
private _currentNotAnchoredIssues;
|
|
92
96
|
constructor(win: Window, props?: AbleDOMProps);
|
|
93
97
|
private _onElementId;
|
|
98
|
+
private _getHighlighter;
|
|
94
99
|
private _addIssue;
|
|
95
100
|
private _removeIssue;
|
|
96
101
|
private _validate;
|
|
97
102
|
private _processElementDependingOnIds;
|
|
103
|
+
private _updateCurrentAnchoredIssues;
|
|
104
|
+
private _onIssueAdded;
|
|
105
|
+
private _onIssueUpdated;
|
|
106
|
+
private _onIssueRemoved;
|
|
98
107
|
private _remove;
|
|
99
108
|
private _onFocusIn;
|
|
100
109
|
private _onFocusOut;
|
|
101
110
|
private _notifyAsync;
|
|
102
|
-
|
|
111
|
+
private _getCurrentIssues;
|
|
112
|
+
idle(): Promise<ValidationIssue[]>;
|
|
113
|
+
clearCurrentIssues(anchored?: boolean, notAnchored?: boolean): void;
|
|
114
|
+
highlightElement(element: HTMLElement | null, scrollIntoView?: boolean, autoHideTime?: number): void;
|
|
103
115
|
log: typeof console.error;
|
|
104
116
|
addRule(rule: ValidationRule): void;
|
|
105
117
|
removeRule(rule: ValidationRule): void;
|
|
@@ -219,6 +231,52 @@ declare class CustomNotifyRule extends ValidationRule {
|
|
|
219
231
|
customNotify(message: string, element?: HTMLElement): void;
|
|
220
232
|
}
|
|
221
233
|
|
|
234
|
+
/*!
|
|
235
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
236
|
+
* Licensed under the MIT License.
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
declare class RequiredParentRule extends ValidationRule {
|
|
240
|
+
type: ValidationRuleType;
|
|
241
|
+
name: string;
|
|
242
|
+
anchored: boolean;
|
|
243
|
+
private parentRequirements;
|
|
244
|
+
accept(element: HTMLElement): boolean;
|
|
245
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
246
|
+
private hasValidParent;
|
|
247
|
+
private createIssue;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/*!
|
|
251
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
252
|
+
* Licensed under the MIT License.
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
declare class NestedInteractiveElementRule extends ValidationRule {
|
|
256
|
+
type: ValidationRuleType;
|
|
257
|
+
name: string;
|
|
258
|
+
anchored: boolean;
|
|
259
|
+
private _isAriaHidden;
|
|
260
|
+
private _isInteractive;
|
|
261
|
+
private _findNestedInteractive;
|
|
262
|
+
accept(element: HTMLElement): boolean;
|
|
263
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/*!
|
|
267
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
268
|
+
* Licensed under the MIT License.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
declare class TabIndexRule extends ValidationRule {
|
|
272
|
+
type: ValidationRuleType;
|
|
273
|
+
name: string;
|
|
274
|
+
anchored: boolean;
|
|
275
|
+
accept(element: HTMLElement): boolean;
|
|
276
|
+
private isInteractiveElement;
|
|
277
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
278
|
+
}
|
|
279
|
+
|
|
222
280
|
interface HTMLElementAttributes {
|
|
223
281
|
readonly [name: string]: string;
|
|
224
282
|
}
|
|
@@ -228,4 +286,4 @@ declare function matchesSelector(element: HTMLElement, selector: string): boolea
|
|
|
228
286
|
declare function isDisplayNone(element: HTMLElement): boolean;
|
|
229
287
|
declare function isElementVisible(element: HTMLElement): boolean;
|
|
230
288
|
|
|
231
|
-
export { AbleDOM, type AbleDOMProps, AtomicRule, BadFocusRule, type BlurIssue, ContrastRule, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, type ValidationIssue, type ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
|
|
289
|
+
export { AbleDOM, type AbleDOMProps, AtomicRule, BadFocusRule, type BlurIssue, ContrastRule, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, NestedInteractiveElementRule, RequiredParentRule, TabIndexRule, type ValidationIssue, type ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,12 +69,13 @@ interface AbleDOMProps {
|
|
|
69
69
|
headless?: boolean;
|
|
70
70
|
callbacks?: {
|
|
71
71
|
onIssueAdded?(element: HTMLElement | null, rule: ValidationRule, issue: ValidationIssue): void;
|
|
72
|
-
onIssueUpdated?(element: HTMLElement
|
|
73
|
-
onIssueRemoved?(element: HTMLElement
|
|
72
|
+
onIssueUpdated?(element: HTMLElement, rule: ValidationRule, issue: ValidationIssue): void;
|
|
73
|
+
onIssueRemoved?(element: HTMLElement, rule: ValidationRule): void;
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
declare class AbleDOM {
|
|
77
77
|
private _win;
|
|
78
|
+
private _isDisposed;
|
|
78
79
|
private _props;
|
|
79
80
|
private _observer;
|
|
80
81
|
private _clearValidationTimeout;
|
|
@@ -87,19 +88,30 @@ declare class AbleDOM {
|
|
|
87
88
|
private _startFunc;
|
|
88
89
|
private _isStarted;
|
|
89
90
|
private _issuesUI;
|
|
91
|
+
private _elementHighlighter;
|
|
90
92
|
private _idlePromise;
|
|
91
93
|
private _idleResolve;
|
|
94
|
+
private _currentAnchoredIssues;
|
|
95
|
+
private _currentNotAnchoredIssues;
|
|
92
96
|
constructor(win: Window, props?: AbleDOMProps);
|
|
93
97
|
private _onElementId;
|
|
98
|
+
private _getHighlighter;
|
|
94
99
|
private _addIssue;
|
|
95
100
|
private _removeIssue;
|
|
96
101
|
private _validate;
|
|
97
102
|
private _processElementDependingOnIds;
|
|
103
|
+
private _updateCurrentAnchoredIssues;
|
|
104
|
+
private _onIssueAdded;
|
|
105
|
+
private _onIssueUpdated;
|
|
106
|
+
private _onIssueRemoved;
|
|
98
107
|
private _remove;
|
|
99
108
|
private _onFocusIn;
|
|
100
109
|
private _onFocusOut;
|
|
101
110
|
private _notifyAsync;
|
|
102
|
-
|
|
111
|
+
private _getCurrentIssues;
|
|
112
|
+
idle(): Promise<ValidationIssue[]>;
|
|
113
|
+
clearCurrentIssues(anchored?: boolean, notAnchored?: boolean): void;
|
|
114
|
+
highlightElement(element: HTMLElement | null, scrollIntoView?: boolean, autoHideTime?: number): void;
|
|
103
115
|
log: typeof console.error;
|
|
104
116
|
addRule(rule: ValidationRule): void;
|
|
105
117
|
removeRule(rule: ValidationRule): void;
|
|
@@ -219,6 +231,52 @@ declare class CustomNotifyRule extends ValidationRule {
|
|
|
219
231
|
customNotify(message: string, element?: HTMLElement): void;
|
|
220
232
|
}
|
|
221
233
|
|
|
234
|
+
/*!
|
|
235
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
236
|
+
* Licensed under the MIT License.
|
|
237
|
+
*/
|
|
238
|
+
|
|
239
|
+
declare class RequiredParentRule extends ValidationRule {
|
|
240
|
+
type: ValidationRuleType;
|
|
241
|
+
name: string;
|
|
242
|
+
anchored: boolean;
|
|
243
|
+
private parentRequirements;
|
|
244
|
+
accept(element: HTMLElement): boolean;
|
|
245
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
246
|
+
private hasValidParent;
|
|
247
|
+
private createIssue;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/*!
|
|
251
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
252
|
+
* Licensed under the MIT License.
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
declare class NestedInteractiveElementRule extends ValidationRule {
|
|
256
|
+
type: ValidationRuleType;
|
|
257
|
+
name: string;
|
|
258
|
+
anchored: boolean;
|
|
259
|
+
private _isAriaHidden;
|
|
260
|
+
private _isInteractive;
|
|
261
|
+
private _findNestedInteractive;
|
|
262
|
+
accept(element: HTMLElement): boolean;
|
|
263
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/*!
|
|
267
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
268
|
+
* Licensed under the MIT License.
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
declare class TabIndexRule extends ValidationRule {
|
|
272
|
+
type: ValidationRuleType;
|
|
273
|
+
name: string;
|
|
274
|
+
anchored: boolean;
|
|
275
|
+
accept(element: HTMLElement): boolean;
|
|
276
|
+
private isInteractiveElement;
|
|
277
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
278
|
+
}
|
|
279
|
+
|
|
222
280
|
interface HTMLElementAttributes {
|
|
223
281
|
readonly [name: string]: string;
|
|
224
282
|
}
|
|
@@ -228,4 +286,4 @@ declare function matchesSelector(element: HTMLElement, selector: string): boolea
|
|
|
228
286
|
declare function isDisplayNone(element: HTMLElement): boolean;
|
|
229
287
|
declare function isElementVisible(element: HTMLElement): boolean;
|
|
230
288
|
|
|
231
|
-
export { AbleDOM, type AbleDOMProps, AtomicRule, BadFocusRule, type BlurIssue, ContrastRule, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, type ValidationIssue, type ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
|
|
289
|
+
export { AbleDOM, type AbleDOMProps, AtomicRule, BadFocusRule, type BlurIssue, ContrastRule, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, NestedInteractiveElementRule, RequiredParentRule, TabIndexRule, type ValidationIssue, type ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
|