@operato/context 2.0.0-alpha.6 → 2.0.0-alpha.60

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +293 -0
  2. package/dist/src/layouts/ox-context-page-toolbar.d.ts +8 -3
  3. package/dist/src/layouts/ox-context-page-toolbar.js +6 -3
  4. package/dist/src/layouts/ox-context-page-toolbar.js.map +1 -1
  5. package/dist/src/layouts/ox-context-toolbar.d.ts +1 -1
  6. package/dist/src/tools/ox-page-action-context-bar.d.ts +11 -3
  7. package/dist/src/tools/ox-page-action-context-bar.js +21 -18
  8. package/dist/src/tools/ox-page-action-context-bar.js.map +1 -1
  9. package/dist/src/tools/ox-page-action-overlay-template.d.ts +1 -1
  10. package/dist/src/tools/ox-page-title-bar.d.ts +1 -1
  11. package/dist/src/tools/ox-title-bar.d.ts +1 -1
  12. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.d.ts +25 -0
  13. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js +101 -0
  14. package/dist/stories/ox-context-page-toolbar-select-buttons.stories.js.map +1 -0
  15. package/dist/stories/ox-context-page-toolbar-select.stories.d.ts +24 -0
  16. package/dist/stories/ox-context-page-toolbar-select.stories.js +82 -0
  17. package/dist/stories/ox-context-page-toolbar-select.stories.js.map +1 -0
  18. package/dist/stories/ox-context-page-toolbar.stories.d.ts +24 -0
  19. package/dist/stories/ox-context-page-toolbar.stories.js +87 -0
  20. package/dist/stories/ox-context-page-toolbar.stories.js.map +1 -0
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +19 -19
  23. package/src/layouts/ox-context-page-toolbar.ts +9 -3
  24. package/src/tools/ox-page-action-context-bar.ts +50 -38
  25. package/stories/ox-context-page-toolbar-select-buttons.stories.ts +115 -0
  26. package/stories/ox-context-page-toolbar-select.stories.ts +96 -0
  27. package/stories/ox-context-page-toolbar.stories.ts +101 -0
  28. package/themes/app-theme.css +145 -0
@@ -0,0 +1,115 @@
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 '@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="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
33
+
34
+ <style>
35
+ body {
36
+ background-color: white;
37
+ }
38
+
39
+ ${CommonHeaderStyles.cssText}
40
+ </style>
41
+
42
+ <div style="height:600px;">
43
+ <div class="header">
44
+ <div class="title">
45
+ <mwc-icon>summarize</mwc-icon>
46
+ ${label}
47
+ </div>
48
+
49
+ <div class="filters">
50
+ <label>Filter-X</label><input type="text" name="name"></input>
51
+ <ox-input-select-buttons
52
+ @change=${(e: Event) => {
53
+ console.log((e.target as HTMLInputElement).value)
54
+ }}
55
+ name="wearables"
56
+ .value=${'Gloves'}
57
+ .options=${[
58
+ { display: 'SHOOSE', value: 'Shoose' },
59
+ { display: 'CHOTHES', value: 'Clothes' },
60
+ { display: 'GLOVES', value: 'Gloves' }
61
+ ]}
62
+ multiple
63
+ ></ox-input-select-buttons>
64
+ </div>
65
+
66
+ <ox-context-page-toolbar class="actions"
67
+ .tools=${[
68
+ {
69
+ position: TOOL_POSITION.FRONT,
70
+ template: html` <mwc-icon>download</mwc-icon> `,
71
+ context: 'exportable'
72
+ },
73
+ {
74
+ position: TOOL_POSITION.FRONT,
75
+ template: html` <mwc-icon>upload</mwc-icon> `,
76
+ context: 'importable'
77
+ },
78
+ {
79
+ position: TOOL_POSITION.CENTER,
80
+ template: html`<ox-page-action-context-bar
81
+ .actions=${[
82
+ {
83
+ title: 'save',
84
+ action: () => {},
85
+ icon: 'save'
86
+ },
87
+ {
88
+ title: 'copy',
89
+ action: () => {},
90
+ icon: 'content_copy'
91
+ },
92
+ {
93
+ title: 'delete',
94
+ action: () => {},
95
+ icon: 'delete'
96
+ }
97
+ ]}
98
+ ></ox-page-action-context-bar>`
99
+ }
100
+ ]}
101
+ .context=${{
102
+ exportable: true,
103
+ importable: true,
104
+ toolbar: false
105
+ }}
106
+
107
+ }> </ox-context-page-toolbar>
108
+ </div>
109
+ </div>
110
+ `
111
+
112
+ export const Regular = Template.bind({})
113
+ Regular.args = {
114
+ label: 'common header styles'
115
+ }
@@ -0,0 +1,96 @@
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
+
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="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
32
+
33
+ <style>
34
+ body {
35
+ background-color: white;
36
+ }
37
+
38
+ ${CommonHeaderStyles.cssText}
39
+ </style>
40
+
41
+ <div style="height:600px;">
42
+ <div class="header">
43
+ <div class="title">
44
+ <mwc-icon>summarize</mwc-icon>
45
+ ${label}
46
+ </div>
47
+
48
+ <div class="filters">
49
+ <label>Filter</label><input type="text"></input>
50
+ </div>
51
+
52
+ <ox-context-page-toolbar class="actions"
53
+ .tools=${[
54
+ {
55
+ position: TOOL_POSITION.FRONT,
56
+ template: html` <mwc-icon>download</mwc-icon> `,
57
+ context: 'exportable'
58
+ },
59
+ {
60
+ position: TOOL_POSITION.FRONT,
61
+ template: html` <mwc-icon>upload</mwc-icon> `,
62
+ context: 'importable'
63
+ },
64
+ {
65
+ position: TOOL_POSITION.CENTER,
66
+ template: html`<ox-page-action-context-bar
67
+ .actions=${[
68
+ {
69
+ title: 'smile',
70
+ action: () => {},
71
+ select: ['', 'delete', 'hahaha', 'hohoho']
72
+ },
73
+ {
74
+ title: 'save',
75
+ action: () => {},
76
+ icon: 'save'
77
+ }
78
+ ]}
79
+ ></ox-page-action-context-bar>`
80
+ }
81
+ ]}
82
+ .context=${{
83
+ exportable: true,
84
+ importable: true,
85
+ toolbar: false
86
+ }}
87
+
88
+ }> </ox-context-page-toolbar>
89
+ </div>
90
+ </div>
91
+ `
92
+
93
+ export const Regular = Template.bind({})
94
+ Regular.args = {
95
+ label: 'common header styles'
96
+ }
@@ -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
+
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="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
32
+
33
+ <style>
34
+ body {
35
+ background-color: white;
36
+ }
37
+
38
+ ${CommonHeaderStyles.cssText}
39
+ </style>
40
+
41
+ <div style="height:600px;">
42
+ <div class="header">
43
+ <div class="title">
44
+ <mwc-icon>summarize</mwc-icon>
45
+ ${label}
46
+ </div>
47
+
48
+ <div class="filters">
49
+ <label>Filter</label><input type="text"></input>
50
+ </div>
51
+
52
+ <ox-context-page-toolbar class="actions"
53
+ .tools=${[
54
+ {
55
+ position: TOOL_POSITION.FRONT,
56
+ template: html` <mwc-icon>download</mwc-icon> `,
57
+ context: 'exportable'
58
+ },
59
+ {
60
+ position: TOOL_POSITION.FRONT,
61
+ template: html` <mwc-icon>upload</mwc-icon> `,
62
+ context: 'importable'
63
+ },
64
+ {
65
+ position: TOOL_POSITION.CENTER,
66
+ template: html`<ox-page-action-context-bar
67
+ .actions=${[
68
+ {
69
+ title: 'save',
70
+ action: () => {},
71
+ icon: 'save'
72
+ },
73
+ {
74
+ title: 'copy',
75
+ action: () => {},
76
+ icon: 'content_copy'
77
+ },
78
+ {
79
+ title: 'delete',
80
+ action: () => {},
81
+ icon: 'delete'
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
+ }