@operato/app 2.0.0-alpha.11 → 2.0.0-alpha.111
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 +589 -0
- package/demo/data-grist-test.html +25 -14
- package/demo/index.html +13 -2
- package/dist/src/filters-form/filter-resource-select.js +13 -16
- package/dist/src/filters-form/filter-resource-select.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-code.d.ts +1 -1
- package/dist/src/grist-editor/ox-grist-editor-json.d.ts +1 -1
- package/dist/src/grist-editor/ox-grist-editor-privilege.d.ts +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-code.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js +2 -2
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-renderer-resource-code.d.ts +1 -1
- package/dist/src/grist-editor/ox-popup-code-input.d.ts +2 -1
- package/dist/src/grist-editor/ox-popup-code-input.js +7 -8
- package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -1
- package/dist/src/grist-editor/ox-popup-privilege-input.d.ts +2 -1
- package/dist/src/grist-editor/ox-popup-privilege-input.js +8 -15
- package/dist/src/grist-editor/ox-popup-privilege-input.js.map +1 -1
- package/dist/src/input/ox-input-background-pattern.d.ts +1 -1
- package/dist/src/input/ox-input-fill-style.d.ts +1 -1
- package/dist/src/input/ox-input-graphql.d.ts +1 -0
- package/dist/src/input/ox-input-graphql.js +6 -2
- package/dist/src/input/ox-input-graphql.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-id.d.ts +2 -1
- package/dist/src/selector/ox-selector-resource-id.js +8 -9
- package/dist/src/selector/ox-selector-resource-id.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object-legacy.d.ts +4 -3
- package/dist/src/selector/ox-selector-resource-object-legacy.js +8 -9
- package/dist/src/selector/ox-selector-resource-object-legacy.js.map +1 -1
- package/dist/src/selector/ox-selector-resource-object.d.ts +3 -2
- package/dist/src/selector/ox-selector-resource-object.js +9 -10
- 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-input-graphql.stories.js +13 -1
- package/dist/stories/ox-input-graphql.stories.js.map +1 -1
- 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 +27 -30
- package/src/filters-form/filter-resource-select.ts +32 -31
- package/src/grist-editor/ox-grist-editor-resource-code.ts +2 -2
- package/src/grist-editor/ox-grist-editor-resource-id.ts +2 -2
- package/src/grist-editor/ox-popup-code-input.ts +7 -8
- package/src/grist-editor/ox-popup-privilege-input.ts +8 -15
- package/src/input/ox-input-graphql.ts +3 -2
- package/src/selector/ox-selector-resource-id.ts +8 -9
- package/src/selector/ox-selector-resource-object-legacy.ts +16 -17
- package/src/selector/ox-selector-resource-object.ts +10 -11
- package/stories/graphql-client.stories.ts +73 -0
- package/stories/ox-input-graphql.stories.ts +13 -1
- package/stories/ox-selector-resource-object.stories.ts +98 -0
- package/themes/app-theme.css +10 -0
- package/themes/grist-theme.css +3 -1
|
@@ -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
|
@@ -82,6 +82,16 @@ body {
|
|
|
82
82
|
--mdc-button-outline-width: 1px;
|
|
83
83
|
--mdc-button-horizontal-padding: 16px;
|
|
84
84
|
|
|
85
|
+
/* material style component themes */
|
|
86
|
+
--md-theme-on-primary: var(--theme-white-color);
|
|
87
|
+
--md-theme-primary: var(--secondary-text-color);
|
|
88
|
+
--md-theme-on-secondary: var(--theme-white-color);
|
|
89
|
+
--md-theme-secondary: var(--primary-color);
|
|
90
|
+
--md-button-outline-color: var(--primary-color);
|
|
91
|
+
--md-danger-button-primary-color: var(--status-danger-color);
|
|
92
|
+
--md-danger-button-outline-color: var(--status-danger-color);
|
|
93
|
+
--md-button-outline-width: 1px;
|
|
94
|
+
|
|
85
95
|
/* button style */
|
|
86
96
|
--button-background-color: #fafbfc;
|
|
87
97
|
--button-background-focus-color: var(--primary-color);
|
package/themes/grist-theme.css
CHANGED
|
@@ -35,9 +35,11 @@ body {
|
|
|
35
35
|
--grid-header-filter-title-font: normal 12px var(--theme-font);
|
|
36
36
|
--grid-header-filter-title-icon-color: var(--primary-color);
|
|
37
37
|
|
|
38
|
+
--grid-body-bottom-border: 1px solid rgba(var(--secondary-color-rgb), 0.2);
|
|
39
|
+
|
|
38
40
|
--grid-record-background-color: var(--theme-white-color);
|
|
39
41
|
--grid-record-odd-background-color: #f9f7f5;
|
|
40
|
-
--grid-record-padding:
|
|
42
|
+
--grid-record-padding: 0 5px 0 5px;
|
|
41
43
|
--grid-record-color: var(--secondary-color);
|
|
42
44
|
--grid-record-color-hover: var(--primary-color);
|
|
43
45
|
--grid-record-wide-fontsize: var(--fontsize-small);
|