@operato/app 2.0.0-alpha.99 → 2.0.0-beta.1
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 +438 -0
- package/demo/data-grist-test.html +1 -1
- package/dist/src/filter-renderer/filter-resource-select.js +9 -9
- package/dist/src/filter-renderer/filter-resource-select.js.map +1 -1
- package/dist/src/filters-form/filter-resource-select.js +10 -10
- package/dist/src/filters-form/filter-resource-select.js.map +1 -1
- package/dist/src/grist-editor/ox-popup-code-input.js +1 -1
- package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -1
- package/dist/src/grist-editor/ox-popup-privilege-input.js +1 -1
- package/dist/src/grist-editor/ox-popup-privilege-input.js.map +1 -1
- package/dist/src/input/ox-input-background-pattern.js +8 -8
- package/dist/src/input/ox-input-background-pattern.js.map +1 -1
- package/dist/src/input/ox-input-graphql.js +0 -1
- package/dist/src/input/ox-input-graphql.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-id.js +1 -1
- package/dist/src/selector/ox-selector-resource-id.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object-legacy.d.ts +2 -2
- package/dist/src/selector/ox-selector-resource-object-legacy.js +1 -1
- package/dist/src/selector/ox-selector-resource-object-legacy.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object.js +1 -1
- package/dist/src/selector/ox-selector-resource-object.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 +14 -15
- package/src/filter-renderer/filter-resource-select.ts +53 -52
- package/src/filters-form/filter-resource-select.ts +50 -50
- package/src/grist-editor/ox-popup-code-input.ts +1 -1
- package/src/grist-editor/ox-popup-privilege-input.ts +1 -1
- package/src/input/ox-input-background-pattern.ts +8 -8
- package/src/input/ox-input-graphql.ts +0 -1
- package/src/selector/ox-selector-resource-id.ts +1 -1
- package/src/selector/ox-selector-resource-object-legacy.ts +3 -3
- package/src/selector/ox-selector-resource-object.ts +1 -1
- package/stories/graphql-client.stories.ts +73 -0
- package/stories/ox-selector-resource-object.stories.ts +98 -0
- package/themes/app-theme.css +1 -1
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-
|
|
5
|
+
"version": "2.0.0-beta.1",
|
|
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-
|
|
138
|
-
"@operato/data-grist": "^2.0.0-
|
|
139
|
-
"@operato/font": "^2.0.0-
|
|
140
|
-
"@operato/form": "^2.0.0-
|
|
141
|
-
"@operato/graphql": "^2.0.0-
|
|
142
|
-
"@operato/i18n": "^2.0.0-
|
|
143
|
-
"@operato/input": "^2.0.0-
|
|
144
|
-
"@operato/layout": "^2.0.0-
|
|
145
|
-
"@operato/property-editor": "^2.0.0-
|
|
146
|
-
"@operato/shell": "^2.0.0-
|
|
147
|
-
"@operato/styles": "^2.0.0-
|
|
148
|
-
"@operato/utils": "^2.0.0-
|
|
137
|
+
"@operato/attachment": "^2.0.0-beta.1",
|
|
138
|
+
"@operato/data-grist": "^2.0.0-beta.1",
|
|
139
|
+
"@operato/font": "^2.0.0-beta.1",
|
|
140
|
+
"@operato/form": "^2.0.0-beta.1",
|
|
141
|
+
"@operato/graphql": "^2.0.0-beta.0",
|
|
142
|
+
"@operato/i18n": "^2.0.0-beta.0",
|
|
143
|
+
"@operato/input": "^2.0.0-beta.1",
|
|
144
|
+
"@operato/layout": "^2.0.0-beta.0",
|
|
145
|
+
"@operato/property-editor": "^2.0.0-beta.1",
|
|
146
|
+
"@operato/shell": "^2.0.0-beta.0",
|
|
147
|
+
"@operato/styles": "^2.0.0-beta.0",
|
|
148
|
+
"@operato/utils": "^2.0.0-beta.0",
|
|
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": "9ea81d43b1a5b47e2e40320baf6f8729552edc05"
|
|
191
190
|
}
|
|
@@ -54,9 +54,9 @@ function openResourceSelector(column: ColumnConfig, value: any, confirmCallback:
|
|
|
54
54
|
export const FilterResourceSelect: FilterSelectRenderer = (column, value, owner: any) => {
|
|
55
55
|
const filter = column.filter as FilterConfigObject
|
|
56
56
|
const { operator = 'like' } = filter
|
|
57
|
-
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {}
|
|
58
|
-
const hideValue = value ? value[idField] : ''
|
|
59
|
-
const text = value ? value[nameField] : ''
|
|
57
|
+
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {}
|
|
58
|
+
const hideValue = value ? value[idField] : ''
|
|
59
|
+
const text = value ? value[nameField] : ''
|
|
60
60
|
|
|
61
61
|
return operator === 'like'
|
|
62
62
|
? html` <input
|
|
@@ -79,54 +79,55 @@ export const FilterResourceSelect: FilterSelectRenderer = (column, value, owner:
|
|
|
79
79
|
}}
|
|
80
80
|
/>`
|
|
81
81
|
: operator == 'in'
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
input.value = disp;
|
|
104
|
-
|
|
105
|
-
let codeInput = owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
106
|
-
? owner.renderRoot.querySelector(`[name="${column.name}"]`)
|
|
107
|
-
: owner.renderRoot.querySelector(`form [name="${column.name}"]`);
|
|
108
|
-
|
|
109
|
-
const objectValue = selected ? selected[idField] : '';
|
|
110
|
-
codeInput.value = objectValue;
|
|
111
|
-
|
|
112
|
-
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
113
|
-
|
|
114
|
-
owner.dispatchEvent(
|
|
115
|
-
new CustomEvent('filter-change', {
|
|
116
|
-
bubbles: true,
|
|
117
|
-
composed: true,
|
|
118
|
-
detail: {
|
|
119
|
-
name: column.name,
|
|
120
|
-
operator,
|
|
121
|
-
value: objectValue
|
|
82
|
+
? html``
|
|
83
|
+
: operator === 'eq'
|
|
84
|
+
? html`
|
|
85
|
+
<input name="${column.name}" .value=${hideValue} type="text" hidden />
|
|
86
|
+
<input
|
|
87
|
+
type="text"
|
|
88
|
+
name="${column.name}_disp"
|
|
89
|
+
.value=${text}
|
|
90
|
+
readonly
|
|
91
|
+
@click=${(e: Event) => {
|
|
92
|
+
e.stopPropagation()
|
|
93
|
+
|
|
94
|
+
const input = e.target as HTMLInputElement
|
|
95
|
+
|
|
96
|
+
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
97
|
+
let disp = selected ? selected[idField] : ''
|
|
98
|
+
|
|
99
|
+
if (selected && nameField) {
|
|
100
|
+
disp = selected[nameField]
|
|
122
101
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
102
|
+
|
|
103
|
+
input.value = disp
|
|
104
|
+
|
|
105
|
+
let codeInput =
|
|
106
|
+
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
107
|
+
? owner.renderRoot.querySelector(`[name="${column.name}"]`)
|
|
108
|
+
: owner.renderRoot.querySelector(`form [name="${column.name}"]`)
|
|
109
|
+
|
|
110
|
+
const objectValue = selected ? selected[idField] : ''
|
|
111
|
+
codeInput.value = objectValue
|
|
112
|
+
|
|
113
|
+
input.dispatchEvent(new Event('change', { bubbles: true }))
|
|
114
|
+
|
|
115
|
+
owner.dispatchEvent(
|
|
116
|
+
new CustomEvent('filter-change', {
|
|
117
|
+
bubbles: true,
|
|
118
|
+
composed: true,
|
|
119
|
+
detail: {
|
|
120
|
+
name: column.name,
|
|
121
|
+
operator,
|
|
122
|
+
value: objectValue
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
openResourceSelector(column, value, confirmCallback)
|
|
129
|
+
}}
|
|
130
|
+
/>
|
|
131
|
+
`
|
|
132
|
+
: html``
|
|
132
133
|
}
|
|
@@ -11,7 +11,7 @@ import { GristRecord } from '@operato/data-grist'
|
|
|
11
11
|
type SelectedCallback = (value?: Partial<GristRecord>) => void
|
|
12
12
|
|
|
13
13
|
function openResourceSelector(filter: FilterConfig, value: any, confirmCallback: SelectedCallback) {
|
|
14
|
-
const { queryName, select, list, basicArgs, valueField = 'id', title } = filter.options || {}
|
|
14
|
+
const { queryName, select, list, basicArgs, valueField = 'id', title } = filter.options || ({} as any)
|
|
15
15
|
|
|
16
16
|
var template = html`
|
|
17
17
|
<ox-selector-resource-object
|
|
@@ -47,7 +47,7 @@ function openResourceSelector(filter: FilterConfig, value: any, confirmCallback:
|
|
|
47
47
|
|
|
48
48
|
export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner: any) => {
|
|
49
49
|
const { name, operator = 'like' } = filter
|
|
50
|
-
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || {}
|
|
50
|
+
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = filter.options || ({} as any)
|
|
51
51
|
const hideValue = value ? value[idField] : ''
|
|
52
52
|
const text = value ? value[nameField] : ''
|
|
53
53
|
|
|
@@ -72,59 +72,59 @@ export const FilterResourceSelect: FilterSelectRenderer = (filter, value, owner:
|
|
|
72
72
|
}}
|
|
73
73
|
/>`
|
|
74
74
|
: operator == 'in'
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
? html``
|
|
76
|
+
: operator === 'eq'
|
|
77
|
+
? html`
|
|
78
|
+
<input name="${name}" .value=${hideValue} type="text" hidden />
|
|
79
|
+
<input
|
|
80
|
+
type="text"
|
|
81
|
+
name="${name}_disp"
|
|
82
|
+
.value=${text}
|
|
83
|
+
readonly
|
|
84
|
+
@change=${() => false}
|
|
85
|
+
@click=${(e: Event) => {
|
|
86
|
+
e.stopPropagation()
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
const input = e.target as HTMLInputElement
|
|
89
|
+
const codeInput =
|
|
90
|
+
owner.tagName.toLowerCase() == 'ox-grid-header'
|
|
91
|
+
? owner.renderRoot.querySelector(`[name="${name}"]`)
|
|
92
|
+
: owner.renderRoot.querySelector(`form [name="${name}"]`)
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
const confirmCallback = (selected?: { [field: string]: any }) => {
|
|
95
|
+
let disp = selected ? selected[idField] : ''
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
if (selected && nameField) {
|
|
98
|
+
disp = selected[nameField]
|
|
99
|
+
}
|
|
100
|
+
input.value = disp
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
const value = selected ? selected[idField] : ''
|
|
103
|
+
codeInput.value = value
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
codeInput.dispatchEvent(
|
|
106
|
+
new Event('change', {
|
|
107
|
+
bubbles: true,
|
|
108
|
+
composed: true
|
|
109
|
+
})
|
|
110
|
+
)
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
112
|
+
owner.dispatchEvent(
|
|
113
|
+
new CustomEvent('filter-change', {
|
|
114
|
+
bubbles: true,
|
|
115
|
+
composed: true,
|
|
116
|
+
detail: {
|
|
117
|
+
name: name,
|
|
118
|
+
operator,
|
|
119
|
+
value
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
openResourceSelector(filter, codeInput.value, confirmCallback)
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
`
|
|
129
|
+
: html``
|
|
130
130
|
}
|
|
@@ -18,7 +18,7 @@ export class OxPopupCodeInput extends LitElement {
|
|
|
18
18
|
display: flex;
|
|
19
19
|
flex-direction: column;
|
|
20
20
|
|
|
21
|
-
background-color:
|
|
21
|
+
background-color: var(--md-sys-color-surface);
|
|
22
22
|
|
|
23
23
|
width: var(--overlay-center-normal-width, 50%);
|
|
24
24
|
height: var(--overlay-center-normal-height, 50%);
|
|
@@ -20,7 +20,7 @@ export class OxPopupPrivilegeInput extends LitElement {
|
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: column;
|
|
22
22
|
|
|
23
|
-
background-color:
|
|
23
|
+
background-color: var(--md-sys-color-surface);
|
|
24
24
|
|
|
25
25
|
width: var(--overlay-center-normal-width, 50%);
|
|
26
26
|
height: var(--overlay-center-normal-height, 50%);
|
|
@@ -117,7 +117,7 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
117
117
|
const value = this.value || ({} as BackgroundPatternOption)
|
|
118
118
|
|
|
119
119
|
return html`
|
|
120
|
-
<label> <ox-i18n msgid="label.image"
|
|
120
|
+
<label> <ox-i18n msgid="label.image">image</ox-i18n> </label>
|
|
121
121
|
|
|
122
122
|
<ox-attachment-selector
|
|
123
123
|
value-key="image"
|
|
@@ -128,7 +128,7 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
128
128
|
custom-editor
|
|
129
129
|
></ox-attachment-selector>
|
|
130
130
|
|
|
131
|
-
<label> <ox-i18n msgid="label.align"
|
|
131
|
+
<label> <ox-i18n msgid="label.align">align</ox-i18n> </label>
|
|
132
132
|
|
|
133
133
|
<select value-key="align" class="select-content" .value=${value.align}>
|
|
134
134
|
<option value="left-top">Left Top</option>
|
|
@@ -143,16 +143,16 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
143
143
|
</select>
|
|
144
144
|
|
|
145
145
|
<div class="grid-10">
|
|
146
|
-
<label> <ox-i18n msgid="label.offset-x"
|
|
146
|
+
<label> <ox-i18n msgid="label.offset-x">offsetX</ox-i18n> </label>
|
|
147
147
|
<input type="number" value-key="offsetX" .value=${value.offsetX} />
|
|
148
148
|
|
|
149
|
-
<label> <ox-i18n msgid="label.offset-y"
|
|
149
|
+
<label> <ox-i18n msgid="label.offset-y">offsetY</ox-i18n> </label>
|
|
150
150
|
<input type="number" value-key="offsetY" .value=${value.offsetY} />
|
|
151
151
|
|
|
152
|
-
<label> <ox-i18n msgid="label.width"
|
|
152
|
+
<label> <ox-i18n msgid="label.width">width</ox-i18n> </label>
|
|
153
153
|
<input type="number" value-key="width" .value=${value.width} />
|
|
154
154
|
|
|
155
|
-
<label> <ox-i18n msgid="label.height"
|
|
155
|
+
<label> <ox-i18n msgid="label.height">height</ox-i18n> </label>
|
|
156
156
|
<input type="number" value-key="height" .value=${value.height} />
|
|
157
157
|
</div>
|
|
158
158
|
|
|
@@ -163,12 +163,12 @@ export class OxInputBackgroundPattern extends OxFormField {
|
|
|
163
163
|
|
|
164
164
|
<div class="grid-10">
|
|
165
165
|
<input value-key="fitPattern" type="checkbox" .checked=${value.fitPattern} required />
|
|
166
|
-
<label> <ox-i18n msgid="label.fit"
|
|
166
|
+
<label> <ox-i18n msgid="label.fit">fit</ox-i18n> </label>
|
|
167
167
|
</div>
|
|
168
168
|
|
|
169
169
|
<div class="grid-10">
|
|
170
170
|
<input value-key="noRepeat" type="checkbox" .checked=${value.noRepeat} required />
|
|
171
|
-
<label> <ox-i18n msgid="label.no-repeat"
|
|
171
|
+
<label> <ox-i18n msgid="label.no-repeat">no repeat</ox-i18n> </label>
|
|
172
172
|
</div>
|
|
173
173
|
`
|
|
174
174
|
}
|
|
@@ -21,7 +21,7 @@ export class OxSelectorResourceId extends LitElement {
|
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
|
|
24
|
-
background-color:
|
|
24
|
+
background-color: var(--md-sys-color-surface);
|
|
25
25
|
|
|
26
26
|
width: var(--overlay-center-normal-width, 50%);
|
|
27
27
|
height: var(--overlay-center-normal-height, 50%);
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
InheritedValueType,
|
|
18
18
|
ZERO_DATA
|
|
19
19
|
} from '@operato/data-grist'
|
|
20
|
-
import { MultiColumnFormStyles,
|
|
20
|
+
import { MultiColumnFormStyles, OxSearchForm } from '@operato/form'
|
|
21
21
|
import { buildArgs, client, gqlContext } from '@operato/graphql'
|
|
22
22
|
import { i18next } from '@operato/i18n'
|
|
23
23
|
import { closePopup } from '@operato/popup'
|
|
@@ -34,7 +34,7 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
34
34
|
display: flex;
|
|
35
35
|
flex-direction: column;
|
|
36
36
|
|
|
37
|
-
background-color:
|
|
37
|
+
background-color: var(--md-sys-color-surface);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
ox-grist {
|
|
@@ -76,7 +76,7 @@ export class OxSelectorResourceObjectLegacy extends LitElement {
|
|
|
76
76
|
@property({ type: String }) valueField: string | ((item: any) => any) = 'id'
|
|
77
77
|
|
|
78
78
|
@query('ox-grist') grist!: DataGrist
|
|
79
|
-
@query('ox-search-form') searchForm!:
|
|
79
|
+
@query('ox-search-form') searchForm!: OxSearchForm
|
|
80
80
|
|
|
81
81
|
render() {
|
|
82
82
|
return html`
|
|
@@ -29,7 +29,7 @@ export class OxSelectorResourceObject extends LitElement {
|
|
|
29
29
|
display: flex;
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
|
|
32
|
-
background-color:
|
|
32
|
+
background-color: var(--md-sys-color-surface);
|
|
33
33
|
|
|
34
34
|
width: var(--overlay-center-normal-width, 50%);
|
|
35
35
|
height: var(--overlay-center-normal-height, 50%);
|
|
@@ -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
|
+
}
|
package/themes/app-theme.css
CHANGED
|
@@ -131,7 +131,7 @@ body {
|
|
|
131
131
|
|
|
132
132
|
/* form style */
|
|
133
133
|
--label-font: normal var(--fontsize-default) var(--theme-font);
|
|
134
|
-
--label-color: var(--
|
|
134
|
+
--label-color: var(--md-sys-color-on-surface);
|
|
135
135
|
--label-text-transform: capitalize;
|
|
136
136
|
--input-margin: var(--margin-narrow) 0;
|
|
137
137
|
--input-padding: var(--padding-default);
|