@builder.io/mitosis 0.0.50-6 → 0.0.50
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/dist/src/__tests__/angular.test.js +6 -0
- package/dist/src/__tests__/builder.test.js +5 -1
- package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/multiple-onUpdate.raw.jsx +13 -0
- package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/multiple-onUpdateWithDeps.raw.jsx +19 -0
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.jsx +6 -3
- package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/self-referencing-component-with-children.raw.jsx +15 -0
- package/dist/src/__tests__/data/blocks/self-referencing-component.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/self-referencing-component.raw.jsx +12 -0
- package/dist/src/__tests__/data/blocks/shadow-dom.raw.d.ts +6 -0
- package/dist/src/__tests__/data/blocks/shadow-dom.raw.jsx +54 -0
- package/dist/src/__tests__/data/blocks/slot.raw.d.ts +5 -0
- package/dist/src/__tests__/data/blocks/slot.raw.jsx +6 -0
- package/dist/src/__tests__/data/blocks/stamped-io.raw.jsx +8 -0
- package/dist/src/__tests__/data/blocks/styles.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/styles.raw.jsx +10 -0
- package/dist/src/__tests__/data/context/simple.context.lite.d.ts +8 -1
- package/dist/src/__tests__/html.test.js +6 -0
- package/dist/src/__tests__/qwik.directive.test.d.ts +1 -0
- package/dist/src/__tests__/qwik.directive.test.js +107 -0
- package/dist/src/__tests__/qwik.test.js +256 -128
- package/dist/src/__tests__/react-native.test.js +12 -0
- package/dist/src/__tests__/react.test.js +12 -0
- package/dist/src/__tests__/svelte.test.js +24 -0
- package/dist/src/__tests__/vue.test.js +12 -0
- package/dist/src/__tests__/webcomponent.test.d.ts +1 -0
- package/dist/src/__tests__/webcomponent.test.js +12 -0
- package/dist/src/constants/html_tags.d.ts +1 -0
- package/dist/src/constants/html_tags.js +119 -0
- package/dist/src/generators/angular.js +7 -4
- package/dist/src/generators/context/react copy.d.ts +8 -0
- package/dist/src/generators/context/react copy.js +28 -0
- package/dist/src/generators/context/solid.d.ts +8 -0
- package/dist/src/generators/context/solid.js +28 -0
- package/dist/src/generators/context/svelte.d.ts +8 -0
- package/dist/src/generators/context/svelte.js +28 -0
- package/dist/src/generators/helpers/context.d.ts +2 -0
- package/dist/src/generators/helpers/context.js +8 -0
- package/dist/src/generators/html.js +20 -14
- package/dist/src/generators/mitosis.js +4 -3
- package/dist/src/generators/qwik/component.js +26 -5
- package/dist/src/generators/qwik/directives.d.ts +14 -5
- package/dist/src/generators/qwik/directives.js +32 -25
- package/dist/src/generators/qwik/handlers.js +3 -4
- package/dist/src/generators/qwik/jsx.js +17 -5
- package/dist/src/generators/qwik/src-generator.d.ts +0 -9
- package/dist/src/generators/qwik/src-generator.js +93 -101
- package/dist/src/generators/qwik/styles.js +8 -11
- package/dist/src/generators/react.js +9 -8
- package/dist/src/generators/solid.js +82 -8
- package/dist/src/generators/stencil/generate.js +5 -3
- package/dist/src/generators/stencil/index.js +5 -1
- package/dist/src/generators/svelte.d.ts +9 -1
- package/dist/src/generators/svelte.js +175 -76
- package/dist/src/generators/vue.d.ts +1 -1
- package/dist/src/generators/vue.js +86 -10
- package/dist/src/helpers/babel-transform copy.d.ts +8 -0
- package/dist/src/helpers/babel-transform copy.js +138 -0
- package/dist/src/helpers/babel-transform.d.ts +4 -7
- package/dist/src/helpers/babel-transform.js +18 -2
- package/dist/src/helpers/babel-transform.test.d.ts +1 -0
- package/dist/src/helpers/babel-transform.test.js +7 -0
- package/dist/src/helpers/create-mitosis-component.js +1 -1
- package/dist/src/helpers/get-state-object-string.js +2 -1
- package/dist/src/helpers/map-refs.js +22 -9
- package/dist/src/helpers/parsers.d.ts +8 -0
- package/dist/src/helpers/parsers.js +66 -0
- package/dist/src/helpers/render-imports.d.ts +2 -4
- package/dist/src/helpers/render-imports.js +32 -14
- package/dist/src/index.d.ts +10 -5
- package/dist/src/index.js +11 -5
- package/dist/src/parsers/builder.d.ts +16 -50
- package/dist/src/parsers/builder.js +22 -40
- package/dist/src/parsers/context.js +5 -1
- package/dist/src/parsers/jsx.d.ts +7 -0
- package/dist/src/parsers/jsx.js +27 -5
- package/dist/src/parsers/liquid.js +5 -1
- package/dist/src/plugins/compile-away-builder-components.js +5 -1
- package/dist/src/symbols/symbol-processor.js +3 -3
- package/dist/src/targets.d.ts +1 -1
- package/dist/src/types/mitosis-component.d.ts +8 -3
- package/dist/test/qwik/Accordion/high.jsx +0 -1
- package/dist/test/qwik/Accordion/low.jsx +171 -65
- package/dist/test/qwik/Accordion/med.jsx +9 -10
- package/dist/test/qwik/For/high.jsx +0 -1
- package/dist/test/qwik/For/low.jsx +25 -58
- package/dist/test/qwik/For/med.jsx +9 -10
- package/dist/test/qwik/Image/high.js +9 -1
- package/dist/test/qwik/Image/low.js +0 -42
- package/dist/test/qwik/Image/med.js +149 -12
- package/dist/test/qwik/Image.slow/high.js +9 -1
- package/dist/test/qwik/Image.slow/low.js +0 -42
- package/dist/test/qwik/Image.slow/med.js +149 -12
- package/dist/{src/types/generators.d.ts → test/qwik/bindings/high.cjs} +0 -0
- package/dist/test/qwik/bindings/low.cjs +33 -0
- package/dist/test/qwik/bindings/med.cjs +12 -0
- package/dist/test/qwik/button/high.js +1 -13
- package/dist/test/qwik/button/low.js +8 -40
- package/dist/test/qwik/button/med.js +36 -11
- package/dist/test/qwik/component/bindings/high.jsx +0 -1
- package/dist/test/qwik/component/bindings/low.jsx +26 -71
- package/dist/test/qwik/component/bindings/med.jsx +48 -39
- package/dist/test/qwik/component/component/inputs/high.cjsx +9 -0
- package/dist/test/qwik/component/component/inputs/low.cjsx +0 -0
- package/dist/test/qwik/component/component/inputs/med.cjsx +65 -0
- package/dist/test/qwik/hello_world/stylesheet/high.jsx +0 -1
- package/dist/test/qwik/hello_world/stylesheet/low.jsx +6 -27
- package/dist/test/qwik/hello_world/stylesheet/med.jsx +9 -10
- package/dist/test/qwik/page-with-symbol/high.js +0 -1
- package/dist/test/qwik/page-with-symbol/low.js +15 -52
- package/dist/test/qwik/page-with-symbol/med.js +9 -10
- package/dist/test/qwik/show-hide/high.jsx +9 -0
- package/dist/test/qwik/show-hide/low.jsx +0 -0
- package/dist/test/qwik/show-hide/med.jsx +174 -0
- package/dist/test/qwik/svg/high.js +0 -1
- package/dist/test/qwik/svg/low.js +9 -35
- package/dist/test/qwik/svg/med.js +9 -10
- package/dist/test/qwik/todo/Todo.cjs/high.cjs +4 -39
- package/dist/test/qwik/todo/Todo.cjs/low.cjs +0 -1
- package/dist/test/qwik/todo/Todo.cjs/med.cjs +38 -61
- package/dist/test/qwik/todo/Todo.js/high.js +22 -5
- package/dist/test/qwik/todo/Todo.js/med.js +45 -1
- package/dist/test/qwik/todo/Todo.tsx/high.tsx +4 -39
- package/dist/test/qwik/todo/Todo.tsx/low.tsx +0 -1
- package/dist/test/qwik/todo/Todo.tsx/med.tsx +31 -34
- package/dist/test/qwik/todos/Todo.tsx/high.tsx +0 -12
- package/dist/test/qwik/todos/Todo.tsx/low.tsx +18 -25
- package/dist/test/qwik/todos/Todo.tsx/med.tsx +8 -10
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -22
- package/dist/src/__tests__/data/blocks/onMount-onUnMount.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/onMount-onUnMount.jsx +0 -13
- package/dist/src/__tests__/data/blocks/onMount.d.ts +0 -1
- package/dist/src/__tests__/data/blocks/onMount.jsx +0 -13
- package/dist/src/types/generators.js +0 -1
|
@@ -1,71 +1,48 @@
|
|
|
1
|
-
const
|
|
2
|
-
const createStore = require("@builder.io/qwik").createStore;
|
|
1
|
+
const componentQrl = require("@builder.io/qwik").componentQrl;
|
|
3
2
|
const h = require("@builder.io/qwik").h;
|
|
4
3
|
const qrl = require("@builder.io/qwik").qrl;
|
|
5
4
|
const useLexicalScope = require("@builder.io/qwik").useLexicalScope;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const __state__ = createStore({});
|
|
11
|
-
const state = exports.__merge(__state__, __props__,true);
|
|
12
|
-
;
|
|
13
|
-
return qrl("./med.js", "Todo_onRender", [__props__,__state__]);
|
|
5
|
+
exports.Todo_onMount = (state) => {
|
|
6
|
+
typeof __STATE__ === "object" &&
|
|
7
|
+
Object.assign(state, __STATE__[state.serverStateId]);
|
|
8
|
+
return qrl("./med.js", "Todo_onRender", [state]);
|
|
14
9
|
};
|
|
15
|
-
exports.Todo =
|
|
16
|
-
|
|
10
|
+
exports.Todo = componentQrl(qrl("./med.js", "Todo_onMount", []));
|
|
17
11
|
exports.Todo_onRender = () => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
const state = useLexicalScope()[0];
|
|
13
|
+
return h(
|
|
14
|
+
"li",
|
|
15
|
+
{
|
|
16
|
+
class: `${props.todo.completed ? "completed" : ""} ${
|
|
17
|
+
state.editing ? "editing" : ""
|
|
18
|
+
}`,
|
|
19
|
+
},
|
|
24
20
|
h(
|
|
25
|
-
"
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
"div",
|
|
22
|
+
{ class: "view" },
|
|
23
|
+
h("input", {
|
|
24
|
+
type: "checkbox",
|
|
25
|
+
class: "toggle",
|
|
26
|
+
checked: props.todo.completed,
|
|
27
|
+
onClickQrl: qrl("./high.js", "Todo_onClick_0", [state]),
|
|
28
|
+
}),
|
|
29
29
|
h(
|
|
30
|
-
"
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
h(
|
|
35
|
-
"input",
|
|
36
|
-
{
|
|
37
|
-
type: "checkbox",
|
|
38
|
-
class: "toggle",
|
|
39
|
-
checked: props.todo.completed,
|
|
40
|
-
"on:click": qrl("./high.js", "Todo_onClick_0", [__props__, __state__])
|
|
41
|
-
}
|
|
42
|
-
),
|
|
43
|
-
h(
|
|
44
|
-
"label",
|
|
45
|
-
{
|
|
46
|
-
"on:dblclick": qrl("./high.js", "Todo_onDblClick_1", [__props__, __state__])
|
|
47
|
-
},
|
|
48
|
-
props.todo.text
|
|
49
|
-
),
|
|
50
|
-
h(
|
|
51
|
-
"button",
|
|
52
|
-
{
|
|
53
|
-
class: "destroy",
|
|
54
|
-
"on:click": qrl("./high.js", "Todo_onClick_2", [__props__, __state__])
|
|
55
|
-
}
|
|
56
|
-
)
|
|
30
|
+
"label",
|
|
31
|
+
{ onDblClickQrl: qrl("./high.js", "Todo_onDblClick_1", [state]) },
|
|
32
|
+
props.todo.text
|
|
57
33
|
),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
34
|
+
h("button", {
|
|
35
|
+
class: "destroy",
|
|
36
|
+
onClickQrl: qrl("./high.js", "Todo_onClick_2", [state]),
|
|
37
|
+
})
|
|
38
|
+
),
|
|
39
|
+
state.editing
|
|
40
|
+
? h("input", {
|
|
41
|
+
class: "edit",
|
|
42
|
+
value: props.todo.text,
|
|
43
|
+
onBlurQrl: qrl("./high.js", "Todo_onBlur_3", [state]),
|
|
44
|
+
onKeyUpQrl: qrl("./high.js", "Todo_onKeyUp_4", [state]),
|
|
45
|
+
})
|
|
46
|
+
: null
|
|
70
47
|
);
|
|
71
48
|
};
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import{
|
|
2
|
-
|
|
3
|
-
state
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useEvent, useLexicalScope } from "@builder.io/qwik";
|
|
2
|
+
export const Todo_onClick_0 = () => {
|
|
3
|
+
const state = useLexicalScope()[0];
|
|
4
|
+
state.toggle();
|
|
5
|
+
};
|
|
6
|
+
export const Todo_onDblClick_1 = () => {
|
|
7
|
+
const state = useLexicalScope()[0];
|
|
8
|
+
state.editing = true;
|
|
9
|
+
};
|
|
10
|
+
export const Todo_onClick_2 = () => {
|
|
11
|
+
todosState.todos.splice(todosState.todos.indexOf(props.todo));
|
|
12
|
+
};
|
|
13
|
+
export const Todo_onBlur_3 = () => {
|
|
14
|
+
const state = useLexicalScope()[0];
|
|
15
|
+
state.editing = false;
|
|
16
|
+
};
|
|
17
|
+
export const Todo_onKeyUp_4 = () => {
|
|
18
|
+
{
|
|
19
|
+
const event = useEvent();
|
|
20
|
+
props.todo.text = event.target.value;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -1 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { componentQrl, h, qrl, useLexicalScope } from "@builder.io/qwik";
|
|
2
|
+
export const Todo_onMount = (state) => {
|
|
3
|
+
typeof __STATE__ === "object" &&
|
|
4
|
+
Object.assign(state, __STATE__[state.serverStateId]);
|
|
5
|
+
return qrl("./med.js", "Todo_onRender", [state]);
|
|
6
|
+
};
|
|
7
|
+
export const Todo = componentQrl(qrl("./med.js", "Todo_onMount", []));
|
|
8
|
+
export const Todo_onRender = () => {
|
|
9
|
+
const state = useLexicalScope()[0];
|
|
10
|
+
return h(
|
|
11
|
+
"li",
|
|
12
|
+
{
|
|
13
|
+
class: `${props.todo.completed ? "completed" : ""} ${
|
|
14
|
+
state.editing ? "editing" : ""
|
|
15
|
+
}`,
|
|
16
|
+
},
|
|
17
|
+
h(
|
|
18
|
+
"div",
|
|
19
|
+
{ class: "view" },
|
|
20
|
+
h("input", {
|
|
21
|
+
type: "checkbox",
|
|
22
|
+
class: "toggle",
|
|
23
|
+
checked: props.todo.completed,
|
|
24
|
+
onClickQrl: qrl("./high.js", "Todo_onClick_0", [state]),
|
|
25
|
+
}),
|
|
26
|
+
h(
|
|
27
|
+
"label",
|
|
28
|
+
{ onDblClickQrl: qrl("./high.js", "Todo_onDblClick_1", [state]) },
|
|
29
|
+
props.todo.text
|
|
30
|
+
),
|
|
31
|
+
h("button", {
|
|
32
|
+
class: "destroy",
|
|
33
|
+
onClickQrl: qrl("./high.js", "Todo_onClick_2", [state]),
|
|
34
|
+
})
|
|
35
|
+
),
|
|
36
|
+
state.editing
|
|
37
|
+
? h("input", {
|
|
38
|
+
class: "edit",
|
|
39
|
+
value: props.todo.text,
|
|
40
|
+
onBlurQrl: qrl("./high.js", "Todo_onBlur_3", [state]),
|
|
41
|
+
onKeyUpQrl: qrl("./high.js", "Todo_onKeyUp_4", [state]),
|
|
42
|
+
})
|
|
43
|
+
: null
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -1,57 +1,22 @@
|
|
|
1
|
-
import { __merge } from "./med.js";
|
|
2
|
-
|
|
3
1
|
import { useEvent, useLexicalScope } from "@builder.io/qwik";
|
|
4
|
-
|
|
5
|
-
|
|
6
2
|
export const Todo_onClick_0 = () => {
|
|
7
|
-
const
|
|
8
|
-
const __props__ = __scope__[0];
|
|
9
|
-
const __state__ = __scope__[1];
|
|
10
|
-
const state = __merge(__state__, __props__);
|
|
11
|
-
;
|
|
12
|
-
|
|
3
|
+
const state = useLexicalScope()[0];
|
|
13
4
|
state.toggle();
|
|
14
5
|
};
|
|
15
|
-
|
|
16
6
|
export const Todo_onDblClick_1 = () => {
|
|
17
|
-
const
|
|
18
|
-
const __props__ = __scope__[0];
|
|
19
|
-
const __state__ = __scope__[1];
|
|
20
|
-
const state = __merge(__state__, __props__);
|
|
21
|
-
;
|
|
22
|
-
|
|
7
|
+
const state = useLexicalScope()[0];
|
|
23
8
|
state.editing = true;
|
|
24
9
|
};
|
|
25
|
-
|
|
26
10
|
export const Todo_onClick_2 = () => {
|
|
27
|
-
const __scope__ = useLexicalScope();
|
|
28
|
-
const __props__ = __scope__[0];
|
|
29
|
-
const __state__ = __scope__[1];
|
|
30
|
-
const state = __merge(__state__, __props__);
|
|
31
|
-
;
|
|
32
|
-
|
|
33
11
|
todosState.todos.splice(todosState.todos.indexOf(props.todo));
|
|
34
12
|
};
|
|
35
|
-
|
|
36
13
|
export const Todo_onBlur_3 = () => {
|
|
37
|
-
const
|
|
38
|
-
const __props__ = __scope__[0];
|
|
39
|
-
const __state__ = __scope__[1];
|
|
40
|
-
const state = __merge(__state__, __props__);
|
|
41
|
-
;
|
|
42
|
-
|
|
14
|
+
const state = useLexicalScope()[0];
|
|
43
15
|
state.editing = false;
|
|
44
16
|
};
|
|
45
|
-
|
|
46
17
|
export const Todo_onKeyUp_4 = () => {
|
|
47
|
-
const __scope__ = useLexicalScope();
|
|
48
|
-
const __props__ = __scope__[0];
|
|
49
|
-
const __state__ = __scope__[1];
|
|
50
|
-
const state = __merge(__state__, __props__);
|
|
51
|
-
;
|
|
52
18
|
{
|
|
53
19
|
const event = useEvent();
|
|
54
|
-
props.todo.text = event.target.value
|
|
20
|
+
props.todo.text = event.target.value;
|
|
55
21
|
}
|
|
56
22
|
};
|
|
57
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const __state__ = createStore({});
|
|
7
|
-
const state = __merge(__state__, __props__,true);
|
|
8
|
-
;
|
|
9
|
-
return qrl("./med.js", "Todo_onRender", [__props__,__state__]);
|
|
1
|
+
import { componentQrl, h, qrl, useLexicalScope } from "@builder.io/qwik";
|
|
2
|
+
export const Todo_onMount = (state) => {
|
|
3
|
+
typeof __STATE__ === "object" &&
|
|
4
|
+
Object.assign(state, __STATE__[state.serverStateId]);
|
|
5
|
+
return qrl("./med.js", "Todo_onRender", [state]);
|
|
10
6
|
};
|
|
11
|
-
export const Todo =
|
|
12
|
-
|
|
7
|
+
export const Todo = componentQrl<any, any>(qrl("./med.js", "Todo_onMount", []));
|
|
13
8
|
export const Todo_onRender = () => {
|
|
14
|
-
const
|
|
15
|
-
const __props__ = __scope__[0];
|
|
16
|
-
const __state__ = __scope__[1];
|
|
17
|
-
const state = __merge(__state__, __props__);
|
|
18
|
-
;
|
|
9
|
+
const state = useLexicalScope()[0];
|
|
19
10
|
return (
|
|
20
|
-
<li
|
|
11
|
+
<li
|
|
12
|
+
class={`${props.todo.completed ? "completed" : ""} ${
|
|
13
|
+
state.editing ? "editing" : ""
|
|
14
|
+
}`}
|
|
15
|
+
>
|
|
21
16
|
<div class="view">
|
|
22
|
-
<input
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
<input
|
|
18
|
+
type="checkbox"
|
|
19
|
+
class="toggle"
|
|
20
|
+
checked={props.todo.completed}
|
|
21
|
+
onClickQrl={qrl("./high.js", "Todo_onClick_0", [state])}
|
|
22
|
+
></input>
|
|
23
|
+
<label onDblClickQrl={qrl("./high.js", "Todo_onDblClick_1", [state])}>
|
|
28
24
|
{props.todo.text}
|
|
29
25
|
</label>
|
|
30
|
-
<button
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
<button
|
|
27
|
+
class="destroy"
|
|
28
|
+
onClickQrl={qrl("./high.js", "Todo_onClick_2", [state])}
|
|
29
|
+
></button>
|
|
33
30
|
</div>
|
|
34
|
-
{
|
|
35
|
-
<input
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
31
|
+
{state.editing ? (
|
|
32
|
+
<input
|
|
33
|
+
class="edit"
|
|
34
|
+
value={props.todo.text}
|
|
35
|
+
onBlurQrl={qrl("./high.js", "Todo_onBlur_3", [state])}
|
|
36
|
+
onKeyUpQrl={qrl("./high.js", "Todo_onKeyUp_4", [state])}
|
|
37
|
+
></input>
|
|
38
|
+
) : null}
|
|
42
39
|
</li>
|
|
43
40
|
);
|
|
44
41
|
};
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import { __merge } from "./med.js";
|
|
2
|
-
|
|
3
|
-
import { useLexicalScope } from "@builder.io/qwik";
|
|
4
|
-
|
|
5
|
-
|
|
6
1
|
export const Todos_onClick_0 = () => {
|
|
7
|
-
const __scope__ = useLexicalScope();
|
|
8
|
-
const __props__ = __scope__[0];
|
|
9
|
-
const __state__ = __scope__[1];
|
|
10
|
-
const state = __merge(__state__, __props__);
|
|
11
|
-
;
|
|
12
|
-
|
|
13
2
|
const newValue = !todosState.allCompleted;
|
|
14
3
|
|
|
15
4
|
for (const todoItem of todosState.todos) {
|
|
16
5
|
todoItem.completed = newValue;
|
|
17
6
|
}
|
|
18
7
|
};
|
|
19
|
-
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import { Todo
|
|
2
|
-
|
|
1
|
+
import { Todo } from "./med.js";
|
|
3
2
|
import { h, qrl, useLexicalScope } from "@builder.io/qwik";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
3
|
export const Todos_onRender = () => {
|
|
8
|
-
const
|
|
9
|
-
const __props__ = __scope__[0];
|
|
10
|
-
const __state__ = __scope__[1];
|
|
11
|
-
const state = __merge(__state__, __props__);
|
|
12
|
-
;
|
|
4
|
+
const state = useLexicalScope()[0];
|
|
13
5
|
return (
|
|
14
6
|
<section class="main">
|
|
15
|
-
{
|
|
16
|
-
<input
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
7
|
+
{todosState.todos.length ? (
|
|
8
|
+
<input
|
|
9
|
+
type="checkbox"
|
|
10
|
+
class="toggle-all"
|
|
11
|
+
checked={todosState.allCompleted}
|
|
12
|
+
onClickQrl={qrl("./high.js", "Todos_onClick_0", [state])}
|
|
13
|
+
></input>
|
|
14
|
+
) : null}
|
|
23
15
|
<ul class="todo-list">
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
{(todosState.todos || []).map(
|
|
17
|
+
function (__value__) {
|
|
18
|
+
var state = Object.assign({}, this, {
|
|
19
|
+
todosItem: __value__ == null ? {} : __value__,
|
|
20
|
+
});
|
|
21
|
+
return <Todo todo={todo}></Todo>;
|
|
22
|
+
}.bind(state)
|
|
23
|
+
)}
|
|
31
24
|
</ul>
|
|
32
25
|
</section>
|
|
33
26
|
);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const __state__ = createStore({});
|
|
7
|
-
const state = __merge(__state__, __props__,true);
|
|
8
|
-
;
|
|
9
|
-
return qrl("./low.js", "Todos_onRender", [__props__,__state__]);
|
|
1
|
+
import { componentQrl, qrl } from "@builder.io/qwik";
|
|
2
|
+
export const Todos_onMount = (state) => {
|
|
3
|
+
typeof __STATE__ === "object" &&
|
|
4
|
+
Object.assign(state, __STATE__[state.serverStateId]);
|
|
5
|
+
return qrl("./low.js", "Todos_onRender", [state]);
|
|
10
6
|
};
|
|
11
|
-
export const Todos =
|
|
7
|
+
export const Todos = componentQrl<any, any>(
|
|
8
|
+
qrl("./med.js", "Todos_onMount", [])
|
|
9
|
+
);
|