File tree Expand file tree Collapse file tree 7 files changed +63
-31
lines changed
src/features/framework-plugins/lit Expand file tree Collapse file tree 7 files changed +63
-31
lines changed Original file line number Diff line number Diff line change 7
7
"path" : " fixtures/-default/package/bar.js" ,
8
8
"declarations" : [
9
9
{
10
- "kind" : " function" ,
11
- "name" : " bar"
10
+ "kind" : " class" ,
11
+ "description" : " " ,
12
+ "name" : " CustomElementSchemaViewerElement" ,
13
+ "members" : [
14
+ {
15
+ "type" : {
16
+ "text" : " boolean"
17
+ },
18
+ "description" : " this is desc" ,
19
+ "name" : " src" ,
20
+ "kind" : " field" ,
21
+ "privacy" : " public"
22
+ }
23
+ ],
24
+ "attributes" : [
25
+ {
26
+ "name" : " src" ,
27
+ "fieldName" : " src"
28
+ }
29
+ ],
30
+ "superclass" : {
31
+ "name" : " LitElement"
32
+ },
33
+ "tagName" : " customelement-schema-viewer" ,
34
+ "customElement" : true
12
35
}
13
36
],
14
37
"exports" : [
15
38
{
16
39
"kind" : " js" ,
17
- "name" : " bar " ,
40
+ "name" : " CustomElementSchemaViewerElement " ,
18
41
"declaration" : {
19
- "name" : " bar " ,
42
+ "name" : " CustomElementSchemaViewerElement " ,
20
43
"module" : " fixtures/-default/package/bar.js"
21
44
}
22
- }
23
- ]
24
- },
25
- {
26
- "kind" : " javascript-module" ,
27
- "path" : " fixtures/-default/package/foo.js" ,
28
- "declarations" : [
45
+ },
29
46
{
30
- "kind" : " function" ,
31
- "name" : " foo"
32
- }
33
- ],
34
- "exports" : [
35
- {
36
- "kind" : " js" ,
37
- "name" : " foo" ,
47
+ "kind" : " custom-element-definition" ,
48
+ "name" : " customelement-schema-viewer" ,
38
49
"declaration" : {
39
- "name" : " foo " ,
40
- "module" : " fixtures/-default/package/foo .js"
50
+ "name" : " CustomElementSchemaViewerElement " ,
51
+ "module" : " fixtures/-default/package/bar .js"
41
52
}
42
53
}
43
54
]
Original file line number Diff line number Diff line change 1
- import type foo from 'ts' ;
2
- import { named } from 'thirdparty' ;
3
- export function bar ( ) {
1
+ /**
2
+ * @property {boolean } src this is desc
3
+ */
4
+ @customElement ( "customelement-schema-viewer" )
5
+ export class CustomElementSchemaViewerElement extends LitElement {
4
6
7
+
8
+ static get properties ( ) {
9
+ return {
10
+ src : { type : Boolean }
11
+ }
12
+ }
5
13
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 26
26
{
27
27
"kind" : " field" ,
28
28
"name" : " prop1" ,
29
+ "type" : {
30
+ "text" : " string"
31
+ },
32
+ "description" : " this is the description" ,
29
33
"privacy" : " public" ,
30
34
"default" : " 'foo'"
31
35
},
Original file line number Diff line number Diff line change 24
24
"name" : " decoratedPropertyNoAttr"
25
25
},
26
26
{
27
- "kind" : " field" ,
27
+ "type" : {
28
+ "text" : " string"
29
+ },
30
+ "description" : " this is the description" ,
28
31
"name" : " prop1" ,
32
+ "kind" : " field" ,
29
33
"privacy" : " public" ,
30
34
"default" : " 'foo'"
31
35
},
Original file line number Diff line number Diff line change 1
1
import { LitElement , property , customElement } from 'lit-element' ;
2
2
3
+ /**
4
+ * @prop {string } prop1 this is the description
5
+ */
3
6
@customElement ( 'my-element' )
4
7
class MyElement extends LitElement {
5
8
static get properties ( ) {
Original file line number Diff line number Diff line change @@ -44,7 +44,14 @@ export function staticPropertiesPlugin() {
44
44
currClass . attributes = [ ...( currClass ?. attributes || [ ] ) , attribute ]
45
45
}
46
46
47
- currClass ?. members . push ( classMember ) ;
47
+
48
+ const existingField = currClass ?. members ?. find ( field => field . name === classMember . name ) ;
49
+
50
+ if ( ! existingField ) {
51
+ currClass . members . push ( classMember ) ;
52
+ } else {
53
+ currClass . members = currClass ?. members ?. map ( field => field . name === classMember . name ? ( { ...field , ...classMember } ) : field ) ;
54
+ }
48
55
} ) ;
49
56
return ;
50
57
}
You can’t perform that action at this time.
0 commit comments