-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcosmoz-bottom-bar.html.js
137 lines (133 loc) · 3.43 KB
/
cosmoz-bottom-bar.html.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* eslint-disable max-len */
import '@neovici/cosmoz-dropdown';
import { html } from '@polymer/polymer/lib/utils/html-tag';
export default html`
<style>
:host {
display: block;
bottom: 0;
left: 0;
width: 100%;
max-width: 100%; /* Firefox fix */
background-color: inherit;
transition: max-height 0.3s ease;
flex: none;
background-color: var(
--cosmoz-bottom-bar-bg-color,
rgba(230, 230, 230, 0.8)
);
box-shadow: var(--cosmoz-bottom-bar-shadow, none);
z-index: 1;
--cosmoz-dropdown-anchor-spacing: 12px 6px;
--paper-button: {
background-color: inherit;
text-transform: none;
border: 0;
border-radius: 0;
font-size: inherit;
color: inherit;
font-weight: inherit;
margin: 0;
padding: 0;
};
}
:host([force-open]) {
transition: none;
}
[hidden],
::slotted([hidden]) {
display: none !important;
}
#bar {
padding: 0 3%;
display: flex;
align-items: center;
}
#info {
min-width: 5px;
padding-right: 3%;
margin-right: auto;
white-space: nowrap;
}
#bottomBarToolbar::slotted(:not(slot):not([unstyled])) {
margin: 0 0.29em;
min-width: 40px;
min-height: 40px;
text-overflow: ellipsis;
white-space: nowrap;
background: var(
--cosmoz-bottom-bar-button-bg-color,
var(--cosmoz-button-bg-color, #101010)
);
color: var(
--cosmoz-bottom-bar-button-color,
var(--cosmoz-button-color, #fff)
);
border-radius: 6px;
padding: 0 18px;
font-size: 14px;
font-weight: 500;
line-height: 40px;
}
#bottomBarToolbar::slotted(:not(slot)[disabled]) {
opacity: var(--cosmoz-button-disabled-opacity, 0.15);
pointer-events: none;
}
#bottomBarToolbar::slotted(:not(slot):hover) {
background: var(
--cosmoz-bottom-bar-button-hover-bg-color,
var(--cosmoz-button-hover-bg-color, #3a3f44)
);
}
#dropdown::part(content) {
max-width: 300px;
}
:host([hide-actions]) #bottomBarToolbar,
:host([hide-actions]) #bottomBarMenu,
:host([hide-actions]) #dropdown {
display: none;
}
</style>
<div id="bar" style$="[[ _getHeightStyle(computedBarHeight) ]]" part="bar">
<div id="info" part="info"><slot name="info"></slot></div>
<slot id="bottomBarToolbar" name="bottom-bar-toolbar"></slot>
<cosmoz-dropdown-menu
id="dropdown"
hidden="[[ !hasMenuItems ]]"
placement="[[ topPlacement ]]"
>
<svg
slot="button"
width="4"
height="16"
viewBox="0 0 4 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M1.50996e-07 2C1.02714e-07 3.10457 0.89543 4 2 4C3.10457 4 4 3.10457 4 2C4 0.89543 3.10457 -3.91405e-08 2 -8.74228e-08C0.895431 -1.35705e-07 1.99278e-07 0.89543 1.50996e-07 2Z"
fill="white"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M1.50996e-07 8C1.02714e-07 9.10457 0.89543 10 2 10C3.10457 10 4 9.10457 4 8C4 6.89543 3.10457 6 2 6C0.895431 6 1.99278e-07 6.89543 1.50996e-07 8Z"
fill="white"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M1.50996e-07 14C1.02714e-07 15.1046 0.89543 16 2 16C3.10457 16 4 15.1046 4 14C4 12.8954 3.10457 12 2 12C0.895431 12 1.99278e-07 12.8954 1.50996e-07 14Z"
fill="white"
/>
</svg>
<slot id="bottomBarMenu" name="bottom-bar-menu"></slot>
</cosmoz-dropdown-menu>
<slot name="extra" id="extraSlot"></slot>
</div>
<div hidden style="display:none">
<slot id="content"></slot>
</div>
`;