@shoelace-style/localize 1.1.1 → 1.1.2

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/fast.js CHANGED
@@ -18,6 +18,12 @@ export function localize() {
18
18
  return this.getAttribute('lang');
19
19
  }
20
20
  set lang(value) {
21
+ if (value === null || value === undefined) {
22
+ this.removeAttribute('lang');
23
+ }
24
+ else {
25
+ this.setAttribute('lang', value);
26
+ }
21
27
  connectedElements.set(this, value);
22
28
  this.updateLocalizedTerms();
23
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoelace-style/localize",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "A micro library for localizing custom elements.",
5
5
  "main": "/dist/index.js",
6
6
  "module": "/dist/index.js",
package/src/fast.ts CHANGED
@@ -27,11 +27,17 @@ export function localize() {
27
27
  connectedElements.delete(this as typeof targetClass);
28
28
  }
29
29
 
30
- get lang(): string {
30
+ get lang() {
31
31
  return this.getAttribute('lang');
32
32
  }
33
33
 
34
34
  set lang(value: string) {
35
+ if (value === null || value === undefined) {
36
+ this.removeAttribute('lang');
37
+ } else {
38
+ this.setAttribute('lang', value);
39
+ }
40
+
35
41
  connectedElements.set(this as typeof targetClass, value);
36
42
  this.updateLocalizedTerms();
37
43
  }