be-intl 0.0.44 → 0.0.46

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/be-intl.js CHANGED
@@ -1,8 +1,19 @@
1
+ // @ts-check
2
+ import { propInfo, rejected, resolved } from 'be-enhanced/cc.js';
1
3
  import { BeValueAdded } from 'be-value-added/be-value-added.js';
4
+ /** @import {Actions, AP} from './types' */
5
+ /** @import {BEConfig, IEnhancement, BEAllProps} from './ts-refs/be-enhanced/types.d.ts' */
6
+
7
+ /**
8
+ * @implements {Actions}
9
+ */
2
10
  class BeIntl extends BeValueAdded {
11
+ /**
12
+ * @type {BEConfig<AP & BEAllProps, Actions & IEnhancement>}
13
+ */
3
14
  static config = {
4
15
  propInfo: {
5
- ...(super.config.propInfo),
16
+ ...propInfo,
6
17
  locale: {},
7
18
  format: {},
8
19
  intlDateFormat: {},
@@ -10,7 +21,7 @@ class BeIntl extends BeValueAdded {
10
21
  currency: {},
11
22
  },
12
23
  actions: {
13
- ...(super.config.actions),
24
+
14
25
  hydrate: {
15
26
  ifAllOf: ['attached'],
16
27
  },
@@ -28,9 +39,14 @@ class BeIntl extends BeValueAdded {
28
39
  }
29
40
  },
30
41
  positractions: [
31
- ...(super.config.positractions)
42
+ resolved, rejected,
32
43
  ]
33
44
  };
45
+ /**
46
+ *
47
+ * @param {AP & BEAllProps} self
48
+ * @returns {void}
49
+ */
34
50
  formatNumber(self) {
35
51
  const { enhancedElement, value } = self;
36
52
  if (value === undefined) {
@@ -42,7 +58,7 @@ class BeIntl extends BeValueAdded {
42
58
  }
43
59
  formatDate(self) {
44
60
  const { enhancedElement, value, intlNumberFormat } = self;
45
- enhancedElement.textContent = this.intlDateFormat.format(value);
61
+ enhancedElement.textContent = self.intlDateFormat.format(value);
46
62
  }
47
63
  onFormattingChange(self) {
48
64
  const { enhancedElement, locale, format, currency } = self;
package/behivior.js CHANGED
@@ -1,5 +1,11 @@
1
+ // @ts-check
1
2
  import { BeHive, MountObserver, seed } from 'be-hive/be-hive.js';
2
3
  const defaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
4
+ /** @import {EMC} from './ts-refs/trans-render/be/types.d.ts' */
5
+
6
+ /**
7
+ * @type {EMC}
8
+ */
3
9
  export const emc = {
4
10
  base: 'be-intl',
5
11
  branches: ['', 'style', 'currency', 'weekday', 'year', 'month', 'day'],
@@ -43,7 +49,10 @@ export const emc = {
43
49
  ],
44
50
  enhPropKey: 'beIntl',
45
51
  importEnh: async () => {
46
- const { BeIntl } = await import('./be-intl.js');
52
+ const { BeIntl } =
53
+ /** @type {{new(): IEnhancement<Element>}} */
54
+ /** @type {any} */
55
+ (await import('./be-intl.js'));
47
56
  return BeIntl;
48
57
  }
49
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-intl",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "keywords": [
5
5
  "web-components",
6
6
  "web-component",
@@ -27,15 +27,15 @@
27
27
  "update": "ncu -u && npm install"
28
28
  },
29
29
  "dependencies": {
30
- "be-enhanced": "0.0.114",
31
- "be-hive": "0.0.194",
32
- "be-propagating": "0.0.56",
33
- "be-value-added": "0.0.48",
34
- "trans-render": "0.0.801"
30
+ "be-enhanced": "0.0.131",
31
+ "be-hive": "0.0.201",
32
+ "be-propagating": "0.0.57",
33
+ "be-value-added": "0.0.50",
34
+ "trans-render": "0.0.821"
35
35
  },
36
36
  "devDependencies": {
37
37
  "may-it-serve": "0.0.8",
38
- "@playwright/test": "1.45.2"
38
+ "@playwright/test": "1.46.0"
39
39
  },
40
40
  "author": "anderson.bruce.b@gmail.com",
41
41
  "license": "MIT"
package/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ActionOnEventConfigs } from "trans-render/froop/types";
2
- import {BVAEndUserProps, BVAAllProps, BVAActions} from 'be-value-added/types';
1
+ import {BVAEndUserProps, BVAAllProps, BVAActions} from './ts-refs/be-value-added/types';
2
+ import {BEAllProps} from './ts-refs/be-enhanced/types';
3
3
 
4
4
  export interface EndUserProps extends BVAEndUserProps{
5
5
  format?: Intl.NumberFormatOptions | Intl.DateTimeFormatOptions,
@@ -11,7 +11,7 @@ export interface EndUserProps extends BVAEndUserProps{
11
11
  export interface AllProps extends EndUserProps, BVAAllProps{
12
12
  attached?: boolean;
13
13
  intlDateFormat?: Intl.DateTimeFormat,
14
- intlNumberFormat?: Intl.NumberFormat,
14
+ intlNumberFormat: Intl.NumberFormat,
15
15
  }
16
16
 
17
17
  export type AP = AllProps;
@@ -20,10 +20,9 @@ export type PAP = Partial<AP>;
20
20
 
21
21
  export type ProPAP = Promise<PAP>;
22
22
 
23
- export type POA = [PAP | undefined, ActionOnEventConfigs<PAP, Actions>];
24
23
 
25
24
  export interface Actions extends BVAActions {
26
- formatNumber(self: this): void;
25
+ formatNumber(self: AP & BEAllProps): void;
27
26
  formatDate(self: this): void;
28
27
  onFormattingChange(self: this): PAP;
29
28
  }
@@ -1,5 +1,11 @@
1
+ // @ts-check
1
2
  import { MountObserver, seed, BeHive } from 'be-hive/be-hive.js';
2
3
  import { emc as baseEMC } from './behivior.js';
4
+ /** @import {EMC} from './ts-refs/trans-render/be/types.d.ts' */
5
+
6
+ /**
7
+ * @type {EMC}
8
+ */
3
9
  export const emc = {
4
10
  ...baseEMC,
5
11
  base: '🌐',