-
Notifications
You must be signed in to change notification settings - Fork 0
/
behivior.js
60 lines (59 loc) · 1.51 KB
/
behivior.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// @ts-check
import { BeHive, MountObserver, seed } from 'be-hive/be-hive.js';
const defaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
/** @import {EMC} from './ts-refs/trans-render/be/types.d.ts' */
/**
* @type {EMC}
*/
export const emc = {
base: 'be-intl',
branches: ['', 'style', 'currency', 'weekday', 'year', 'month', 'day'],
map: {
'0.0': {
instanceOf: 'Object',
mapsTo: 'format',
valIfFalsy: {},
},
'1.0': {
instanceOf: 'String',
mapsTo: '?.format?.style'
},
'2.0': {
instanceOf: 'String',
mapsTo: '?.format?.currency'
},
'3.0': {
instanceOf: 'String',
mapsTo: '?.format?.weekday'
},
'4.0': {
instanceOf: 'String',
mapsTo: '?.format?.year'
},
'5.0': {
instanceOf: 'String',
mapsTo: '?.format?.month'
},
'6.0': {
instanceOf: 'String',
mapsTo: '?.format?.day'
}
},
osotas: [
{
name: 'lang',
valIfNull: defaultLocale,
mapsTo: 'locale',
}
],
enhPropKey: 'beIntl',
importEnh: async () => {
const { BeIntl } =
/** @type {{new(): IEnhancement<Element>}} */
/** @type {any} */
(await import('./be-intl.js'));
return BeIntl;
}
};
const mose = seed(emc);
MountObserver.synthesize(document, BeHive, mose);