@operato/context 2.0.0-alpha.64 → 2.0.0-alpha.65
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/layouts/ox-context-toolbar.js +49 -58
- package/dist/src/layouts/ox-context-toolbar.js.map +1 -1
- package/dist/src/tools/ox-page-action-context-bar.js +20 -23
- package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +1 -1
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar-select.stories.js +1 -1
- package/dist/stories/ox-context-page-toolbar-select.stories.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar.stories.js +1 -1
- package/dist/stories/ox-context-page-toolbar.stories.js.map +1 -1
- package/dist/stories/ox-context-toolbar-complex-2.stories.d.ts +19 -0
- package/dist/stories/ox-context-toolbar-complex-2.stories.js +136 -0
- package/dist/stories/ox-context-toolbar-complex-2.stories.js.map +1 -0
- package/dist/stories/ox-context-toolbar-complex.stories copy.d.ts +19 -0
- package/dist/stories/ox-context-toolbar-complex.stories copy.js +146 -0
- package/dist/stories/ox-context-toolbar-complex.stories copy.js.map +1 -0
- package/dist/stories/ox-context-toolbar-complex.stories.d.ts +19 -0
- package/dist/stories/ox-context-toolbar-complex.stories.js +146 -0
- package/dist/stories/ox-context-toolbar-complex.stories.js.map +1 -0
- package/dist/stories/ox-context-toolbar-overflow.stories.d.ts +19 -0
- package/dist/stories/ox-context-toolbar-overflow.stories.js +127 -0
- package/dist/stories/ox-context-toolbar-overflow.stories.js.map +1 -0
- package/dist/stories/ox-context-toolbar.stories copy.d.ts +19 -0
- package/dist/stories/ox-context-toolbar.stories copy.js +82 -0
- package/dist/stories/ox-context-toolbar.stories copy.js.map +1 -0
- package/dist/stories/ox-context-toolbar.stories.d.ts +1 -6
- package/dist/stories/ox-context-toolbar.stories.js +23 -31
- package/dist/stories/ox-context-toolbar.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/layouts/ox-context-toolbar.ts +49 -58
- package/src/tools/ox-page-action-context-bar.ts +20 -23
- package/stories/ox-context-page-toolbar-select-buttons.stories.ts +1 -1
- package/stories/ox-context-page-toolbar-select.stories.ts +1 -1
- package/stories/ox-context-page-toolbar.stories.ts +1 -1
- package/stories/ox-context-toolbar-complex.stories.ts +158 -0
- package/stories/ox-context-toolbar-overflow.stories.ts +139 -0
- package/stories/ox-context-toolbar.stories.ts +24 -34
- package/themes/context-theme.css +74 -0
|
@@ -19,72 +19,52 @@ export class ContextToolbar extends connect(store)(LitElement) {
|
|
|
19
19
|
background-color: var(--context-toolbar-background-color);
|
|
20
20
|
justify-content: space-between;
|
|
21
21
|
box-shadow: var(--context-toolbar-shadow-line);
|
|
22
|
+
|
|
23
|
+
padding: 6px 10px;
|
|
24
|
+
gap: 4px;
|
|
22
25
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
|
|
27
|
+
div {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
flex-wrap: nowrap;
|
|
31
|
+
|
|
32
|
+
align-items: center;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
padding: 0;
|
|
28
35
|
}
|
|
29
|
-
|
|
30
|
-
#front
|
|
36
|
+
|
|
37
|
+
#front-end md-icon,
|
|
38
|
+
#front md-icon {
|
|
31
39
|
background-color: var(--context-toolbar-function-button-background-color);
|
|
32
40
|
border: var(--context-toolbar-function-button-border);
|
|
33
|
-
height: var(--context-toolbar-function-button-height);
|
|
34
|
-
margin: var(--context-toolbar-button-margin);
|
|
35
|
-
padding: var(--context-toolbar-function-button-padding);
|
|
36
41
|
color: var(--context-toolbar-function-button-color);
|
|
37
|
-
line-height: var(--context-toolbar-function-button-lineheight);
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
}
|
|
40
|
-
#front-end mwc-icon:first-child,
|
|
41
|
-
#front mwc-icon:first-child {
|
|
42
|
-
border-top-left-radius: var(--context-toolbar-function-button-radius);
|
|
43
|
-
border-bottom-left-radius: var(--context-toolbar-function-button-radius);
|
|
44
|
-
}
|
|
45
|
-
#front-end mwc-icon:last-child,
|
|
46
|
-
#front mwc-icon:last-child {
|
|
47
|
-
border-top-right-radius: var(--context-toolbar-function-button-radius);
|
|
48
|
-
border-bottom-right-radius: var(--context-toolbar-function-button-radius);
|
|
49
42
|
}
|
|
50
43
|
|
|
51
|
-
#front-end
|
|
44
|
+
#front-end md-icon {
|
|
52
45
|
background-color: var(--primary-color);
|
|
53
46
|
}
|
|
54
|
-
#front-end
|
|
47
|
+
#front-end md-icon:hover {
|
|
55
48
|
background-color: var(--context-toolbar-function-button-background-color);
|
|
56
49
|
}
|
|
57
|
-
#front
|
|
50
|
+
#front md-icon:hover {
|
|
58
51
|
background-color: var(--context-toolbar-function-button-hover-background-color);
|
|
59
52
|
}
|
|
60
53
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
#center > * {
|
|
68
|
-
align-items: center;
|
|
69
|
-
}
|
|
70
|
-
#rear-end > *,
|
|
71
|
-
#rear > * {
|
|
72
|
-
margin: var(--context-toolbar-button-margin);
|
|
73
|
-
}
|
|
74
|
-
#rear-end {
|
|
75
|
-
align-items: start;
|
|
54
|
+
div md-icon:first-child {
|
|
55
|
+
border-radius: 0;
|
|
56
|
+
border-top-left-radius: var(--context-toolbar-function-button-radius);
|
|
57
|
+
border-bottom-left-radius: var(--context-toolbar-function-button-radius);
|
|
76
58
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
59
|
+
div md-icon:last-child {
|
|
60
|
+
border-radius: 0;
|
|
61
|
+
border-top-right-radius: var(--context-toolbar-function-button-radius);
|
|
62
|
+
border-bottom-right-radius: var(--context-toolbar-function-button-radius);
|
|
80
63
|
}
|
|
81
64
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
align-items: center;
|
|
86
|
-
overflow: hidden;
|
|
87
|
-
padding: 0;
|
|
65
|
+
#center {
|
|
66
|
+
flex: 1;
|
|
67
|
+
justify-content: end;
|
|
88
68
|
}
|
|
89
69
|
|
|
90
70
|
* {
|
|
@@ -105,6 +85,13 @@ export class ContextToolbar extends connect(store)(LitElement) {
|
|
|
105
85
|
color: var(--theme-white-color);
|
|
106
86
|
}
|
|
107
87
|
}
|
|
88
|
+
|
|
89
|
+
@media only screen and (max-width: 460px) {
|
|
90
|
+
:host {
|
|
91
|
+
padding: 0;
|
|
92
|
+
gap: 0;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
108
95
|
`
|
|
109
96
|
]
|
|
110
97
|
}
|
|
@@ -131,15 +118,19 @@ export class ContextToolbar extends connect(store)(LitElement) {
|
|
|
131
118
|
let rearEndTools = tools.filter(tool => tool.position == TOOL_POSITION.REAR_END)
|
|
132
119
|
|
|
133
120
|
return html`
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
121
|
+
${frontEndTools.length > 0
|
|
122
|
+
? html`<div id="front-end">${frontEndTools.map(tool => html` ${tool.template} `)}</div>`
|
|
123
|
+
: nothing}
|
|
124
|
+
${frontTools.length > 0
|
|
125
|
+
? html`<div id="front">${frontTools.map(tool => html` ${tool.template} `)}</div>`
|
|
126
|
+
: nothing}
|
|
127
|
+
${centerTools.length > 0
|
|
128
|
+
? html`<div id="center">${centerTools.map(tool => html` ${tool.template} `)}</div>`
|
|
129
|
+
: nothing}
|
|
130
|
+
${rearTools.length > 0 ? html`<div id="rear">${rearTools.map(tool => html` ${tool.template} `)}</div>` : nothing}
|
|
131
|
+
${rearEndTools.length > 0
|
|
132
|
+
? html`<div id="rear-end">${rearEndTools.map(tool => html` ${tool.template} `)}</div>`
|
|
133
|
+
: nothing}
|
|
143
134
|
`
|
|
144
135
|
}
|
|
145
136
|
|
|
@@ -18,8 +18,7 @@ export class PageActionContextBar extends connect(store)(LitElement) {
|
|
|
18
18
|
:host {
|
|
19
19
|
display: flex;
|
|
20
20
|
overflow: hidden;
|
|
21
|
-
|
|
22
|
-
gap:var(--padding-narrow);
|
|
21
|
+
gap: var(--padding-narrow);
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
:host *:focus {
|
|
@@ -29,32 +28,30 @@ export class PageActionContextBar extends connect(store)(LitElement) {
|
|
|
29
28
|
button {
|
|
30
29
|
display: flex;
|
|
31
30
|
align-items: center;
|
|
32
|
-
background-color: var(--button-background-color
|
|
31
|
+
background-color: var(--button-background-color, #fafbfc);
|
|
33
32
|
border: 1px solid rgba(var(--primary-color-rgb), 0.5);
|
|
34
|
-
border-radius:var(--button-border-radius);
|
|
35
|
-
|
|
36
|
-
font-size:var(--fontsize-default);
|
|
37
|
-
color:var(--secondary-color);
|
|
33
|
+
border-radius: var(--button-border-radius);
|
|
34
|
+
|
|
35
|
+
font-size: var(--fontsize-default);
|
|
36
|
+
color: var(--secondary-color);
|
|
38
37
|
|
|
39
38
|
md-icon {
|
|
40
|
-
margin:4px 1px;
|
|
39
|
+
margin: 4px 1px;
|
|
41
40
|
|
|
42
|
-
--md-icon-size:18px;
|
|
41
|
+
--md-icon-size: 18px;
|
|
43
42
|
color: var(--primary-color);
|
|
44
43
|
}
|
|
45
|
-
&:hover{
|
|
44
|
+
&:hover {
|
|
46
45
|
background-color: var(--primary-color);
|
|
47
46
|
|
|
48
47
|
color: var(--theme-white-color);
|
|
49
48
|
|
|
50
|
-
md-icon{
|
|
49
|
+
md-icon {
|
|
51
50
|
color: var(--white-theme-color);
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
55
|
[filled] {
|
|
59
56
|
font-variation-settings: 'FILL' 1;
|
|
60
57
|
}
|
|
@@ -66,34 +63,34 @@ export class PageActionContextBar extends connect(store)(LitElement) {
|
|
|
66
63
|
md-icon {
|
|
67
64
|
color: var(--mdc-danger-button-primary-color);
|
|
68
65
|
}
|
|
69
|
-
&:hover{
|
|
70
|
-
background-color:var(--mdc-danger-button-primary-color);
|
|
66
|
+
&:hover {
|
|
67
|
+
background-color: var(--mdc-danger-button-primary-color);
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
|
|
74
71
|
[more] {
|
|
75
72
|
position: absolute;
|
|
76
73
|
top: 0;
|
|
77
|
-
right:
|
|
74
|
+
right: 0;
|
|
78
75
|
background-color: var(--context-action-bar-more-button-background-color);
|
|
79
76
|
box-shadow: -2px 0px 2px 1px rgba(0, 0, 0, 0.2);
|
|
80
77
|
padding: var(--context-action-bar-more-button-padding);
|
|
81
78
|
color: var(--context-action-bar-more-button-color);
|
|
79
|
+
padding: 10px;
|
|
82
80
|
font-size: 2rem;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
@media screen and (max-width: 460px) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
--mdc-shape-small: var(--context-action-bar-more-button-border-radius);
|
|
84
|
+
:host {
|
|
85
|
+
gap: 0;
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
[more] {
|
|
92
|
-
position: absolute;
|
|
93
89
|
margin-top: -10px;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
button {
|
|
93
|
+
border-radius: 0;
|
|
97
94
|
}
|
|
98
95
|
}
|
|
99
96
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '../src/layouts/ox-context-toolbar.js'
|
|
3
|
+
import '../src/tools/ox-page-action-context-bar.js'
|
|
4
|
+
import { TOOL_POSITION } from '@operato/layout'
|
|
5
|
+
|
|
6
|
+
import '@operato/styles'
|
|
7
|
+
|
|
8
|
+
import { css, html, render, TemplateResult } from 'lit'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'ox-context-toolbar complex',
|
|
12
|
+
component: 'ox-context-toolbar',
|
|
13
|
+
argTypes: {}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Story<T> {
|
|
17
|
+
(args: T): TemplateResult
|
|
18
|
+
args?: Partial<T>
|
|
19
|
+
argTypes?: Record<string, unknown>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface ArgTypes {}
|
|
23
|
+
|
|
24
|
+
const Template: Story<ArgTypes> = () => html`
|
|
25
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
26
|
+
<link href="/themes/context-theme.css" rel="stylesheet" />
|
|
27
|
+
|
|
28
|
+
<link
|
|
29
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
30
|
+
rel="stylesheet"
|
|
31
|
+
/>
|
|
32
|
+
<link
|
|
33
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
34
|
+
rel="stylesheet"
|
|
35
|
+
/>
|
|
36
|
+
<link
|
|
37
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
38
|
+
rel="stylesheet"
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
body {
|
|
43
|
+
background-color: white;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
46
|
+
|
|
47
|
+
<div style="height:100px; padding: 10px; background-color: black;">
|
|
48
|
+
<ox-context-toolbar
|
|
49
|
+
.tools=${[
|
|
50
|
+
{
|
|
51
|
+
position: TOOL_POSITION.FRONT_END,
|
|
52
|
+
template: html` <md-icon>download</md-icon> `,
|
|
53
|
+
context: 'exportable'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
position: TOOL_POSITION.FRONT_END,
|
|
57
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
58
|
+
context: 'importable'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
position: TOOL_POSITION.FRONT,
|
|
62
|
+
template: html` <md-icon>download</md-icon> `,
|
|
63
|
+
context: 'exportable'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
position: TOOL_POSITION.FRONT,
|
|
67
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
68
|
+
context: 'importable'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
position: TOOL_POSITION.CENTER,
|
|
72
|
+
template: html`<ox-page-action-context-bar
|
|
73
|
+
.actions=${[
|
|
74
|
+
{
|
|
75
|
+
title: 'save',
|
|
76
|
+
action: () => {},
|
|
77
|
+
icon: 'save'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: 'copy',
|
|
81
|
+
action: () => {},
|
|
82
|
+
icon: 'content_copy'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: 'delete',
|
|
86
|
+
action: () => {},
|
|
87
|
+
icon: 'delete'
|
|
88
|
+
}
|
|
89
|
+
]}
|
|
90
|
+
></ox-page-action-context-bar>`
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
position: TOOL_POSITION.REAR,
|
|
94
|
+
template: html`<ox-page-action-context-bar
|
|
95
|
+
.actions=${[
|
|
96
|
+
{
|
|
97
|
+
title: 'save',
|
|
98
|
+
action: () => {},
|
|
99
|
+
icon: 'save'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
title: 'copy',
|
|
103
|
+
action: () => {},
|
|
104
|
+
icon: 'content_copy'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: 'delete',
|
|
108
|
+
action: () => {},
|
|
109
|
+
icon: 'delete'
|
|
110
|
+
}
|
|
111
|
+
]}
|
|
112
|
+
></ox-page-action-context-bar>`
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
position: TOOL_POSITION.REAR_END,
|
|
116
|
+
template: html`<ox-page-action-context-bar
|
|
117
|
+
.actions=${[
|
|
118
|
+
{
|
|
119
|
+
title: 'save',
|
|
120
|
+
action: () => {},
|
|
121
|
+
icon: 'save'
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
title: 'copy',
|
|
125
|
+
action: () => {},
|
|
126
|
+
icon: 'content_copy'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
title: 'delete',
|
|
130
|
+
action: () => {},
|
|
131
|
+
icon: 'delete'
|
|
132
|
+
}
|
|
133
|
+
]}
|
|
134
|
+
></ox-page-action-context-bar>`
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
position: TOOL_POSITION.REAR_END,
|
|
138
|
+
template: html` <md-icon>download</md-icon> `,
|
|
139
|
+
context: 'exportable'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
position: TOOL_POSITION.REAR_END,
|
|
143
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
144
|
+
context: 'importable'
|
|
145
|
+
}
|
|
146
|
+
]}
|
|
147
|
+
.context=${{
|
|
148
|
+
exportable: true,
|
|
149
|
+
importable: true,
|
|
150
|
+
toolbar: true
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
</ox-context-toolbar>
|
|
154
|
+
</div>
|
|
155
|
+
`
|
|
156
|
+
|
|
157
|
+
export const Regular = Template.bind({})
|
|
158
|
+
Regular.args = {}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '../src/layouts/ox-context-toolbar.js'
|
|
3
|
+
import '../src/tools/ox-page-action-context-bar.js'
|
|
4
|
+
import { TOOL_POSITION } from '@operato/layout'
|
|
5
|
+
|
|
6
|
+
import '@operato/styles'
|
|
7
|
+
|
|
8
|
+
import { css, html, render, TemplateResult } from 'lit'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'ox-context-toolbar overflow',
|
|
12
|
+
component: 'ox-context-toolbar',
|
|
13
|
+
argTypes: {}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface Story<T> {
|
|
17
|
+
(args: T): TemplateResult
|
|
18
|
+
args?: Partial<T>
|
|
19
|
+
argTypes?: Record<string, unknown>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface ArgTypes {}
|
|
23
|
+
|
|
24
|
+
const Template: Story<ArgTypes> = () => html`
|
|
25
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
26
|
+
<link href="/themes/context-theme.css" rel="stylesheet" />
|
|
27
|
+
|
|
28
|
+
<link
|
|
29
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
30
|
+
rel="stylesheet"
|
|
31
|
+
/>
|
|
32
|
+
<link
|
|
33
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
34
|
+
rel="stylesheet"
|
|
35
|
+
/>
|
|
36
|
+
<link
|
|
37
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
38
|
+
rel="stylesheet"
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
<style>
|
|
42
|
+
body {
|
|
43
|
+
background-color: white;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
46
|
+
|
|
47
|
+
<div style="height:100px; padding: 10px; background-color: yellow;">
|
|
48
|
+
<ox-context-toolbar
|
|
49
|
+
.tools=${[
|
|
50
|
+
{
|
|
51
|
+
position: TOOL_POSITION.FRONT,
|
|
52
|
+
template: html` <md-icon>download</md-icon> `,
|
|
53
|
+
context: 'exportable'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
position: TOOL_POSITION.FRONT,
|
|
57
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
58
|
+
context: 'importable'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
position: TOOL_POSITION.CENTER,
|
|
62
|
+
template: html`<ox-page-action-context-bar
|
|
63
|
+
.actions=${[
|
|
64
|
+
{
|
|
65
|
+
title: 'save',
|
|
66
|
+
action: () => {},
|
|
67
|
+
icon: 'save'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
title: 'copy',
|
|
71
|
+
action: () => {},
|
|
72
|
+
icon: 'content_copy'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
title: 'delete',
|
|
76
|
+
action: () => {},
|
|
77
|
+
icon: 'delete'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: 'save',
|
|
81
|
+
action: () => {},
|
|
82
|
+
icon: 'save'
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
title: 'copy',
|
|
86
|
+
action: () => {},
|
|
87
|
+
icon: 'content_copy'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'delete',
|
|
91
|
+
action: () => {},
|
|
92
|
+
icon: 'delete'
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: 'save',
|
|
96
|
+
action: () => {},
|
|
97
|
+
icon: 'save'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
title: 'copy',
|
|
101
|
+
action: () => {},
|
|
102
|
+
icon: 'content_copy'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
title: 'delete',
|
|
106
|
+
action: () => {},
|
|
107
|
+
icon: 'delete'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
title: 'save',
|
|
111
|
+
action: () => {},
|
|
112
|
+
icon: 'save'
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: 'copy',
|
|
116
|
+
action: () => {},
|
|
117
|
+
icon: 'content_copy'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
title: 'delete',
|
|
121
|
+
action: () => {},
|
|
122
|
+
icon: 'delete'
|
|
123
|
+
}
|
|
124
|
+
]}
|
|
125
|
+
></ox-page-action-context-bar>`
|
|
126
|
+
}
|
|
127
|
+
]}
|
|
128
|
+
.context=${{
|
|
129
|
+
exportable: true,
|
|
130
|
+
importable: true,
|
|
131
|
+
toolbar: true
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
</ox-context-toolbar>
|
|
135
|
+
</div>
|
|
136
|
+
`
|
|
137
|
+
|
|
138
|
+
export const Regular = Template.bind({})
|
|
139
|
+
Regular.args = {}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import '@material/web/icon/icon.js'
|
|
2
2
|
import '../src/layouts/ox-context-toolbar.js'
|
|
3
3
|
import '../src/tools/ox-page-action-context-bar.js'
|
|
4
|
-
import { CommonHeaderStyles } from '@operato/styles'
|
|
5
4
|
import { TOOL_POSITION } from '@operato/layout'
|
|
6
5
|
|
|
7
6
|
import '@operato/styles'
|
|
@@ -11,9 +10,7 @@ import { css, html, render, TemplateResult } from 'lit'
|
|
|
11
10
|
export default {
|
|
12
11
|
title: 'ox-context-toolbar',
|
|
13
12
|
component: 'ox-context-toolbar',
|
|
14
|
-
argTypes: {
|
|
15
|
-
label: { control: 'string' }
|
|
16
|
-
}
|
|
13
|
+
argTypes: {}
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
interface Story<T> {
|
|
@@ -22,37 +19,33 @@ interface Story<T> {
|
|
|
22
19
|
argTypes?: Record<string, unknown>
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
interface ArgTypes {
|
|
26
|
-
label?: string
|
|
27
|
-
}
|
|
22
|
+
interface ArgTypes {}
|
|
28
23
|
|
|
29
|
-
const Template: Story<ArgTypes> = (
|
|
24
|
+
const Template: Story<ArgTypes> = () => html`
|
|
30
25
|
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<link
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
<link href="/themes/context-theme.css" rel="stylesheet" />
|
|
27
|
+
|
|
28
|
+
<link
|
|
29
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
30
|
+
rel="stylesheet"
|
|
31
|
+
/>
|
|
32
|
+
<link
|
|
33
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
34
|
+
rel="stylesheet"
|
|
35
|
+
/>
|
|
36
|
+
<link
|
|
37
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
38
|
+
rel="stylesheet"
|
|
39
|
+
/>
|
|
40
|
+
|
|
36
41
|
<style>
|
|
37
42
|
body {
|
|
38
43
|
background-color: white;
|
|
39
44
|
}
|
|
40
|
-
|
|
41
|
-
${CommonHeaderStyles.cssText}
|
|
42
45
|
</style>
|
|
43
46
|
|
|
44
|
-
<div style="height:
|
|
45
|
-
<
|
|
46
|
-
<div class="title">
|
|
47
|
-
<md-icon>summarize</md-icon>
|
|
48
|
-
${label}
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<div class="filters">
|
|
52
|
-
<label>Filter</label><input type="text"></input>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
|
-
<ox-context-toolbar class="actions"
|
|
47
|
+
<div style="height:100px; padding: 10px; background-color: black;">
|
|
48
|
+
<ox-context-toolbar
|
|
56
49
|
.tools=${[
|
|
57
50
|
{
|
|
58
51
|
position: TOOL_POSITION.FRONT,
|
|
@@ -90,15 +83,12 @@ const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
|
|
|
90
83
|
.context=${{
|
|
91
84
|
exportable: true,
|
|
92
85
|
importable: true,
|
|
93
|
-
toolbar:
|
|
86
|
+
toolbar: true
|
|
94
87
|
}}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
</div>
|
|
88
|
+
>
|
|
89
|
+
</ox-context-toolbar>
|
|
98
90
|
</div>
|
|
99
91
|
`
|
|
100
92
|
|
|
101
93
|
export const Regular = Template.bind({})
|
|
102
|
-
Regular.args = {
|
|
103
|
-
label: 'common header styles'
|
|
104
|
-
}
|
|
94
|
+
Regular.args = {}
|