be-intl 0.0.11 → 0.0.13

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.
Files changed (3) hide show
  1. package/README.md +4 -0
  2. package/be-intl.js +6 -1
  3. package/package.json +9 -8
package/README.md CHANGED
@@ -17,6 +17,8 @@ emits
17
17
  <data value=123456.789 lang="de-DE" be-intl='{ "style": "currency", "currency": "EUR" }'>123.456,79 €</data>
18
18
  ```
19
19
 
20
+ The output element provides identical support.
21
+
20
22
  ```html
21
23
  <time lang="ar-EG" datetime=2011-11-18T14:54:39.929Z be-intl='{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }'></time>
22
24
  ```
@@ -51,3 +53,5 @@ import 'be-intl/be-intl.js';
51
53
  import 'https://esm.run/be-intl';
52
54
  </script>
53
55
  ```
56
+
57
+ [TODO] aria-polite ?
package/be-intl.js CHANGED
@@ -17,7 +17,8 @@ export class BeIntl extends BE {
17
17
  propagator.addEventListener('lang', e => {
18
18
  this.locale = e.detail.newVal;
19
19
  });
20
- switch (enhancedElement.localName) {
20
+ const { localName } = enhancedElement;
21
+ switch (localName) {
21
22
  case 'data':
22
23
  case 'output':
23
24
  {
@@ -37,10 +38,14 @@ export class BeIntl extends BE {
37
38
  if (val !== '') {
38
39
  this.value = JSON.parse(val);
39
40
  }
41
+ if (localName === 'data') {
42
+ enhancedElement.ariaLive = 'polite';
43
+ }
40
44
  }
41
45
  break;
42
46
  case 'time':
43
47
  {
48
+ enhancedElement.ariaLive = 'polite';
44
49
  propagator.addEventListener('dateTime', e => {
45
50
  const newVal = e.detail.newVal;
46
51
  switch (typeof newVal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-intl",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "keywords": [
5
5
  "web-components",
6
6
  "web-component",
@@ -22,18 +22,19 @@
22
22
  "scripts": {
23
23
  "test": "playwright test",
24
24
  "serve": "node node_modules/may-it-serve/serve.js",
25
- "safari": "npx playwright wk http://localhost:3030"
25
+ "safari": "npx playwright wk http://localhost:3030",
26
+ "update": "ncu -u && npm install"
26
27
  },
27
28
  "dependencies": {
28
- "be-enhanced": "0.0.33",
29
- "be-hive": "0.0.110",
30
- "be-propagating": "0.0.20",
31
- "trans-render": "0.0.693",
32
- "xtal-element": "0.0.571"
29
+ "be-enhanced": "0.0.37",
30
+ "be-hive": "0.0.116",
31
+ "be-propagating": "0.0.21",
32
+ "trans-render": "0.0.701",
33
+ "xtal-element": "0.0.575"
33
34
  },
34
35
  "devDependencies": {
35
36
  "may-it-serve": "0.0.5",
36
- "@playwright/test": "1.35.1"
37
+ "@playwright/test": "1.36.2"
37
38
  },
38
39
  "author": "anderson.bruce.b@gmail.com",
39
40
  "license": "MIT"