@pushengineering/umg-web-components 2.0.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/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js +56 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js +13 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js +37 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js +19 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/query.js +34 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist/node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js +260 -0
- package/dist/node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js +50 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js +37 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/if-defined.js +10 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/map.js +15 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/range.js +14 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/style-map.js +39 -0
- package/dist/node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js +259 -0
- package/dist/packages/web-components/classes/event-manager/event-manager.js +50 -0
- package/dist/packages/web-components/classes/index.js +4 -0
- package/dist/packages/web-components/components/badge/badge.js +146 -0
- package/dist/packages/web-components/components/banner/banner.js +389 -0
- package/dist/packages/web-components/components/banner-image/banner-image.js +161 -0
- package/dist/packages/web-components/components/box/box.js +208 -0
- package/dist/packages/web-components/components/button/button.js +336 -0
- package/dist/packages/web-components/components/button-group/button-group.js +98 -0
- package/dist/packages/web-components/components/button-icon/button-icon.js +246 -0
- package/dist/packages/web-components/components/caption-card/caption-card.js +331 -0
- package/dist/packages/web-components/components/deferred-media/deferred-media.js +212 -0
- package/dist/packages/web-components/components/disclosure/disclosure.js +255 -0
- package/dist/packages/web-components/components/event-table/event-content.js +106 -0
- package/dist/packages/web-components/components/event-table/event-date.js +45 -0
- package/dist/packages/web-components/components/event-table/event-table.js +74 -0
- package/dist/packages/web-components/components/event-table/event.js +45 -0
- package/dist/packages/web-components/components/footer/footer.js +153 -0
- package/dist/packages/web-components/components/grid/grid-cell.js +40 -0
- package/dist/packages/web-components/components/grid/grid.js +106 -0
- package/dist/packages/web-components/components/header/header.js +368 -0
- package/dist/packages/web-components/components/header-drawer/header-drawer.js +292 -0
- package/dist/packages/web-components/components/header-drawer/menu-drawer.js +176 -0
- package/dist/packages/web-components/components/horizontal-stack/horizontal-stack.js +93 -0
- package/dist/packages/web-components/components/icon/icon.js +81 -0
- package/dist/packages/web-components/components/icon/icons.svg.js +191 -0
- package/dist/packages/web-components/components/image/image.js +157 -0
- package/dist/packages/web-components/components/index.js +82 -0
- package/dist/packages/web-components/components/link/link.js +95 -0
- package/dist/packages/web-components/components/link-group/link-group.js +126 -0
- package/dist/packages/web-components/components/logo/logo.js +161 -0
- package/dist/packages/web-components/components/media-gallery/media-gallery.js +82 -0
- package/dist/packages/web-components/components/media-gallery/media.js +31 -0
- package/dist/packages/web-components/components/media-text/media-text.js +276 -0
- package/dist/packages/web-components/components/media-text/styles/media-size.js +119 -0
- package/dist/packages/web-components/components/menu/menu.js +328 -0
- package/dist/packages/web-components/components/modal/modal.js +143 -0
- package/dist/packages/web-components/components/number-field/number-field.js +339 -0
- package/dist/packages/web-components/components/overlay/overlay.js +77 -0
- package/dist/packages/web-components/components/page/page.js +105 -0
- package/dist/packages/web-components/components/popover/popover.js +163 -0
- package/dist/packages/web-components/components/rich-text/rich-text.js +126 -0
- package/dist/packages/web-components/components/section/section.js +400 -0
- package/dist/packages/web-components/components/select/select.js +359 -0
- package/dist/packages/web-components/components/slider/slide.js +68 -0
- package/dist/packages/web-components/components/slider/slider-controls.js +258 -0
- package/dist/packages/web-components/components/slider/slider.js +374 -0
- package/dist/packages/web-components/components/slider/styles/controls.js +98 -0
- package/dist/packages/web-components/components/slider/styles/slider.js +233 -0
- package/dist/packages/web-components/components/socials/socials.js +96 -0
- package/dist/packages/web-components/components/table/table.js +158 -0
- package/dist/packages/web-components/components/text/text.js +245 -0
- package/dist/packages/web-components/components/text-field/text-field.js +257 -0
- package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slide.js +51 -0
- package/dist/packages/web-components/components/thumbnail-slider/thumbnail-slider.js +88 -0
- package/dist/packages/web-components/components/vertical-stack/vertical-stack.js +95 -0
- package/dist/packages/web-components/components/video/video.js +185 -0
- package/dist/packages/web-components/scripts/mergeStyles.js +8 -0
- package/dist/packages/web-components/scripts/polyfills/scrollyfills.js +43 -0
- package/dist/packages/web-components/scripts/settings.js +7 -0
- package/dist/packages/web-components/scripts/themeStyleSheet.js +9 -0
- package/dist/packages/web-components/scripts/utilities/debounce.js +9 -0
- package/dist/packages/web-components/scripts/utilities/paddingTransformations.js +46 -0
- package/dist/packages/web-components/styles/button.js +55 -0
- package/dist/packages/web-components/styles/fonts.js +181 -0
- package/dist/packages/web-components/styles/global.js +40 -0
- package/dist/packages/web-components/styles/grid.js +114 -0
- package/dist/packages/web-components/styles/group.js +121 -0
- package/dist/packages/web-components/styles/icon-size.js +19 -0
- package/dist/packages/web-components/styles/link.js +30 -0
- package/dist/packages/web-components/styles/placeholder-media.js +27 -0
- package/package.json +92 -0
- package/readme.md +266 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as a } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as m } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { classMap as n } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
5
|
+
import { customElement as x } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
6
|
+
import { property as i } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
7
|
+
import { global as c } from "../../styles/global.js";
|
|
8
|
+
import { fontSizes as d, fontWeights as f, fontStyle as u, fontMargins as y } from "../../styles/fonts.js";
|
|
9
|
+
import { settings as b } from "../../scripts/settings.js";
|
|
10
|
+
import { mergeStyles as w } from "../../scripts/mergeStyles.js";
|
|
11
|
+
import { css as v } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
12
|
+
var S = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, r = (t, s, h, l) => {
|
|
13
|
+
for (var o = l > 1 ? void 0 : l ? $(s, h) : s, p = t.length - 1, g; p >= 0; p--)
|
|
14
|
+
(g = t[p]) && (o = (l ? g(s, h, o) : g(o)) || o);
|
|
15
|
+
return l && o && S(s, h, o), o;
|
|
16
|
+
};
|
|
17
|
+
const { prefix: k } = b;
|
|
18
|
+
let e = class extends m {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.as = "p", this.variant = "bodyMd", this.color = "default", this.fontWeight = "regular", this.fontStyle = "normal", this.withoutMargin = !1, this.transform = "none", this.truncate = !1, this.breakWord = !1, this.hidden = !1;
|
|
21
|
+
}
|
|
22
|
+
textClasses() {
|
|
23
|
+
const t = {
|
|
24
|
+
text: !0,
|
|
25
|
+
"txt--truncate": this.truncate,
|
|
26
|
+
"txt--breakword": this.breakWord,
|
|
27
|
+
"txt--hidden": this.hidden
|
|
28
|
+
};
|
|
29
|
+
return this.color && (t["txt--color-" + this.color] = !0), this.variant && (t["txt--" + this.variant] = !0), this.lineHeight && (t["txt--line-height-" + this.lineHeight] = !0), this.spacing && (t["txt--spacing-" + this.spacing] = !0), this.fontWeight && (t["txt--" + this.fontWeight] = !0), this.fontStyle && (t["txt--" + this.fontStyle] = !0), this.alignment && (t["txt--align-" + this.alignment] = this.alignment), this.mobileAlignment ? t["txt--mobile-align-" + this.mobileAlignment] = !0 : t["txt--mobile-align-" + this.alignment] = this.alignment, this.withoutMargin && this.as !== "span" && (t["text--without-margin"] = !0), this.transform !== "none" && (t["txt-transform--" + this.transform] = !0), t;
|
|
30
|
+
}
|
|
31
|
+
textAs(t) {
|
|
32
|
+
switch (this.as) {
|
|
33
|
+
case "p":
|
|
34
|
+
return a`<p part="p-text paragraph" class="paragraph${n(t)}"><slot></slot></p>`;
|
|
35
|
+
case "h1":
|
|
36
|
+
return a`<h1 part="h1-text heading" class="heading${n(t)}"><slot></slot></h1>`;
|
|
37
|
+
case "h2":
|
|
38
|
+
return a`<h2 part="h2-text heading" class="heading${n(t)}"><slot></slot></h2>`;
|
|
39
|
+
case "h3":
|
|
40
|
+
return a`<h3 part="h3-text heading" class="heading${n(t)}"><slot></slot></h3>`;
|
|
41
|
+
case "h4":
|
|
42
|
+
return a`<h4 part="h4-text heading" class="heading${n(t)}"><slot></slot></h4>`;
|
|
43
|
+
case "h5":
|
|
44
|
+
return a`<h5 part="h5-text heading" class="heading${n(t)}"><slot></slot></h5>`;
|
|
45
|
+
case "skeleton":
|
|
46
|
+
return a`<div class="skeleton${n(t)}"><slot></slot></div>`;
|
|
47
|
+
default:
|
|
48
|
+
return a`
|
|
49
|
+
<span part="span-text span" class="span${n(t)}"><slot></slot></span>`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
return a`${this.textAs(this.textClasses())}`;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
e.styles = w([
|
|
57
|
+
c,
|
|
58
|
+
d,
|
|
59
|
+
f,
|
|
60
|
+
u,
|
|
61
|
+
y,
|
|
62
|
+
v`
|
|
63
|
+
.skeleton {
|
|
64
|
+
display: flex;
|
|
65
|
+
background-color: rgb(var(--um-color-skeleton-bg, 1));
|
|
66
|
+
height: 0.5rem;
|
|
67
|
+
border-radius: 0.5rem;
|
|
68
|
+
min-width: 5rem;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
span.span.text {
|
|
72
|
+
margin-bottom: 0;
|
|
73
|
+
}
|
|
74
|
+
.heading,
|
|
75
|
+
.paragraph {
|
|
76
|
+
margin-top: 0;
|
|
77
|
+
text-align: inherit;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.heading.text--without-margin,
|
|
81
|
+
.paragraph.text--without-margin,
|
|
82
|
+
.skeleton.text--without-margin {
|
|
83
|
+
margin-bottom: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Color */
|
|
87
|
+
.txt--color-default {
|
|
88
|
+
color: inherit
|
|
89
|
+
}
|
|
90
|
+
.txt--color-subdued {
|
|
91
|
+
color: rgba(var(--um-color-base-text-subdued), 1)
|
|
92
|
+
}
|
|
93
|
+
.txt--color-warning {
|
|
94
|
+
color: rgba(var(--um-color-base-text-warning), 1)
|
|
95
|
+
}
|
|
96
|
+
.txt--color-inverse {
|
|
97
|
+
color: rgba(var(--um-color-base-text-inverse), 1);
|
|
98
|
+
}
|
|
99
|
+
.txt-transform--uppercase {
|
|
100
|
+
text-transform: uppercase;
|
|
101
|
+
}
|
|
102
|
+
.txt-transform--capitalize {
|
|
103
|
+
text-transform: capitalize
|
|
104
|
+
}
|
|
105
|
+
.txt-transform--lowercase {
|
|
106
|
+
text-transform: lowercase;
|
|
107
|
+
}
|
|
108
|
+
.txt--truncate {
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
text-overflow: ellipsis;
|
|
112
|
+
}
|
|
113
|
+
.txt--breakword {
|
|
114
|
+
overflow-wrap: anywhere;
|
|
115
|
+
word-break: normal;
|
|
116
|
+
}
|
|
117
|
+
.txt--hidden {
|
|
118
|
+
position: absolute !important;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
width: 1px;
|
|
121
|
+
height: 1px;
|
|
122
|
+
margin: -1px;
|
|
123
|
+
padding: 0;
|
|
124
|
+
border: 0;
|
|
125
|
+
clip: rect(0 0 0 0);
|
|
126
|
+
word-wrap: normal !important;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Text line-height */
|
|
130
|
+
.txt--line-height-extra-loose.heading,
|
|
131
|
+
.txt--line-height-extra-loose.paragraph {
|
|
132
|
+
line-height: calc(1 + 1 / max(1, var(--um-font-size-body-scale, 1)));
|
|
133
|
+
}
|
|
134
|
+
.txt--line-height-loose.heading,
|
|
135
|
+
.txt--line-height-loose.paragraph {
|
|
136
|
+
line-height: calc(1 + 0.8 / max(1, var(--um-font-size-body-scale, 1)));
|
|
137
|
+
}
|
|
138
|
+
.txt--line-height-normal.heading,
|
|
139
|
+
.txt--line-height-normal.paragraph {
|
|
140
|
+
line-height: calc(1 + 0.5 / max(1, var(--um-font-size-body-scale, 1)));
|
|
141
|
+
}
|
|
142
|
+
.txt--line-height-compact.heading,
|
|
143
|
+
.txt--line-height-compact.paragraph {
|
|
144
|
+
line-height: calc(1 + 0.3 / max(1, var(--um-font-size-body-scale, 1)));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Text kerning */
|
|
148
|
+
.txt--spacing-extra-loose.heading,
|
|
149
|
+
.txt--spacing-extra-loose.paragraph,
|
|
150
|
+
.txt--spacing-extra-loose.span {
|
|
151
|
+
letter-spacing: 0.1rem;
|
|
152
|
+
}
|
|
153
|
+
.txt--spacing-loose.heading,
|
|
154
|
+
.txt--spacing-loose.paragraph,
|
|
155
|
+
.txt--spacing-loose.span {
|
|
156
|
+
letter-spacing: 0.05rem;
|
|
157
|
+
}
|
|
158
|
+
.txt--spacing-normal.heading,
|
|
159
|
+
.txt--spacing-normal.paragraph,
|
|
160
|
+
.txt--spacing-normal.span {
|
|
161
|
+
letter-spacing: inherit;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Text justification */
|
|
165
|
+
@media screen and (max-width: 48rem) {
|
|
166
|
+
.txt--mobile-align-start {
|
|
167
|
+
text-align: left;
|
|
168
|
+
}
|
|
169
|
+
.txt--mobile-align-center {
|
|
170
|
+
text-align: center;
|
|
171
|
+
}
|
|
172
|
+
.txt--mobile-align-end {
|
|
173
|
+
text-align: right;
|
|
174
|
+
}
|
|
175
|
+
.txt--mobile-align-justify {
|
|
176
|
+
text-align: justify;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
@media screen and (min-width: 48.06rem) {
|
|
180
|
+
.txt--margin {
|
|
181
|
+
margin-bottom: var(--um-space-16, 1rem);
|
|
182
|
+
}
|
|
183
|
+
.txt--align-start {
|
|
184
|
+
text-align: left;
|
|
185
|
+
}
|
|
186
|
+
.txt--align-center {
|
|
187
|
+
text-align: center;
|
|
188
|
+
}
|
|
189
|
+
.txt--align-end {
|
|
190
|
+
text-align: right;
|
|
191
|
+
}
|
|
192
|
+
.txt--align-justify {
|
|
193
|
+
text-align: justify;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
`
|
|
197
|
+
]);
|
|
198
|
+
r([
|
|
199
|
+
i({ type: String })
|
|
200
|
+
], e.prototype, "as", 2);
|
|
201
|
+
r([
|
|
202
|
+
i({ type: String })
|
|
203
|
+
], e.prototype, "variant", 2);
|
|
204
|
+
r([
|
|
205
|
+
i({ type: String })
|
|
206
|
+
], e.prototype, "color", 2);
|
|
207
|
+
r([
|
|
208
|
+
i({ type: String })
|
|
209
|
+
], e.prototype, "fontWeight", 2);
|
|
210
|
+
r([
|
|
211
|
+
i({ type: String })
|
|
212
|
+
], e.prototype, "fontStyle", 2);
|
|
213
|
+
r([
|
|
214
|
+
i({ type: String })
|
|
215
|
+
], e.prototype, "lineHeight", 2);
|
|
216
|
+
r([
|
|
217
|
+
i({ type: String })
|
|
218
|
+
], e.prototype, "spacing", 2);
|
|
219
|
+
r([
|
|
220
|
+
i({ type: String })
|
|
221
|
+
], e.prototype, "alignment", 2);
|
|
222
|
+
r([
|
|
223
|
+
i({ type: String })
|
|
224
|
+
], e.prototype, "mobileAlignment", 2);
|
|
225
|
+
r([
|
|
226
|
+
i({ type: Boolean })
|
|
227
|
+
], e.prototype, "withoutMargin", 2);
|
|
228
|
+
r([
|
|
229
|
+
i()
|
|
230
|
+
], e.prototype, "transform", 2);
|
|
231
|
+
r([
|
|
232
|
+
i({ type: Boolean })
|
|
233
|
+
], e.prototype, "truncate", 2);
|
|
234
|
+
r([
|
|
235
|
+
i({ type: Boolean })
|
|
236
|
+
], e.prototype, "breakWord", 2);
|
|
237
|
+
r([
|
|
238
|
+
i({ type: Boolean })
|
|
239
|
+
], e.prototype, "hidden", 2);
|
|
240
|
+
e = r([
|
|
241
|
+
x(`${k}-text`)
|
|
242
|
+
], e);
|
|
243
|
+
export {
|
|
244
|
+
e as Text
|
|
245
|
+
};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import { html as s } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import { LitElement as c } from "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { customElement as h } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
5
|
+
import { property as t } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
6
|
+
import { classMap as a } from "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/directives/class-map.js";
|
|
7
|
+
import { global as m } from "../../styles/global.js";
|
|
8
|
+
import { settings as f } from "../../scripts/settings.js";
|
|
9
|
+
import { mergeStyles as b } from "../../scripts/mergeStyles.js";
|
|
10
|
+
import { css as _ } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
11
|
+
var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, i = (e, o, n, d) => {
|
|
12
|
+
for (var l = d > 1 ? void 0 : d ? y(o, n) : o, p = e.length - 1, u; p >= 0; p--)
|
|
13
|
+
(u = e[p]) && (l = (d ? u(o, n, l) : u(l)) || l);
|
|
14
|
+
return d && l && v(o, n, l), l;
|
|
15
|
+
};
|
|
16
|
+
const { prefix: x } = f;
|
|
17
|
+
let r = class extends c {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.type = "text", this.hideLabel = !1, this.multiline = !1, this.placeholder = "", this.disabled = !1, this.required = !1, this.id = "", this.error = !1, this.name = "", this.value = "";
|
|
20
|
+
}
|
|
21
|
+
fieldClasses() {
|
|
22
|
+
const e = {
|
|
23
|
+
"field__inner--required": this.required
|
|
24
|
+
};
|
|
25
|
+
return (this.type === "checkbox" || this.type === "radio") && (e["field__inner--inline"] = !0), e;
|
|
26
|
+
}
|
|
27
|
+
inputClasses() {
|
|
28
|
+
return {
|
|
29
|
+
field__input: !0,
|
|
30
|
+
"field__input--multiline": this.multiline,
|
|
31
|
+
"field__input--error": this.error
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
labelClasses() {
|
|
35
|
+
return {
|
|
36
|
+
field__label: !0,
|
|
37
|
+
"field__label--disabled": this.disabled,
|
|
38
|
+
"visually-hidden": this.hideLabel
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
renderLabel(e) {
|
|
42
|
+
return s`
|
|
43
|
+
<label class="${a(e)}" for="${this.id}">
|
|
44
|
+
<slot name="label"></slot>
|
|
45
|
+
</label>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
renderInput(e) {
|
|
49
|
+
return s`
|
|
50
|
+
<div class="input">
|
|
51
|
+
<input
|
|
52
|
+
part="text-field"
|
|
53
|
+
class="${a(e)}"
|
|
54
|
+
id="${this.id}"
|
|
55
|
+
type="${this.type}"
|
|
56
|
+
?disabled="${this.disabled}"
|
|
57
|
+
?required="${this.required}"
|
|
58
|
+
placeholder="${this.placeholder}"
|
|
59
|
+
name="${this.name}"
|
|
60
|
+
value="${this.value}"
|
|
61
|
+
>
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
renderTextarea(e) {
|
|
66
|
+
return s`
|
|
67
|
+
<div class="input">
|
|
68
|
+
<textarea
|
|
69
|
+
part="text-filed"
|
|
70
|
+
class="${a(e)}"
|
|
71
|
+
id="${this.id}"
|
|
72
|
+
?disabled="${this.disabled}"
|
|
73
|
+
?required="${this.required}"
|
|
74
|
+
placeholder="${this.placeholder}"
|
|
75
|
+
value="${this.value}"
|
|
76
|
+
>
|
|
77
|
+
</textarea>
|
|
78
|
+
</div>
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
renderErrorMessage() {
|
|
82
|
+
if (this.error)
|
|
83
|
+
return s`
|
|
84
|
+
<span class="field__error-text">
|
|
85
|
+
<slot name="error-message"></slot>
|
|
86
|
+
</span>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
inputAs(e) {
|
|
90
|
+
switch (this.type) {
|
|
91
|
+
case "checkbox":
|
|
92
|
+
case "radio":
|
|
93
|
+
return s`
|
|
94
|
+
<div class="field__inner${a(e)}">
|
|
95
|
+
${this.renderInput(this.inputClasses())}
|
|
96
|
+
${this.renderLabel(this.labelClasses())}
|
|
97
|
+
</div>
|
|
98
|
+
`;
|
|
99
|
+
default:
|
|
100
|
+
return s`
|
|
101
|
+
<div class="field__inner${a(e)}">
|
|
102
|
+
${this.renderLabel(this.labelClasses())}
|
|
103
|
+
${this.renderInput(this.inputClasses())}
|
|
104
|
+
</div>
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
checkIfMultiline() {
|
|
109
|
+
return this.multiline ? s`
|
|
110
|
+
<div class="field__inner${a(this.fieldClasses())}">
|
|
111
|
+
${this.renderLabel(this.labelClasses())}
|
|
112
|
+
${this.renderTextarea(this.inputClasses())}
|
|
113
|
+
</div>
|
|
114
|
+
` : s`
|
|
115
|
+
${this.inputAs(this.fieldClasses())}
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
render() {
|
|
119
|
+
return s`
|
|
120
|
+
<div class="field">
|
|
121
|
+
${this.checkIfMultiline()}
|
|
122
|
+
${this.renderErrorMessage()}
|
|
123
|
+
</div>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
r.styles = b([
|
|
128
|
+
m,
|
|
129
|
+
_`
|
|
130
|
+
/* Base */
|
|
131
|
+
.field {
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
position: relative;
|
|
135
|
+
font-size: var(--um-font-size-bodySm, 0.875rem);
|
|
136
|
+
}
|
|
137
|
+
.field__inner {
|
|
138
|
+
align-items: flex-start;
|
|
139
|
+
display: flex;
|
|
140
|
+
}
|
|
141
|
+
.field__inner:not(.field__inner--inline) {
|
|
142
|
+
flex-direction: column;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Required */
|
|
146
|
+
.field__inner--required .input::before {
|
|
147
|
+
content: '';
|
|
148
|
+
position: absolute;
|
|
149
|
+
top: 0;
|
|
150
|
+
left: 0;
|
|
151
|
+
bottom: 0;
|
|
152
|
+
display: block;
|
|
153
|
+
border-right: 0.25rem solid rgba(var(--um-color-base-text-warning, 200,0,0), 0.7);
|
|
154
|
+
width: 0;
|
|
155
|
+
height: 100%;
|
|
156
|
+
z-index: 1;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Field label */
|
|
160
|
+
.field__label {
|
|
161
|
+
color: inherit;
|
|
162
|
+
font-size: inherit;
|
|
163
|
+
margin-bottom: var(--um-space-4, 0.25rem);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Field input */
|
|
167
|
+
.field__input {
|
|
168
|
+
border: 0.0625rem solid rgba(var(--um-color-input-border, var(--um-color-section-text, 0,0,0), var(--um-opacity-input-border, 0.2)));
|
|
169
|
+
border-radius: var(--um-border-input-radius, 0);
|
|
170
|
+
font-family: var(--um-font-family-body, Roboto, Arial, Helvetica, sans-serif);
|
|
171
|
+
font-size: inherit;
|
|
172
|
+
height: var(--um-space-40, 2rem);
|
|
173
|
+
padding: var(--um-space-8, 0.5rem);
|
|
174
|
+
width: 100%;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* Textarea */
|
|
178
|
+
.field__input--multiline {
|
|
179
|
+
min-height: var(--um-space-112, 7rem);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Error state */
|
|
183
|
+
.field__input--error {
|
|
184
|
+
border: 0.0625rem solid rgba(var(--um-color-base-text-warning, 245,0,0), 1);
|
|
185
|
+
}
|
|
186
|
+
.field__error-text {
|
|
187
|
+
color: rgba(var(--um-color-base-text-warning, 245,0,0), 1);
|
|
188
|
+
font-size: calc(var(--um-font-size-body-scale, 1) * var(--um-font-size-body-sm, 0.875rem));
|
|
189
|
+
padding-top: var(--um-space-4, 0.25rem);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Disabled */
|
|
193
|
+
:host([disabled]) {
|
|
194
|
+
--um-color-button-icon-text: var(--um-color-border-disabled, 236, 236, 236);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.field__input[disabled] {
|
|
198
|
+
cursor: default;
|
|
199
|
+
background-color: rgb(255,255,255,1);
|
|
200
|
+
color: rgb(var(--um-color-base-text-disabled, 200, 200, 200),1);
|
|
201
|
+
border-color: rgb(var(--um-color-border-disabled, 236, 236, 236), 1);
|
|
202
|
+
}
|
|
203
|
+
.field__label--disabled {
|
|
204
|
+
color: rgb(var(--um-color-base-text-disabled,200, 200, 200),1);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Input Types */
|
|
208
|
+
.input {
|
|
209
|
+
position: relative;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Radio/check */
|
|
213
|
+
.field__input[type=checkbox],
|
|
214
|
+
.field__input[type=radio] {
|
|
215
|
+
height: auto;
|
|
216
|
+
margin: 0.3rem 0.5rem 0 0;
|
|
217
|
+
padding: 0;
|
|
218
|
+
width: auto;
|
|
219
|
+
}
|
|
220
|
+
`
|
|
221
|
+
]);
|
|
222
|
+
i([
|
|
223
|
+
t()
|
|
224
|
+
], r.prototype, "type", 2);
|
|
225
|
+
i([
|
|
226
|
+
t({ type: Boolean })
|
|
227
|
+
], r.prototype, "hideLabel", 2);
|
|
228
|
+
i([
|
|
229
|
+
t({ type: Boolean })
|
|
230
|
+
], r.prototype, "multiline", 2);
|
|
231
|
+
i([
|
|
232
|
+
t()
|
|
233
|
+
], r.prototype, "placeholder", 2);
|
|
234
|
+
i([
|
|
235
|
+
t({ type: Boolean, reflect: !0 })
|
|
236
|
+
], r.prototype, "disabled", 2);
|
|
237
|
+
i([
|
|
238
|
+
t({ type: Boolean })
|
|
239
|
+
], r.prototype, "required", 2);
|
|
240
|
+
i([
|
|
241
|
+
t()
|
|
242
|
+
], r.prototype, "id", 2);
|
|
243
|
+
i([
|
|
244
|
+
t({ type: Boolean })
|
|
245
|
+
], r.prototype, "error", 2);
|
|
246
|
+
i([
|
|
247
|
+
t()
|
|
248
|
+
], r.prototype, "name", 2);
|
|
249
|
+
i([
|
|
250
|
+
t({ reflect: !0 })
|
|
251
|
+
], r.prototype, "value", 2);
|
|
252
|
+
r = i([
|
|
253
|
+
h(`${x}-text-field`)
|
|
254
|
+
], r);
|
|
255
|
+
export {
|
|
256
|
+
r as TextField
|
|
257
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/reactive-element.js";
|
|
2
|
+
import "../../../../node_modules/.pnpm/lit-html@3.1.2/node_modules/lit-html/lit-html.js";
|
|
3
|
+
import "../../../../node_modules/.pnpm/lit-element@4.0.4/node_modules/lit-element/lit-element.js";
|
|
4
|
+
import { property as n } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
5
|
+
import { customElement as c } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
6
|
+
import { Slide as a } from "../slider/slide.js";
|
|
7
|
+
import { settings as d } from "../../scripts/settings.js";
|
|
8
|
+
import { css as f } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/css-tag.js";
|
|
9
|
+
var u = Object.defineProperty, b = Object.getOwnPropertyDescriptor, l = (m, t, s, e) => {
|
|
10
|
+
for (var r = e > 1 ? void 0 : e ? b(t, s) : t, i = m.length - 1, p; i >= 0; i--)
|
|
11
|
+
(p = m[i]) && (r = (e ? p(t, s, r) : p(r)) || r);
|
|
12
|
+
return e && r && u(t, s, r), r;
|
|
13
|
+
};
|
|
14
|
+
const { prefix: v } = d;
|
|
15
|
+
let o = class extends a {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments), this.mediaId = "";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
o.styles = [
|
|
21
|
+
a.styles,
|
|
22
|
+
f`
|
|
23
|
+
:host {
|
|
24
|
+
padding: var(--um-space-4, 0.25rem);
|
|
25
|
+
}
|
|
26
|
+
:host([active]) {
|
|
27
|
+
padding: 0;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
:host([active])::after {
|
|
31
|
+
content: '';
|
|
32
|
+
display: block;
|
|
33
|
+
position: absolute;
|
|
34
|
+
inset: 0;
|
|
35
|
+
background-color: rgb(255,255,255,0.2);
|
|
36
|
+
cursor: default;
|
|
37
|
+
}
|
|
38
|
+
li {
|
|
39
|
+
border: 0.0625rem solid rgb(0,0,0,0.1);
|
|
40
|
+
}
|
|
41
|
+
`
|
|
42
|
+
];
|
|
43
|
+
l([
|
|
44
|
+
n()
|
|
45
|
+
], o.prototype, "mediaId", 2);
|
|
46
|
+
o = l([
|
|
47
|
+
c(`${v}-thumbnail-slide`)
|
|
48
|
+
], o);
|
|
49
|
+
export {
|
|
50
|
+
o as ThumbnailSlide
|
|
51
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { customElement as c } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
2
|
+
import { property as n } from "../../../../node_modules/.pnpm/@lit_reactive-element@2.0.4/node_modules/@lit/reactive-element/decorators/property.js";
|
|
3
|
+
import { Slider as u } from "../slider/slider.js";
|
|
4
|
+
import "./thumbnail-slide.js";
|
|
5
|
+
import { settings as p } from "../../scripts/settings.js";
|
|
6
|
+
import { EventManager as h } from "../../classes/event-manager/event-manager.js";
|
|
7
|
+
var v = Object.defineProperty, m = Object.getOwnPropertyDescriptor, d = (e, t, s, r) => {
|
|
8
|
+
for (var i = r > 1 ? void 0 : r ? m(t, s) : t, o = e.length - 1, l; o >= 0; o--)
|
|
9
|
+
(l = e[o]) && (i = (r ? l(t, s, i) : l(i)) || i);
|
|
10
|
+
return r && i && v(t, s, i), i;
|
|
11
|
+
};
|
|
12
|
+
const { prefix: f } = p;
|
|
13
|
+
let a = class extends u {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(), this.currentMediaId = "", this.contentType = "slider", this.desktopSlider = !0, this.mobileSlider = !0, this.slideEventManager = new h(this);
|
|
16
|
+
const e = [...this.constructor.eventTypes];
|
|
17
|
+
e.push("active-slide"), e.forEach((t) => {
|
|
18
|
+
this.addEventListener(t, this._customEventsHandler);
|
|
19
|
+
}), this._initialiseSlides();
|
|
20
|
+
}
|
|
21
|
+
async _initialiseSlides() {
|
|
22
|
+
await this.updateComplete, this._updateActiveSlide(this.currentMediaId), this._sliderItems.forEach((e) => {
|
|
23
|
+
e.addEventListener("click", () => {
|
|
24
|
+
const t = {
|
|
25
|
+
mediaId: e.getAttribute("mediaId")
|
|
26
|
+
};
|
|
27
|
+
this._eventsDispatcher("active-slide", t);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
slidesChanged() {
|
|
32
|
+
super.slidesChanged(), this._initialiseSlides();
|
|
33
|
+
}
|
|
34
|
+
_updateActiveSlide(e) {
|
|
35
|
+
e && this._sliderItems.forEach((t, s) => {
|
|
36
|
+
t.hasAttribute("active") && t.removeAttribute("active");
|
|
37
|
+
const r = t.getAttribute("mediaId");
|
|
38
|
+
if (e === r) {
|
|
39
|
+
t.setAttribute("active", ""), this._updateActiveMedia(r);
|
|
40
|
+
const i = {
|
|
41
|
+
slideNumber: s + 1
|
|
42
|
+
};
|
|
43
|
+
this._eventsDispatcher("slide-link", i);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
_updateActiveMedia(e) {
|
|
48
|
+
this.slideEventManager.dispatchCustomEvent(
|
|
49
|
+
"active-media",
|
|
50
|
+
{ mediaId: e },
|
|
51
|
+
{ bubbles: !0, composed: !0 }
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
_eventsDispatcher(e, t) {
|
|
55
|
+
if (!e)
|
|
56
|
+
throw new Error("Missing custom event type");
|
|
57
|
+
const s = { bubbles: !0, composed: !0 };
|
|
58
|
+
e == "active-slide" && this.slideEventManager.dispatchCustomEvent(e, t, s), e == "slide-link" && this.slideEventManager.dispatchCustomEvent(e, t, s);
|
|
59
|
+
}
|
|
60
|
+
_customEventsHandler(e) {
|
|
61
|
+
super._customEventsHandler(e), e.type === "active-slide" && this._updateActiveSlide(e.detail.mediaId);
|
|
62
|
+
}
|
|
63
|
+
updated(e) {
|
|
64
|
+
super.updated(e), e.has("currentMediaId") && e.get("currentMediaId") && this._updateActiveSlide(this.currentMediaId);
|
|
65
|
+
}
|
|
66
|
+
gridClasses() {
|
|
67
|
+
const e = super.gridClasses();
|
|
68
|
+
return e["slider--selectable"] = !0, e;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
d([
|
|
72
|
+
n({ reflect: !0 })
|
|
73
|
+
], a.prototype, "currentMediaId", 2);
|
|
74
|
+
d([
|
|
75
|
+
n({ state: !0 })
|
|
76
|
+
], a.prototype, "contentType", 2);
|
|
77
|
+
d([
|
|
78
|
+
n({ state: !0, type: Boolean })
|
|
79
|
+
], a.prototype, "desktopSlider", 2);
|
|
80
|
+
d([
|
|
81
|
+
n({ state: !0, type: Boolean })
|
|
82
|
+
], a.prototype, "mobileSlider", 2);
|
|
83
|
+
a = d([
|
|
84
|
+
c(`${f}-thumbnail-slider`)
|
|
85
|
+
], a);
|
|
86
|
+
export {
|
|
87
|
+
a as ThumbnailSlider
|
|
88
|
+
};
|