@joist/element 4.2.2 → 4.2.3-next.0
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 +4 -1
- package/src/lib/query.ts +1 -1
- package/src/lib/templating/README.md +292 -0
- package/src/lib/templating/bind.ts +40 -0
- package/src/lib/templating/define.ts +4 -0
- package/src/lib/templating/elements/for.element.test.ts +39 -0
- package/src/lib/templating/elements/for.element.ts +151 -0
- package/src/lib/templating/elements/if.element.test.ts +55 -0
- package/src/lib/templating/elements/if.element.ts +67 -0
- package/src/lib/templating/elements/props.element.test.ts +62 -0
- package/src/lib/templating/elements/props.element.ts +80 -0
- package/src/lib/templating/elements/scope.ts +45 -0
- package/src/lib/templating/elements/value.element.test.ts +20 -0
- package/src/lib/templating/elements/value.element.ts +41 -0
- package/src/lib/templating/events.ts +21 -0
- package/src/lib/templating/token.test.ts +74 -0
- package/src/lib/templating/token.ts +34 -0
- package/src/lib/templating.ts +2 -0
- package/src/lib.ts +1 -0
- package/target/lib/query.d.ts +1 -1
- package/target/lib/templating/bind.d.ts +1 -0
- package/target/lib/templating/bind.js +30 -0
- package/target/lib/templating/bind.js.map +1 -0
- package/target/lib/templating/define.d.ts +4 -0
- package/target/lib/templating/define.js +5 -0
- package/target/lib/templating/define.js.map +1 -0
- package/target/lib/templating/elements/for.element.d.ts +23 -0
- package/target/lib/templating/elements/for.element.js +168 -0
- package/target/lib/templating/elements/for.element.js.map +1 -0
- package/target/lib/templating/elements/for.element.test.d.ts +2 -0
- package/target/lib/templating/elements/for.element.test.js +34 -0
- package/target/lib/templating/elements/for.element.test.js.map +1 -0
- package/target/lib/templating/elements/if.element.d.ts +13 -0
- package/target/lib/templating/elements/if.element.js +71 -0
- package/target/lib/templating/elements/if.element.js.map +1 -0
- package/target/lib/templating/elements/if.element.test.d.ts +1 -0
- package/target/lib/templating/elements/if.element.test.js +47 -0
- package/target/lib/templating/elements/if.element.test.js.map +1 -0
- package/target/lib/templating/elements/props.element.d.ts +11 -0
- package/target/lib/templating/elements/props.element.js +92 -0
- package/target/lib/templating/elements/props.element.js.map +1 -0
- package/target/lib/templating/elements/props.element.test.d.ts +1 -0
- package/target/lib/templating/elements/props.element.test.js +53 -0
- package/target/lib/templating/elements/props.element.test.js.map +1 -0
- package/target/lib/templating/elements/scope.d.ts +13 -0
- package/target/lib/templating/elements/scope.js +59 -0
- package/target/lib/templating/elements/scope.js.map +1 -0
- package/target/lib/templating/elements/value.element.d.ts +9 -0
- package/target/lib/templating/elements/value.element.js +56 -0
- package/target/lib/templating/elements/value.element.js.map +1 -0
- package/target/lib/templating/elements/value.element.test.d.ts +1 -0
- package/target/lib/templating/elements/value.element.test.js +16 -0
- package/target/lib/templating/elements/value.element.test.js.map +1 -0
- package/target/lib/templating/events.d.ts +12 -0
- package/target/lib/templating/events.js +10 -0
- package/target/lib/templating/events.js.map +1 -0
- package/target/lib/templating/token.d.ts +8 -0
- package/target/lib/templating/token.js +27 -0
- package/target/lib/templating/token.js.map +1 -0
- package/target/lib/templating/token.test.js +56 -0
- package/target/lib/templating/token.test.js.map +1 -0
- package/target/lib/templating.d.ts +2 -0
- package/target/lib/templating.js +3 -0
- package/target/lib/templating.js.map +1 -0
- package/target/lib.d.ts +1 -0
- package/target/lib.js.map +1 -1
- package/src/lib/template.test.ts +0 -123
- package/src/lib/template.ts +0 -130
- package/target/lib/template.d.ts +0 -11
- package/target/lib/template.js +0 -89
- package/target/lib/template.js.map +0 -1
- package/target/lib/template.test.js +0 -91
- package/target/lib/template.test.js.map +0 -1
- /package/target/lib/{template.test.d.ts → templating/token.test.d.ts} +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import "./props.element.js";
|
|
2
|
+
|
|
3
|
+
import { fixtureSync, html } from "@open-wc/testing";
|
|
4
|
+
import { assert } from "chai";
|
|
5
|
+
|
|
6
|
+
import type { JoistValueEvent } from "../events.js";
|
|
7
|
+
|
|
8
|
+
it("should pass props to child", () => {
|
|
9
|
+
const element = fixtureSync(html`
|
|
10
|
+
<div
|
|
11
|
+
@joist::value=${(e: JoistValueEvent) => {
|
|
12
|
+
if (e.token.bindTo === "href") {
|
|
13
|
+
e.update({
|
|
14
|
+
oldValue: null,
|
|
15
|
+
newValue: "$foo",
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (e.token.bindTo === "target") {
|
|
20
|
+
e.update({
|
|
21
|
+
oldValue: null,
|
|
22
|
+
newValue: {
|
|
23
|
+
value: "_blank",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<j-props>
|
|
30
|
+
<a $href="href" $target="target.value">Hello World</a>
|
|
31
|
+
</j-props>
|
|
32
|
+
</div>
|
|
33
|
+
`);
|
|
34
|
+
|
|
35
|
+
const anchor = element.querySelector("a");
|
|
36
|
+
|
|
37
|
+
assert.equal(anchor?.getAttribute("href"), "$foo");
|
|
38
|
+
assert.equal(anchor?.getAttribute("target"), "_blank");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("should pass props to specified child", () => {
|
|
42
|
+
const element = fixtureSync(html`
|
|
43
|
+
<div
|
|
44
|
+
@joist::value=${(e: JoistValueEvent) => {
|
|
45
|
+
e.update({
|
|
46
|
+
oldValue: null,
|
|
47
|
+
newValue: "#foo",
|
|
48
|
+
});
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
<j-props>
|
|
52
|
+
<a>Default</a>
|
|
53
|
+
<a id="test" $href="href">Target</a>
|
|
54
|
+
</j-props>
|
|
55
|
+
</div>
|
|
56
|
+
`);
|
|
57
|
+
|
|
58
|
+
const anchor = element.querySelectorAll("a");
|
|
59
|
+
|
|
60
|
+
assert.equal(anchor[0].getAttribute("href"), null);
|
|
61
|
+
assert.equal(anchor[1].getAttribute("href"), "#foo");
|
|
62
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { attr } from "../../attr.js";
|
|
2
|
+
import { element } from "../../element.js";
|
|
3
|
+
import { css, html } from "../../tags.js";
|
|
4
|
+
|
|
5
|
+
import { JoistValueEvent } from "../events.js";
|
|
6
|
+
import { JToken } from "../token.js";
|
|
7
|
+
|
|
8
|
+
export class JAttrToken extends JToken {
|
|
9
|
+
mapTo: string;
|
|
10
|
+
mapsToProp: boolean;
|
|
11
|
+
|
|
12
|
+
constructor(attr: Attr) {
|
|
13
|
+
if (!attr.name.startsWith("$")) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
`Invalid attribute token: ${attr.name}, should start with $`,
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
super(attr.value);
|
|
20
|
+
|
|
21
|
+
this.mapsToProp = attr.name.startsWith("$.");
|
|
22
|
+
|
|
23
|
+
this.mapTo = attr.name.slice(this.mapsToProp ? 2 : 1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@element({
|
|
28
|
+
tagName: "j-props",
|
|
29
|
+
// prettier-ignore
|
|
30
|
+
shadowDom: [css`:host{display: contents;}`, html`<slot></slot>`],
|
|
31
|
+
})
|
|
32
|
+
export class JoistIfElement extends HTMLElement {
|
|
33
|
+
@attr()
|
|
34
|
+
accessor target = "";
|
|
35
|
+
|
|
36
|
+
connectedCallback(): void {
|
|
37
|
+
this.#bindProps([this]); // bind own props
|
|
38
|
+
this.#bindProps(this.children); // bind child props
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#bindProps(children: Iterable<Element>) {
|
|
42
|
+
for (const child of children) {
|
|
43
|
+
for (const attr of child.attributes) {
|
|
44
|
+
if (attr.name.startsWith("$")) {
|
|
45
|
+
const token = new JAttrToken(attr);
|
|
46
|
+
|
|
47
|
+
this.dispatchEvent(
|
|
48
|
+
new JoistValueEvent(token, ({ newValue, oldValue }) => {
|
|
49
|
+
if (newValue === oldValue) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let valueToWrite = newValue;
|
|
54
|
+
|
|
55
|
+
if (typeof newValue === "object" && newValue !== null) {
|
|
56
|
+
valueToWrite = token.readTokenValueFrom(newValue);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (token.isNegated) {
|
|
60
|
+
valueToWrite = !valueToWrite;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (token.mapsToProp) {
|
|
64
|
+
Reflect.set(child, token.mapTo, valueToWrite);
|
|
65
|
+
} else {
|
|
66
|
+
if (valueToWrite === true) {
|
|
67
|
+
child.setAttribute(token.mapTo, "");
|
|
68
|
+
} else if (valueToWrite === false) {
|
|
69
|
+
child.removeAttribute(token.mapTo);
|
|
70
|
+
} else {
|
|
71
|
+
child.setAttribute(token.mapTo, String(valueToWrite));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { attr } from "../../attr.js";
|
|
2
|
+
import { element } from "../../element.js";
|
|
3
|
+
import { listen } from "../../listen.js";
|
|
4
|
+
import { css, html } from "../../tags.js";
|
|
5
|
+
import type { JoistValueEvent } from "../events.js";
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
"j-scope": JoistScopeElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@element({
|
|
14
|
+
tagName: "j-value",
|
|
15
|
+
// prettier-ignore
|
|
16
|
+
shadowDom: [css`:host{display: contents;}`, html`<slot></slot>`],
|
|
17
|
+
})
|
|
18
|
+
export class JoistScopeElement extends HTMLElement {
|
|
19
|
+
@attr()
|
|
20
|
+
accessor name = "";
|
|
21
|
+
|
|
22
|
+
@attr()
|
|
23
|
+
accessor value = "";
|
|
24
|
+
|
|
25
|
+
#binding: JoistValueEvent | null = null;
|
|
26
|
+
|
|
27
|
+
@listen("joist::value")
|
|
28
|
+
onJoistValueFound(e: JoistValueEvent): void {
|
|
29
|
+
if (e.token.bindTo === this.name) {
|
|
30
|
+
e.stopPropagation();
|
|
31
|
+
|
|
32
|
+
this.#binding = e;
|
|
33
|
+
|
|
34
|
+
this.#binding.update({ oldValue: null, newValue: this.value });
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
attributeChangedCallback(
|
|
39
|
+
_: string,
|
|
40
|
+
oldValue: string,
|
|
41
|
+
newValue: string,
|
|
42
|
+
): void {
|
|
43
|
+
this.#binding?.update({ oldValue, newValue });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./value.element.js";
|
|
2
|
+
|
|
3
|
+
import { fixtureSync, html } from "@open-wc/testing";
|
|
4
|
+
import { assert } from "chai";
|
|
5
|
+
|
|
6
|
+
import type { JoistValueEvent } from "../events.js";
|
|
7
|
+
|
|
8
|
+
it("should render content when the bind value is truthy", () => {
|
|
9
|
+
const element = fixtureSync(html`
|
|
10
|
+
<div
|
|
11
|
+
@joist::value=${(e: JoistValueEvent) => {
|
|
12
|
+
e.update({ oldValue: null, newValue: "Hello World" });
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<j-value bind="test"></j-value>
|
|
16
|
+
</div>
|
|
17
|
+
`);
|
|
18
|
+
|
|
19
|
+
assert.equal(element.textContent?.trim(), "Hello World");
|
|
20
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { attr } from "../../attr.js";
|
|
2
|
+
import { element } from "../../element.js";
|
|
3
|
+
import { css, html } from "../../tags.js";
|
|
4
|
+
import { JoistValueEvent } from "../events.js";
|
|
5
|
+
import { JToken } from "../token.js";
|
|
6
|
+
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
"j-value": JoistValueElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@element({
|
|
14
|
+
tagName: "j-value",
|
|
15
|
+
// prettier-ignore
|
|
16
|
+
shadowDom: [css`:host{display: contents;}`, html`<slot></slot>`],
|
|
17
|
+
})
|
|
18
|
+
export class JoistValueElement extends HTMLElement {
|
|
19
|
+
@attr()
|
|
20
|
+
accessor bind = "";
|
|
21
|
+
|
|
22
|
+
connectedCallback(): void {
|
|
23
|
+
const token = new JToken(this.bind);
|
|
24
|
+
|
|
25
|
+
this.dispatchEvent(
|
|
26
|
+
new JoistValueEvent(token, (value) => {
|
|
27
|
+
let valueToWrite: string;
|
|
28
|
+
|
|
29
|
+
if (typeof value.newValue === "object" && value.newValue !== null) {
|
|
30
|
+
valueToWrite = String(token.readTokenValueFrom(value.newValue));
|
|
31
|
+
} else {
|
|
32
|
+
valueToWrite = String(value.newValue);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (this.textContent !== valueToWrite) {
|
|
36
|
+
this.textContent = valueToWrite;
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Change } from "@joist/observable";
|
|
2
|
+
|
|
3
|
+
import type { JToken } from "./token.js";
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
interface HTMLElementEventMap {
|
|
7
|
+
"joist::value": JoistValueEvent;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class JoistValueEvent extends Event {
|
|
12
|
+
readonly token: JToken;
|
|
13
|
+
readonly update: (value: Change<unknown>) => void;
|
|
14
|
+
|
|
15
|
+
constructor(bindTo: JToken, update: (value: Change<unknown>) => void) {
|
|
16
|
+
super("joist::value", { bubbles: true, composed: true });
|
|
17
|
+
|
|
18
|
+
this.token = bindTo;
|
|
19
|
+
this.update = update;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { assert } from "chai";
|
|
2
|
+
|
|
3
|
+
import { JToken } from "./token.js";
|
|
4
|
+
|
|
5
|
+
describe("JToken", () => {
|
|
6
|
+
describe("constructor", () => {
|
|
7
|
+
it("should initialize with a raw token", () => {
|
|
8
|
+
const token = new JToken("example.token");
|
|
9
|
+
assert.equal(token.rawToken, "example.token");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it("should set isNegated to true if the token starts with '!'", () => {
|
|
13
|
+
const token = new JToken("!example.token");
|
|
14
|
+
assert.isTrue(token.isNegated);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("should set isNegated to false if the token does not start with '!'", () => {
|
|
18
|
+
const token = new JToken("example.token");
|
|
19
|
+
assert.isFalse(token.isNegated);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("should correctly parse the bindTo property", () => {
|
|
23
|
+
const token = new JToken("example.token");
|
|
24
|
+
assert.equal(token.bindTo, "example");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should correctly parse the path property", () => {
|
|
28
|
+
const token = new JToken("example.token.part");
|
|
29
|
+
assert.deepEqual(token.path, ["token", "part"]);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("should remove '!' from bindTo if present", () => {
|
|
33
|
+
const token = new JToken("!example.token");
|
|
34
|
+
assert.equal(token.bindTo, "example");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("readTokenValueFrom", () => {
|
|
39
|
+
it("should read the value from a nested object", () => {
|
|
40
|
+
const token = new JToken("example.token.part");
|
|
41
|
+
const obj = { token: { part: 42 } };
|
|
42
|
+
const value = token.readTokenValueFrom<number>(obj);
|
|
43
|
+
assert.equal(value, 42);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("should return undefined if the path does not exist", () => {
|
|
47
|
+
const token = new JToken("example.nonexistent.path");
|
|
48
|
+
const obj = { token: { part: 42 } };
|
|
49
|
+
const value = token.readTokenValueFrom(obj);
|
|
50
|
+
assert.isUndefined(value);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("should handle empty paths gracefully", () => {
|
|
54
|
+
const token = new JToken("example");
|
|
55
|
+
const obj = { foo: 42 };
|
|
56
|
+
const value = token.readTokenValueFrom(obj);
|
|
57
|
+
|
|
58
|
+
assert.deepEqual(value, { foo: 42 });
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("should throw an error if the object is null or undefined", () => {
|
|
62
|
+
const token = new JToken("example.token");
|
|
63
|
+
assert.throws(
|
|
64
|
+
() => token.readTokenValueFrom<any>(null as any),
|
|
65
|
+
TypeError,
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
assert.throws(
|
|
69
|
+
() => token.readTokenValueFrom<any>(undefined as any),
|
|
70
|
+
TypeError,
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export class JToken {
|
|
2
|
+
rawToken: string;
|
|
3
|
+
isNegated = false;
|
|
4
|
+
bindTo: string;
|
|
5
|
+
path: string[] = [];
|
|
6
|
+
|
|
7
|
+
constructor(rawToken: string) {
|
|
8
|
+
this.rawToken = rawToken;
|
|
9
|
+
|
|
10
|
+
this.isNegated = this.rawToken.startsWith("!");
|
|
11
|
+
|
|
12
|
+
this.path = this.rawToken.split(".");
|
|
13
|
+
this.bindTo = this.path.shift() ?? "";
|
|
14
|
+
this.bindTo = this.bindTo.replaceAll("!", "");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
readTokenValueFrom<T = unknown>(obj: object): T {
|
|
18
|
+
let pointer: any = obj;
|
|
19
|
+
|
|
20
|
+
if (!this.path.length) {
|
|
21
|
+
return pointer;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
for (const part of this.path) {
|
|
25
|
+
pointer = pointer[part];
|
|
26
|
+
|
|
27
|
+
if (pointer === undefined) {
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return pointer;
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/lib.ts
CHANGED
|
@@ -4,5 +4,6 @@ export { listen } from "./lib/listen.js";
|
|
|
4
4
|
export { element } from "./lib/element.js";
|
|
5
5
|
export { query } from "./lib/query.js";
|
|
6
6
|
export { queryAll } from "./lib/query-all.js";
|
|
7
|
+
export { QueryResult } from "./lib/query.js";
|
|
7
8
|
export { ready } from "./lib/lifecycle.js";
|
|
8
9
|
export { attrChanged } from "./lib/attr-changed.js";
|
package/target/lib/query.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ type Tags = keyof HTMLElementTagNameMap;
|
|
|
2
2
|
type SVGTags = keyof SVGElementTagNameMap;
|
|
3
3
|
type MathTags = keyof MathMLElementTagNameMap;
|
|
4
4
|
type NodeUpdate<T extends Node> = Partial<T> | ((node: T) => Partial<T>);
|
|
5
|
-
type QueryResult<T extends Node> = (updates?: NodeUpdate<T>) => T;
|
|
5
|
+
export type QueryResult<T extends Node> = (updates?: NodeUpdate<T>) => T;
|
|
6
6
|
export declare function query<K extends Tags>(selectors: K, root?: HTMLElement | ShadowRoot): QueryResult<HTMLElementTagNameMap[K]>;
|
|
7
7
|
export declare function query<K extends SVGTags>(selectors: K, root?: HTMLElement | ShadowRoot): QueryResult<SVGElementTagNameMap[K]>;
|
|
8
8
|
export declare function query<K extends MathTags>(selectors: K, root?: HTMLElement | ShadowRoot): QueryResult<MathMLElementTagNameMap[K]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function bind(): <This extends HTMLElement, Value>(base: ClassAccessorDecoratorTarget<This, Value>, ctx: ClassAccessorDecoratorContext<This, Value>) => ClassAccessorDecoratorResult<This, Value>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { instanceMetadataStore, observe } from "@joist/observable";
|
|
2
|
+
export function bind() {
|
|
3
|
+
return function bindDecorator(base, ctx) {
|
|
4
|
+
const internalObserve = observe()(base, ctx);
|
|
5
|
+
return {
|
|
6
|
+
init(value) {
|
|
7
|
+
this.addEventListener("joist::value", (e) => {
|
|
8
|
+
if (e.token.bindTo === ctx.name) {
|
|
9
|
+
const instanceMeta = instanceMetadataStore.read(this);
|
|
10
|
+
e.stopPropagation();
|
|
11
|
+
e.update({ oldValue: null, newValue: ctx.access.get(this) });
|
|
12
|
+
instanceMeta.bindings.add((changes) => {
|
|
13
|
+
const key = ctx.name;
|
|
14
|
+
const res = changes.get(key);
|
|
15
|
+
if (res) {
|
|
16
|
+
e.update(res);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
if (internalObserve.init) {
|
|
22
|
+
return internalObserve.init.call(this, value);
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
},
|
|
26
|
+
set: internalObserve.set,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=bind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind.js","sourceRoot":"","sources":["../../../src/lib/templating/bind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEnE,MAAM,UAAU,IAAI;IAClB,OAAO,SAAS,aAAa,CAC3B,IAA+C,EAC/C,GAA+C;QAE/C,MAAM,eAAe,GAAG,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAE7C,OAAO;YACL,IAAI,CAAC,KAAK;gBACR,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE;oBAC1C,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC;wBAChC,MAAM,YAAY,GAAG,qBAAqB,CAAC,IAAI,CAAO,IAAI,CAAC,CAAC;wBAE5D,CAAC,CAAC,eAAe,EAAE,CAAC;wBAEpB,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBAE7D,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;4BACpC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAkB,CAAC;4BACnC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;4BAE7B,IAAI,GAAG,EAAE,CAAC;gCACR,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;4BAChB,CAAC;wBACH,CAAC,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,CAAC;gBAEH,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;oBACzB,OAAO,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBAChD,CAAC;gBAED,OAAO,KAAK,CAAC;YACf,CAAC;YACD,GAAG,EAAE,eAAe,CAAC,GAAG;SACzB,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/lib/templating/define.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAClC,OAAO,6BAA6B,CAAC;AACrC,OAAO,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
interface HTMLElementTagNameMap {
|
|
3
|
+
"j-for": JositForElement;
|
|
4
|
+
"j-for-scope": JForScope;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export interface EachCtx<T> {
|
|
8
|
+
value: T | null;
|
|
9
|
+
index: number | null;
|
|
10
|
+
position: number | null;
|
|
11
|
+
}
|
|
12
|
+
export declare class JForScope<T = unknown> extends HTMLElement {
|
|
13
|
+
accessor each: EachCtx<T>;
|
|
14
|
+
accessor key: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class JositForElement extends HTMLElement {
|
|
17
|
+
#private;
|
|
18
|
+
accessor bind: string;
|
|
19
|
+
accessor key: string;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
updateItems(): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { __esDecorate, __runInitializers } from "tslib";
|
|
2
|
+
import { attr } from "../../attr.js";
|
|
3
|
+
import { element } from "../../element.js";
|
|
4
|
+
import { query } from "../../query.js";
|
|
5
|
+
import { css, html } from "../../tags.js";
|
|
6
|
+
import { bind } from "../bind.js";
|
|
7
|
+
import { JoistValueEvent } from "../events.js";
|
|
8
|
+
import { JToken } from "../token.js";
|
|
9
|
+
let JForScope = (() => {
|
|
10
|
+
let _classDecorators = [element({
|
|
11
|
+
tagName: "j-for-scope",
|
|
12
|
+
shadowDom: [css `:host{display: contents;}`, html `<slot></slot>`],
|
|
13
|
+
})];
|
|
14
|
+
let _classDescriptor;
|
|
15
|
+
let _classExtraInitializers = [];
|
|
16
|
+
let _classThis;
|
|
17
|
+
let _classSuper = HTMLElement;
|
|
18
|
+
let _each_decorators;
|
|
19
|
+
let _each_initializers = [];
|
|
20
|
+
let _each_extraInitializers = [];
|
|
21
|
+
let _key_decorators;
|
|
22
|
+
let _key_initializers = [];
|
|
23
|
+
let _key_extraInitializers = [];
|
|
24
|
+
var JForScope = class extends _classSuper {
|
|
25
|
+
static { _classThis = this; }
|
|
26
|
+
static {
|
|
27
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
28
|
+
_each_decorators = [bind()];
|
|
29
|
+
_key_decorators = [attr()];
|
|
30
|
+
__esDecorate(this, null, _each_decorators, { kind: "accessor", name: "each", static: false, private: false, access: { has: obj => "each" in obj, get: obj => obj.each, set: (obj, value) => { obj.each = value; } }, metadata: _metadata }, _each_initializers, _each_extraInitializers);
|
|
31
|
+
__esDecorate(this, null, _key_decorators, { kind: "accessor", name: "key", static: false, private: false, access: { has: obj => "key" in obj, get: obj => obj.key, set: (obj, value) => { obj.key = value; } }, metadata: _metadata }, _key_initializers, _key_extraInitializers);
|
|
32
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
33
|
+
JForScope = _classThis = _classDescriptor.value;
|
|
34
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
35
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
36
|
+
}
|
|
37
|
+
#each_accessor_storage = __runInitializers(this, _each_initializers, {
|
|
38
|
+
value: null,
|
|
39
|
+
index: null,
|
|
40
|
+
position: null,
|
|
41
|
+
});
|
|
42
|
+
get each() { return this.#each_accessor_storage; }
|
|
43
|
+
set each(value) { this.#each_accessor_storage = value; }
|
|
44
|
+
#key_accessor_storage = (__runInitializers(this, _each_extraInitializers), __runInitializers(this, _key_initializers, ""));
|
|
45
|
+
get key() { return this.#key_accessor_storage; }
|
|
46
|
+
set key(value) { this.#key_accessor_storage = value; }
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
|
+
__runInitializers(this, _key_extraInitializers);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
return JForScope = _classThis;
|
|
53
|
+
})();
|
|
54
|
+
export { JForScope };
|
|
55
|
+
let JositForElement = (() => {
|
|
56
|
+
let _classDecorators = [element({
|
|
57
|
+
tagName: "j-for",
|
|
58
|
+
shadowDom: [css `:host{display:contents;}`, html `<slot></slot>`],
|
|
59
|
+
})];
|
|
60
|
+
let _classDescriptor;
|
|
61
|
+
let _classExtraInitializers = [];
|
|
62
|
+
let _classThis;
|
|
63
|
+
let _classSuper = HTMLElement;
|
|
64
|
+
let _bind_decorators;
|
|
65
|
+
let _bind_initializers = [];
|
|
66
|
+
let _bind_extraInitializers = [];
|
|
67
|
+
let _key_decorators;
|
|
68
|
+
let _key_initializers = [];
|
|
69
|
+
let _key_extraInitializers = [];
|
|
70
|
+
var JositForElement = class extends _classSuper {
|
|
71
|
+
static { _classThis = this; }
|
|
72
|
+
static {
|
|
73
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
74
|
+
_bind_decorators = [attr()];
|
|
75
|
+
_key_decorators = [attr()];
|
|
76
|
+
__esDecorate(this, null, _bind_decorators, { kind: "accessor", name: "bind", static: false, private: false, access: { has: obj => "bind" in obj, get: obj => obj.bind, set: (obj, value) => { obj.bind = value; } }, metadata: _metadata }, _bind_initializers, _bind_extraInitializers);
|
|
77
|
+
__esDecorate(this, null, _key_decorators, { kind: "accessor", name: "key", static: false, private: false, access: { has: obj => "key" in obj, get: obj => obj.key, set: (obj, value) => { obj.key = value; } }, metadata: _metadata }, _key_initializers, _key_extraInitializers);
|
|
78
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
79
|
+
JositForElement = _classThis = _classDescriptor.value;
|
|
80
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
81
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
82
|
+
}
|
|
83
|
+
#bind_accessor_storage = __runInitializers(this, _bind_initializers, "");
|
|
84
|
+
get bind() { return this.#bind_accessor_storage; }
|
|
85
|
+
set bind(value) { this.#bind_accessor_storage = value; }
|
|
86
|
+
#key_accessor_storage = (__runInitializers(this, _bind_extraInitializers), __runInitializers(this, _key_initializers, ""));
|
|
87
|
+
get key() { return this.#key_accessor_storage; }
|
|
88
|
+
set key(value) { this.#key_accessor_storage = value; }
|
|
89
|
+
#template = (__runInitializers(this, _key_extraInitializers), query("template", this));
|
|
90
|
+
#items = [];
|
|
91
|
+
#scopes = new Map();
|
|
92
|
+
connectedCallback() {
|
|
93
|
+
const template = this.#template();
|
|
94
|
+
if (this.firstElementChild !== template) {
|
|
95
|
+
throw new Error("The first Node in j-for needs to be a template");
|
|
96
|
+
}
|
|
97
|
+
let currentScope = template.nextElementSibling;
|
|
98
|
+
while (currentScope instanceof JForScope) {
|
|
99
|
+
this.#scopes.set(currentScope.key, currentScope);
|
|
100
|
+
currentScope = currentScope.nextElementSibling;
|
|
101
|
+
}
|
|
102
|
+
const token = new JToken(this.bind);
|
|
103
|
+
this.dispatchEvent(new JoistValueEvent(token, ({ newValue, oldValue }) => {
|
|
104
|
+
if (newValue !== oldValue) {
|
|
105
|
+
if (isIterable(newValue)) {
|
|
106
|
+
this.#items = newValue;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
this.#items = [];
|
|
110
|
+
}
|
|
111
|
+
this.updateItems();
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
updateItems() {
|
|
116
|
+
const template = this.#template();
|
|
117
|
+
const leftoverScopes = new Map(this.#scopes);
|
|
118
|
+
let index = 0;
|
|
119
|
+
for (const item of this.#items) {
|
|
120
|
+
const key = hasProperty(item, this.key) ? item[this.key] : index;
|
|
121
|
+
let scope = leftoverScopes.get(key);
|
|
122
|
+
if (!scope) {
|
|
123
|
+
scope = new JForScope();
|
|
124
|
+
scope.append(document.importNode(template.content, true));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
leftoverScopes.delete(key);
|
|
128
|
+
}
|
|
129
|
+
scope.key = String(key);
|
|
130
|
+
scope.each = {
|
|
131
|
+
position: index + 1,
|
|
132
|
+
index: index,
|
|
133
|
+
value: item,
|
|
134
|
+
};
|
|
135
|
+
if (!scope.isConnected) {
|
|
136
|
+
const child = this.children[index + 1];
|
|
137
|
+
if (child) {
|
|
138
|
+
child.before(scope);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
this.append(scope);
|
|
142
|
+
}
|
|
143
|
+
this.#scopes.set(key, scope);
|
|
144
|
+
}
|
|
145
|
+
index++;
|
|
146
|
+
}
|
|
147
|
+
for (const scope of leftoverScopes.values()) {
|
|
148
|
+
scope.remove();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
disconnectedCallback() {
|
|
152
|
+
for (const scope of this.#scopes.values()) {
|
|
153
|
+
scope.remove();
|
|
154
|
+
}
|
|
155
|
+
this.#scopes.clear();
|
|
156
|
+
this.#items = [];
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
return JositForElement = _classThis;
|
|
160
|
+
})();
|
|
161
|
+
export { JositForElement };
|
|
162
|
+
function isIterable(obj) {
|
|
163
|
+
return obj != null && typeof obj[Symbol.iterator] === "function";
|
|
164
|
+
}
|
|
165
|
+
function hasProperty(item, key) {
|
|
166
|
+
return Object.prototype.hasOwnProperty.call(item, key);
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=for.element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for.element.js","sourceRoot":"","sources":["../../../../src/lib/templating/elements/for.element.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;IAoBxB,SAAS;4BALrB,OAAO,CAAC;YACP,OAAO,EAAE,aAAa;YAEtB,SAAS,EAAE,CAAC,GAAG,CAAA,2BAA2B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