@operato/app 2.0.0-alpha.106 → 2.0.0-alpha.107
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 +9 -0
- package/dist/src/input/ox-input-graphql.js +0 -1
- package/dist/src/input/ox-input-graphql.js.map +1 -1
- package/dist/stories/graphql-client.stories.d.ts +26 -0
- package/dist/stories/graphql-client.stories.js +55 -0
- package/dist/stories/graphql-client.stories.js.map +1 -0
- package/dist/stories/ox-selector-resource-object.stories.d.ts +29 -0
- package/dist/stories/ox-selector-resource-object.stories.js +80 -0
- package/dist/stories/ox-selector-resource-object.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -12
- package/src/input/ox-input-graphql.ts +0 -1
- package/stories/graphql-client.stories.ts +73 -0
- package/stories/ox-selector-resource-object.stories.ts +98 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/app",
|
|
3
3
|
"description": "WebApplication production supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "2.0.0-alpha.
|
|
5
|
+
"version": "2.0.0-alpha.107",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -134,22 +134,21 @@
|
|
|
134
134
|
"@graphql-tools/delegate": "^10.0.1",
|
|
135
135
|
"@graphql-tools/wrap": "^8.5.0",
|
|
136
136
|
"@material/web": "^1.4.0",
|
|
137
|
-
"@operato/attachment": "^2.0.0-alpha.
|
|
138
|
-
"@operato/data-grist": "^2.0.0-alpha.
|
|
139
|
-
"@operato/font": "^2.0.0-alpha.
|
|
140
|
-
"@operato/form": "^2.0.0-alpha.
|
|
141
|
-
"@operato/graphql": "^2.0.0-alpha.
|
|
137
|
+
"@operato/attachment": "^2.0.0-alpha.107",
|
|
138
|
+
"@operato/data-grist": "^2.0.0-alpha.107",
|
|
139
|
+
"@operato/font": "^2.0.0-alpha.107",
|
|
140
|
+
"@operato/form": "^2.0.0-alpha.107",
|
|
141
|
+
"@operato/graphql": "^2.0.0-alpha.107",
|
|
142
142
|
"@operato/i18n": "^2.0.0-alpha.59",
|
|
143
|
-
"@operato/input": "^2.0.0-alpha.
|
|
144
|
-
"@operato/layout": "^2.0.0-alpha.
|
|
145
|
-
"@operato/property-editor": "^2.0.0-alpha.
|
|
146
|
-
"@operato/shell": "^2.0.0-alpha.
|
|
143
|
+
"@operato/input": "^2.0.0-alpha.107",
|
|
144
|
+
"@operato/layout": "^2.0.0-alpha.107",
|
|
145
|
+
"@operato/property-editor": "^2.0.0-alpha.107",
|
|
146
|
+
"@operato/shell": "^2.0.0-alpha.107",
|
|
147
147
|
"@operato/styles": "^2.0.0-alpha.102",
|
|
148
148
|
"@operato/utils": "^2.0.0-alpha.68",
|
|
149
149
|
"cm6-graphql": "^0.0.14",
|
|
150
150
|
"codemirror": "^6.0.1",
|
|
151
151
|
"cronstrue": "^2.2.0",
|
|
152
|
-
"cross-fetch": "^3.1.5",
|
|
153
152
|
"graphql": "^16.5.0",
|
|
154
153
|
"graphql-config": "^5.0.2",
|
|
155
154
|
"graphql-tag": "^2.12.6",
|
|
@@ -187,5 +186,5 @@
|
|
|
187
186
|
"prettier --write"
|
|
188
187
|
]
|
|
189
188
|
},
|
|
190
|
-
"gitHead": "
|
|
189
|
+
"gitHead": "32057ca0cb2c8ff542aca6d438d1ffbb77dc1cc8"
|
|
191
190
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { setClientLink, createMockLink } from '@operato/graphql/graphql-env.js'
|
|
2
|
+
import '@operato/graphql/graphql-client.js'
|
|
3
|
+
import '../src/input/ox-input-graphql.js'
|
|
4
|
+
|
|
5
|
+
// TODO cm6-graphql에서 사용하는 nullthrows 관련 모듈 오류로 스토리북 테스트가 안됨.
|
|
6
|
+
|
|
7
|
+
import { html, TemplateResult } from 'lit'
|
|
8
|
+
|
|
9
|
+
setClientLink(
|
|
10
|
+
createMockLink({
|
|
11
|
+
request: {
|
|
12
|
+
query: ''
|
|
13
|
+
},
|
|
14
|
+
result: {
|
|
15
|
+
data: {
|
|
16
|
+
viewer: null
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
title: 'graphql-client',
|
|
24
|
+
component: 'graphql-client',
|
|
25
|
+
argTypes: {
|
|
26
|
+
value: { control: 'text' },
|
|
27
|
+
name: { control: 'text' }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface Story<T> {
|
|
32
|
+
(args: T): TemplateResult
|
|
33
|
+
args?: Partial<T>
|
|
34
|
+
argTypes?: Record<string, unknown>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ArgTypes {
|
|
38
|
+
name?: string
|
|
39
|
+
value?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Template: Story<ArgTypes> = ({ name = 'code', value = '' }: ArgTypes) => html`
|
|
43
|
+
<style>
|
|
44
|
+
body {
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
47
|
+
|
|
48
|
+
<ox-input-graphql
|
|
49
|
+
@change=${(e: Event) => {
|
|
50
|
+
console.log((e.target as HTMLInputElement).value)
|
|
51
|
+
}}
|
|
52
|
+
name=${name}
|
|
53
|
+
.value=${value}
|
|
54
|
+
>
|
|
55
|
+
</ox-input-graphql>
|
|
56
|
+
`
|
|
57
|
+
|
|
58
|
+
export const Regular = Template.bind({})
|
|
59
|
+
Regular.args = {
|
|
60
|
+
name: 'code',
|
|
61
|
+
value: `
|
|
62
|
+
query privileges {
|
|
63
|
+
privileges {
|
|
64
|
+
items {
|
|
65
|
+
privilege
|
|
66
|
+
category
|
|
67
|
+
description
|
|
68
|
+
}
|
|
69
|
+
total
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`
|
|
73
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { html, TemplateResult } from 'lit'
|
|
2
|
+
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
3
|
+
|
|
4
|
+
import { setClientLink, createMockLink } from '@operato/graphql/graphql-env.js'
|
|
5
|
+
import '../src/selector/ox-selector-resource-object'
|
|
6
|
+
|
|
7
|
+
setClientLink(
|
|
8
|
+
createMockLink({
|
|
9
|
+
request: {
|
|
10
|
+
query: ''
|
|
11
|
+
},
|
|
12
|
+
result: {
|
|
13
|
+
data: {
|
|
14
|
+
viewer: null
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
title: 'ox-selector-resource-object',
|
|
22
|
+
component: 'ox-selector-resource-object',
|
|
23
|
+
argTypes: {
|
|
24
|
+
queryName: { control: 'string' },
|
|
25
|
+
value: { control: 'string' },
|
|
26
|
+
valueField: { control: 'string' }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Story<T> {
|
|
31
|
+
(args: T): TemplateResult
|
|
32
|
+
args?: Partial<T>
|
|
33
|
+
argTypes?: Record<string, unknown>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface ArgTypes {
|
|
37
|
+
queryName: string
|
|
38
|
+
value?: string
|
|
39
|
+
valueField?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Template: Story<ArgTypes> = ({ value = '', queryName, valueField }: ArgTypes) => html`
|
|
43
|
+
<style>
|
|
44
|
+
body {
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
const select = ['name', 'description']
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<ox-selector-resource-object
|
|
53
|
+
@change=${(e: Event) => {
|
|
54
|
+
console.log((e.target as HTMLInputElement).value)
|
|
55
|
+
}}
|
|
56
|
+
name=${name}
|
|
57
|
+
value=${ifDefined(value)}
|
|
58
|
+
valueField=${ifDefined(valueField)}
|
|
59
|
+
.queryName=${queryName}
|
|
60
|
+
.confirmCallback=${(record: any) => console.log('confirm', record)}
|
|
61
|
+
.columns=${[
|
|
62
|
+
{
|
|
63
|
+
type: 'string',
|
|
64
|
+
name: 'id',
|
|
65
|
+
header: 'id',
|
|
66
|
+
hidden: true,
|
|
67
|
+
width: 100,
|
|
68
|
+
queryName: ''
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'string',
|
|
72
|
+
name: 'name',
|
|
73
|
+
header: 'name',
|
|
74
|
+
hidden: false,
|
|
75
|
+
width: 150,
|
|
76
|
+
queryName: ''
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: 'string',
|
|
80
|
+
name: 'description',
|
|
81
|
+
header: 'description',
|
|
82
|
+
hidden: false,
|
|
83
|
+
width: 150,
|
|
84
|
+
queryName: ''
|
|
85
|
+
}
|
|
86
|
+
]}
|
|
87
|
+
.list=${['name', 'description']}
|
|
88
|
+
.basicArgs=${''}
|
|
89
|
+
>
|
|
90
|
+
</ox-selector-resource-object>
|
|
91
|
+
`
|
|
92
|
+
|
|
93
|
+
export const Regular = Template.bind({})
|
|
94
|
+
Regular.args = {
|
|
95
|
+
value: '',
|
|
96
|
+
queryName: 'entity',
|
|
97
|
+
valueField: 'id'
|
|
98
|
+
}
|