@operato/menu 2.0.0-alpha.55
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/.editorconfig +29 -0
- package/.storybook/main.js +3 -0
- package/.storybook/server.mjs +8 -0
- package/CHANGELOG.md +12 -0
- package/README.md +75 -0
- package/demo/index.html +40 -0
- package/dist/src/index.d.ts +0 -0
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/menu-landscape-styles.d.ts +1 -0
- package/dist/src/menu-landscape-styles.js +149 -0
- package/dist/src/menu-landscape-styles.js.map +1 -0
- package/dist/src/menu-portrait-styles.d.ts +1 -0
- package/dist/src/menu-portrait-styles.js +147 -0
- package/dist/src/menu-portrait-styles.js.map +1 -0
- package/dist/src/ox-menu-landscape.d.ts +21 -0
- package/dist/src/ox-menu-landscape.js +99 -0
- package/dist/src/ox-menu-landscape.js.map +1 -0
- package/dist/src/ox-menu-part.d.ts +29 -0
- package/dist/src/ox-menu-part.js +135 -0
- package/dist/src/ox-menu-part.js.map +1 -0
- package/dist/src/ox-menu-portrait.d.ts +13 -0
- package/dist/src/ox-menu-portrait.js +85 -0
- package/dist/src/ox-menu-portrait.js.map +1 -0
- package/dist/src/ox-top-menu-bar.d.ts +23 -0
- package/dist/src/ox-top-menu-bar.js +145 -0
- package/dist/src/ox-top-menu-bar.js.map +1 -0
- package/dist/src/types.d.ts +10 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/stories/ox-menu-container.d.ts +15 -0
- package/dist/stories/ox-menu-container.js +94 -0
- package/dist/stories/ox-menu-container.js.map +1 -0
- package/dist/stories/ox-menu-portrait.stories.d.ts +17 -0
- package/dist/stories/ox-menu-portrait.stories.js +35 -0
- package/dist/stories/ox-menu-portrait.stories.js.map +1 -0
- package/dist/stories/test-menus.d.ts +2 -0
- package/dist/stories/test-menus.js +179 -0
- package/dist/stories/test-menus.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +100 -0
- package/src/index.ts +0 -0
- package/src/menu-landscape-styles.ts +149 -0
- package/src/menu-portrait-styles.ts +147 -0
- package/src/ox-menu-landscape.ts +105 -0
- package/src/ox-menu-part.ts +131 -0
- package/src/ox-menu-portrait.ts +87 -0
- package/src/ox-top-menu-bar.ts +147 -0
- package/src/types.ts +10 -0
- package/stories/ox-menu-container.ts +97 -0
- package/stories/ox-menu-portrait.stories.ts +46 -0
- package/stories/test-menus.ts +180 -0
- package/themes/app-theme.css +145 -0
- package/tsconfig.json +23 -0
- package/web-dev-server.config.mjs +27 -0
- package/web-test-runner.config.mjs +41 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import '@material/mwc-icon'
|
|
2
|
+
import '../src/ox-menu-portrait'
|
|
3
|
+
|
|
4
|
+
import { css, html, LitElement, PropertyValues } from 'lit'
|
|
5
|
+
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
6
|
+
|
|
7
|
+
import { ScrollbarStyles } from '@operato/styles'
|
|
8
|
+
|
|
9
|
+
import { Menu } from '../src/types'
|
|
10
|
+
|
|
11
|
+
function isActiveMenu(menu: Menu, path?: string) {
|
|
12
|
+
return (
|
|
13
|
+
menu.path?.split('?')[0] === path ||
|
|
14
|
+
(menu.active && typeof menu.active === 'function' && menu.active.call(menu, { path }))
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@customElement('ox-menu-container')
|
|
19
|
+
export class OxMenuContainer extends LitElement {
|
|
20
|
+
static styles = [
|
|
21
|
+
ScrollbarStyles,
|
|
22
|
+
css`
|
|
23
|
+
:host {
|
|
24
|
+
display: flex;
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
background-color: var(--theme-white-color);
|
|
28
|
+
}
|
|
29
|
+
`
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
@property({ type: Array }) menus?: Menu[]
|
|
33
|
+
|
|
34
|
+
@state() activeMenu?: Menu
|
|
35
|
+
@state() activeTopLevel?: Menu
|
|
36
|
+
@state() path?: string
|
|
37
|
+
|
|
38
|
+
render() {
|
|
39
|
+
return html`
|
|
40
|
+
<div
|
|
41
|
+
@click=${(e: MouseEvent) => {
|
|
42
|
+
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey) {
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
const anchor: HTMLAnchorElement = e.composedPath().filter((n: any) => n.tagName === 'A')[0] as any
|
|
46
|
+
if (!anchor) {
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
const href = anchor.href
|
|
50
|
+
e.preventDefault()
|
|
51
|
+
|
|
52
|
+
var [_, path, ...others] = new URL(href).pathname.split('/')
|
|
53
|
+
this.path = path
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<ox-menu-portrait
|
|
57
|
+
.menus=${this.menus}
|
|
58
|
+
.activeTopLevel=${this.activeTopLevel}
|
|
59
|
+
.activeMenu=${this.activeMenu}
|
|
60
|
+
.path=${this.path || ''}
|
|
61
|
+
></ox-menu-portrait>
|
|
62
|
+
</div>
|
|
63
|
+
`
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
firstUpdated() {
|
|
67
|
+
this.renderRoot.addEventListener('active-toplevel', (e: Event) => {
|
|
68
|
+
e.stopPropagation()
|
|
69
|
+
e.preventDefault()
|
|
70
|
+
|
|
71
|
+
this.activeTopLevel = (e as CustomEvent).detail
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
updated(changes: PropertyValues<this>) {
|
|
76
|
+
if (changes.has('menus') || changes.has('path')) {
|
|
77
|
+
this.findActivePage()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private findActivePage() {
|
|
82
|
+
var menus = this.menus || []
|
|
83
|
+
var activeMenu
|
|
84
|
+
|
|
85
|
+
this.activeTopLevel = menus.find(menu => {
|
|
86
|
+
if (isActiveMenu(menu, this.path)) {
|
|
87
|
+
activeMenu = menu
|
|
88
|
+
return true
|
|
89
|
+
} else if (menu.menus) {
|
|
90
|
+
activeMenu = menu.menus.find((menu: Menu) => isActiveMenu(menu, this.path))
|
|
91
|
+
return !!activeMenu
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
this.activeMenu = activeMenu || this.activeTopLevel
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import '../src/ox-menu-portrait'
|
|
2
|
+
|
|
3
|
+
import { html, TemplateResult } from 'lit'
|
|
4
|
+
import { menus } from './test-menus'
|
|
5
|
+
import './ox-menu-container'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'OxMenuPortrait',
|
|
9
|
+
component: 'ox-menu-portrait',
|
|
10
|
+
argTypes: {}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Story<T> {
|
|
14
|
+
(args: T): TemplateResult
|
|
15
|
+
args?: Partial<T>
|
|
16
|
+
argTypes?: Record<string, unknown>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface ArgTypes {}
|
|
20
|
+
|
|
21
|
+
const Template: Story<ArgTypes> = ({}: ArgTypes) => html`
|
|
22
|
+
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
23
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
body {
|
|
27
|
+
background-color: cyan;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.container {
|
|
31
|
+
display: flex;
|
|
32
|
+
width: 260px;
|
|
33
|
+
height: 500px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ox-menu-container {
|
|
37
|
+
flex: 1;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
40
|
+
|
|
41
|
+
<div class="container">
|
|
42
|
+
<ox-menu-container .menus=${menus}></ox-menu-container>
|
|
43
|
+
</div>
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
export const Regular = Template.bind({})
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { Menu } from '../src/types'
|
|
2
|
+
|
|
3
|
+
export const menus: Menu[] = [
|
|
4
|
+
{
|
|
5
|
+
name: '나의 업무 공간',
|
|
6
|
+
type: 'group'
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
name: '내 업무함',
|
|
10
|
+
icon: 'format_list_bulleted',
|
|
11
|
+
path: 'todo-list',
|
|
12
|
+
badge: '777'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: '내 결재함',
|
|
16
|
+
icon: 'approval',
|
|
17
|
+
path: 'approval-pending-list',
|
|
18
|
+
badge: '3'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: '업무 이력 캘린더',
|
|
22
|
+
icon: 'calendar_month',
|
|
23
|
+
path: 'done-list-calendar',
|
|
24
|
+
description: '업무와 관련된 수행 또는 결재 이력을 캘린더에서 조회할 수 있습니다.',
|
|
25
|
+
menus: [
|
|
26
|
+
{
|
|
27
|
+
name: '업무 이력',
|
|
28
|
+
icon: 'history',
|
|
29
|
+
path: 'done-list'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: '결재 수행 이력',
|
|
33
|
+
icon: 'history',
|
|
34
|
+
path: 'approval-done-list'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'DATASET',
|
|
40
|
+
type: 'group'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: '데이타 셋 관리',
|
|
44
|
+
icon: 'display_settings',
|
|
45
|
+
path: 'data-set-list'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: '데이타 키셋 관리',
|
|
49
|
+
icon: 'display_settings',
|
|
50
|
+
path: 'data-key-set-list'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: '데이타 센서 관리',
|
|
54
|
+
icon: 'sensors',
|
|
55
|
+
path: 'data-sensor-list'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'DATA ENTRY',
|
|
59
|
+
type: 'group'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
icon: 'post_add',
|
|
63
|
+
name: '데이타 입력 화면',
|
|
64
|
+
path: 'data-entry-list'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'DATA REPORT',
|
|
68
|
+
type: 'group'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: '데이타 샘플 조회',
|
|
72
|
+
icon: 'checklist',
|
|
73
|
+
path: 'data-sample-list',
|
|
74
|
+
menus: [
|
|
75
|
+
{
|
|
76
|
+
name: 'TEST',
|
|
77
|
+
icon: 'checklist',
|
|
78
|
+
path: 'data-sample-search/bfb95a47-5cbd-4415-9032-14789e27c819'
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: '자숙 공정',
|
|
82
|
+
icon: 'checklist',
|
|
83
|
+
path: 'data-sample-search/5aad9fe2-56a3-4796-afd9-6c044ab39990'
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: '탕비실 관리',
|
|
87
|
+
icon: 'checklist',
|
|
88
|
+
path: 'data-sample-search/0176fcc3-0dbf-4fe6-9bd0-ca9f9ae91cf4'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: '파일 관리',
|
|
92
|
+
icon: 'checklist',
|
|
93
|
+
path: 'data-sample-search/9c6ce158-e28c-4b00-92b9-59739d906609'
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: '화장실 관리',
|
|
97
|
+
icon: 'checklist',
|
|
98
|
+
path: 'data-sample-search/3998c6a1-b39d-45cf-a0cb-2b11b49331a0'
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: '데이타 이탈점 조회',
|
|
104
|
+
icon: 'playlist_remove',
|
|
105
|
+
path: 'data-ooc-list'
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: '데이터 수집 마감 조회',
|
|
109
|
+
icon: 'functions',
|
|
110
|
+
path: 'data-summary-list',
|
|
111
|
+
menus: [
|
|
112
|
+
{
|
|
113
|
+
name: '자숙 공정',
|
|
114
|
+
icon: 'checklist',
|
|
115
|
+
path: 'data-summary-period/5aad9fe2-56a3-4796-afd9-6c044ab39990'
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: '탕비실 관리',
|
|
119
|
+
icon: 'checklist',
|
|
120
|
+
path: 'data-summary-period/0176fcc3-0dbf-4fe6-9bd0-ca9f9ae91cf4'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: '화장실 관리',
|
|
124
|
+
icon: 'checklist',
|
|
125
|
+
path: 'data-summary-period/3998c6a1-b39d-45cf-a0cb-2b11b49331a0'
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
icon: 'newspaper',
|
|
131
|
+
name: '데이타 리포트',
|
|
132
|
+
path: 'data-report-list'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
icon: 'archive',
|
|
136
|
+
name: '데이타 아카이브 조회',
|
|
137
|
+
path: 'data-archive-list'
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: '조직',
|
|
141
|
+
type: 'group'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: '조직',
|
|
145
|
+
icon: 'account_tree',
|
|
146
|
+
description: '조직 구성과 결재선 관리를 위한 메뉴 구성입니다.',
|
|
147
|
+
menus: [
|
|
148
|
+
{
|
|
149
|
+
name: '연락처 관리',
|
|
150
|
+
path: 'contact-list'
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: '직원 목록',
|
|
154
|
+
path: 'employee-list'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: '부서 조직도',
|
|
158
|
+
path: 'department-tree'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: '부서 목록',
|
|
162
|
+
path: 'department-list'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: '나의 결재라인 템플릿 목록',
|
|
166
|
+
path: 'my-approval-line-templates-page'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: '공통 결재라인 템플릿 목록',
|
|
170
|
+
path: 'common-approval-line-templates-page'
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: '모니터링',
|
|
176
|
+
type: 'board',
|
|
177
|
+
path: 'board-viewer/85f69924-cdff-438a-9691-569b3542c38e?title=모니터링',
|
|
178
|
+
icon: 'dashboard'
|
|
179
|
+
}
|
|
180
|
+
]
|
|
@@ -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
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2018",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": ["es2017", "dom"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": false,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"useDefineForClassFields": false,
|
|
13
|
+
"importHelpers": true,
|
|
14
|
+
"outDir": "dist",
|
|
15
|
+
"sourceMap": true,
|
|
16
|
+
"inlineSources": true,
|
|
17
|
+
"rootDir": "./",
|
|
18
|
+
"declaration": true,
|
|
19
|
+
"incremental": true,
|
|
20
|
+
"types": ["node", "mocha"]
|
|
21
|
+
},
|
|
22
|
+
"include": ["**/*.ts"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
+
|
|
3
|
+
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
+
const hmr = process.argv.includes('--hmr');
|
|
5
|
+
|
|
6
|
+
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
+
open: '/demo/',
|
|
8
|
+
/** Use regular watch mode if HMR is not enabled. */
|
|
9
|
+
watch: !hmr,
|
|
10
|
+
/** Resolve bare module imports */
|
|
11
|
+
nodeResolve: {
|
|
12
|
+
exportConditions: ['browser', 'development'],
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
16
|
+
// esbuildTarget: 'auto'
|
|
17
|
+
|
|
18
|
+
/** Set appIndex to enable SPA routing */
|
|
19
|
+
// appIndex: 'demo/index.html',
|
|
20
|
+
|
|
21
|
+
plugins: [
|
|
22
|
+
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
23
|
+
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
24
|
+
],
|
|
25
|
+
|
|
26
|
+
// See documentation for all available options
|
|
27
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
+
|
|
3
|
+
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
+
|
|
5
|
+
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
+
/** Test files to run */
|
|
7
|
+
files: 'dist/test/**/*.test.js',
|
|
8
|
+
|
|
9
|
+
/** Resolve bare module imports */
|
|
10
|
+
nodeResolve: {
|
|
11
|
+
exportConditions: ['browser', 'development'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/** Filter out lit dev mode logs */
|
|
15
|
+
filterBrowserLogs(log) {
|
|
16
|
+
for (const arg of log.args) {
|
|
17
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
+
// esbuildTarget: 'auto',
|
|
26
|
+
|
|
27
|
+
/** Amount of browsers to run concurrently */
|
|
28
|
+
// concurrentBrowsers: 2,
|
|
29
|
+
|
|
30
|
+
/** Amount of test files per browser to test concurrently */
|
|
31
|
+
// concurrency: 1,
|
|
32
|
+
|
|
33
|
+
/** Browsers to run tests on */
|
|
34
|
+
// browsers: [
|
|
35
|
+
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
+
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
+
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
+
// ],
|
|
39
|
+
|
|
40
|
+
// See documentation for all available options
|
|
41
|
+
});
|