@brightspace-ui/intl 3.5.3 → 3.6.0
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/lib/common.js +5 -0
- package/package.json +3 -3
package/lib/common.js
CHANGED
|
@@ -121,6 +121,7 @@ class DocumentLocaleSettings {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
this._overrides = val;
|
|
124
|
+
this._listeners.forEach((cb) => cb());
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
addChangeListener(cb) {
|
|
@@ -151,6 +152,7 @@ class DocumentLocaleSettings {
|
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
_handleObserverChange(mutations) {
|
|
155
|
+
let localeAttributeChange = false;
|
|
154
156
|
for (let i = 0; i < mutations.length; i++) {
|
|
155
157
|
const mutation = mutations[i];
|
|
156
158
|
if (mutation.attributeName === 'lang') {
|
|
@@ -161,10 +163,13 @@ class DocumentLocaleSettings {
|
|
|
161
163
|
this.overrides = this._tryParseHtmlElemAttr('data-intl-overrides', {});
|
|
162
164
|
} else if (mutation.attributeName === 'data-timezone') {
|
|
163
165
|
this.timezone = this._tryParseHtmlElemAttr('data-timezone', { name: '', identifier: '' });
|
|
166
|
+
localeAttributeChange = true;
|
|
164
167
|
} else if (mutation.attributeName === 'data-oslo') {
|
|
165
168
|
this.oslo = this._tryParseHtmlElemAttr('data-oslo', { batch: null, collection: null, version: null });
|
|
169
|
+
localeAttributeChange = true;
|
|
166
170
|
}
|
|
167
171
|
}
|
|
172
|
+
if (localeAttributeChange) this._listeners.forEach((cb) => cb());
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
_normalize(langTag) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Internationalization APIs for number, date, time and file size formatting and parsing in D2L Brightspace.",
|
|
5
5
|
"main": "lib/number.js",
|
|
6
6
|
"scripts": {
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"chai": "^4",
|
|
41
41
|
"concurrently": "^6",
|
|
42
42
|
"eslint": "^7",
|
|
43
|
-
"eslint-config-brightspace": "^0.
|
|
43
|
+
"eslint-config-brightspace": "^0.16",
|
|
44
44
|
"eslint-plugin-html": "^6",
|
|
45
45
|
"eslint-plugin-sort-class-members": "^1",
|
|
46
|
-
"http-server": "^
|
|
46
|
+
"http-server": "^14.0",
|
|
47
47
|
"mocha": "^9",
|
|
48
48
|
"mocha-headless-chrome": "^3"
|
|
49
49
|
}
|