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/ts3.9/index.d.ts
CHANGED
|
@@ -67,12 +67,13 @@ interface AbleDOMProps {
|
|
|
67
67
|
headless?: boolean;
|
|
68
68
|
callbacks?: {
|
|
69
69
|
onIssueAdded?(element: HTMLElement | null, rule: ValidationRule, issue: ValidationIssue): void;
|
|
70
|
-
onIssueUpdated?(element: HTMLElement
|
|
71
|
-
onIssueRemoved?(element: HTMLElement
|
|
70
|
+
onIssueUpdated?(element: HTMLElement, rule: ValidationRule, issue: ValidationIssue): void;
|
|
71
|
+
onIssueRemoved?(element: HTMLElement, rule: ValidationRule): void;
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
declare class AbleDOM {
|
|
75
75
|
private _win;
|
|
76
|
+
private _isDisposed;
|
|
76
77
|
private _props;
|
|
77
78
|
private _observer;
|
|
78
79
|
private _clearValidationTimeout;
|
|
@@ -85,19 +86,30 @@ declare class AbleDOM {
|
|
|
85
86
|
private _startFunc;
|
|
86
87
|
private _isStarted;
|
|
87
88
|
private _issuesUI;
|
|
89
|
+
private _elementHighlighter;
|
|
88
90
|
private _idlePromise;
|
|
89
91
|
private _idleResolve;
|
|
92
|
+
private _currentAnchoredIssues;
|
|
93
|
+
private _currentNotAnchoredIssues;
|
|
90
94
|
constructor(win: Window, props?: AbleDOMProps);
|
|
91
95
|
private _onElementId;
|
|
96
|
+
private _getHighlighter;
|
|
92
97
|
private _addIssue;
|
|
93
98
|
private _removeIssue;
|
|
94
99
|
private _validate;
|
|
95
100
|
private _processElementDependingOnIds;
|
|
101
|
+
private _updateCurrentAnchoredIssues;
|
|
102
|
+
private _onIssueAdded;
|
|
103
|
+
private _onIssueUpdated;
|
|
104
|
+
private _onIssueRemoved;
|
|
96
105
|
private _remove;
|
|
97
106
|
private _onFocusIn;
|
|
98
107
|
private _onFocusOut;
|
|
99
108
|
private _notifyAsync;
|
|
100
|
-
|
|
109
|
+
private _getCurrentIssues;
|
|
110
|
+
idle(): Promise<ValidationIssue[]>;
|
|
111
|
+
clearCurrentIssues(anchored?: boolean, notAnchored?: boolean): void;
|
|
112
|
+
highlightElement(element: HTMLElement | null, scrollIntoView?: boolean, autoHideTime?: number): void;
|
|
101
113
|
log: typeof console.error;
|
|
102
114
|
addRule(rule: ValidationRule): void;
|
|
103
115
|
removeRule(rule: ValidationRule): void;
|
|
@@ -202,6 +214,46 @@ declare class CustomNotifyRule extends ValidationRule {
|
|
|
202
214
|
anchored: boolean;
|
|
203
215
|
customNotify(message: string, element?: HTMLElement): void;
|
|
204
216
|
}
|
|
217
|
+
/*!
|
|
218
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
219
|
+
* Licensed under the MIT License.
|
|
220
|
+
*/
|
|
221
|
+
declare class RequiredParentRule extends ValidationRule {
|
|
222
|
+
type: ValidationRuleType;
|
|
223
|
+
name: string;
|
|
224
|
+
anchored: boolean;
|
|
225
|
+
private parentRequirements;
|
|
226
|
+
accept(element: HTMLElement): boolean;
|
|
227
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
228
|
+
private hasValidParent;
|
|
229
|
+
private createIssue;
|
|
230
|
+
}
|
|
231
|
+
/*!
|
|
232
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
233
|
+
* Licensed under the MIT License.
|
|
234
|
+
*/
|
|
235
|
+
declare class NestedInteractiveElementRule extends ValidationRule {
|
|
236
|
+
type: ValidationRuleType;
|
|
237
|
+
name: string;
|
|
238
|
+
anchored: boolean;
|
|
239
|
+
private _isAriaHidden;
|
|
240
|
+
private _isInteractive;
|
|
241
|
+
private _findNestedInteractive;
|
|
242
|
+
accept(element: HTMLElement): boolean;
|
|
243
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
244
|
+
}
|
|
245
|
+
/*!
|
|
246
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
247
|
+
* Licensed under the MIT License.
|
|
248
|
+
*/
|
|
249
|
+
declare class TabIndexRule extends ValidationRule {
|
|
250
|
+
type: ValidationRuleType;
|
|
251
|
+
name: string;
|
|
252
|
+
anchored: boolean;
|
|
253
|
+
accept(element: HTMLElement): boolean;
|
|
254
|
+
private isInteractiveElement;
|
|
255
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
256
|
+
}
|
|
205
257
|
interface HTMLElementAttributes {
|
|
206
258
|
readonly [name: string]: string;
|
|
207
259
|
}
|
|
@@ -210,4 +262,4 @@ declare function hasAccessibilityAttribute(attributes: HTMLElementAttributes): b
|
|
|
210
262
|
declare function matchesSelector(element: HTMLElement, selector: string): boolean;
|
|
211
263
|
declare function isDisplayNone(element: HTMLElement): boolean;
|
|
212
264
|
declare function isElementVisible(element: HTMLElement): boolean;
|
|
213
|
-
export { AbleDOM, AbleDOMProps, AtomicRule, BadFocusRule, BlurIssue, ContrastRule, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, ValidationIssue, ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
|
|
265
|
+
export { AbleDOM, AbleDOMProps, AtomicRule, BadFocusRule, BlurIssue, ContrastRule, CustomNotifyRule, ExistingIdRule, FindElementRule, FocusLostRule, FocusableElementLabelRule, NestedInteractiveElementRule, RequiredParentRule, TabIndexRule, ValidationIssue, ValidationResult, ValidationRule, ValidationRuleType, hasAccessibilityAttribute, isAccessibilityAffectingElement, isDisplayNone, isElementVisible, matchesSelector };
|