@fluffjs/fluff 0.4.1 → 0.4.3
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/package.json
CHANGED
package/runtime/FluffBase.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare abstract class FluffBase extends HTMLElement {
|
|
|
60
60
|
private static __expressionsReady;
|
|
61
61
|
private static readonly __pendingInitCallbacks;
|
|
62
62
|
static __setExpressionTable(expressions: ExpressionFn[], handlers: HandlerFn[], strings?: string[]): void;
|
|
63
|
+
static __decodeString(idx: number): string;
|
|
63
64
|
static __decodeDep(dep: number | number[]): string | string[];
|
|
64
65
|
static __decodeDeps(deps: (number | number[])[] | null): (string | string[])[] | undefined;
|
|
65
66
|
static __decodeMarkerConfig(compact: CompactMarkerConfig): unknown;
|
package/runtime/FluffBase.js
CHANGED
|
@@ -22,7 +22,7 @@ export declare abstract class FluffElement extends FluffBase {
|
|
|
22
22
|
protected __pipe(name: string, value: unknown, ...args: unknown[]): unknown;
|
|
23
23
|
protected __getPipeFn(name: string): ((value: unknown, ...args: unknown[]) => unknown) | undefined;
|
|
24
24
|
protected __getShadowRoot(): ShadowRoot;
|
|
25
|
-
protected __createProp<T>(
|
|
25
|
+
protected __createProp<T>(nameOrIdx: string | number, options: T | {
|
|
26
26
|
initialValue: T;
|
|
27
27
|
[key: string]: unknown;
|
|
28
28
|
}): Property<T>;
|
|
@@ -101,7 +101,8 @@ export class FluffElement extends FluffBase {
|
|
|
101
101
|
__getShadowRoot() {
|
|
102
102
|
return this._shadowRoot;
|
|
103
103
|
}
|
|
104
|
-
__createProp(
|
|
104
|
+
__createProp(nameOrIdx, options) {
|
|
105
|
+
const name = typeof nameOrIdx === 'number' ? FluffBase.__decodeString(nameOrIdx) : nameOrIdx;
|
|
105
106
|
const prop = new Property(options);
|
|
106
107
|
Object.defineProperty(this, name, {
|
|
107
108
|
get() {
|
package/utils/Property.js
CHANGED
|
@@ -174,11 +174,11 @@ export class Property {
|
|
|
174
174
|
if (this.value === undefined)
|
|
175
175
|
return;
|
|
176
176
|
this.onChange.emit(this.value);
|
|
177
|
-
if (direction
|
|
177
|
+
if (direction === Direction.Outbound) {
|
|
178
178
|
this.onOutboundChange.emit(this.value);
|
|
179
179
|
}
|
|
180
|
-
if (direction
|
|
181
|
-
this.
|
|
180
|
+
if (direction === Direction.Inbound) {
|
|
181
|
+
this.onInboundChange.emit(this.value);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
subscribe(direction, cb) {
|