@microsoft/atlas-js
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -30,4 +30,2 @@ export declare const defaultMessageStrings: { | ||
weEncounteredAnUnexpectedError: string; | ||
} & { | ||
[key: string]: string; | ||
}; | ||
@@ -42,2 +40,16 @@ validators: Validator[]; | ||
disconnectedCallback(): void; | ||
getLocaleStrings(): { | ||
contentHasChanged: string; | ||
inputMaxLength: string; | ||
inputMinLength: string; | ||
inputRequired: string; | ||
notAuthenticated: string; | ||
notAuthorized: string; | ||
pleaseFixTheFollowingIssues: string; | ||
thereAreNoEditsToSubmit: string; | ||
tooManyRequests: string; | ||
weEncounteredAnUnexpectedError: string; | ||
} & { | ||
[key: string]: string; | ||
}; | ||
subscribe(target: EventTarget, type: string, listener: EventListenerObject): void; | ||
@@ -44,0 +56,0 @@ setDirty(): void; |
@@ -21,8 +21,3 @@ import { generateElementId, kebabToCamelCase } from '../utilities/util'; | ||
commitTimeout = 0; | ||
locStrings = Object.assign({}, defaultMessageStrings, Array.from(this.attributes) | ||
.filter(a => a.name.startsWith('loc-')) | ||
.reduce((map, a) => { | ||
map[kebabToCamelCase(a.name.substring(4))] = a.value; | ||
return map; | ||
}, {})); | ||
locStrings = defaultMessageStrings; | ||
validators = [ | ||
@@ -56,2 +51,3 @@ this.validateMinLength.bind(this), | ||
} | ||
this.locStrings = this.getLocaleStrings(); | ||
form.setAttribute('novalidate', ''); | ||
@@ -78,2 +74,11 @@ const errorSummaryContainer = document.createElement('div'); | ||
} | ||
getLocaleStrings() { | ||
const formLocaleStrings = Array.from(this.attributes) | ||
.filter(a => a.name.startsWith('loc-')) | ||
.reduce((map, a) => { | ||
map[kebabToCamelCase(a.name.substring(4))] = a.value; | ||
return map; | ||
}, {}); | ||
return Object.assign({}, defaultMessageStrings, formLocaleStrings); | ||
} | ||
subscribe(target, type, listener) { | ||
@@ -80,0 +85,0 @@ target.addEventListener(type, listener); |
{ | ||
"name": "@microsoft/atlas-js", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"public": true, | ||
@@ -5,0 +5,0 @@ "description": "Scripts backing the Atlas Design System used by Microsoft's Developer Relations.", |
@@ -25,12 +25,3 @@ import { generateElementId, kebabToCamelCase } from '../utilities/util'; | ||
commitTimeout = 0; | ||
locStrings = Object.assign( | ||
{}, | ||
defaultMessageStrings, | ||
Array.from(this.attributes) | ||
.filter(a => a.name.startsWith('loc-')) | ||
.reduce((map: { [key: string]: string }, a) => { | ||
map[kebabToCamelCase(a.name.substring(4)) as keyof LocStrings] = a.value; | ||
return map; | ||
}, {}) | ||
); | ||
locStrings = defaultMessageStrings; | ||
@@ -72,2 +63,3 @@ validators: Validator[] = [ | ||
this.locStrings = this.getLocaleStrings(); | ||
form.setAttribute('novalidate', ''); | ||
@@ -102,2 +94,13 @@ const errorSummaryContainer = document.createElement('div'); | ||
getLocaleStrings() { | ||
const formLocaleStrings = Array.from(this.attributes) | ||
.filter(a => a.name.startsWith('loc-')) | ||
.reduce((map: { [key: string]: string }, a) => { | ||
map[kebabToCamelCase(a.name.substring(4)) as keyof LocStrings] = a.value; | ||
return map; | ||
}, {}); | ||
return Object.assign({}, defaultMessageStrings, formLocaleStrings); | ||
} | ||
subscribe(target: EventTarget, type: string, listener: EventListenerObject) { | ||
@@ -104,0 +107,0 @@ target.addEventListener(type, listener); |
Sorry, the diff of this file is not supported yet
69621
1772