element-internals-polyfill
Advanced tools
Comparing version 0.1.46 to 0.1.47
@@ -5,2 +5,12 @@ # Changelog | ||
### [0.1.47](https://github.com/calebdwilliams/element-internals-polyfill/compare/v0.1.46...v0.1.47) (2021-11-26) | ||
### Bug Fixes | ||
* add ariaSetSize to AomMixin ([c11fcae](https://github.com/calebdwilliams/element-internals-polyfill/commit/c11fcae78a31c142bb876e63d0c7fbd3db9bde9b)) | ||
* correct typescript@^4.5.0 types ([68d41a4](https://github.com/calebdwilliams/element-internals-polyfill/commit/68d41a42244bd424aff62a34b5fb2c39fcbe677d)) | ||
* fix reconcileValidity spelling error ([2d2ca18](https://github.com/calebdwilliams/element-internals-polyfill/commit/2d2ca189e1b8ac722eb1fae995bddf465f776e97)) | ||
* update project to work with built-in ElementInternals types ([392703b](https://github.com/calebdwilliams/element-internals-polyfill/commit/392703b510ec808ff0ef059506edbb6acf2324f7)) | ||
### [0.1.46](https://github.com/calebdwilliams/element-internals-polyfill/compare/v0.1.45...v0.1.46) (2021-10-11) | ||
@@ -7,0 +17,0 @@ |
@@ -35,2 +35,3 @@ import { IElementInternals, ICustomElement, LabelsList } from './types'; | ||
ariaSelected: string; | ||
ariaSetSize: string; | ||
ariaSort: string; | ||
@@ -60,3 +61,3 @@ ariaValueMax: string; | ||
* reflecting the changes to be made to the element's validity. If the element is invalid, | ||
* the second argument sets the element's validition message. | ||
* the second argument sets the element's validation message. | ||
* | ||
@@ -63,0 +64,0 @@ * If the field is valid and a message is specified, the method will throw a TypeError. |
@@ -193,2 +193,3 @@ (function () { | ||
ariaSelected: 'aria-selected', | ||
ariaSetSize: 'aria-setsize', | ||
ariaSort: 'aria-sort', | ||
@@ -224,14 +225,14 @@ ariaValueMax: 'aria-valuemax', | ||
class ValidityState { | ||
badInput = false; | ||
customError = false; | ||
patternMismatch = false; | ||
rangeOverflow = false; | ||
rangeUnderflow = false; | ||
stepMismatch = false; | ||
tooLong = false; | ||
tooShort = false; | ||
typeMismatch = false; | ||
valid = true; | ||
valueMissing = false; | ||
constructor() { | ||
this.badInput = false; | ||
this.customError = false; | ||
this.patternMismatch = false; | ||
this.rangeOverflow = false; | ||
this.rangeUnderflow = false; | ||
this.stepMismatch = false; | ||
this.tooLong = false; | ||
this.tooShort = false; | ||
this.typeMismatch = false; | ||
this.valid = true; | ||
this.valueMissing = false; | ||
Object.seal(this); | ||
@@ -254,3 +255,3 @@ } | ||
}; | ||
const reconcileValidty = (validityObject, newState) => { | ||
const reconcileValidity = (validityObject, newState) => { | ||
validityObject.valid = isValid(newState); | ||
@@ -361,2 +362,44 @@ Object.keys(newState).forEach(key => validityObject[key] = newState[key]); | ||
class ElementInternals { | ||
ariaAtomic; | ||
ariaAutoComplete; | ||
ariaBusy; | ||
ariaChecked; | ||
ariaColCount; | ||
ariaColIndex; | ||
ariaColSpan; | ||
ariaCurrent; | ||
ariaDisabled; | ||
ariaExpanded; | ||
ariaHasPopup; | ||
ariaHidden; | ||
ariaKeyShortcuts; | ||
ariaLabel; | ||
ariaLevel; | ||
ariaLive; | ||
ariaModal; | ||
ariaMultiLine; | ||
ariaMultiSelectable; | ||
ariaOrientation; | ||
ariaPlaceholder; | ||
ariaPosInSet; | ||
ariaPressed; | ||
ariaReadOnly; | ||
ariaRelevant; | ||
ariaRequired; | ||
ariaRoleDescription; | ||
ariaRowCount; | ||
ariaRowIndex; | ||
ariaRowSpan; | ||
ariaSelected; | ||
ariaSetSize; | ||
ariaSort; | ||
ariaValueMax; | ||
ariaValueMin; | ||
ariaValueNow; | ||
ariaValueText; | ||
role; | ||
states; | ||
static get isPolyfilled() { | ||
return true; | ||
} | ||
constructor(ref) { | ||
@@ -380,5 +423,2 @@ if (!ref || !ref.tagName || ref.tagName.indexOf('-') === -1) { | ||
} | ||
static get isPolyfilled() { | ||
return true; | ||
} | ||
checkValidity() { | ||
@@ -469,3 +509,3 @@ const ref = refMap.get(this); | ||
delete check.valid; | ||
const { valid } = reconcileValidty(validity, check); | ||
const { valid } = reconcileValidity(validity, check); | ||
if (!valid && !validationMessage) { | ||
@@ -515,2 +555,3 @@ throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`); | ||
class ElementInternalsFeatureDetection extends HTMLElement { | ||
internals; | ||
constructor() { | ||
@@ -517,0 +558,0 @@ super(); |
@@ -35,2 +35,3 @@ import { CustomStateSet } from "./CustomStateSet"; | ||
ariaSelected: string; | ||
ariaSetSize: string; | ||
ariaSort: string; | ||
@@ -69,1 +70,6 @@ ariaValueMax: string; | ||
export declare type LabelsList = NodeListOf<HTMLLabelElement> | []; | ||
declare global { | ||
interface HTMLElement { | ||
attachInternals(): IElementInternals; | ||
} | ||
} |
@@ -28,3 +28,3 @@ /** Emulate the browser's default ValidityState object */ | ||
*/ | ||
export declare const reconcileValidty: (validityObject: ValidityState, newState: Partial<ValidityState>) => ValidityState; | ||
export declare const reconcileValidity: (validityObject: ValidityState, newState: Partial<ValidityState>) => ValidityState; | ||
/** | ||
@@ -31,0 +31,0 @@ * Check if a partial ValidityState object should be valid |
{ | ||
"name": "element-internals-polyfill", | ||
"version": "0.1.46", | ||
"version": "0.1.47", | ||
"description": "A polyfill for the element internals specification", | ||
@@ -78,4 +78,4 @@ "main": "dist/index.js", | ||
"tslib": "^2.1.0", | ||
"typescript": "^4.0.3" | ||
"typescript": "^4.5.2" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
68213
943