@builder.io/mitosis 0.0.47 → 0.0.50-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/CHANGELOG.md +4 -0
- package/dist/src/__tests__/angular.test.d.ts +1 -0
- package/dist/src/__tests__/angular.test.js +12 -0
- package/dist/src/__tests__/data/blocks/columns.raw.jsx +6 -0
- package/dist/src/__tests__/data/blocks/onUpdate.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/onUpdate.raw.jsx +10 -0
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.d.ts +1 -0
- package/dist/src/__tests__/data/blocks/onUpdateWithDeps.raw.jsx +11 -0
- package/dist/src/__tests__/data/blocks/tabs.raw.d.ts +11 -0
- package/dist/src/__tests__/data/blocks/tabs.raw.jsx +24 -0
- package/dist/src/__tests__/qoot.test.d.ts +1 -0
- package/dist/src/__tests__/qoot.test.js +115 -0
- package/dist/src/__tests__/qwik.test.js +38 -10
- package/dist/src/__tests__/react.test.js +12 -0
- package/dist/src/__tests__/svelte.test.d.ts +1 -0
- package/dist/src/__tests__/svelte.test.js +12 -0
- package/dist/src/__tests__/vue.test.js +6 -0
- package/dist/src/generators/angular.js +7 -3
- package/dist/src/generators/builder.js +7 -7
- package/dist/src/generators/html.js +16 -7
- package/dist/src/generators/jsx-lite.d.ts +10 -0
- package/dist/src/generators/jsx-lite.js +176 -0
- package/dist/src/generators/minify.d.ts +1 -0
- package/dist/src/generators/minify.js +24 -0
- package/dist/src/generators/mitosis.js +5 -2
- package/dist/src/generators/qoot.d.ts +21 -0
- package/dist/src/generators/qoot.js +442 -0
- package/dist/src/generators/qwik/component.js +48 -6
- package/dist/src/generators/qwik/directives.d.ts +21 -1
- package/dist/src/generators/qwik/directives.js +80 -3
- package/dist/src/generators/qwik/jsx.d.ts +1 -1
- package/dist/src/generators/qwik/jsx.js +28 -5
- package/dist/src/generators/qwik/src-generator.d.ts +3 -1
- package/dist/src/generators/qwik/src-generator.js +34 -10
- package/dist/src/generators/qwik.d.ts +21 -0
- package/dist/src/generators/qwik.js +458 -0
- package/dist/src/generators/react-native.js +57 -41
- package/dist/src/generators/react.js +18 -8
- package/dist/src/generators/solid.js +5 -2
- package/dist/src/generators/svelte.js +10 -5
- package/dist/src/generators/vue.js +7 -5
- package/dist/src/helpers/create-jsx-lite-component.d.ts +2 -0
- package/dist/src/helpers/create-jsx-lite-component.js +16 -0
- package/dist/src/helpers/create-jsx-lite-context.d.ts +4 -0
- package/dist/src/helpers/create-jsx-lite-context.js +18 -0
- package/dist/src/helpers/create-jsx-lite-node.d.ts +2 -0
- package/dist/src/helpers/create-jsx-lite-node.js +16 -0
- package/dist/src/helpers/is-jsx-lite-node.d.ts +2 -0
- package/dist/src/helpers/is-jsx-lite-node.js +7 -0
- package/dist/src/helpers/map-refs.js +7 -6
- package/dist/src/helpers/process-http-requests.js +3 -3
- package/dist/src/helpers/process-tag-references.js +4 -3
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +4 -3
- package/dist/src/jsx-types.d.ts +1 -1
- package/dist/src/parsers/builder.d.ts +50 -10
- package/dist/src/parsers/builder.js +37 -7
- package/dist/src/parsers/jsx.js +43 -3
- package/dist/src/parsers/liquid.js +4 -4
- package/dist/src/plugins/compile-away-builder-components.js +40 -20
- package/dist/src/symbols/symbol-processor.d.ts +18 -0
- package/dist/src/symbols/symbol-processor.js +177 -0
- package/dist/src/types/jsx-lite-component.d.ts +63 -0
- package/dist/src/types/jsx-lite-component.js +2 -0
- package/dist/src/types/jsx-lite-context.d.ts +6 -0
- package/dist/src/types/jsx-lite-context.js +2 -0
- package/dist/src/types/jsx-lite-node.d.ts +13 -0
- package/dist/src/types/jsx-lite-node.js +2 -0
- package/dist/src/types/jsx-lite-styles.d.ts +1 -0
- package/dist/src/types/jsx-lite-styles.js +2 -0
- package/dist/src/types/mitosis-component.d.ts +10 -5
- package/dist/test/qoot/Todo/bundle.js +88 -0
- package/dist/test/qoot/Todo/component.ts +17 -0
- package/dist/test/qoot/Todo/onButtonClick.ts +13 -0
- package/dist/test/qoot/Todo/onInput2Blur.ts +11 -0
- package/dist/test/qoot/Todo/onInput2KeyUp.ts +10 -0
- package/dist/test/qoot/Todo/onInputClick.ts +10 -0
- package/dist/test/qoot/Todo/onLabelDblClick.ts +11 -0
- package/dist/test/qoot/Todo/public.ts +4 -0
- package/dist/test/qoot/Todo/template.tsx +46 -0
- package/dist/test/qoot/Todos/component.ts +9 -0
- package/dist/test/qoot/Todos/onInputClick.ts +14 -0
- package/dist/test/qoot/Todos/public.ts +3 -0
- package/dist/test/qoot/Todos/template.tsx +30 -0
- package/dist/test/qwik/Accordion/low.jsx +39 -33
- package/dist/test/qwik/Accordion/med.jsx +1 -0
- package/dist/test/qwik/For/low.jsx +22 -14
- package/dist/test/qwik/For/med.jsx +1 -0
- package/dist/test/qwik/Image/low.js +20 -47
- package/dist/test/qwik/Image/med.js +3 -1
- package/dist/test/qwik/Image.slow/low.js +20 -47
- package/dist/test/qwik/Image.slow/med.js +3 -1
- package/dist/test/qwik/{todo → Todo}/Todo.cjs/high.cjs +0 -0
- package/dist/test/qwik/{todo → Todo}/Todo.cjs/low.cjs +0 -0
- package/dist/test/qwik/Todo/Todo.cjs/med.cjs +64 -0
- package/dist/test/qwik/{todo → Todo}/Todo.js/high.js +0 -0
- package/dist/test/qwik/{todo → Todo}/Todo.js/low.js +0 -0
- package/dist/test/qwik/Todo/Todo.js/med.js +1 -0
- package/dist/test/qwik/{todo → Todo}/Todo.tsx/high.tsx +0 -0
- package/dist/test/qwik/{todo → Todo}/Todo.tsx/low.tsx +0 -0
- package/dist/test/qwik/Todo/Todo.tsx/med.tsx +39 -0
- package/dist/test/qwik/Todo/bundle.js +46 -0
- package/dist/test/qwik/Todo/component.ts +17 -0
- package/dist/test/qwik/Todo/onButtonClick.ts +10 -0
- package/dist/test/qwik/Todo/onInput2Blur.ts +14 -0
- package/dist/test/qwik/Todo/onInput2KeyUp.ts +10 -0
- package/dist/test/qwik/Todo/onInputClick.ts +13 -0
- package/dist/test/qwik/Todo/onLabelDblClick.ts +11 -0
- package/dist/test/qwik/Todo/public.ts +3 -0
- package/dist/test/qwik/Todo/template.tsx +46 -0
- package/dist/test/qwik/Todo.ts +4 -0
- package/dist/test/qwik/Todo_component.ts +17 -0
- package/dist/test/qwik/Todo_onButtonClick.ts +13 -0
- package/dist/test/qwik/Todo_onInput2Blur.ts +14 -0
- package/dist/test/qwik/Todo_onInput2KeyUp.ts +10 -0
- package/dist/test/qwik/Todo_onInputClick.ts +13 -0
- package/dist/test/qwik/Todo_onLabelDblClick.ts +14 -0
- package/dist/test/qwik/Todo_template.tsx +46 -0
- package/dist/test/qwik/{todos → Todos}/Todo.tsx/high.tsx +0 -0
- package/dist/test/qwik/Todos/Todo.tsx/low.tsx +33 -0
- package/dist/test/qwik/Todos/Todo.tsx/med.tsx +9 -0
- package/dist/test/qwik/Todos/component.ts +9 -0
- package/dist/test/qwik/Todos/onInputClick.ts +14 -0
- package/dist/test/qwik/Todos/public.ts +3 -0
- package/dist/test/qwik/Todos/template.tsx +30 -0
- package/dist/test/qwik/Todos.ts +3 -0
- package/dist/test/qwik/Todos_component.ts +9 -0
- package/dist/test/qwik/Todos_onInputClick.ts +14 -0
- package/dist/test/qwik/Todos_template.tsx +30 -0
- package/dist/test/qwik/button/low.js +18 -10
- package/dist/test/qwik/button/med.js +3 -1
- package/dist/test/qwik/component/bindings/high.jsx +1 -0
- package/dist/test/qwik/component/bindings/low.jsx +84 -0
- package/dist/test/qwik/component/bindings/med.jsx +47 -0
- package/dist/test/qwik/hello_world/stylesheet/low.jsx +10 -4
- package/dist/test/qwik/hello_world/stylesheet/med.jsx +1 -0
- package/dist/test/qwik/page-with-symbol/low.js +23 -17
- package/dist/test/qwik/page-with-symbol/med.js +1 -0
- package/dist/test/qwik/qwik/Image/high.js +1 -0
- package/dist/test/qwik/qwik/Image/low.js +75 -0
- package/dist/test/qwik/qwik/Image/med.js +9 -0
- package/dist/test/qwik/qwik/Image.slow/high.js +1 -0
- package/dist/test/qwik/qwik/Image.slow/low.js +75 -0
- package/dist/test/qwik/qwik/Image.slow/med.js +9 -0
- package/dist/test/qwik/qwik/button/high.js +8 -0
- package/dist/test/qwik/qwik/button/low.js +34 -0
- package/dist/test/qwik/qwik/button/med.js +9 -0
- package/dist/test/qwik/qwik/hello_world/stylesheet/high.jsx +1 -0
- package/dist/test/qwik/qwik/hello_world/stylesheet/low.jsx +24 -0
- package/dist/test/qwik/qwik/hello_world/stylesheet/med.jsx +9 -0
- package/dist/test/qwik/qwik/page-with-symbol/high.js +1 -0
- package/dist/test/qwik/qwik/page-with-symbol/low.js +49 -0
- package/dist/test/qwik/qwik/page-with-symbol/med.js +9 -0
- package/dist/test/qwik/qwik/svg/high.js +1 -0
- package/dist/test/qwik/qwik/svg/low.js +30 -0
- package/dist/test/qwik/qwik/svg/med.js +9 -0
- package/dist/test/qwik/qwik/todo/Todo.cjs/high.cjs +31 -0
- package/dist/test/qwik/qwik/todo/Todo.cjs/low.cjs +1 -0
- package/dist/test/qwik/{todo → qwik/todo}/Todo.cjs/med.cjs +0 -0
- package/dist/test/qwik/qwik/todo/Todo.js/high.js +5 -0
- package/dist/{src/types/generators.d.ts → test/qwik/qwik/todo/Todo.js/low.js} +0 -0
- package/dist/test/qwik/{todo → qwik/todo}/Todo.js/med.js +0 -0
- package/dist/test/qwik/qwik/todo/Todo.tsx/high.tsx +30 -0
- package/dist/test/qwik/qwik/todo/Todo.tsx/low.tsx +1 -0
- package/dist/test/qwik/{todo → qwik/todo}/Todo.tsx/med.tsx +0 -0
- package/dist/test/qwik/qwik/todos/Todo.tsx/high.tsx +12 -0
- package/dist/test/qwik/{todos → qwik/todos}/Todo.tsx/low.tsx +3 -4
- package/dist/test/qwik/{todos → qwik/todos}/Todo.tsx/med.tsx +0 -0
- package/dist/test/qwik/svg/low.js +16 -10
- package/dist/test/qwik/svg/med.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/types/generators.js +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { injectMethod, QRL, jsxFactory } from "@builder.io/qwik";
|
|
2
|
+
import { TodosComponent } from "./component.js";
|
|
3
|
+
|
|
4
|
+
import { TodosState as todosState } from "../TodosState/public.js";
|
|
5
|
+
import { Todo } from "../Todo/public.js";
|
|
6
|
+
|
|
7
|
+
export default injectMethod(TodosComponent, function (this: TodosComponent) {
|
|
8
|
+
return (
|
|
9
|
+
<section class="main">
|
|
10
|
+
{todosState.todos.length ? (
|
|
11
|
+
<>
|
|
12
|
+
<input
|
|
13
|
+
class="toggle-all"
|
|
14
|
+
type="checkbox"
|
|
15
|
+
checked={todosState.allCompleted}
|
|
16
|
+
on:click={QRL`ui:/Todos/onInputClick`}
|
|
17
|
+
/>
|
|
18
|
+
</>
|
|
19
|
+
) : undefined}
|
|
20
|
+
|
|
21
|
+
<ul class="todo-list">
|
|
22
|
+
{todosState.todos.map((todo) => (
|
|
23
|
+
<>
|
|
24
|
+
<Todo todo={todo}></Todo>
|
|
25
|
+
</>
|
|
26
|
+
))}
|
|
27
|
+
</ul>
|
|
28
|
+
</section>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
1
3
|
import { h, qHook } from "@builder.io/qwik";
|
|
2
4
|
|
|
3
5
|
|
|
@@ -41,52 +43,56 @@ export const MyComponent_styles = `
|
|
|
41
43
|
}
|
|
42
44
|
`;
|
|
43
45
|
|
|
44
|
-
export const MyComponent_onRender = qHook((
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
47
|
+
const state = __merge(__state__, __props__);
|
|
48
|
+
;
|
|
49
|
+
return (
|
|
50
|
+
<div gridRowWidth="25%"
|
|
51
|
+
class="csw5022"
|
|
52
|
+
items={[{title:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item title',id:'builder-5fed2723c1cc4fb39e9d22b9c54ef179',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-2cad86b387ec405d82917895d7af0a12',component:{name:'Text',options:{text:'<p>Item 1</p>'}},responsiveStyles:{large:{textAlign:'left',display:'flex',flexDirection:'column'}}}],responsiveStyles:{large:{marginTop:'10px',position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',paddingBottom:'10px'}}}],detail:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item detail',id:'builder-18279a99b32240f19aa21d3f4b015cc9',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-2dbfa56b8988461c8566bbe759580e9b',component:{name:'Text',options:{text:'<p>Item 1 content</p>'}},responsiveStyles:{large:{paddingTop:'50px',textAlign:'left',display:'flex',flexDirection:'column',paddingBottom:'50px'}}}],responsiveStyles:{large:{position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',marginTop:'10px',paddingBottom:'10px'}}}]},{title:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item title',id:'builder-2a93def22a354cf7aa193c20d1ad6def',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-1365fc457ece45db82ad90dbe9819e7c',component:{name:'Text',options:{text:'<p>Item 2</p>'}},responsiveStyles:{large:{textAlign:'left',display:'flex',flexDirection:'column'}}}],responsiveStyles:{large:{marginTop:'10px',position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',paddingBottom:'10px'}}}],detail:[{'@type':'@builder.io/sdk:Element','@version':2,layerName:'Accordion item detail',id:'builder-fd6ef41da6d040328fbd8b0801611fe5',children:[{'@type':'@builder.io/sdk:Element','@version':2,id:'builder-7362f9fd64c647c5a400d9e75c74473f',component:{name:'Text',options:{text:'<p>Item 2 content</p>'}},responsiveStyles:{large:{paddingTop:'50px',textAlign:'left',display:'flex',flexDirection:'column',paddingBottom:'50px'}}}],responsiveStyles:{large:{position:'relative',display:'flex',alignItems:'stretch',flexDirection:'column',marginTop:'10px',paddingBottom:'10px'}}}]}]}
|
|
53
|
+
animate={true}>
|
|
54
|
+
<div>
|
|
55
|
+
<div builder="accordion">
|
|
56
|
+
<div builder="accordion-title">
|
|
57
|
+
<div class="csanagh">
|
|
58
|
+
<div class="crwdrpw">
|
|
59
|
+
<div innerHTML="<p>Item 1</p>"
|
|
60
|
+
class="builder-text">
|
|
61
|
+
</div>
|
|
56
62
|
</div>
|
|
57
63
|
</div>
|
|
58
64
|
</div>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
<div builder="accordion-detail">
|
|
66
|
+
<div class="c4qyc1p">
|
|
67
|
+
<div class="ctcw2m4">
|
|
68
|
+
<div innerHTML="<p>Item 1 content</p>"
|
|
69
|
+
class="builder-text">
|
|
70
|
+
</div>
|
|
65
71
|
</div>
|
|
66
72
|
</div>
|
|
67
73
|
</div>
|
|
68
74
|
</div>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
<div builder="accordion">
|
|
76
|
+
<div builder="accordion-title">
|
|
77
|
+
<div class="csanagh">
|
|
78
|
+
<div class="crwdrpw">
|
|
79
|
+
<div innerHTML="<p>Item 2</p>"
|
|
80
|
+
class="builder-text">
|
|
81
|
+
</div>
|
|
76
82
|
</div>
|
|
77
83
|
</div>
|
|
78
84
|
</div>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
<div builder="accordion-detail">
|
|
86
|
+
<div class="c4qyc1p">
|
|
87
|
+
<div class="ctcw2m4">
|
|
88
|
+
<div innerHTML="<p>Item 2 content</p>"
|
|
89
|
+
class="builder-text">
|
|
90
|
+
</div>
|
|
85
91
|
</div>
|
|
86
92
|
</div>
|
|
87
93
|
</div>
|
|
88
94
|
</div>
|
|
89
95
|
</div>
|
|
90
96
|
</div>
|
|
91
|
-
|
|
92
|
-
)
|
|
97
|
+
);
|
|
98
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
5
6
|
export const MyComponent = qComponent({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
1
3
|
import { h, qHook } from "@builder.io/qwik";
|
|
2
4
|
|
|
3
5
|
|
|
@@ -33,23 +35,29 @@ export const MyComponent_styles = `
|
|
|
33
35
|
}
|
|
34
36
|
`;
|
|
35
37
|
|
|
36
|
-
export const MyComponent_onRender = qHook((
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
39
|
+
const state = __merge(__state__, __props__);
|
|
40
|
+
;
|
|
41
|
+
return (
|
|
42
|
+
<div class="cvdfnp5"
|
|
43
|
+
maxWidth={1200}>
|
|
44
|
+
<section class="cz5wnof">
|
|
45
|
+
{ (state.simpleList.results || []).map((function(__value__) {
|
|
46
|
+
var state = Object.assign({}, this, {resultsItem: __value__ == null ? {} : __value__});
|
|
47
|
+
return (<div class="cdrk993">
|
|
48
|
+
<div class="builder-text"
|
|
49
|
+
innerHTML={(() => {
|
|
44
50
|
try { var _virtual_index=state.resultsItem.data.title;return _virtual_index }
|
|
45
51
|
catch (err) {
|
|
46
52
|
console.warn('Builder code error', err);
|
|
47
53
|
}
|
|
48
54
|
})()}>
|
|
55
|
+
</div>
|
|
49
56
|
</div>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
)
|
|
57
|
+
);
|
|
58
|
+
}).bind(state))
|
|
59
|
+
}
|
|
60
|
+
</section>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
5
6
|
export const MyComponent = qComponent({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
3
|
+
import { Image } from "./med.js";
|
|
4
|
+
|
|
1
5
|
import { h, qHook } from "@builder.io/qwik";
|
|
2
6
|
|
|
3
7
|
|
|
@@ -13,56 +17,25 @@ export const MyComponent_styles = `
|
|
|
13
17
|
min-width: 20px;
|
|
14
18
|
overflow: hidden;
|
|
15
19
|
}
|
|
16
|
-
.c4vjsfu{
|
|
17
|
-
width: 100%;
|
|
18
|
-
padding-top: 100%;
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
font-size: 0;
|
|
21
|
-
}
|
|
22
|
-
.cffxoir{
|
|
23
|
-
object-fit: cover;
|
|
24
|
-
object-position: center;
|
|
25
|
-
position: absolute;
|
|
26
|
-
height: 100%;
|
|
27
|
-
width: 100%;
|
|
28
|
-
top: 0;
|
|
29
|
-
left: 0;
|
|
30
|
-
}
|
|
31
20
|
`;
|
|
32
21
|
|
|
33
|
-
export const MyComponent_onRender = qHook((
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class: "cvk52jt"
|
|
38
|
-
},
|
|
39
|
-
h(
|
|
40
|
-
"picture",
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
h(
|
|
45
|
-
"source",
|
|
46
|
-
{
|
|
47
|
-
srcset: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
48
|
-
type: "image/webp"
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
h(
|
|
52
|
-
"img",
|
|
53
|
-
{
|
|
54
|
-
src: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
55
|
-
srcset: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
56
|
-
class: "cffxoir",
|
|
57
|
-
loading: "lazy"
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
),
|
|
22
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
23
|
+
const state = __merge(__state__, __props__);
|
|
24
|
+
;
|
|
25
|
+
return (
|
|
61
26
|
h(
|
|
62
|
-
|
|
27
|
+
Image,
|
|
63
28
|
{
|
|
64
|
-
|
|
29
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
30
|
+
backgroundSize: "cover",
|
|
31
|
+
backgroundPosition: "center",
|
|
32
|
+
class: "cvk52jt",
|
|
33
|
+
lazy: true,
|
|
34
|
+
fitContent: true,
|
|
35
|
+
aspectRatio: 1,
|
|
36
|
+
height: 1300,
|
|
37
|
+
width: 1300
|
|
65
38
|
}
|
|
66
39
|
)
|
|
67
|
-
)
|
|
68
|
-
)
|
|
40
|
+
);
|
|
41
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { qComponent, qHook } from "@builder.io/qwik";
|
|
1
|
+
import { h, qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
5
6
|
export const MyComponent = qComponent({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
7
8
|
onRender: qHook("./low#MyComponent_onRender"),
|
|
8
9
|
styles: "./low#MyComponent_styles"
|
|
9
10
|
});
|
|
11
|
+
export const Image = function Image(props){var jsx = props.children || [];var image = props.image;if(image){var isBuilderIoImage = !!(image || '').match(/builder\.io/);var imgProps ={src:props.image,style:"object-fit:".concat(props.backgroundSize || 'cover',";object-position:").concat(props.backgroundPosition || 'center',";")+(props.aspectRatio ? 'position:absolute;height:100%;width:100%;top:0;left:0':''),sizes:props.sizes,alt:props.altText,loading:props.lazy ? 'lazy':undefined,srcset:undefined,};var sizingDiv = h('div',{class:'builder-image-sizer',style:"width:100%;padding-top:".concat((props.aspectRatio || 1)* 100,"%;pointer-events:none;font-size:0"),});if(isBuilderIoImage){var srcset = ['100','200','400','800','1200','1600','2000'] .map(function(size){return updateQueryParam(image,'width',size)+ ' ' + size + 'w';}).concat([image]).join(',');imgProps.srcset = srcset;jsx = jsx = [ h('picture',{},[ h('source',{type:'image/webp',srcset:srcset}),h('img',imgProps,jsx),]),sizingDiv,];}else{jsx = [h('img',imgProps,jsx),sizingDiv];}}var children = props.children ? [jsx].concat(props.children):[jsx];return h(props.href ? 'a':'div',{href:props.href,class:props.class},children);function updateQueryParam(uri,key,value){if(uri === void 0){uri = '';}var re = new RegExp('([?&])' + key + '=.*?(&|$)','i');var separator = uri.indexOf('?')!==-1 ? '&':'?';if(uri.match(re)){return uri.replace(re,'$1' + key + '=' + encodeURIComponent(value)+ '$2');}return uri + separator + key + '=' + encodeURIComponent(value);}};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { __merge } from "./med";
|
|
2
|
+
|
|
3
|
+
import { Image } from "./med.js";
|
|
4
|
+
|
|
1
5
|
import { h, qHook } from "@builder.io/qwik";
|
|
2
6
|
|
|
3
7
|
|
|
@@ -13,56 +17,25 @@ export const MyComponent_styles = `
|
|
|
13
17
|
min-width: 20px;
|
|
14
18
|
overflow: hidden;
|
|
15
19
|
}
|
|
16
|
-
.c4vjsfu{
|
|
17
|
-
width: 100%;
|
|
18
|
-
padding-top: 100%;
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
font-size: 0;
|
|
21
|
-
}
|
|
22
|
-
.cffxoir{
|
|
23
|
-
object-fit: cover;
|
|
24
|
-
object-position: center;
|
|
25
|
-
position: absolute;
|
|
26
|
-
height: 100%;
|
|
27
|
-
width: 100%;
|
|
28
|
-
top: 0;
|
|
29
|
-
left: 0;
|
|
30
|
-
}
|
|
31
20
|
`;
|
|
32
21
|
|
|
33
|
-
export const MyComponent_onRender = qHook((
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
class: "cvk52jt"
|
|
38
|
-
},
|
|
39
|
-
h(
|
|
40
|
-
"picture",
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
h(
|
|
45
|
-
"source",
|
|
46
|
-
{
|
|
47
|
-
srcset: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?format=webp&width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
48
|
-
type: "image/webp"
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
h(
|
|
52
|
-
"img",
|
|
53
|
-
{
|
|
54
|
-
src: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
55
|
-
srcset: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=100 100w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=200 200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=400 400w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=800 800w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1200 1200w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=1600 1600w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b?width=2000 2000w, https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
56
|
-
class: "cffxoir",
|
|
57
|
-
loading: "lazy"
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
),
|
|
22
|
+
export const MyComponent_onRender = qHook((__props__, __state__) => {
|
|
23
|
+
const state = __merge(__state__, __props__);
|
|
24
|
+
;
|
|
25
|
+
return (
|
|
61
26
|
h(
|
|
62
|
-
|
|
27
|
+
Image,
|
|
63
28
|
{
|
|
64
|
-
|
|
29
|
+
image: "https://cdn.builder.io/api/v1/image/assets%2F23dfd7cef1104af59f281d58ec525923%2F4ecf7b7554464b0183ab8250f67e797b",
|
|
30
|
+
backgroundSize: "cover",
|
|
31
|
+
backgroundPosition: "center",
|
|
32
|
+
class: "cvk52jt",
|
|
33
|
+
lazy: true,
|
|
34
|
+
fitContent: true,
|
|
35
|
+
aspectRatio: 1,
|
|
36
|
+
height: 1300,
|
|
37
|
+
width: 1300
|
|
65
38
|
}
|
|
66
39
|
)
|
|
67
|
-
)
|
|
68
|
-
)
|
|
40
|
+
);
|
|
41
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { qComponent, qHook } from "@builder.io/qwik";
|
|
1
|
+
import { h, qComponent, qHook } from "@builder.io/qwik";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
4
5
|
export const onMountCreateEmptyState = qHook(() => ({}));
|
|
5
6
|
export const MyComponent = qComponent({
|
|
6
7
|
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
7
8
|
onRender: qHook("./low#MyComponent_onRender"),
|
|
8
9
|
styles: "./low#MyComponent_styles"
|
|
9
10
|
});
|
|
11
|
+
export const Image = function Image(props){var jsx = props.children || [];var image = props.image;if(image){var isBuilderIoImage = !!(image || '').match(/builder\.io/);var imgProps ={src:props.image,style:"object-fit:".concat(props.backgroundSize || 'cover',";object-position:").concat(props.backgroundPosition || 'center',";")+(props.aspectRatio ? 'position:absolute;height:100%;width:100%;top:0;left:0':''),sizes:props.sizes,alt:props.altText,loading:props.lazy ? 'lazy':undefined,srcset:undefined,};var sizingDiv = h('div',{class:'builder-image-sizer',style:"width:100%;padding-top:".concat((props.aspectRatio || 1)* 100,"%;pointer-events:none;font-size:0"),});if(isBuilderIoImage){var srcset = ['100','200','400','800','1200','1600','2000'] .map(function(size){return updateQueryParam(image,'width',size)+ ' ' + size + 'w';}).concat([image]).join(',');imgProps.srcset = srcset;jsx = jsx = [ h('picture',{},[ h('source',{type:'image/webp',srcset:srcset}),h('img',imgProps,jsx),]),sizingDiv,];}else{jsx = [h('img',imgProps,jsx),sizingDiv];}}var children = props.children ? [jsx].concat(props.children):[jsx];return h(props.href ? 'a':'div',{href:props.href,class:props.class},children);function updateQueryParam(uri,key,value){if(uri === void 0){uri = '';}var re = new RegExp('([?&])' + key + '=.*?(&|$)','i');var separator = uri.indexOf('?')!==-1 ? '&':'?';if(uri.match(re)){return uri.replace(re,'$1' + key + '=' + encodeURIComponent(value)+ '$2');}return uri + separator + key + '=' + encodeURIComponent(value);}};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
const h = require("@builder.io/qwik").h;
|
|
2
|
+
const qComponent = require("@builder.io/qwik").qComponent;
|
|
3
|
+
const qHook = require("@builder.io/qwik").qHook;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
exports.__merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
7
|
+
exports.onMountCreateEmptyState = qHook(() => ({}));
|
|
8
|
+
exports.Todo = qComponent({
|
|
9
|
+
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
10
|
+
onRender: qHook("./med#Todo_onRender")
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
exports.Todo_onRender = qHook((__props__, __state__) => {
|
|
14
|
+
const state = exports.__merge(__state__, __props__);
|
|
15
|
+
;
|
|
16
|
+
return (
|
|
17
|
+
h(
|
|
18
|
+
"li",
|
|
19
|
+
{
|
|
20
|
+
class: `${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`
|
|
21
|
+
},
|
|
22
|
+
h(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
class: "view"
|
|
26
|
+
},
|
|
27
|
+
h(
|
|
28
|
+
"input",
|
|
29
|
+
{
|
|
30
|
+
type: "checkbox",
|
|
31
|
+
class: "toggle",
|
|
32
|
+
checked: props.todo.completed,
|
|
33
|
+
"on:click": qHook("./high#Todo_onClick_0")
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
h(
|
|
37
|
+
"label",
|
|
38
|
+
{
|
|
39
|
+
"on:dblclick": qHook("./high#Todo_onDblClick_1")
|
|
40
|
+
},
|
|
41
|
+
props.todo.text
|
|
42
|
+
),
|
|
43
|
+
h(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
class: "destroy",
|
|
47
|
+
"on:click": qHook("./high#Todo_onClick_2")
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
),
|
|
51
|
+
state.editing ?
|
|
52
|
+
h(
|
|
53
|
+
"input",
|
|
54
|
+
{
|
|
55
|
+
class: "edit",
|
|
56
|
+
value: props.todo.text,
|
|
57
|
+
"on:blur": qHook("./high#Todo_onBlur_3"),
|
|
58
|
+
"on:keyup": qHook("./high#Todo_onKeyUp_4")
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
: null
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
});
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h,qComponent,qHook}from"@builder.io/qwik";export const __merge=function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};export const onMountCreateEmptyState=qHook(()=>({}));export const Todo=qComponent({onMount:qHook("./med#onMountCreateEmptyState"),onRender:qHook("./med#Todo_onRender")});export const Todo_onRender=qHook((__props__,__state__)=>{const state=__merge(__state__,__props__);;return (h("li",{class:`${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`},h("div",{class:"view"},h("input",{type:"checkbox",class:"toggle",checked:props.todo.completed,"on:click":qHook("./high#Todo_onClick_0")}),h("label",{"on:dblclick":qHook("./high#Todo_onDblClick_1")},props.todo.text),h("button",{class:"destroy","on:click":qHook("./high#Todo_onClick_2")})),state.editing?h("input",{class:"edit",value:props.todo.text,"on:blur":qHook("./high#Todo_onBlur_3"),"on:keyup":qHook("./high#Todo_onKeyUp_4")}):null));});
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { h, qComponent, qHook } from "@builder.io/qwik";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const __merge = function __merge(state,props,create){if(create === void 0){create = false;}for(var key in props){if(key.indexOf(':')==-1 && !key.startsWith('__')&& Object.prototype.hasOwnProperty.call(props,key)){state[key] = props[key];}}if(create && typeof __STATE__ == 'object' && props.serverStateId){debugger;Object.assign(state,__STATE__[props.serverStateId]);}return state;};
|
|
5
|
+
export const onMountCreateEmptyState = qHook<any, any>(() => ({}));
|
|
6
|
+
export const Todo = qComponent<any, any>({
|
|
7
|
+
onMount: qHook("./med#onMountCreateEmptyState"),
|
|
8
|
+
onRender: qHook("./med#Todo_onRender")
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const Todo_onRender = qHook((__props__, __state__) => {
|
|
12
|
+
const state = __merge(__state__, __props__);
|
|
13
|
+
;
|
|
14
|
+
return (
|
|
15
|
+
<li class={`${props.todo.completed ? 'completed' : ''} ${state.editing ? 'editing' : ''}`}>
|
|
16
|
+
<div class="view">
|
|
17
|
+
<input type="checkbox"
|
|
18
|
+
class="toggle"
|
|
19
|
+
checked={props.todo.completed}
|
|
20
|
+
on:click={qHook("./high#Todo_onClick_0")}>
|
|
21
|
+
</input>
|
|
22
|
+
<label on:dblclick={qHook("./high#Todo_onDblClick_1")}>
|
|
23
|
+
{props.todo.text}
|
|
24
|
+
</label>
|
|
25
|
+
<button class="destroy"
|
|
26
|
+
on:click={qHook("./high#Todo_onClick_2")}>
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
{ state.editing ?
|
|
30
|
+
<input class="edit"
|
|
31
|
+
value={props.todo.text}
|
|
32
|
+
on:blur={qHook("./high#Todo_onBlur_3")}
|
|
33
|
+
on:keyup={qHook("./high#Todo_onKeyUp_4")}>
|
|
34
|
+
</input>
|
|
35
|
+
: null
|
|
36
|
+
}
|
|
37
|
+
</li>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Component, injectMethod, h, QRL } from '@builder.io/qwik';
|
|
2
|
+
|
|
3
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4
|
+
class TodoComponent extends Component {
|
|
5
|
+
constructor(...args) {
|
|
6
|
+
super(...args);
|
|
7
|
+
|
|
8
|
+
_defineProperty(this, "editing", false);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
toggle() {
|
|
12
|
+
this.todo.completed = !this.todo.completed;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$newState() {
|
|
16
|
+
return {}; // TODO
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
_defineProperty(TodoComponent, "$templateQRL", "ui:/Todo/bundle.template");
|
|
22
|
+
|
|
23
|
+
const template = injectMethod(TodoComponent, function () {
|
|
24
|
+
return h("li", {
|
|
25
|
+
class: `${this.todo.completed ? "completed" : ""} ${this.editing ? "editing" : ""}`
|
|
26
|
+
}, h("div", {
|
|
27
|
+
class: "view"
|
|
28
|
+
}, h("input", {
|
|
29
|
+
type: "checkbox",
|
|
30
|
+
class: "toggle",
|
|
31
|
+
checked: this.todo.completed,
|
|
32
|
+
"on:click": QRL`ui:/Todo/bundle.onInputClick`
|
|
33
|
+
}), h("label", {
|
|
34
|
+
"on:dblclick": QRL`ui:/Todo/bundle.onLabelDblClick`
|
|
35
|
+
}, this.todo.text), h("button", {
|
|
36
|
+
class: "destroy",
|
|
37
|
+
"on:click": QRL`ui:/Todo/bundle.onButtonClick`
|
|
38
|
+
})), this.editing ? h(null, null, h("input", {
|
|
39
|
+
class: "edit",
|
|
40
|
+
value: this.todo.text,
|
|
41
|
+
"on:blur": QRL`ui:/Todo/bundle.onInput2Blur`,
|
|
42
|
+
"on:keyup": QRL`ui:/Todo/bundle.onInput2KeyUp`
|
|
43
|
+
})) : undefined);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { template };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, QRL } from "@builder.io/qwik";
|
|
2
|
+
|
|
3
|
+
export class TodoComponent extends Component<any, any> {
|
|
4
|
+
static $templateQRL = "ui:/Todo/template";
|
|
5
|
+
|
|
6
|
+
editing = false;
|
|
7
|
+
toggle() {
|
|
8
|
+
this.todo.completed = !this.todo.completed;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
$newState() {
|
|
12
|
+
return {}; // TODO
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { injectEventHandler, provideEvent, markDirty } from "@builder.io/qwik";
|
|
2
|
+
import { TodoComponent } from "./component.js";
|
|
3
|
+
|
|
4
|
+
export const onButtonClick = injectEventHandler(
|
|
5
|
+
TodoComponent,
|
|
6
|
+
provideEvent(),
|
|
7
|
+
async function (this: TodoComponent, event: Event) {
|
|
8
|
+
todosState.todos.splice(todosState.todos.indexOf(this.todo));
|
|
9
|
+
}
|
|
10
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { injectEventHandler, provideEvent, markDirty } from "@builder.io/qwik";
|
|
2
|
+
import { TodoComponent } from "./component.js";
|
|
3
|
+
|
|
4
|
+
export default injectEventHandler(
|
|
5
|
+
TodoComponent,
|
|
6
|
+
provideEvent(),
|
|
7
|
+
async function (this: TodoComponent, event: Event) {
|
|
8
|
+
this.editing = false;
|
|
9
|
+
markDirty(this);
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
his);
|
|
13
|
+
}
|
|
14
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { injectEventHandler, provideEvent, markDirty } from "@builder.io/qwik";
|
|
2
|
+
import { TodoComponent } from "./component.js";
|
|
3
|
+
|
|
4
|
+
export const onInput2KeyUp = injectEventHandler(
|
|
5
|
+
TodoComponent,
|
|
6
|
+
provideEvent(),
|
|
7
|
+
async function (this: TodoComponent, event: Event) {
|
|
8
|
+
this.todo.text = event.target.value;
|
|
9
|
+
}
|
|
10
|
+
);
|