@operato/context 2.0.0-alpha.9 → 2.0.0-alpha.92
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 +470 -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 -10
- 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 +139 -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 +12 -5
- package/dist/src/tools/ox-page-action-context-bar.js +43 -48
- package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
- package/dist/src/tools/ox-page-action-overlay-template.d.ts +2 -2
- package/dist/src/tools/ox-page-action-overlay-template.js +22 -31
- 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 +85 -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-empty.stories.d.ts +19 -0
- package/dist/stories/ox-context-toolbar-empty.stories.js +88 -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 -10
- package/src/layouts/ox-context-toolbar.ts +140 -70
- package/src/styles/ox-context-toolbar-overlay-style.ts +2 -2
- package/src/tools/ox-page-action-context-bar.ts +71 -67
- package/src/tools/ox-page-action-overlay-template.ts +42 -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 +99 -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-empty.stories.ts +100 -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 +38 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
2
|
|
|
3
3
|
import { css, html, LitElement } from 'lit'
|
|
4
4
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
5
5
|
import { connect } from 'pwa-helpers'
|
|
6
6
|
|
|
7
7
|
import { store } from '@operato/shell'
|
|
8
|
-
import { ScrollbarStyles } from '@operato/styles'
|
|
8
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'
|
|
9
9
|
import { sleep } from '@operato/utils'
|
|
10
10
|
|
|
11
11
|
import { ContextToolbarOverlayStyle } from '../styles/ox-context-toolbar-overlay-style.js'
|
|
@@ -15,34 +15,23 @@ export class PageActionOverlayTemplate extends connect(store)(LitElement) {
|
|
|
15
15
|
static get styles() {
|
|
16
16
|
return [
|
|
17
17
|
ScrollbarStyles,
|
|
18
|
+
ButtonContainerStyles,
|
|
18
19
|
ContextToolbarOverlayStyle,
|
|
19
20
|
css`
|
|
20
21
|
:host {
|
|
21
22
|
display: flex;
|
|
22
23
|
flex-wrap: wrap;
|
|
23
|
-
gap: var(--
|
|
24
|
+
gap: var(--padding-narrow);
|
|
24
25
|
}
|
|
25
26
|
:host *:focus {
|
|
26
27
|
outline: none;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
button {
|
|
30
31
|
background-color: var(--main-section-background-color);
|
|
31
32
|
border-radius: var(--context-action-bar-more-button-border-radius);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
[danger] {
|
|
35
|
-
--mdc-theme-primary: var(--mdc-danger-button-primary-color);
|
|
36
|
-
--mdc-button-outline-color: var(--mdc-danger-button-outline-color);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@media screen and (max-width: 460px) {
|
|
40
|
-
mwc-button {
|
|
41
|
-
--mdc-button-horizontal-padding: var(--padding-default);
|
|
42
|
-
border-radius: 4px;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
35
|
@keyframes rotate {
|
|
47
36
|
from {
|
|
48
37
|
transform: rotate(0deg);
|
|
@@ -61,47 +50,49 @@ export class PageActionOverlayTemplate extends connect(store)(LitElement) {
|
|
|
61
50
|
return html`
|
|
62
51
|
${this.actions.map(($action, idx) => {
|
|
63
52
|
let { type, title, icon, action, select, href, emphasis } = $action as any
|
|
64
|
-
let { outlined, raised, dense, danger } = emphasis || {}
|
|
53
|
+
let { outlined, raised, dense, danger, filled } = emphasis || {}
|
|
65
54
|
|
|
66
55
|
return type == 'text'
|
|
67
56
|
? html` <span>${title}</span> `
|
|
68
57
|
: type == 'select' || (select && select.length > 0)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
button.disabled = true
|
|
58
|
+
? html`
|
|
59
|
+
<select @change=${action}>
|
|
60
|
+
${select.map((option: any) => html` <option>${option}</option> `)}
|
|
61
|
+
</select>
|
|
62
|
+
`
|
|
63
|
+
: type == 'link'
|
|
64
|
+
? html` <a href=${href}>${title}</a> `
|
|
65
|
+
: html`
|
|
66
|
+
<button
|
|
67
|
+
?dense=${dense}
|
|
68
|
+
?raised=${raised}
|
|
69
|
+
?outlined=${outlined}
|
|
70
|
+
?danger=${danger}
|
|
71
|
+
?filled=${filled}
|
|
72
|
+
@click=${async (e: MouseEvent) => {
|
|
73
|
+
/* all actions should be bloked for a second */
|
|
74
|
+
const button = e.currentTarget as any
|
|
75
|
+
button.icon = 'rotate_right'
|
|
76
|
+
button.setAttribute('working', true)
|
|
77
|
+
button.disabled = true
|
|
90
78
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
79
|
+
try {
|
|
80
|
+
action()
|
|
81
|
+
} finally {
|
|
82
|
+
await sleep(1000)
|
|
83
|
+
button.disabled = false
|
|
84
|
+
/* because icon can be changed after sleep, don't use closure 'icon'. */
|
|
85
|
+
button.icon = this.actions[idx]?.icon || 'done_all'
|
|
86
|
+
button.removeAttribute('working')
|
|
99
87
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
88
|
+
window.history.back()
|
|
89
|
+
}
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<md-icon>${icon || 'done_all'}</md-icon>
|
|
93
|
+
${title}
|
|
94
|
+
</button>
|
|
95
|
+
`
|
|
105
96
|
})}
|
|
106
97
|
`
|
|
107
98
|
}
|
|
@@ -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,99 @@
|
|
|
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-select',
|
|
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: 'smile',
|
|
73
|
+
action: () => {},
|
|
74
|
+
select: ['', 'delete', 'hahaha', 'hohoho']
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: 'save',
|
|
78
|
+
action: () => {},
|
|
79
|
+
icon: 'save'
|
|
80
|
+
}
|
|
81
|
+
]}
|
|
82
|
+
></ox-page-action-context-bar>`
|
|
83
|
+
}
|
|
84
|
+
]}
|
|
85
|
+
.context=${{
|
|
86
|
+
exportable: true,
|
|
87
|
+
importable: true,
|
|
88
|
+
toolbar: false
|
|
89
|
+
}}
|
|
90
|
+
|
|
91
|
+
}> </ox-context-page-toolbar>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
`
|
|
95
|
+
|
|
96
|
+
export const Regular = Template.bind({})
|
|
97
|
+
Regular.args = {
|
|
98
|
+
label: 'common header styles'
|
|
99
|
+
}
|
|
@@ -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
|
+
}
|