be-hive 0.0.229 → 0.0.231

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-hive.js CHANGED
@@ -134,7 +134,7 @@ export class BeHive extends Synthesizer {
134
134
  (await import('./e.js')).e(mergeWithDefaults, mountedElement, ws, initialPropValues);
135
135
  }
136
136
  //initialPropValues.scopedCustomHandlers = scopedHandlers.get(synConfig.top)?.get(enhPropKey);
137
- enhancementInstance.attach(mountedElement, {
137
+ await enhancementInstance.attach(mountedElement, {
138
138
  initialAttrInfo,
139
139
  initialPropValues,
140
140
  mountCnfg: mergeWithDefaults,
package/be-hive.ts CHANGED
@@ -156,7 +156,7 @@ export class BeHive extends Synthesizer {
156
156
  (await import('./e.js')).e(mergeWithDefaults, mountedElement, ws, initialPropValues);
157
157
  }
158
158
  //initialPropValues.scopedCustomHandlers = scopedHandlers.get(synConfig.top)?.get(enhPropKey);
159
- enhancementInstance.attach(mountedElement, {
159
+ await enhancementInstance.attach(mountedElement, {
160
160
  initialAttrInfo,
161
161
  initialPropValues,
162
162
  mountCnfg: mergeWithDefaults,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-hive",
3
- "version": "0.0.229",
3
+ "version": "0.0.231",
4
4
  "keywords": [
5
5
  "web-components",
6
6
  "web-component",
@@ -45,9 +45,9 @@
45
45
  "update": "ncu -u && npm install"
46
46
  },
47
47
  "dependencies": {
48
- "be-enhanced": "0.0.149",
48
+ "be-enhanced": "0.0.151",
49
49
  "mount-observer": "0.0.39",
50
- "trans-render": "0.0.855"
50
+ "trans-render": "0.0.857"
51
51
  },
52
52
  "devDependencies": {
53
53
  "ssi-server": "0.0.1"
package/prsObj.js CHANGED
@@ -1,85 +1,85 @@
1
- export async function prsObj(prop, newValue, initialPropValues, attr) {
2
- const { instanceOf, mapsTo, valIfFalsy } = prop;
3
- let valToSet = newValue;
4
- if (valIfFalsy !== undefined && !newValue && mapsTo) {
5
- if (mapsTo === '.') {
6
- if (typeof valIfFalsy === 'object') {
7
- Object.assign(initialPropValues, valIfFalsy);
8
- }
9
- else {
10
- throw 'NI';
11
- }
12
- }
13
- else {
14
- initialPropValues[mapsTo] = valIfFalsy;
15
- }
16
- }
17
- else {
18
- switch (instanceOf) {
19
- case 'Object':
20
- if (!newValue)
21
- return;
22
- try {
23
- valToSet = JSON.parse(newValue);
24
- }
25
- catch (e) {
26
- throw { err: 400, attr, newValue };
27
- }
28
- if (mapsTo === undefined)
29
- throw 400;
30
- if (mapsTo === '.') {
31
- Object.assign(initialPropValues, valToSet);
32
- }
33
- else {
34
- initialPropValues[mapsTo] = valToSet;
35
- }
36
- break;
37
- case 'String':
38
- initialPropValues[mapsTo] = valToSet;
39
- break;
40
- case 'Boolean':
41
- initialPropValues[mapsTo] = valToSet !== null;
42
- break;
43
- case 'Number':
44
- initialPropValues[mapsTo] = Number(valToSet);
45
- break;
46
- case 'DSSArray':
47
- case 'Object$tring':
48
- case 'Object$entences':
49
- const { strValMapsTo, objValMapsTo, arrValMapsTo } = prop;
50
- let parsedObj;
51
- switch (instanceOf) {
52
- case 'Object$tring':
53
- const { Object$tring } = await import('trans-render/Object$tring.js');
54
- parsedObj = new Object$tring(newValue);
55
- break;
56
- case 'Object$entences':
57
- const { Object$entences } = await import('trans-render/Object$entences.js');
58
- parsedObj = new Object$entences(newValue, prop);
59
- break;
60
- case 'DSSArray':
61
- const { DSSArray } = await import('trans-render/DSSArray.js');
62
- parsedObj = new DSSArray(newValue);
63
- break;
64
- }
65
- await parsedObj.parse();
66
- if (parsedObj.strVal && strValMapsTo !== undefined) {
67
- initialPropValues[strValMapsTo] = parsedObj.strVal;
68
- }
69
- if (parsedObj.objVal && objValMapsTo !== undefined) {
70
- if (objValMapsTo === '.') {
71
- Object.assign(initialPropValues, parsedObj.objVal);
72
- }
73
- else {
74
- initialPropValues[objValMapsTo] = parsedObj.objVal;
75
- }
76
- }
77
- else if (parsedObj.arrVal && arrValMapsTo !== undefined) {
78
- initialPropValues[arrValMapsTo] = parsedObj.arrVal;
79
- }
80
- break;
81
- default:
82
- throw 'NI';
83
- }
84
- }
85
- }
1
+ export async function prsObj(prop, newValue, initialPropValues, attr) {
2
+ const { instanceOf, mapsTo, valIfFalsy } = prop;
3
+ let valToSet = newValue;
4
+ if (valIfFalsy !== undefined && !newValue && mapsTo) {
5
+ if (mapsTo === '.') {
6
+ if (typeof valIfFalsy === 'object') {
7
+ Object.assign(initialPropValues, valIfFalsy);
8
+ }
9
+ else {
10
+ throw 'NI';
11
+ }
12
+ }
13
+ else {
14
+ initialPropValues[mapsTo] = valIfFalsy;
15
+ }
16
+ }
17
+ else {
18
+ switch (instanceOf) {
19
+ case 'Object':
20
+ if (!newValue)
21
+ return;
22
+ try {
23
+ valToSet = JSON.parse(newValue);
24
+ }
25
+ catch (e) {
26
+ throw { err: 400, attr, newValue };
27
+ }
28
+ if (mapsTo === undefined)
29
+ throw 400;
30
+ if (mapsTo === '.') {
31
+ Object.assign(initialPropValues, valToSet);
32
+ }
33
+ else {
34
+ initialPropValues[mapsTo] = valToSet;
35
+ }
36
+ break;
37
+ case 'String':
38
+ initialPropValues[mapsTo] = valToSet;
39
+ break;
40
+ case 'Boolean':
41
+ initialPropValues[mapsTo] = valToSet !== null;
42
+ break;
43
+ case 'Number':
44
+ initialPropValues[mapsTo] = Number(valToSet);
45
+ break;
46
+ case 'DSSArray':
47
+ case 'Object$tring':
48
+ case 'Object$entences':
49
+ const { strValMapsTo, objValMapsTo, arrValMapsTo } = prop;
50
+ let parsedObj;
51
+ switch (instanceOf) {
52
+ case 'Object$tring':
53
+ const { Object$tring } = await import('trans-render/Object$tring.js');
54
+ parsedObj = new Object$tring(newValue);
55
+ break;
56
+ case 'Object$entences':
57
+ const { Object$entences } = await import('trans-render/Object$entences.js');
58
+ parsedObj = new Object$entences(newValue, prop);
59
+ break;
60
+ case 'DSSArray':
61
+ const { DSSArray } = await import('trans-render/DSSArray.js');
62
+ parsedObj = new DSSArray(newValue);
63
+ break;
64
+ }
65
+ await parsedObj.parse();
66
+ if (parsedObj.strVal && strValMapsTo !== undefined) {
67
+ initialPropValues[strValMapsTo] = parsedObj.strVal;
68
+ }
69
+ if (parsedObj.objVal && objValMapsTo !== undefined) {
70
+ if (objValMapsTo === '.') {
71
+ Object.assign(initialPropValues, parsedObj.objVal);
72
+ }
73
+ else {
74
+ initialPropValues[objValMapsTo] = parsedObj.objVal;
75
+ }
76
+ }
77
+ else if (parsedObj.arrVal && arrValMapsTo !== undefined) {
78
+ initialPropValues[arrValMapsTo] = parsedObj.arrVal;
79
+ }
80
+ break;
81
+ default:
82
+ throw 'NI';
83
+ }
84
+ }
85
+ }