be-intl 0.0.2 → 0.0.4

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 +10 -0
  2. package/be-intl.js +12 -2
  3. package/package.json +40 -40
package/README.md CHANGED
@@ -17,6 +17,16 @@ 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
+ ```html
21
+ <time lang="ar-EG" datetime=2011-11-18T14:54:39.929Z be-intl='{ "weekday": "long", "year": "numeric", "month": "long", "day": "numeric" }'></time>
22
+ ```
23
+
24
+ emits
25
+
26
+ ```html
27
+ <time lang="ar-EG" datetime="2011-11-18T14:54:39.929Z" be-intl="{ &quot;weekday&quot;: &quot;long&quot;, &quot;year&quot;: &quot;numeric&quot;, &quot;month&quot;: &quot;long&quot;, &quot;day&quot;: &quot;numeric&quot; }">الجمعة، ١٨ نوفمبر ٢٠١١</time>
28
+ ```
29
+
20
30
  ## Viewing Locally
21
31
 
22
32
  1. Install git.
package/be-intl.js CHANGED
@@ -72,7 +72,12 @@ export class BeIntl extends BE {
72
72
  this.locale = enhancedElement.lang || defaultLocale;
73
73
  }
74
74
  formatNumber(self) {
75
- const { enhancedElement, value, intlNumberFormat } = self;
75
+ const { enhancedElement, value } = self;
76
+ if (value === undefined) {
77
+ enhancedElement.textContent = '';
78
+ return;
79
+ }
80
+ const { intlNumberFormat } = self;
76
81
  enhancedElement.textContent = intlNumberFormat.format(value);
77
82
  }
78
83
  formatDate(self) {
@@ -106,7 +111,12 @@ const xe = new XE({
106
111
  ...propDefaults,
107
112
  },
108
113
  propInfo: {
109
- ...propInfo
114
+ ...propInfo,
115
+ value: {
116
+ notify: {
117
+ dispatch: true
118
+ }
119
+ }
110
120
  },
111
121
  actions: {
112
122
  formatNumber: {
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "be-intl",
3
- "version": "0.0.2",
4
- "keywords": [
5
- "web-components",
6
- "web-component",
7
- "custom-element",
8
- "custom-elements"
9
- ],
10
- "description": "Format numbers, dates automatically and semantically.",
11
- "main": "be-intl.js",
12
- "module": "be-intl.js",
13
- "exports": {
14
- ".": "./be-intl.js",
15
- "./be-intl.js": "./be-intl.js"
16
- },
17
- "files": [
18
- "*.js",
19
- "types.d.ts"
20
- ],
21
- "types": "types.d.ts",
22
- "scripts": {
23
- "test": "playwright test",
24
- "serve": "node node_modules/may-it-serve/serve.js",
25
- "safari": "npx playwright wk http://localhost:3030"
26
- },
27
- "dependencies": {
28
- "be-enhanced": "0.0.21",
29
- "be-hive": "0.0.95",
30
- "be-propagating": "0.0.10",
31
- "trans-render": "0.0.683",
32
- "xtal-element": "0.0.562"
33
- },
34
- "devDependencies": {
35
- "may-it-serve": "0.0.5",
36
- "@playwright/test": "1.34.3"
37
- },
38
- "author": "",
39
- "license": "MIT"
40
- }
1
+ {
2
+ "name": "be-intl",
3
+ "version": "0.0.4",
4
+ "keywords": [
5
+ "web-components",
6
+ "web-component",
7
+ "custom-element",
8
+ "custom-elements"
9
+ ],
10
+ "description": "Format numbers, dates automatically and semantically.",
11
+ "main": "be-intl.js",
12
+ "module": "be-intl.js",
13
+ "exports": {
14
+ ".": "./be-intl.js",
15
+ "./be-intl.js": "./be-intl.js"
16
+ },
17
+ "files": [
18
+ "*.js",
19
+ "types.d.ts"
20
+ ],
21
+ "types": "types.d.ts",
22
+ "scripts": {
23
+ "test": "playwright test",
24
+ "serve": "node node_modules/may-it-serve/serve.js",
25
+ "safari": "npx playwright wk http://localhost:3030"
26
+ },
27
+ "dependencies": {
28
+ "be-enhanced": "0.0.28",
29
+ "be-hive": "0.0.103",
30
+ "be-propagating": "0.0.14",
31
+ "trans-render": "0.0.688",
32
+ "xtal-element": "0.0.566"
33
+ },
34
+ "devDependencies": {
35
+ "may-it-serve": "0.0.5",
36
+ "@playwright/test": "1.35.0"
37
+ },
38
+ "author": "anderson.bruce.b@gmail.com",
39
+ "license": "MIT"
40
+ }