Skip to content

Commit e63d253

Browse files
committed
Some updates
1 parent c132b49 commit e63d253

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ and it is currently not meant to ever be used in production.
1111

1212
```tsx
1313
import { component, elem, prop, setMethods, Attrs } from 'js-element'
14-
import { html, createRef, ref, withLit } from 'js-element/lit'
14+
import { html, withLit } from 'js-element/lit'
1515
import { useState } from 'js-element/hooks'
1616
import counterStyles from './counter.css'
1717

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-element",
3-
"version": "0.0.203",
3+
"version": "0.0.205",
44
"description": "",
55
"license": "LGPL-3.0",
66
"main": "./index.js",

rollup.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ function createConfig(pkg, moduleFormat, productive) {
5454
'js-element/utils',
5555
'js-element/lit',
5656
'lit-html',
57-
'lit-html/directives/ref'
57+
'lit-html/directives/class-map',
58+
'lit-html/directives/ref',
59+
'lit-html/directives/repeat',
60+
'lit-html/directives/style-map'
5861
],
5962

6063
plugins: [

src/main/js-element-lit.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import { html, render } from 'lit-html'
1+
import { html, render, TemplateResult } from 'lit-html'
22
import { createRef, ref, Ref } from 'lit-html/directives/ref'
3+
import { classMap } from 'lit-html/directives/class-map'
4+
import { styleMap } from 'lit-html/directives/style-map'
5+
import { repeat } from 'lit-html/directives/repeat'
36

47
// === exports =======================================================
58

6-
export { createRef, html, ref, withLit, Ref }
9+
export { classMap, createRef, html, ref, repeat, styleMap, withLit }
10+
export { Ref, TemplateResult }
711

812
// === functions =====================================================
913

src/main/js-element.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,23 @@ function elem<E extends Component, C>(params: {
108108
}
109109
}
110110

111+
function prop<T>(proto: Component, propName: string): void
112+
111113
function prop<T>(params?: {
112114
attr: {
113115
mapPropToAttr(value: T): string | null
114116
mapAttrToProp(value: string | null): T
115117
}
116118
refl?: boolean
117-
}) {
119+
}): (proto: Component, propName: string) => void
120+
121+
function prop(arg1?: any, arg2?: any): any {
122+
if (typeof arg2 === 'string') {
123+
return prop()(arg1, arg2)
124+
}
125+
126+
const params = arg1 // TODO!!!
127+
118128
const { attr, refl: reflect } = params || {}
119129

120130
return (proto: Component, propName: string) => {

0 commit comments

Comments
 (0)