@operato/context 2.0.0-alpha.46 → 2.0.0-alpha.47
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-page-toolbar.d.ts +8 -3
- package/dist/src/layouts/ox-context-page-toolbar.js +6 -3
- package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
- package/dist/src/tools/ox-page-action-context-bar.d.ts +9 -1
- package/dist/src/tools/ox-page-action-context-bar.js +21 -18
- package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
- package/dist/stories/ox-context-page-toolbar-select.stories.d.ts +24 -0
- package/dist/stories/ox-context-page-toolbar-select.stories.js +91 -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 +86 -0
- package/dist/stories/ox-context-page-toolbar.stories.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/layouts/ox-context-page-toolbar.ts +9 -3
- package/src/tools/ox-page-action-context-bar.ts +50 -38
- package/stories/ox-context-page-toolbar-select.stories.ts +106 -0
- package/stories/ox-context-page-toolbar.stories.ts +101 -0
- package/themes/app-theme.css +145 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import '@material/mwc-icon'
|
|
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 { store } from '@operato/shell'
|
|
7
|
+
|
|
8
|
+
import '@operato/styles'
|
|
9
|
+
|
|
10
|
+
import { css, html, render, TemplateResult } from 'lit'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'ox-context-page-toolbar',
|
|
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="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
33
|
+
|
|
34
|
+
<script>
|
|
35
|
+
const store
|
|
36
|
+
</script>
|
|
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
|
+
<mwc-icon>summarize</mwc-icon>
|
|
50
|
+
${label}
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="filters">
|
|
54
|
+
<label>Filter</label><input type="text"></input>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<ox-context-page-toolbar class="actions"
|
|
58
|
+
.tools=${[
|
|
59
|
+
{
|
|
60
|
+
position: TOOL_POSITION.FRONT,
|
|
61
|
+
template: html` <mwc-icon>download</mwc-icon> `,
|
|
62
|
+
context: 'exportable'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
position: TOOL_POSITION.FRONT,
|
|
66
|
+
template: html` <mwc-icon>upload</mwc-icon> `,
|
|
67
|
+
context: 'importable'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
position: TOOL_POSITION.CENTER,
|
|
71
|
+
template: html`<ox-page-action-context-bar
|
|
72
|
+
.actions=${[
|
|
73
|
+
{
|
|
74
|
+
title: 'smile',
|
|
75
|
+
action: () => {},
|
|
76
|
+
select: ['', 'delete', 'hahaha', 'hohoho']
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
title: 'save',
|
|
80
|
+
action: () => {},
|
|
81
|
+
icon: 'save'
|
|
82
|
+
}
|
|
83
|
+
]}
|
|
84
|
+
></ox-page-action-context-bar>`
|
|
85
|
+
}
|
|
86
|
+
]}
|
|
87
|
+
.context=${{
|
|
88
|
+
exportable: true,
|
|
89
|
+
importable: true,
|
|
90
|
+
toolbar: false
|
|
91
|
+
}}
|
|
92
|
+
|
|
93
|
+
}> </ox-context-page-toolbar>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
`
|
|
97
|
+
|
|
98
|
+
export const Regular = Template.bind({})
|
|
99
|
+
Regular.args = {
|
|
100
|
+
label: 'common header styles'
|
|
101
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
body {
|
|
2
|
+
/* theme color */
|
|
3
|
+
--primary-color-rgb: 130, 105, 96;
|
|
4
|
+
--primary-color: rgb(var(--primary-color-rgb));
|
|
5
|
+
--secondary-color-rgb: 78, 78, 90;
|
|
6
|
+
--secondary-color: rgb(var(--secondary-color-rgb));
|
|
7
|
+
--focus-color: var(--theme-white-color);
|
|
8
|
+
--primary-background-color: var(--secondary-color);
|
|
9
|
+
--secondary-background-color: #283644;
|
|
10
|
+
--main-section-background-color: #f5f2ee;
|
|
11
|
+
--theme-white-color: #fff;
|
|
12
|
+
--theme-black-color: rgba(0, 0, 0, 0.9);
|
|
13
|
+
|
|
14
|
+
--focus-background-color: var(--primary-color);
|
|
15
|
+
--primary-text-color: #3c3938;
|
|
16
|
+
--secondary-text-color: var(--primary-color);
|
|
17
|
+
|
|
18
|
+
--opacity-dark-color: rgba(0, 0, 0, 0.4);
|
|
19
|
+
--opacity-light-color: rgba(255, 255, 255, 0.8);
|
|
20
|
+
|
|
21
|
+
/* status color */
|
|
22
|
+
--status-success-color: #35a24a;
|
|
23
|
+
--status-warning-color: #ee8d03;
|
|
24
|
+
--status-danger-color: #d14946;
|
|
25
|
+
--status-info-color: #398ace;
|
|
26
|
+
|
|
27
|
+
/* common style */
|
|
28
|
+
--border-radius: 4px;
|
|
29
|
+
--border-dark-color: 1px solid rgba(0, 0, 0, 0.15);
|
|
30
|
+
--border-light-color: 1px solid rgba(255, 255, 255, 0.3);
|
|
31
|
+
|
|
32
|
+
--box-shadow: 2px 2px 3px 0px rgba(0, 0, 0, 0.1);
|
|
33
|
+
|
|
34
|
+
--theme-font: 'Noto', Helvetica;
|
|
35
|
+
|
|
36
|
+
--margin-default: 9px;
|
|
37
|
+
--margin-narrow: 4px;
|
|
38
|
+
--margin-wide: 15px;
|
|
39
|
+
--padding-default: var(--margin-default);
|
|
40
|
+
--padding-narrow: var(--margin-narrow);
|
|
41
|
+
--padding-wide: var(--margin-wide);
|
|
42
|
+
|
|
43
|
+
--scrollbar-thumb-color: rgba(57, 78, 100, 0.5);
|
|
44
|
+
--scrollbar-thumb-hover-color: var(--primary-color);
|
|
45
|
+
|
|
46
|
+
--fontsize-default: 14px;
|
|
47
|
+
--fontsize-small: 13px;
|
|
48
|
+
--fontsize-large: 16px;
|
|
49
|
+
|
|
50
|
+
/* app layout style */
|
|
51
|
+
--app-grid-template-area: 'header header header' 'nav main aside' 'nav footer aside';
|
|
52
|
+
|
|
53
|
+
/* title & description style */
|
|
54
|
+
--title-margin: var(--margin-narrow) 0;
|
|
55
|
+
--title-font: bold 24px var(--theme-font);
|
|
56
|
+
--title-text-color: var(--secondary-color);
|
|
57
|
+
--title-font-mobile: bold 20px var(--theme-font);
|
|
58
|
+
|
|
59
|
+
--page-description-margin: var(--margin-narrow) 0 var(--margin-wide) 0;
|
|
60
|
+
--page-description-font: normal var(--fontsize-default) / 1.2rem var(--theme-font);
|
|
61
|
+
--page-description-color: var(--secondary-text-color);
|
|
62
|
+
|
|
63
|
+
--subtitle-padding: 12px 5px 3px 5px;
|
|
64
|
+
--subtitle-font: bold 18px var(--theme-font);
|
|
65
|
+
--subtitle-text-color: var(--primary-color);
|
|
66
|
+
--subtitle-border-bottom: 1px solid var(--primary-color);
|
|
67
|
+
|
|
68
|
+
/* icon style */
|
|
69
|
+
--icon-tiny-size: 24px;
|
|
70
|
+
--icon-default-size: 36px;
|
|
71
|
+
--icon-big-size: 48px;
|
|
72
|
+
--icon-default-color: var(--theme-white-color);
|
|
73
|
+
|
|
74
|
+
/* material design component themes */
|
|
75
|
+
--mdc-theme-on-primary: var(--theme-white-color);
|
|
76
|
+
--mdc-theme-primary: var(--secondary-text-color);
|
|
77
|
+
--mdc-theme-on-secondary: var(--theme-white-color);
|
|
78
|
+
--mdc-theme-secondary: var(--primary-color);
|
|
79
|
+
--mdc-button-outline-color: var(--primary-color);
|
|
80
|
+
--mdc-danger-button-primary-color: var(--status-danger-color);
|
|
81
|
+
--mdc-danger-button-outline-color: var(--status-danger-color);
|
|
82
|
+
--mdc-button-outline-width: 1px;
|
|
83
|
+
--mdc-button-horizontal-padding: 16px;
|
|
84
|
+
|
|
85
|
+
/* button style */
|
|
86
|
+
--button-background-color: #fafbfc;
|
|
87
|
+
--button-background-focus-color: var(--primary-color);
|
|
88
|
+
--button-border: var(--border-dark-color);
|
|
89
|
+
--button-border-radius: var(--border-radius);
|
|
90
|
+
--button-margin: var(--margin-default) var(--margin-default) var(--margin-default) 0;
|
|
91
|
+
--button-padding: var(--padding-default);
|
|
92
|
+
--button-color: var(--secondary-color);
|
|
93
|
+
--button-font: normal 15px var(--theme-font);
|
|
94
|
+
--button-text-transform: capitalize;
|
|
95
|
+
--button-active-box-shadow: 1px 1px 1px 0px rgba(0, 0, 0, 0.2);
|
|
96
|
+
--button-activ-border: 1px solid var(--primary-color);
|
|
97
|
+
|
|
98
|
+
--button-primary-background-color: var(--primary-color);
|
|
99
|
+
--button-primary-active-background-color: var(--status-success-color);
|
|
100
|
+
--button-primary-padding: var(--margin-default) var(--margin-wide);
|
|
101
|
+
--button-primary-color: var(--theme-white-color);
|
|
102
|
+
--button-primary-font: bold 16px var(--theme-font);
|
|
103
|
+
|
|
104
|
+
/* table style */
|
|
105
|
+
--th-padding: var(--padding-default);
|
|
106
|
+
--th-border-top: 2px solid var(--secondary-color);
|
|
107
|
+
--th-text-transform: capitalize;
|
|
108
|
+
--th-font: bold var(--fontsize-small) var(--theme-font);
|
|
109
|
+
--th-color: rgba(var(--secondary-color-rgb), 0.8);
|
|
110
|
+
|
|
111
|
+
--tr-background-color: var(--theme-white-color);
|
|
112
|
+
--tr-background-odd-color: rgba(255, 255, 255, 0.4);
|
|
113
|
+
--tr-background-hover-color: #e1f5fe;
|
|
114
|
+
--td-border-line: 1px solid rgba(0, 0, 0, 0.05);
|
|
115
|
+
--td-border-bottom: 1px solid rgba(0, 0, 0, 0.09);
|
|
116
|
+
--td-padding: var(--padding-default);
|
|
117
|
+
--td-font: normal 13px var(--theme-font);
|
|
118
|
+
--td-color: var(--secondary-color);
|
|
119
|
+
|
|
120
|
+
--label-cell-background-color: #f6f6f6; /* th or td common background color */
|
|
121
|
+
|
|
122
|
+
/* form style */
|
|
123
|
+
--label-font: normal var(--fontsize-default) var(--theme-font);
|
|
124
|
+
--label-color: var(--secondary-color);
|
|
125
|
+
--label-text-transform: capitalize;
|
|
126
|
+
--input-margin: var(--margin-narrow) 0;
|
|
127
|
+
--input-padding: var(--padding-default);
|
|
128
|
+
--input-min-width: 200px;
|
|
129
|
+
--input-font: normal var(--fontsize-default) var(--theme-font);
|
|
130
|
+
--input-hint-font: normal var(--fontsize-small) var(--theme-font);
|
|
131
|
+
--input-hint-color: #666;
|
|
132
|
+
--input-container-max-width: 900px;
|
|
133
|
+
--fieldset-margin: var(--padding-wide) 0;
|
|
134
|
+
--fieldset-padding: 0 var(--padding-wide) var(--padding-wide) var(--padding-wide);
|
|
135
|
+
--legend-padding: var(--padding-default) 0;
|
|
136
|
+
--legend-color: var(--secondary-text-color);
|
|
137
|
+
--legend-font: bold 16px var(--theme-font);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@media only screen and (max-width: 460px) {
|
|
141
|
+
body {
|
|
142
|
+
/* subtitle style */
|
|
143
|
+
--subtitle-margin: 0;
|
|
144
|
+
}
|
|
145
|
+
}
|