@operato/context 2.0.0-alpha.13 → 2.0.0-alpha.131
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 +708 -0
- package/demo/index.html +13 -2
- package/dist/src/layouts/ox-context-page-toolbar.d.ts +9 -4
- package/dist/src/layouts/ox-context-page-toolbar.js +30 -14
- package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
- package/dist/src/layouts/ox-context-toolbar.d.ts +5 -3
- package/dist/src/layouts/ox-context-toolbar.js +138 -73
- package/dist/src/layouts/ox-context-toolbar.js.map +1 -1
- package/dist/src/styles/ox-context-toolbar-overlay-style.js +2 -2
- package/dist/src/styles/ox-context-toolbar-overlay-style.js.map +1 -1
- package/dist/src/tools/ox-page-action-context-bar.d.ts +14 -6
- package/dist/src/tools/ox-page-action-context-bar.js +84 -68
- package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
- package/dist/src/tools/ox-page-action-overlay-template.d.ts +3 -2
- package/dist/src/tools/ox-page-action-overlay-template.js +38 -39
- package/dist/src/tools/ox-page-action-overlay-template.js.map +1 -1
- package/dist/src/tools/ox-page-title-bar.d.ts +2 -2
- package/dist/src/tools/ox-page-title-bar.js +6 -8
- package/dist/src/tools/ox-page-title-bar.js.map +1 -1
- package/dist/src/tools/ox-title-bar.d.ts +2 -2
- package/dist/src/tools/ox-title-bar.js +6 -8
- package/dist/src/tools/ox-title-bar.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.d.ts +25 -0
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +127 -0
- package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js.map +1 -0
- package/dist/stories/ox-context-page-toolbar-select.stories.d.ts +24 -0
- package/dist/stories/ox-context-page-toolbar-select.stories.js +94 -0
- package/dist/stories/ox-context-page-toolbar-select.stories.js.map +1 -0
- package/dist/stories/ox-context-page-toolbar.stories.d.ts +24 -0
- package/dist/stories/ox-context-page-toolbar.stories.js +93 -0
- package/dist/stories/ox-context-page-toolbar.stories.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 +150 -0
- package/dist/stories/ox-context-toolbar-complex.stories.js.map +1 -0
- package/dist/stories/ox-context-toolbar-cooldown.stories.d.ts +18 -0
- package/dist/stories/ox-context-toolbar-cooldown.stories.js +100 -0
- package/dist/stories/ox-context-toolbar-cooldown.stories.js.map +1 -0
- package/dist/stories/ox-context-toolbar-empty.stories.d.ts +18 -0
- package/dist/stories/ox-context-toolbar-empty.stories.js +79 -0
- package/dist/stories/ox-context-toolbar-empty.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 +131 -0
- package/dist/stories/ox-context-toolbar-overflow.stories.js.map +1 -0
- package/dist/stories/ox-context-toolbar.stories.d.ts +19 -0
- package/dist/stories/ox-context-toolbar.stories.js +188 -0
- package/dist/stories/ox-context-toolbar.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -20
- package/src/layouts/ox-context-page-toolbar.ts +33 -14
- package/src/layouts/ox-context-toolbar.ts +139 -70
- package/src/styles/ox-context-toolbar-overlay-style.ts +2 -2
- package/src/tools/ox-page-action-context-bar.ts +96 -69
- package/src/tools/ox-page-action-overlay-template.ts +50 -51
- package/src/tools/ox-page-title-bar.ts +6 -8
- package/src/tools/ox-title-bar.ts +6 -8
- package/stories/ox-context-page-toolbar-select-buttons.stories.ts +141 -0
- package/stories/ox-context-page-toolbar-select.stories.ts +108 -0
- package/stories/ox-context-page-toolbar.stories.ts +107 -0
- package/stories/ox-context-toolbar-complex.stories.ts +162 -0
- package/stories/ox-context-toolbar-cooldown.stories.ts +112 -0
- package/stories/ox-context-toolbar-empty.stories.ts +92 -0
- package/stories/ox-context-toolbar-overflow.stories.ts +143 -0
- package/stories/ox-context-toolbar.stories.ts +200 -0
- package/themes/app-theme.css +161 -0
- package/themes/context-theme.css +74 -0
- package/themes/material-theme.css +88 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
2
|
import '@operato/input/ox-input-search.js'
|
|
3
3
|
|
|
4
4
|
import { css, html, LitElement } from 'lit'
|
|
@@ -22,7 +22,7 @@ export class PageTitleBar extends connect(store)(LitElement) {
|
|
|
22
22
|
--help-icon-opacity: 0.2;
|
|
23
23
|
--help-icon-size: 20px;
|
|
24
24
|
|
|
25
|
-
--
|
|
25
|
+
--md-icon-size: 20px;
|
|
26
26
|
|
|
27
27
|
--input-search-padding: var(--padding-narrow);
|
|
28
28
|
--input-search-font: normal 14px var(--theme-font);
|
|
@@ -92,10 +92,8 @@ export class PageTitleBar extends connect(store)(LitElement) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
return html`
|
|
95
|
-
${title ? html` <div titler>${icon ? html`<
|
|
96
|
-
${help && title
|
|
97
|
-
? html` <mwc-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</mwc-icon> `
|
|
98
|
-
: html``}
|
|
95
|
+
${title ? html` <div titler>${icon ? html`<md-icon>${icon}</md-icon> ` : html``}${text}</div> ` : html``}
|
|
96
|
+
${help && title ? html` <md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon> ` : html``}
|
|
99
97
|
${searchable || filterable
|
|
100
98
|
? html`
|
|
101
99
|
<div search>
|
|
@@ -110,9 +108,9 @@ export class PageTitleBar extends connect(store)(LitElement) {
|
|
|
110
108
|
></ox-input-search>`
|
|
111
109
|
: html``}
|
|
112
110
|
${!title && help && searchable
|
|
113
|
-
? html`<
|
|
111
|
+
? html`<md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon>`
|
|
114
112
|
: html``}
|
|
115
|
-
${filterable ? html`<
|
|
113
|
+
${filterable ? html`<md-icon @click=${(e: MouseEvent) => filterHandler()}>unfold_more</md-icon>` : html``}
|
|
116
114
|
</div>
|
|
117
115
|
`
|
|
118
116
|
: html``}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
2
|
import '@operato/input/ox-input-search.js'
|
|
3
3
|
|
|
4
4
|
import { css, html, LitElement } from 'lit'
|
|
@@ -21,7 +21,7 @@ export class TitleBar extends connect(store)(LitElement) {
|
|
|
21
21
|
--help-icon-opacity: 0.2;
|
|
22
22
|
--help-icon-size: 20px;
|
|
23
23
|
|
|
24
|
-
--
|
|
24
|
+
--md-icon-size: 20px;
|
|
25
25
|
|
|
26
26
|
--input-search-padding: 7px;
|
|
27
27
|
--input-search-border-bottom: none;
|
|
@@ -88,10 +88,8 @@ export class TitleBar extends connect(store)(LitElement) {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
return html`
|
|
91
|
-
${title ? html` <div titler>${icon ? html`<
|
|
92
|
-
${help && title
|
|
93
|
-
? html` <mwc-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</mwc-icon> `
|
|
94
|
-
: html``}
|
|
91
|
+
${title ? html` <div titler>${icon ? html`<md-icon>${icon}</md-icon> ` : html``}${text}</div> ` : html``}
|
|
92
|
+
${help && title ? html` <md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon> ` : html``}
|
|
95
93
|
${searchable || filterable
|
|
96
94
|
? html`
|
|
97
95
|
<div search>
|
|
@@ -106,9 +104,9 @@ export class TitleBar extends connect(store)(LitElement) {
|
|
|
106
104
|
></ox-input-search>`
|
|
107
105
|
: html``}
|
|
108
106
|
${!title && help && searchable
|
|
109
|
-
? html`<
|
|
107
|
+
? html`<md-icon @click=${(e: MouseEvent) => openHelp(help)} help>help</md-icon>`
|
|
110
108
|
: html``}
|
|
111
|
-
${filterable ? html`<
|
|
109
|
+
${filterable ? html`<md-icon @click=${(e: MouseEvent) => filterHandler()}>tune</md-icon>` : html``}
|
|
112
110
|
</div>
|
|
113
111
|
`
|
|
114
112
|
: html``}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '../src/layouts/ox-context-page-toolbar.js'
|
|
3
|
+
import '../src/tools/ox-page-action-context-bar.js'
|
|
4
|
+
import '@operato/input/ox-input-select-buttons.js'
|
|
5
|
+
import { CommonHeaderStyles } from '@operato/styles'
|
|
6
|
+
import { TOOL_POSITION } from '@operato/layout'
|
|
7
|
+
|
|
8
|
+
import '@operato/styles'
|
|
9
|
+
|
|
10
|
+
import { css, html, render, TemplateResult } from 'lit'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'ox-context-page-toolbar select buttons',
|
|
14
|
+
component: 'ox-context-page-toolbar',
|
|
15
|
+
argTypes: {
|
|
16
|
+
label: { control: 'string' }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Story<T> {
|
|
21
|
+
(args: T): TemplateResult
|
|
22
|
+
args?: Partial<T>
|
|
23
|
+
argTypes?: Record<string, unknown>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ArgTypes {
|
|
27
|
+
label?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
|
|
31
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
32
|
+
<link href="/themes/material-theme.css" rel="stylesheet" />
|
|
33
|
+
|
|
34
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
35
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
36
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
body {
|
|
40
|
+
background-color: white;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${CommonHeaderStyles.cssText}
|
|
44
|
+
</style>
|
|
45
|
+
|
|
46
|
+
<div style="height:600px;">
|
|
47
|
+
<div class="header">
|
|
48
|
+
<div class="title">
|
|
49
|
+
${label}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="filters">
|
|
53
|
+
<label>Filter-X</label><input type="text" name="name"></input>
|
|
54
|
+
<ox-input-select-buttons
|
|
55
|
+
@change=${(e: Event) => {
|
|
56
|
+
console.log((e.target as HTMLInputElement).value)
|
|
57
|
+
}}
|
|
58
|
+
name="wearables"
|
|
59
|
+
.value=${'Gloves'}
|
|
60
|
+
.options=${[
|
|
61
|
+
{ display: 'SHOOSE', value: 'Shoose' },
|
|
62
|
+
{ display: 'CHOTHES', value: 'Clothes' },
|
|
63
|
+
{ display: 'GLOVES', value: 'Gloves' }
|
|
64
|
+
]}
|
|
65
|
+
multiple
|
|
66
|
+
></ox-input-select-buttons>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<ox-context-page-toolbar class="actions"
|
|
70
|
+
.tools=${[
|
|
71
|
+
{
|
|
72
|
+
position: TOOL_POSITION.FRONT,
|
|
73
|
+
template: html` <md-icon>download</md-icon> `,
|
|
74
|
+
context: 'exportable'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
position: TOOL_POSITION.FRONT,
|
|
78
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
79
|
+
context: 'importable'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
position: TOOL_POSITION.CENTER,
|
|
83
|
+
template: html`<ox-page-action-context-bar
|
|
84
|
+
.actions=${[
|
|
85
|
+
{
|
|
86
|
+
title: 'save',
|
|
87
|
+
action: () => {},
|
|
88
|
+
icon: 'save'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: 'copy',
|
|
92
|
+
action: () => {},
|
|
93
|
+
icon: 'content_copy',
|
|
94
|
+
emphasis: {
|
|
95
|
+
outlined: true
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
title: 'edit',
|
|
100
|
+
action: () => {},
|
|
101
|
+
icon: 'content_copy',
|
|
102
|
+
emphasis: {
|
|
103
|
+
outlined: true
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: 'hoppaang',
|
|
108
|
+
action: () => {},
|
|
109
|
+
icon: '',
|
|
110
|
+
emphasis: {
|
|
111
|
+
outlined: true
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: 'delete',
|
|
116
|
+
action: () => {},
|
|
117
|
+
icon: 'delete',
|
|
118
|
+
emphasis: {
|
|
119
|
+
danger: true,
|
|
120
|
+
filled: true
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
]}
|
|
124
|
+
></ox-page-action-context-bar>`
|
|
125
|
+
}
|
|
126
|
+
]}
|
|
127
|
+
.context=${{
|
|
128
|
+
exportable: true,
|
|
129
|
+
importable: true,
|
|
130
|
+
toolbar: false
|
|
131
|
+
}}
|
|
132
|
+
|
|
133
|
+
}> </ox-context-page-toolbar>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
`
|
|
137
|
+
|
|
138
|
+
export const Regular = Template.bind({})
|
|
139
|
+
Regular.args = {
|
|
140
|
+
label: 'common header styles'
|
|
141
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '../src/layouts/ox-context-page-toolbar.js'
|
|
3
|
+
import '../src/tools/ox-page-action-context-bar.js'
|
|
4
|
+
import { CommonHeaderStyles } from '@operato/styles'
|
|
5
|
+
import { TOOL_POSITION } from '@operato/layout'
|
|
6
|
+
import { sleep } from '@operato/utils'
|
|
7
|
+
|
|
8
|
+
import '@operato/styles'
|
|
9
|
+
|
|
10
|
+
import { css, html, render, TemplateResult } from 'lit'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'ox-context-page-toolbar-select',
|
|
14
|
+
component: 'ox-context-page-toolbar',
|
|
15
|
+
argTypes: {
|
|
16
|
+
label: { control: 'string' }
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Story<T> {
|
|
21
|
+
(args: T): TemplateResult
|
|
22
|
+
args?: Partial<T>
|
|
23
|
+
argTypes?: Record<string, unknown>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface ArgTypes {
|
|
27
|
+
label?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
|
|
31
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
32
|
+
<link href="/themes/material-theme.css" rel="stylesheet" />
|
|
33
|
+
|
|
34
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
35
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
36
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
body {
|
|
40
|
+
background-color: white;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${CommonHeaderStyles.cssText}
|
|
44
|
+
</style>
|
|
45
|
+
|
|
46
|
+
<div style="height:600px;">
|
|
47
|
+
<div class="header">
|
|
48
|
+
<div class="title">
|
|
49
|
+
${label}
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div class="filters">
|
|
53
|
+
<label>Filter</label><input type="text"></input>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<ox-context-page-toolbar class="actions"
|
|
57
|
+
.tools=${[
|
|
58
|
+
{
|
|
59
|
+
position: TOOL_POSITION.FRONT,
|
|
60
|
+
template: html` <md-icon>download</md-icon> `,
|
|
61
|
+
context: 'exportable'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
position: TOOL_POSITION.FRONT,
|
|
65
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
66
|
+
context: 'importable'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
position: TOOL_POSITION.CENTER,
|
|
70
|
+
template: html`<ox-page-action-context-bar
|
|
71
|
+
.actions=${[
|
|
72
|
+
{
|
|
73
|
+
type: 'icon',
|
|
74
|
+
title: 'favorite',
|
|
75
|
+
icon: 'favorite',
|
|
76
|
+
action: async () => {
|
|
77
|
+
await sleep(1000)
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: 'smile',
|
|
82
|
+
action: () => {},
|
|
83
|
+
select: ['', 'delete', 'hahaha', 'hohoho']
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: 'save',
|
|
87
|
+
action: () => {},
|
|
88
|
+
icon: 'save'
|
|
89
|
+
}
|
|
90
|
+
]}
|
|
91
|
+
></ox-page-action-context-bar>`
|
|
92
|
+
}
|
|
93
|
+
]}
|
|
94
|
+
.context=${{
|
|
95
|
+
exportable: true,
|
|
96
|
+
importable: true,
|
|
97
|
+
toolbar: false
|
|
98
|
+
}}
|
|
99
|
+
|
|
100
|
+
}> </ox-context-page-toolbar>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
`
|
|
104
|
+
|
|
105
|
+
export const Regular = Template.bind({})
|
|
106
|
+
Regular.args = {
|
|
107
|
+
label: 'common header styles'
|
|
108
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
import '../src/layouts/ox-context-page-toolbar.js'
|
|
3
|
+
import '../src/tools/ox-page-action-context-bar.js'
|
|
4
|
+
import { CommonHeaderStyles } from '@operato/styles'
|
|
5
|
+
import { TOOL_POSITION } from '@operato/layout'
|
|
6
|
+
|
|
7
|
+
import '@operato/styles'
|
|
8
|
+
|
|
9
|
+
import { css, html, render, TemplateResult } from 'lit'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'ox-context-page-toolbar',
|
|
13
|
+
component: 'ox-context-page-toolbar',
|
|
14
|
+
argTypes: {
|
|
15
|
+
label: { control: 'string' }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface Story<T> {
|
|
20
|
+
(args: T): TemplateResult
|
|
21
|
+
args?: Partial<T>
|
|
22
|
+
argTypes?: Record<string, unknown>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ArgTypes {
|
|
26
|
+
label?: string
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const Template: Story<ArgTypes> = ({ label = '' }: ArgTypes) => html`
|
|
30
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
31
|
+
<link href="/themes/material-theme.css" rel="stylesheet" />
|
|
32
|
+
|
|
33
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
34
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
35
|
+
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1" rel="stylesheet">
|
|
36
|
+
|
|
37
|
+
<style>
|
|
38
|
+
body {
|
|
39
|
+
background-color: white;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
${CommonHeaderStyles.cssText}
|
|
43
|
+
</style>
|
|
44
|
+
|
|
45
|
+
<div style="height:600px;">
|
|
46
|
+
<div class="header">
|
|
47
|
+
<div class="title">
|
|
48
|
+
${label}
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="filters">
|
|
52
|
+
<label>Filter</label><input type="text"></input>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<ox-context-page-toolbar class="actions"
|
|
56
|
+
.tools=${[
|
|
57
|
+
{
|
|
58
|
+
position: TOOL_POSITION.FRONT,
|
|
59
|
+
template: html` <md-icon>download</md-icon> `,
|
|
60
|
+
context: 'exportable'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
position: TOOL_POSITION.FRONT,
|
|
64
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
65
|
+
context: 'importable'
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
position: TOOL_POSITION.CENTER,
|
|
69
|
+
template: html`<ox-page-action-context-bar
|
|
70
|
+
.actions=${[
|
|
71
|
+
{
|
|
72
|
+
title: 'save',
|
|
73
|
+
action: () => {},
|
|
74
|
+
icon: 'save'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: 'copy',
|
|
78
|
+
action: () => {},
|
|
79
|
+
icon: 'content_copy'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
title: 'delete',
|
|
83
|
+
action: () => {},
|
|
84
|
+
icon: 'delete',
|
|
85
|
+
emphasis: {
|
|
86
|
+
danger: true
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
]}
|
|
90
|
+
></ox-page-action-context-bar>`
|
|
91
|
+
}
|
|
92
|
+
]}
|
|
93
|
+
.context=${{
|
|
94
|
+
exportable: true,
|
|
95
|
+
importable: true,
|
|
96
|
+
toolbar: false
|
|
97
|
+
}}
|
|
98
|
+
|
|
99
|
+
}> </ox-context-page-toolbar>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
`
|
|
103
|
+
|
|
104
|
+
export const Regular = Template.bind({})
|
|
105
|
+
Regular.args = {
|
|
106
|
+
label: 'common header styles'
|
|
107
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
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/material-theme.css" rel="stylesheet" />
|
|
27
|
+
<link href="/themes/context-theme.css" rel="stylesheet" />
|
|
28
|
+
|
|
29
|
+
<link
|
|
30
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
31
|
+
rel="stylesheet"
|
|
32
|
+
/>
|
|
33
|
+
<link
|
|
34
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
35
|
+
rel="stylesheet"
|
|
36
|
+
/>
|
|
37
|
+
<link
|
|
38
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
39
|
+
rel="stylesheet"
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<style>
|
|
43
|
+
body {
|
|
44
|
+
background-color: white;
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
47
|
+
|
|
48
|
+
<div style="height:100px; padding: 10px; background-color: black;">
|
|
49
|
+
<ox-context-toolbar
|
|
50
|
+
.tools=${[
|
|
51
|
+
{
|
|
52
|
+
position: TOOL_POSITION.FRONT_END,
|
|
53
|
+
template: html` <md-icon>download</md-icon> `,
|
|
54
|
+
context: 'exportable'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
position: TOOL_POSITION.FRONT_END,
|
|
58
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
59
|
+
context: 'importable'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
position: TOOL_POSITION.FRONT,
|
|
63
|
+
template: html` <md-icon>download</md-icon> `,
|
|
64
|
+
context: 'exportable'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
position: TOOL_POSITION.FRONT,
|
|
68
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
69
|
+
context: 'importable'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
position: TOOL_POSITION.CENTER,
|
|
73
|
+
template: html`<ox-page-action-context-bar
|
|
74
|
+
.actions=${[
|
|
75
|
+
{
|
|
76
|
+
title: 'save',
|
|
77
|
+
action: () => {},
|
|
78
|
+
icon: 'save'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: 'copy',
|
|
82
|
+
action: () => {},
|
|
83
|
+
icon: 'content_copy'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
title: 'delete',
|
|
87
|
+
action: () => {},
|
|
88
|
+
icon: 'delete',
|
|
89
|
+
emphasis: {
|
|
90
|
+
danger: true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]}
|
|
94
|
+
></ox-page-action-context-bar>`
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
position: TOOL_POSITION.REAR,
|
|
98
|
+
template: html`<ox-page-action-context-bar
|
|
99
|
+
.actions=${[
|
|
100
|
+
{
|
|
101
|
+
title: 'save',
|
|
102
|
+
action: () => {},
|
|
103
|
+
icon: 'save'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: 'copy',
|
|
107
|
+
action: () => {},
|
|
108
|
+
icon: 'content_copy'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: 'delete',
|
|
112
|
+
action: () => {},
|
|
113
|
+
icon: 'delete'
|
|
114
|
+
}
|
|
115
|
+
]}
|
|
116
|
+
></ox-page-action-context-bar>`
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
position: TOOL_POSITION.REAR_END,
|
|
120
|
+
template: html`<ox-page-action-context-bar
|
|
121
|
+
.actions=${[
|
|
122
|
+
{
|
|
123
|
+
title: 'save',
|
|
124
|
+
action: () => {},
|
|
125
|
+
icon: 'save'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
title: 'copy',
|
|
129
|
+
action: () => {},
|
|
130
|
+
icon: 'content_copy'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: 'delete',
|
|
134
|
+
action: () => {},
|
|
135
|
+
icon: 'delete'
|
|
136
|
+
}
|
|
137
|
+
]}
|
|
138
|
+
></ox-page-action-context-bar>`
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
position: TOOL_POSITION.REAR_END,
|
|
142
|
+
template: html` <md-icon>download</md-icon> `,
|
|
143
|
+
context: 'exportable'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
position: TOOL_POSITION.REAR_END,
|
|
147
|
+
template: html` <md-icon>upload</md-icon> `,
|
|
148
|
+
context: 'importable'
|
|
149
|
+
}
|
|
150
|
+
]}
|
|
151
|
+
.context=${{
|
|
152
|
+
exportable: true,
|
|
153
|
+
importable: true,
|
|
154
|
+
toolbar: true
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
</ox-context-toolbar>
|
|
158
|
+
</div>
|
|
159
|
+
`
|
|
160
|
+
|
|
161
|
+
export const Regular = Template.bind({})
|
|
162
|
+
Regular.args = {}
|