mount-observer 0.0.50 → 0.0.51
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/MountObserver.js
CHANGED
|
@@ -220,6 +220,9 @@ export class MountObserver extends EventTarget {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
this.#filterAndMount(elsToInspect, true, false);
|
|
223
|
+
for (const el of elsToInspect) {
|
|
224
|
+
await this.#inspectWithin(el, false);
|
|
225
|
+
}
|
|
223
226
|
}, { signal: this.#abortController.signal });
|
|
224
227
|
await this.#inspectWithin(within, true);
|
|
225
228
|
}
|
|
@@ -422,7 +425,8 @@ export class MountObserver extends EventTarget {
|
|
|
422
425
|
async #inspectWithin(within, initializing) {
|
|
423
426
|
await bindish(within, this.#mountInit.assigner);
|
|
424
427
|
await this.composeFragment(within, 0);
|
|
425
|
-
const
|
|
428
|
+
const match = await this.#selector();
|
|
429
|
+
const els = Array.from(within.querySelectorAll(match));
|
|
426
430
|
this.#filterAndMount(els, false, initializing);
|
|
427
431
|
}
|
|
428
432
|
}
|
package/MountObserver.ts
CHANGED
|
@@ -235,6 +235,9 @@ export class MountObserver extends EventTarget implements IMountObserver{
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
this.#filterAndMount(elsToInspect, true, false);
|
|
238
|
+
for(const el of elsToInspect){
|
|
239
|
+
await this.#inspectWithin(el, false);
|
|
240
|
+
}
|
|
238
241
|
}, {signal: this.#abortController.signal});
|
|
239
242
|
|
|
240
243
|
await this.#inspectWithin(within, true);
|
|
@@ -441,7 +444,8 @@ export class MountObserver extends EventTarget implements IMountObserver{
|
|
|
441
444
|
async #inspectWithin(within: Node, initializing: boolean){
|
|
442
445
|
await bindish(within as DocumentFragment, this.#mountInit.assigner);
|
|
443
446
|
await this.composeFragment(within as DocumentFragment, 0);
|
|
444
|
-
const
|
|
447
|
+
const match = await this.#selector();
|
|
448
|
+
const els = Array.from((within as Element).querySelectorAll(match));
|
|
445
449
|
this.#filterAndMount(els, false, initializing);
|
|
446
450
|
}
|
|
447
451
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {IEnhancement, BEAllProps} from '../trans-render/be/types';
|
|
2
|
+
import { HasIshList } from '../trans-render/dss/types';
|
|
2
3
|
|
|
3
4
|
export interface EndUserProps extends IEnhancement{
|
|
4
5
|
statement: string;
|
|
@@ -7,6 +8,8 @@ export interface EndUserProps extends IEnhancement{
|
|
|
7
8
|
export interface AllProps extends EndUserProps{
|
|
8
9
|
listProp: string;
|
|
9
10
|
itemProp: string;
|
|
11
|
+
ish: EventTarget & HasIshList;
|
|
12
|
+
//updateCnt: number;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
export type AP = AllProps;
|
|
@@ -19,6 +22,7 @@ export type BAP = AP & BEAllProps;
|
|
|
19
22
|
|
|
20
23
|
export interface Actions{
|
|
21
24
|
parse(self: BAP): PAP;
|
|
22
|
-
|
|
25
|
+
init(self: BAP): ProPAP;
|
|
26
|
+
hydrate(self: BAP)
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -184,6 +184,11 @@ export interface PIP<TProp = any, TElement = Element> extends EventListenerObjec
|
|
|
184
184
|
readonly outEvtName: string;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
//TODO: move to mount observer
|
|
188
|
+
export interface HasIsh {
|
|
189
|
+
ish: EventTarget;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface HasIshList {
|
|
188
193
|
ishList: Array<any>;
|
|
189
194
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IMountObserver } from '../../mount-observer/types';
|
|
2
2
|
import { Scope} from '../lib/types';
|
|
3
3
|
import { WrapperConfig } from '../XV/types';
|
|
4
|
+
import {XForm} from '../types';
|
|
4
5
|
|
|
5
6
|
export interface IEventConfig<MCProps = any, MCActions = MCProps, TAction = Action>{
|
|
6
7
|
on?: string,
|
|
@@ -215,7 +216,7 @@ export type Compacts<TProps = any, TActions = TProps> =
|
|
|
215
216
|
| Partial<{[key in `pass_length_of_${keyof TProps & string}_to_${keyof TProps & string}`]: number}>
|
|
216
217
|
| Partial<{[key in `echo_${keyof TProps & string}_to_${keyof TProps & string}`]: number}>
|
|
217
218
|
| Partial<{[key in `echo_${keyof TProps & string}_to_${keyof TProps & string}_after`]: keyof TProps}>
|
|
218
|
-
| Partial<{[key in `when_${keyof TProps & string}
|
|
219
|
+
| Partial<{[key in `when_${keyof TProps & string}_changes_call_${keyof TActions & string}`]: number}>
|
|
219
220
|
| Partial<{[key in `when_${keyof TProps & string}_changes_toggle_${keyof TProps & string}`]: number}>
|
|
220
221
|
| Partial<{[key in `when_${keyof TProps & string}_changes_inc_${keyof TProps & string}_by`]: number}>
|
|
221
222
|
;
|
|
@@ -454,7 +455,7 @@ export interface ICompact{
|
|
|
454
455
|
interface CompactStatement {
|
|
455
456
|
srcKey: string,
|
|
456
457
|
destKey: string,
|
|
457
|
-
op: 'toggle' | 'negate' | '
|
|
458
|
+
op: 'toggle' | 'negate' | 'call' | 'pass_length' | 'echo' | 'inc',
|
|
458
459
|
rhsIsDynamic: boolean
|
|
459
460
|
}
|
|
460
461
|
|
package/waitForIsh.js
CHANGED
|
@@ -2,7 +2,7 @@ export function waitForIsh(el) {
|
|
|
2
2
|
return new Promise((resolve, reject) => {
|
|
3
3
|
const ish = el['ish']; // [TODO] should we make this something that can
|
|
4
4
|
// be passed in, more generic function -- waitForProperty?
|
|
5
|
-
if (ish) {
|
|
5
|
+
if (ish instanceof EventTarget) {
|
|
6
6
|
resolve(ish);
|
|
7
7
|
}
|
|
8
8
|
else {
|
package/waitForIsh.ts
CHANGED
|
@@ -2,7 +2,7 @@ export function waitForIsh(el: Element){
|
|
|
2
2
|
return new Promise((resolve, reject) => {
|
|
3
3
|
const ish = (<any>el)['ish']; // [TODO] should we make this something that can
|
|
4
4
|
// be passed in, more generic function -- waitForProperty?
|
|
5
|
-
if (ish) {
|
|
5
|
+
if (ish instanceof EventTarget) {
|
|
6
6
|
resolve(ish);
|
|
7
7
|
} else {
|
|
8
8
|
// If the element is not yet defined, wait for it to be defined
|