@mintplayer/web-components 1.2.0 → 1.3.0
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/accordion/src/styles/accordion.styles.d.ts +2 -0
- package/card/index.mjs +246 -363
- package/card/src/card-classes.d.ts +0 -7
- package/card/src/card-global.styles.d.ts +2 -0
- package/card/src/index.d.ts +0 -9
- package/card/src/mp-card.element.d.ts +45 -18
- package/package.json +1 -1
- package/timeline/index.mjs +716 -0
- package/timeline/src/components/index.d.ts +2 -0
- package/timeline/src/components/mp-timeline-item.d.ts +63 -0
- package/timeline/src/components/mp-timeline.d.ts +85 -0
- package/timeline/src/index.d.ts +5 -0
- package/timeline/src/styles/index.d.ts +2 -0
- package/timeline/src/styles/timeline-item.styles.d.ts +2 -0
- package/timeline/src/styles/timeline.styles.d.ts +2 -0
- package/timeline-core/index.mjs +23 -0
- package/timeline-core/src/index.d.ts +2 -0
- package/timeline-core/src/models/context.d.ts +39 -0
- package/timeline-core/src/models/index.d.ts +2 -0
- package/timeline-core/src/models/timeline-item.d.ts +44 -0
- package/timeline-core/src/resolve-sides.d.ts +12 -0
- package/card/src/mp-card-body.element.d.ts +0 -12
- package/card/src/mp-card-footer.element.d.ts +0 -14
- package/card/src/mp-card-group.element.d.ts +0 -9
- package/card/src/mp-card-header.element.d.ts +0 -24
- package/card/src/mp-card-img.element.d.ts +0 -28
- package/card/src/mp-card-link.element.d.ts +0 -24
- package/card/src/mp-card-subtitle.element.d.ts +0 -9
- package/card/src/mp-card-text.element.d.ts +0 -9
- package/card/src/mp-card-title.element.d.ts +0 -13
package/card/index.mjs
CHANGED
|
@@ -1,133 +1,173 @@
|
|
|
1
|
-
import { html as
|
|
2
|
-
|
|
3
|
-
This file exists so codegen-wc emits
|
|
4
|
-
.scss
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
--
|
|
16
|
-
--
|
|
17
|
-
--
|
|
18
|
-
--bs-card-cap-padding-x: 1rem;
|
|
19
|
-
--bs-card-cap-bg: rgba(var(--bs-body-color-rgb), 0.03);
|
|
20
|
-
--bs-card-cap-color: ;
|
|
21
|
-
--bs-card-height: ;
|
|
22
|
-
--bs-card-color: ;
|
|
23
|
-
--bs-card-bg: var(--bs-body-bg);
|
|
24
|
-
--bs-card-img-overlay-padding: 1rem;
|
|
25
|
-
--bs-card-group-margin: 0.75rem;
|
|
26
|
-
position: relative;
|
|
1
|
+
import { html as e, unsafeCSS as d, LitElement as l } from "lit";
|
|
2
|
+
e`<!-- mp-card renders its own shadow template (a default <slot>) in mp-card.element.ts.
|
|
3
|
+
This file exists only so codegen-wc emits the \`styles\` constant from the
|
|
4
|
+
sibling .scss for the element's \`static styles\`; the generated \`template\`
|
|
5
|
+
export is intentionally unused. -->`;
|
|
6
|
+
const n = d(`:host {
|
|
7
|
+
--mp-card-spacer-y: 1rem;
|
|
8
|
+
--mp-card-spacer-x: 1rem;
|
|
9
|
+
--mp-card-title-spacer-y: 0.5rem;
|
|
10
|
+
--mp-card-border-width: var(--bs-border-width, 1px);
|
|
11
|
+
--mp-card-border-color: var(--bs-border-color, #dee2e6);
|
|
12
|
+
--mp-card-border-radius: var(--bs-border-radius, 0.375rem);
|
|
13
|
+
--mp-card-cap-padding-y: 0.5rem;
|
|
14
|
+
--mp-card-cap-padding-x: 1rem;
|
|
15
|
+
--mp-card-cap-bg: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.03));
|
|
16
|
+
--mp-card-bg: var(--bs-body-bg, #fff);
|
|
17
|
+
--mp-card-color: var(--bs-body-color, #212529);
|
|
27
18
|
display: flex;
|
|
28
19
|
flex-direction: column;
|
|
20
|
+
position: relative;
|
|
29
21
|
min-width: 0;
|
|
30
|
-
height: var(--
|
|
31
|
-
color: var(--
|
|
22
|
+
height: var(--mp-card-height, auto);
|
|
23
|
+
color: var(--mp-card-color);
|
|
32
24
|
word-wrap: break-word;
|
|
33
|
-
background-color: var(--
|
|
25
|
+
background-color: var(--mp-card-bg);
|
|
34
26
|
background-clip: border-box;
|
|
35
|
-
border: var(--
|
|
36
|
-
border-radius: var(--
|
|
27
|
+
border: var(--mp-card-border-width) solid var(--mp-card-border-color);
|
|
28
|
+
border-radius: var(--mp-card-border-radius);
|
|
29
|
+
overflow: hidden;
|
|
37
30
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
|
|
32
|
+
:host([color=primary]) {
|
|
33
|
+
color: #fff;
|
|
34
|
+
background-color: #0d6efd;
|
|
35
|
+
border-color: #0d6efd;
|
|
41
36
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
|
|
38
|
+
:host([color=primary][outline]) {
|
|
39
|
+
color: inherit;
|
|
40
|
+
background-color: transparent;
|
|
41
|
+
border-color: #0d6efd;
|
|
45
42
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
|
|
44
|
+
:host([color=secondary]) {
|
|
45
|
+
color: #fff;
|
|
46
|
+
background-color: #6c757d;
|
|
47
|
+
border-color: #6c757d;
|
|
50
48
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
|
|
50
|
+
:host([color=secondary][outline]) {
|
|
51
|
+
color: inherit;
|
|
52
|
+
background-color: transparent;
|
|
53
|
+
border-color: #6c757d;
|
|
55
54
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
|
|
56
|
+
:host([color=success]) {
|
|
57
|
+
color: #fff;
|
|
58
|
+
background-color: #198754;
|
|
59
|
+
border-color: #198754;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
color:
|
|
62
|
+
:host([color=success][outline]) {
|
|
63
|
+
color: inherit;
|
|
64
|
+
background-color: transparent;
|
|
65
|
+
border-color: #198754;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
color:
|
|
68
|
+
:host([color=info]) {
|
|
69
|
+
color: #000;
|
|
70
|
+
background-color: #0dcaf0;
|
|
71
|
+
border-color: #0dcaf0;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
color:
|
|
74
|
+
:host([color=info][outline]) {
|
|
75
|
+
color: inherit;
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
border-color: #0dcaf0;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
:host([color=warning]) {
|
|
81
|
+
color: #000;
|
|
82
|
+
background-color: #ffc107;
|
|
83
|
+
border-color: #ffc107;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
:host([color=warning][outline]) {
|
|
87
|
+
color: inherit;
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
border-color: #ffc107;
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
color:
|
|
90
|
-
background-color: var(--bs-card-cap-bg);
|
|
91
|
-
border-bottom: var(--bs-card-border-width) solid var(--bs-card-border-color);
|
|
92
|
+
:host([color=danger]) {
|
|
93
|
+
color: #fff;
|
|
94
|
+
background-color: #dc3545;
|
|
95
|
+
border-color: #dc3545;
|
|
92
96
|
}
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
|
|
98
|
+
:host([color=danger][outline]) {
|
|
99
|
+
color: inherit;
|
|
100
|
+
background-color: transparent;
|
|
101
|
+
border-color: #dc3545;
|
|
95
102
|
}
|
|
96
103
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
color:
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
:host([color=light]) {
|
|
105
|
+
color: #000;
|
|
106
|
+
background-color: #f8f9fa;
|
|
107
|
+
border-color: #f8f9fa;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([color=light][outline]) {
|
|
111
|
+
color: inherit;
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
border-color: #f8f9fa;
|
|
102
114
|
}
|
|
103
|
-
|
|
104
|
-
|
|
115
|
+
|
|
116
|
+
:host([color=dark]) {
|
|
117
|
+
color: #fff;
|
|
118
|
+
background-color: #212529;
|
|
119
|
+
border-color: #212529;
|
|
105
120
|
}
|
|
106
121
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
border-bottom: 0;
|
|
122
|
+
:host([color=dark][outline]) {
|
|
123
|
+
color: inherit;
|
|
124
|
+
background-color: transparent;
|
|
125
|
+
border-color: #212529;
|
|
112
126
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
127
|
+
|
|
128
|
+
:host([color=body]) {
|
|
129
|
+
color: var(--bs-body-color);
|
|
130
|
+
background-color: var(--bs-body-bg, var(--bs-body-bg));
|
|
116
131
|
}
|
|
117
132
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
133
|
+
:host([color=white]) {
|
|
134
|
+
color: #000;
|
|
135
|
+
background-color: #fff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([color=transparent]) {
|
|
139
|
+
color: inherit;
|
|
140
|
+
background-color: transparent;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([color=body][outline]),
|
|
144
|
+
:host([color=white][outline]),
|
|
145
|
+
:host([color=transparent][outline]) {
|
|
146
|
+
background-color: transparent;
|
|
147
|
+
}`), s = d(`.card-body {
|
|
148
|
+
display: block;
|
|
149
|
+
flex: 1 1 auto;
|
|
150
|
+
padding: var(--mp-card-spacer-y, 1rem) var(--mp-card-spacer-x, 1rem);
|
|
151
|
+
color: var(--mp-card-color, inherit);
|
|
121
152
|
}
|
|
122
153
|
|
|
123
|
-
.card-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
154
|
+
.card-header {
|
|
155
|
+
display: block;
|
|
156
|
+
padding: var(--mp-card-cap-padding-y, 0.5rem) var(--mp-card-cap-padding-x, 1rem);
|
|
157
|
+
margin-bottom: 0;
|
|
158
|
+
background-color: var(--mp-card-cap-bg, rgba(0, 0, 0, 0.03));
|
|
159
|
+
border-bottom: var(--mp-card-border-width, 1px) solid var(--mp-card-border-color, #dee2e6);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.card-footer {
|
|
163
|
+
display: block;
|
|
164
|
+
padding: var(--mp-card-cap-padding-y, 0.5rem) var(--mp-card-cap-padding-x, 1rem);
|
|
165
|
+
background-color: var(--mp-card-cap-bg, rgba(0, 0, 0, 0.03));
|
|
166
|
+
border-top: var(--mp-card-border-width, 1px) solid var(--mp-card-border-color, #dee2e6);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.card-group {
|
|
170
|
+
display: block;
|
|
131
171
|
}
|
|
132
172
|
|
|
133
173
|
.card-img,
|
|
@@ -136,101 +176,79 @@ const p = m(`.card {
|
|
|
136
176
|
width: 100%;
|
|
137
177
|
}
|
|
138
178
|
|
|
139
|
-
.card-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
border-top-right-radius: var(--bs-card-inner-border-radius);
|
|
179
|
+
.card-title {
|
|
180
|
+
display: block;
|
|
181
|
+
margin-bottom: var(--mp-card-title-spacer-y, 0.5rem);
|
|
143
182
|
}
|
|
144
183
|
|
|
145
|
-
.card-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
184
|
+
.card-subtitle {
|
|
185
|
+
display: block;
|
|
186
|
+
margin-top: calc(-0.5 * var(--mp-card-title-spacer-y, 0.5rem));
|
|
187
|
+
margin-bottom: 0;
|
|
149
188
|
}
|
|
150
189
|
|
|
151
|
-
.card-
|
|
152
|
-
|
|
190
|
+
.card-text {
|
|
191
|
+
display: block;
|
|
153
192
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
flex-flow: row wrap;
|
|
158
|
-
}
|
|
159
|
-
.card-group > .card {
|
|
160
|
-
flex: 1 0 0;
|
|
161
|
-
margin-bottom: 0;
|
|
162
|
-
}
|
|
163
|
-
.card-group > .card + .card {
|
|
164
|
-
margin-left: 0;
|
|
165
|
-
border-left: 0;
|
|
166
|
-
}
|
|
167
|
-
.card-group > .card:not(:last-child) {
|
|
168
|
-
border-top-right-radius: 0;
|
|
169
|
-
border-bottom-right-radius: 0;
|
|
170
|
-
}
|
|
171
|
-
.card-group > .card:not(:last-child) > .card-img-top,
|
|
172
|
-
.card-group > .card:not(:last-child) > .card-header {
|
|
173
|
-
border-top-right-radius: 0;
|
|
174
|
-
}
|
|
175
|
-
.card-group > .card:not(:last-child) > .card-img-bottom,
|
|
176
|
-
.card-group > .card:not(:last-child) > .card-footer {
|
|
177
|
-
border-bottom-right-radius: 0;
|
|
178
|
-
}
|
|
179
|
-
.card-group > .card:not(:first-child) {
|
|
180
|
-
border-top-left-radius: 0;
|
|
181
|
-
border-bottom-left-radius: 0;
|
|
182
|
-
}
|
|
183
|
-
.card-group > .card:not(:first-child) > .card-img-top,
|
|
184
|
-
.card-group > .card:not(:first-child) > .card-header {
|
|
185
|
-
border-top-left-radius: 0;
|
|
186
|
-
}
|
|
187
|
-
.card-group > .card:not(:first-child) > .card-img-bottom,
|
|
188
|
-
.card-group > .card:not(:first-child) > .card-footer {
|
|
189
|
-
border-bottom-left-radius: 0;
|
|
190
|
-
}
|
|
193
|
+
|
|
194
|
+
.card-text:last-child {
|
|
195
|
+
margin-bottom: 0;
|
|
191
196
|
}
|
|
192
197
|
|
|
193
|
-
|
|
194
|
-
mp-card-
|
|
195
|
-
mp-card-body,
|
|
196
|
-
mp-card-footer,
|
|
197
|
-
mp-card-img,
|
|
198
|
-
mp-card-group,
|
|
199
|
-
bs-card,
|
|
200
|
-
bs-card-header,
|
|
201
|
-
bs-card-body,
|
|
202
|
-
bs-card-footer,
|
|
203
|
-
bs-card-img,
|
|
204
|
-
bs-card-group {
|
|
205
|
-
display: block;
|
|
198
|
+
.card-link + .card-link {
|
|
199
|
+
margin-left: var(--mp-card-spacer-x, 1rem);
|
|
206
200
|
}
|
|
207
201
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
bs-card-text {
|
|
214
|
-
display: block;
|
|
202
|
+
.card-header-tabs {
|
|
203
|
+
margin-right: calc(-0.5 * 1rem);
|
|
204
|
+
margin-bottom: calc(-1 * 0.5rem);
|
|
205
|
+
margin-left: calc(-0.5 * 1rem);
|
|
206
|
+
border-bottom: 0;
|
|
215
207
|
}
|
|
216
208
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
209
|
+
.card-header-pills {
|
|
210
|
+
margin-right: calc(-0.5 * 1rem);
|
|
211
|
+
margin-left: calc(-0.5 * 1rem);
|
|
220
212
|
}
|
|
221
213
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
214
|
+
.text-bg-primary {
|
|
215
|
+
color: #fff !important;
|
|
216
|
+
background-color: RGBA(#0d6efd, var(--bs-bg-opacity, 1)) !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.text-bg-secondary {
|
|
220
|
+
color: #fff !important;
|
|
221
|
+
background-color: RGBA(#6c757d, var(--bs-bg-opacity, 1)) !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.text-bg-success {
|
|
225
|
+
color: #fff !important;
|
|
226
|
+
background-color: RGBA(#198754, var(--bs-bg-opacity, 1)) !important;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.text-bg-info {
|
|
230
|
+
color: #000 !important;
|
|
231
|
+
background-color: RGBA(#0dcaf0, var(--bs-bg-opacity, 1)) !important;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.text-bg-warning {
|
|
235
|
+
color: #000 !important;
|
|
236
|
+
background-color: RGBA(#ffc107, var(--bs-bg-opacity, 1)) !important;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.text-bg-danger {
|
|
240
|
+
color: #fff !important;
|
|
241
|
+
background-color: RGBA(#dc3545, var(--bs-bg-opacity, 1)) !important;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.text-bg-light {
|
|
245
|
+
color: #000 !important;
|
|
246
|
+
background-color: RGBA(#f8f9fa, var(--bs-bg-opacity, 1)) !important;
|
|
229
247
|
}
|
|
230
248
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
249
|
+
.text-bg-dark {
|
|
250
|
+
color: #fff !important;
|
|
251
|
+
background-color: RGBA(#212529, var(--bs-bg-opacity, 1)) !important;
|
|
234
252
|
}
|
|
235
253
|
|
|
236
254
|
.text-bg-body {
|
|
@@ -246,7 +264,37 @@ bs-card-link + bs-card-link > .card-link {
|
|
|
246
264
|
.text-bg-transparent {
|
|
247
265
|
color: inherit;
|
|
248
266
|
background-color: transparent;
|
|
249
|
-
}`)
|
|
267
|
+
}`);
|
|
268
|
+
class i extends l {
|
|
269
|
+
constructor() {
|
|
270
|
+
super(...arguments), this.color = null, this.outline = !1, this.isServerSide = !1;
|
|
271
|
+
}
|
|
272
|
+
static {
|
|
273
|
+
this.styles = [n];
|
|
274
|
+
}
|
|
275
|
+
static get properties() {
|
|
276
|
+
return {
|
|
277
|
+
color: { type: String, reflect: !0 },
|
|
278
|
+
outline: { type: Boolean, reflect: !0 },
|
|
279
|
+
isServerSide: { type: Boolean, attribute: "is-server-side" }
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
connectedCallback() {
|
|
283
|
+
super.connectedCallback(), b();
|
|
284
|
+
}
|
|
285
|
+
render() {
|
|
286
|
+
return e`<slot></slot>`;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
let c = !1;
|
|
290
|
+
function b() {
|
|
291
|
+
if (c || typeof document > "u") return;
|
|
292
|
+
c = !0;
|
|
293
|
+
const r = document.createElement("style");
|
|
294
|
+
r.setAttribute("data-mp-card", ""), r.textContent = String(s), document.head.appendChild(r);
|
|
295
|
+
}
|
|
296
|
+
typeof customElements < "u" && !customElements.get("mp-card") && customElements.define("mp-card", i);
|
|
297
|
+
const p = [
|
|
250
298
|
"primary",
|
|
251
299
|
"secondary",
|
|
252
300
|
"success",
|
|
@@ -259,196 +307,31 @@ bs-card-link + bs-card-link > .card-link {
|
|
|
259
307
|
"white",
|
|
260
308
|
"transparent"
|
|
261
309
|
];
|
|
262
|
-
function
|
|
263
|
-
return
|
|
264
|
-
}
|
|
265
|
-
function s(t, r) {
|
|
266
|
-
const e = Array.from(t.classList);
|
|
267
|
-
for (const a of e)
|
|
268
|
-
a.startsWith(r) && t.classList.remove(a);
|
|
269
|
-
}
|
|
270
|
-
function g(t, r, e) {
|
|
271
|
-
s(t, "text-bg-"), s(t, "border-"), t.classList.remove("border", "bg-transparent"), l(r) && (e ? t.classList.add("border", `border-${r}`, "bg-transparent") : t.classList.add(`text-bg-${r}`));
|
|
310
|
+
function m(r) {
|
|
311
|
+
return r != null && p.includes(r);
|
|
272
312
|
}
|
|
273
|
-
function
|
|
274
|
-
|
|
313
|
+
function g(r, o) {
|
|
314
|
+
const a = Array.from(r.classList);
|
|
315
|
+
for (const t of a)
|
|
316
|
+
t.startsWith(o) && r.classList.remove(t);
|
|
275
317
|
}
|
|
276
|
-
function
|
|
277
|
-
|
|
278
|
-
e && (e.classList.remove("card-header-tabs", "card-header-pills"), r === "tabs" ? e.classList.add("card-header-tabs") : r === "pills" && e.classList.add("card-header-pills"));
|
|
318
|
+
function u(r, o) {
|
|
319
|
+
g(r, "text-bg-"), m(o) && r.classList.add(`text-bg-${o}`);
|
|
279
320
|
}
|
|
280
|
-
function
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
class v extends HTMLElement {
|
|
284
|
-
static get observedAttributes() {
|
|
285
|
-
return ["color", "outline"];
|
|
286
|
-
}
|
|
287
|
-
connectedCallback() {
|
|
288
|
-
y(), this.classList.add("card"), this.applyColor();
|
|
289
|
-
}
|
|
290
|
-
attributeChangedCallback(r, e, a) {
|
|
291
|
-
(r === "color" || r === "outline") && this.applyColor();
|
|
292
|
-
}
|
|
293
|
-
applyColor() {
|
|
294
|
-
const r = this.getAttribute("color"), e = this.hasAttribute("outline") && this.getAttribute("outline") !== "false";
|
|
295
|
-
g(this, r, e);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
let i = !1;
|
|
299
|
-
function y() {
|
|
300
|
-
if (i || typeof document > "u") return;
|
|
301
|
-
i = !0;
|
|
302
|
-
const t = document.createElement("style");
|
|
303
|
-
t.setAttribute("data-mp-card", ""), t.textContent = String(p), document.head.appendChild(t);
|
|
304
|
-
}
|
|
305
|
-
typeof customElements < "u" && !customElements.get("mp-card") && customElements.define("mp-card", v);
|
|
306
|
-
class C extends HTMLElement {
|
|
307
|
-
connectedCallback() {
|
|
308
|
-
this.classList.add("card-body");
|
|
309
|
-
}
|
|
321
|
+
function h(r, o) {
|
|
322
|
+
const a = r.querySelector("nav, ul, .nav");
|
|
323
|
+
a && (a.classList.remove("card-header-tabs", "card-header-pills"), o === "tabs" ? a.classList.add("card-header-tabs") : o === "pills" && a.classList.add("card-header-pills"));
|
|
310
324
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
static get observedAttributes() {
|
|
314
|
-
return ["color"];
|
|
315
|
-
}
|
|
316
|
-
connectedCallback() {
|
|
317
|
-
this.classList.add("card-footer"), o(this, this.getAttribute("color"));
|
|
318
|
-
}
|
|
319
|
-
attributeChangedCallback(r, e, a) {
|
|
320
|
-
r === "color" && o(this, this.getAttribute("color"));
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
typeof customElements < "u" && !customElements.get("mp-card-footer") && customElements.define("mp-card-footer", E);
|
|
324
|
-
class x extends HTMLElement {
|
|
325
|
-
connectedCallback() {
|
|
326
|
-
this.classList.add("card-group");
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
typeof customElements < "u" && !customElements.get("mp-card-group") && customElements.define("mp-card-group", x);
|
|
330
|
-
class k extends HTMLElement {
|
|
331
|
-
constructor() {
|
|
332
|
-
super(...arguments), this.mutationObserver = null;
|
|
333
|
-
}
|
|
334
|
-
static get observedAttributes() {
|
|
335
|
-
return ["color", "nav-style"];
|
|
336
|
-
}
|
|
337
|
-
connectedCallback() {
|
|
338
|
-
this.classList.add("card-header"), this.applyColor(), this.applyNavStyle(), this.mutationObserver = new MutationObserver((r) => {
|
|
339
|
-
r.some(
|
|
340
|
-
(a) => [...Array.from(a.addedNodes), ...Array.from(a.removedNodes)].some(f)
|
|
341
|
-
) && this.applyNavStyle();
|
|
342
|
-
}), this.mutationObserver.observe(this, { childList: !0, subtree: !1 });
|
|
343
|
-
}
|
|
344
|
-
disconnectedCallback() {
|
|
345
|
-
this.mutationObserver?.disconnect(), this.mutationObserver = null;
|
|
346
|
-
}
|
|
347
|
-
attributeChangedCallback(r, e, a) {
|
|
348
|
-
r === "color" && this.applyColor(), r === "nav-style" && this.applyNavStyle();
|
|
349
|
-
}
|
|
350
|
-
applyColor() {
|
|
351
|
-
o(this, this.getAttribute("color"));
|
|
352
|
-
}
|
|
353
|
-
applyNavStyle() {
|
|
354
|
-
const r = this.getAttribute("nav-style");
|
|
355
|
-
h(this, r === "tabs" || r === "pills" ? r : null);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
typeof customElements < "u" && !customElements.get("mp-card-header") && customElements.define("mp-card-header", k);
|
|
359
|
-
class L extends HTMLElement {
|
|
360
|
-
constructor() {
|
|
361
|
-
super(...arguments), this.imgEl = null;
|
|
362
|
-
}
|
|
363
|
-
static get observedAttributes() {
|
|
364
|
-
return ["src", "alt", "position"];
|
|
365
|
-
}
|
|
366
|
-
connectedCallback() {
|
|
367
|
-
if (this.imgEl) return;
|
|
368
|
-
const r = this.getAttribute("position") ?? "top", e = r === "top" ? "card-img-top" : r === "bottom" ? "card-img-bottom" : "card-img";
|
|
369
|
-
this.classList.add(e);
|
|
370
|
-
const a = document.createElement("img");
|
|
371
|
-
if (a.className = e, this.applyImgAttrs(a), this.imgEl = a, r === "overlay") {
|
|
372
|
-
const c = [];
|
|
373
|
-
for (; this.firstChild; ) c.push(this.removeChild(this.firstChild));
|
|
374
|
-
const d = document.createElement("div");
|
|
375
|
-
d.className = "card-img-overlay";
|
|
376
|
-
for (const n of c) d.appendChild(n);
|
|
377
|
-
this.appendChild(a), this.appendChild(d);
|
|
378
|
-
} else r === "bottom" ? this.appendChild(a) : this.insertBefore(a, this.firstChild);
|
|
379
|
-
}
|
|
380
|
-
attributeChangedCallback(r, e, a) {
|
|
381
|
-
this.imgEl && ((r === "src" || r === "alt") && this.applyImgAttrs(this.imgEl), r === "position" && console.warn(
|
|
382
|
-
"[mp-card-img] `position` is set at connect time and cannot be changed afterwards. Recreate the element to switch positions."
|
|
383
|
-
));
|
|
384
|
-
}
|
|
385
|
-
applyImgAttrs(r) {
|
|
386
|
-
const e = this.getAttribute("src");
|
|
387
|
-
e === null ? r.removeAttribute("src") : r.setAttribute("src", e);
|
|
388
|
-
const a = this.getAttribute("alt");
|
|
389
|
-
a === null ? r.removeAttribute("alt") : r.setAttribute("alt", a);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
typeof customElements < "u" && !customElements.get("mp-card-img") && customElements.define("mp-card-img", L);
|
|
393
|
-
class A extends HTMLElement {
|
|
394
|
-
constructor() {
|
|
395
|
-
super(...arguments), this.anchor = null;
|
|
396
|
-
}
|
|
397
|
-
static get observedAttributes() {
|
|
398
|
-
return ["href"];
|
|
399
|
-
}
|
|
400
|
-
connectedCallback() {
|
|
401
|
-
if (this.anchor) return;
|
|
402
|
-
const r = document.createElement("a");
|
|
403
|
-
for (r.className = "card-link"; this.firstChild; )
|
|
404
|
-
r.appendChild(this.firstChild);
|
|
405
|
-
this.appendChild(r), this.anchor = r, this.applyHref();
|
|
406
|
-
}
|
|
407
|
-
attributeChangedCallback(r, e, a) {
|
|
408
|
-
r === "href" && this.applyHref();
|
|
409
|
-
}
|
|
410
|
-
applyHref() {
|
|
411
|
-
if (!this.anchor) return;
|
|
412
|
-
const r = this.getAttribute("href");
|
|
413
|
-
r === null ? this.anchor.removeAttribute("href") : this.anchor.setAttribute("href", r);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
typeof customElements < "u" && !customElements.get("mp-card-link") && customElements.define("mp-card-link", A);
|
|
417
|
-
class w extends HTMLElement {
|
|
418
|
-
connectedCallback() {
|
|
419
|
-
this.classList.add("card-subtitle");
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
typeof customElements < "u" && !customElements.get("mp-card-subtitle") && customElements.define("mp-card-subtitle", w);
|
|
423
|
-
class M extends HTMLElement {
|
|
424
|
-
connectedCallback() {
|
|
425
|
-
this.classList.add("card-text");
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
typeof customElements < "u" && !customElements.get("mp-card-text") && customElements.define("mp-card-text", M);
|
|
429
|
-
class N extends HTMLElement {
|
|
430
|
-
connectedCallback() {
|
|
431
|
-
this.classList.add("card-title");
|
|
432
|
-
}
|
|
325
|
+
function y(r) {
|
|
326
|
+
return r instanceof Element ? r.tagName === "NAV" || r.tagName === "UL" || r.classList.contains("nav") : !1;
|
|
433
327
|
}
|
|
434
|
-
typeof customElements < "u" && !customElements.get("mp-card-title") && customElements.define("mp-card-title", N);
|
|
435
328
|
export {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
v as MpCardElement,
|
|
439
|
-
E as MpCardFooterElement,
|
|
440
|
-
x as MpCardGroupElement,
|
|
441
|
-
k as MpCardHeaderElement,
|
|
442
|
-
L as MpCardImgElement,
|
|
443
|
-
A as MpCardLinkElement,
|
|
444
|
-
w as MpCardSubtitleElement,
|
|
445
|
-
M as MpCardTextElement,
|
|
446
|
-
N as MpCardTitleElement,
|
|
447
|
-
g as applyCardColorClasses,
|
|
329
|
+
p as COLOR_NAMES,
|
|
330
|
+
i as MpCardElement,
|
|
448
331
|
h as applyHeaderNavStyle,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
332
|
+
u as applyTextBgClass,
|
|
333
|
+
g as clearPrefixedClasses,
|
|
334
|
+
b as ensureCardStylesInjected,
|
|
335
|
+
m as isCardColorName,
|
|
336
|
+
y as isNavTargetNode
|
|
454
337
|
};
|