scu-web-components 0.0.21 → 0.0.22
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/chunks/chunk.2SWJYWHF.js +4 -0
- package/dist/chunks/chunk.2SWJYWHF.js.map +7 -0
- package/dist/chunks/chunk.3FBPDSVX.js +246 -0
- package/dist/chunks/chunk.3FBPDSVX.js.map +7 -0
- package/dist/chunks/chunk.3ZF5XE56.js +2 -0
- package/dist/chunks/chunk.3ZF5XE56.js.map +7 -0
- package/dist/chunks/chunk.5B2MVQ27.js +2 -0
- package/dist/chunks/chunk.5B2MVQ27.js.map +7 -0
- package/dist/chunks/chunk.5O57EYF4.js +2 -0
- package/dist/chunks/chunk.5O57EYF4.js.map +7 -0
- package/dist/chunks/chunk.5P5RU7GD.js +2 -0
- package/dist/chunks/chunk.5P5RU7GD.js.map +7 -0
- package/dist/chunks/chunk.5SNSWZHO.js +2 -0
- package/dist/chunks/chunk.5SNSWZHO.js.map +7 -0
- package/dist/chunks/chunk.62GWBO3B.js +2 -0
- package/dist/chunks/chunk.62GWBO3B.js.map +7 -0
- package/dist/chunks/chunk.6JEOFLOD.js +2 -0
- package/dist/chunks/chunk.6JEOFLOD.js.map +7 -0
- package/dist/chunks/chunk.6JZBSBO7.js +2 -0
- package/dist/chunks/chunk.6JZBSBO7.js.map +7 -0
- package/dist/chunks/chunk.75XREEIK.js +58 -0
- package/dist/chunks/chunk.75XREEIK.js.map +7 -0
- package/dist/chunks/chunk.7CJJ52HY.js +2 -0
- package/dist/chunks/chunk.7CJJ52HY.js.map +7 -0
- package/dist/chunks/chunk.7RDBE3IG.js +2 -0
- package/dist/chunks/chunk.7RDBE3IG.js.map +7 -0
- package/dist/chunks/chunk.7VW267FJ.js +17 -0
- package/dist/chunks/chunk.7VW267FJ.js.map +7 -0
- package/dist/chunks/chunk.7Z2IEKUA.js +17 -0
- package/dist/chunks/chunk.7Z2IEKUA.js.map +7 -0
- package/dist/chunks/chunk.ACJT3GFX.js +17 -0
- package/dist/chunks/chunk.ACJT3GFX.js.map +7 -0
- package/dist/chunks/chunk.B63G34N3.js +2 -0
- package/dist/chunks/chunk.B63G34N3.js.map +7 -0
- package/dist/chunks/chunk.BXOGDFND.js +17 -0
- package/dist/chunks/chunk.BXOGDFND.js.map +7 -0
- package/dist/chunks/chunk.DCCR6AGA.js +4 -0
- package/dist/chunks/chunk.DCCR6AGA.js.map +7 -0
- package/dist/chunks/chunk.DTU7NHQP.js +2 -0
- package/dist/chunks/chunk.DTU7NHQP.js.map +7 -0
- package/dist/chunks/chunk.EXCY4PGS.js +2 -0
- package/dist/chunks/chunk.EXCY4PGS.js.map +7 -0
- package/dist/chunks/chunk.F7TA5BBQ.js +4 -0
- package/dist/chunks/chunk.F7TA5BBQ.js.map +7 -0
- package/dist/chunks/chunk.HLMRJM7V.js +47 -0
- package/dist/chunks/chunk.HLMRJM7V.js.map +7 -0
- package/dist/chunks/chunk.IAALPGL2.js +2 -0
- package/dist/chunks/chunk.IAALPGL2.js.map +7 -0
- package/dist/chunks/chunk.KLCHR5KI.js +2 -0
- package/dist/chunks/chunk.KLCHR5KI.js.map +7 -0
- package/dist/chunks/chunk.KLH46EZA.js +2 -0
- package/dist/chunks/chunk.KLH46EZA.js.map +7 -0
- package/dist/chunks/chunk.L6NJJXH5.js +2 -0
- package/dist/chunks/chunk.L6NJJXH5.js.map +7 -0
- package/dist/chunks/chunk.LAQTQIRZ.js +2 -0
- package/dist/chunks/chunk.LAQTQIRZ.js.map +7 -0
- package/dist/chunks/chunk.MBVU2OPU.js +4 -0
- package/dist/chunks/chunk.MBVU2OPU.js.map +7 -0
- package/dist/chunks/chunk.MGZVQJ3S.js +245 -0
- package/dist/chunks/chunk.MGZVQJ3S.js.map +7 -0
- package/dist/chunks/chunk.MLENW6F3.js +246 -0
- package/dist/chunks/chunk.MLENW6F3.js.map +7 -0
- package/dist/chunks/chunk.O5A7YZKV.js +29 -0
- package/dist/chunks/chunk.O5A7YZKV.js.map +7 -0
- package/dist/chunks/chunk.O6N6AMBN.js +209 -0
- package/dist/chunks/chunk.O6N6AMBN.js.map +7 -0
- package/dist/chunks/chunk.PXGXIL4I.js +246 -0
- package/dist/chunks/chunk.PXGXIL4I.js.map +7 -0
- package/dist/chunks/chunk.QXE7UNSK.js +245 -0
- package/dist/chunks/chunk.QXE7UNSK.js.map +7 -0
- package/dist/chunks/chunk.R4YGOT4Y.js +49 -0
- package/dist/chunks/chunk.R4YGOT4Y.js.map +7 -0
- package/dist/chunks/chunk.RBSBLP6E.js +256 -0
- package/dist/chunks/chunk.RBSBLP6E.js.map +7 -0
- package/dist/chunks/chunk.RXMGI7HR.js +2 -0
- package/dist/chunks/chunk.RXMGI7HR.js.map +7 -0
- package/dist/chunks/chunk.S4MESEBR.js +32 -0
- package/dist/chunks/chunk.S4MESEBR.js.map +7 -0
- package/dist/chunks/chunk.SIJSFRVB.js +2 -0
- package/dist/chunks/chunk.SIJSFRVB.js.map +7 -0
- package/dist/chunks/chunk.TXOGG2T7.js +2 -0
- package/dist/chunks/chunk.TXOGG2T7.js.map +7 -0
- package/dist/chunks/chunk.UVVG6NF4.js +2 -0
- package/dist/chunks/chunk.UVVG6NF4.js.map +7 -0
- package/dist/chunks/chunk.W3ITQHQQ.js +245 -0
- package/dist/chunks/chunk.W3ITQHQQ.js.map +7 -0
- package/dist/chunks/chunk.WPOS6KBC.js +2 -0
- package/dist/chunks/chunk.WPOS6KBC.js.map +7 -0
- package/dist/chunks/chunk.WSDDWC5Y.js +47 -0
- package/dist/chunks/chunk.WSDDWC5Y.js.map +7 -0
- package/dist/chunks/chunk.YPWTNS7G.js +17 -0
- package/dist/chunks/chunk.YPWTNS7G.js.map +7 -0
- package/dist/chunks/chunk.YXBLJ773.js +4 -0
- package/dist/chunks/chunk.YXBLJ773.js.map +7 -0
- package/dist/chunks/chunk.Z3OBLET2.js +2 -0
- package/dist/chunks/chunk.Z3OBLET2.js.map +7 -0
- package/dist/chunks/chunk.ZKGK7XFD.js +117 -0
- package/dist/chunks/chunk.ZKGK7XFD.js.map +7 -0
- package/dist/chunks/chunk.ZKH7NVYV.js +17 -0
- package/dist/chunks/chunk.ZKH7NVYV.js.map +7 -0
- package/dist/chunks/chunk.ZWJHKP3F.js +4 -0
- package/dist/chunks/chunk.ZWJHKP3F.js.map +7 -0
- package/dist/custom-elements.json +187 -132
- package/dist/docs/components/ScwCard.json +19 -0
- package/dist/docs/components/ScwImage.json +46 -10
- package/dist/docs/components/manifest.json +78 -78
- package/dist/docs/config.json +1 -1
- package/dist/scw-alert/ScwAlert.js +1 -1
- package/dist/scw-alert/scw-alert.js +1 -1
- package/dist/scw-button/ScwButton.js +1 -1
- package/dist/scw-button/scw-button.js +1 -1
- package/dist/scw-card/ScwCard.js +1 -1
- package/dist/scw-card/scw-card.js +1 -1
- package/dist/scw-components.js +1 -1
- package/dist/scw-form-component/scw-form-component.js +1 -1
- package/dist/scw-heading/ScwHeading.js +1 -1
- package/dist/scw-heading/scw-heading.js +1 -1
- package/dist/scw-icon/ScwIcon.js +1 -1
- package/dist/scw-icon/scw-icon.js +1 -1
- package/dist/scw-image/ScwImage.js +1 -1
- package/dist/scw-image/scw-image-validate.js +1 -1
- package/dist/scw-image/scw-image.js +1 -1
- package/dist/scw-input/scw-input.js +1 -1
- package/dist/scw-link/ScwLink.js +1 -1
- package/dist/scw-link/scw-link.js +1 -1
- package/dist/scw-link-base/ScwLinkBase.js +1 -1
- package/dist/scw-link-base/scw-link-base.js +1 -1
- package/dist/scw-menu-item/ScwMenuItem.js +1 -1
- package/dist/scw-menu-item/scw-menu-item.js +1 -1
- package/dist/scw-page-alert/scw-page-alert.js +1 -1
- package/dist/scw-select/scw-select.js +1 -1
- package/dist/scw-single-input/scw-single-input.js +1 -1
- package/dist/scw-textarea/scw-textarea.js +1 -1
- package/dist/scw.js +1 -1
- package/dist/utils/suffix.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import{a as r,b as s}from"./chunk.RGGLFZST.js";import{a as g}from"./chunk.TXOGG2T7.js";import{a as n,d as c}from"./chunk.S4MESEBR.js";import{a,b as i,e as l}from"./chunk.HCMPRDIX.js";import{a as d}from"./chunk.Y2P62L7U.js";import{g as e}from"./chunk.5YJY6NT6.js";var p=a`
|
|
2
|
+
:host {
|
|
3
|
+
/* scw element */
|
|
4
|
+
position: relative;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
--margin-right: initial;
|
|
7
|
+
--margin-bottom: initial;
|
|
8
|
+
--gap-h-int: initial;
|
|
9
|
+
--gap-v-int: initial;
|
|
10
|
+
margin-right: var(--margin-right, var(--gap-h-int, initial));
|
|
11
|
+
margin-bottom: var(--margin-bottom, var(--gap-v-int, initial));
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([warning]) {
|
|
16
|
+
outline: 2px solid red !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([size=medium]) {
|
|
20
|
+
display: block;
|
|
21
|
+
background-color: rgba(0, 0, 0, 0);
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-flow: column nowrap;
|
|
24
|
+
justify-content: flex-start;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
padding-left: 0px;
|
|
27
|
+
padding-right: 0px;
|
|
28
|
+
padding-top: 0px;
|
|
29
|
+
padding-bottom: 0px;
|
|
30
|
+
/*.image-box {
|
|
31
|
+
width: 100%;
|
|
32
|
+
padding-bottom: 38.8888888889%;
|
|
33
|
+
position: relative;
|
|
34
|
+
}*/
|
|
35
|
+
/*.image {
|
|
36
|
+
@include size-medium-image-mixins.box;
|
|
37
|
+
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
background-position: center;
|
|
41
|
+
background-size: cover;
|
|
42
|
+
}*/
|
|
43
|
+
/*.action {
|
|
44
|
+
@include size-medium-action-mixins.box;
|
|
45
|
+
@include size-medium-action-mixins.sizing;
|
|
46
|
+
}*/
|
|
47
|
+
}
|
|
48
|
+
:host([size=medium]) > *:not(:last-child) {
|
|
49
|
+
margin-bottom: calc(var(--scw-spacing-1) * 0.8);
|
|
50
|
+
--margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );
|
|
51
|
+
}
|
|
52
|
+
:host([size=medium]) .image-box {
|
|
53
|
+
height: 161px;
|
|
54
|
+
}
|
|
55
|
+
:host([size=medium]) .description {
|
|
56
|
+
text-align: LEFT;
|
|
57
|
+
font: var(--scw-type-text-font);
|
|
58
|
+
color: var(--scw-color-grey-02);
|
|
59
|
+
align-self: stretch;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([size=small]) {
|
|
63
|
+
display: block;
|
|
64
|
+
background-color: rgba(0, 0, 0, 0);
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-flow: column nowrap;
|
|
67
|
+
justify-content: flex-start;
|
|
68
|
+
align-items: flex-start;
|
|
69
|
+
padding-left: 0px;
|
|
70
|
+
padding-right: 0px;
|
|
71
|
+
padding-top: 0px;
|
|
72
|
+
padding-bottom: 0px;
|
|
73
|
+
/*.image-box {
|
|
74
|
+
width: 100%;
|
|
75
|
+
padding-bottom: 88.9473684211%;
|
|
76
|
+
position: relative;
|
|
77
|
+
}*/
|
|
78
|
+
/*.image {
|
|
79
|
+
@include size-small-image-mixins.box;
|
|
80
|
+
|
|
81
|
+
position: absolute;
|
|
82
|
+
inset: 0;
|
|
83
|
+
background-position: center;
|
|
84
|
+
background-size: cover;
|
|
85
|
+
}*/
|
|
86
|
+
}
|
|
87
|
+
:host([size=small]) > *:not(:last-child) {
|
|
88
|
+
margin-bottom: calc(var(--scw-spacing-1) * 0.8);
|
|
89
|
+
--margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );
|
|
90
|
+
}
|
|
91
|
+
:host([size=small]) .image-box {
|
|
92
|
+
height: 169px;
|
|
93
|
+
}
|
|
94
|
+
:host([size=small]) .description {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
:host([size=small]) .action {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host .super-heading.mortgage {
|
|
102
|
+
text-align: LEFT;
|
|
103
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
104
|
+
color: var(--scw-color-04, var(--scw-color-mortgage-04));
|
|
105
|
+
align-self: stretch;
|
|
106
|
+
}
|
|
107
|
+
:host .super-heading.savings {
|
|
108
|
+
text-align: LEFT;
|
|
109
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
110
|
+
color: var(--scw-color-04, var(--scw-color-savings-04));
|
|
111
|
+
align-self: stretch;
|
|
112
|
+
}
|
|
113
|
+
:host .super-heading.student {
|
|
114
|
+
text-align: LEFT;
|
|
115
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
116
|
+
color: var(--scw-color-04, var(--scw-color-student-04));
|
|
117
|
+
align-self: stretch;
|
|
118
|
+
}
|
|
119
|
+
:host .super-heading.investments {
|
|
120
|
+
text-align: LEFT;
|
|
121
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
122
|
+
color: var(--scw-color-04, var(--scw-color-investments-04));
|
|
123
|
+
align-self: stretch;
|
|
124
|
+
}
|
|
125
|
+
:host .super-heading.checking {
|
|
126
|
+
text-align: LEFT;
|
|
127
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
128
|
+
color: var(--scw-color-04, var(--scw-color-checking-04));
|
|
129
|
+
align-self: stretch;
|
|
130
|
+
}
|
|
131
|
+
:host .super-heading.credit-cards {
|
|
132
|
+
text-align: LEFT;
|
|
133
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
134
|
+
color: var(--scw-color-04, var(--scw-color-credit-cards-04));
|
|
135
|
+
align-self: stretch;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host {
|
|
139
|
+
display: block;
|
|
140
|
+
background-color: var(--scw-color, rgba(0, 0, 0, 0));
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-flow: column nowrap;
|
|
143
|
+
justify-content: flex-start;
|
|
144
|
+
align-items: flex-start;
|
|
145
|
+
padding-left: 0px;
|
|
146
|
+
padding-right: 0px;
|
|
147
|
+
padding-top: 0px;
|
|
148
|
+
padding-bottom: 0px;
|
|
149
|
+
/*.image {
|
|
150
|
+
@include default-image-mixins.box;
|
|
151
|
+
|
|
152
|
+
position: absolute;
|
|
153
|
+
inset: 0;
|
|
154
|
+
background-position: center;
|
|
155
|
+
background-size: cover;
|
|
156
|
+
}*/
|
|
157
|
+
}
|
|
158
|
+
:host > *:not(:last-child) {
|
|
159
|
+
margin-bottom: calc(var(--scw-spacing-1) * 0.8);
|
|
160
|
+
--margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );
|
|
161
|
+
}
|
|
162
|
+
:host .image-box {
|
|
163
|
+
background-color: var(--scw-color-09, var(--scw-color-grey-09));
|
|
164
|
+
border-radius: 10px 10px 10px 10px;
|
|
165
|
+
align-self: stretch;
|
|
166
|
+
flex: 1;
|
|
167
|
+
flex: initial;
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
height: 345px;
|
|
170
|
+
}
|
|
171
|
+
:host .heading {
|
|
172
|
+
background-color: rgba(0, 0, 0, 0);
|
|
173
|
+
align-self: stretch;
|
|
174
|
+
}
|
|
175
|
+
:host .super-heading {
|
|
176
|
+
text-align: LEFT;
|
|
177
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
178
|
+
color: var(--scw-color-03, var(--scw-color-primary-03));
|
|
179
|
+
align-self: stretch;
|
|
180
|
+
}
|
|
181
|
+
:host .description {
|
|
182
|
+
text-align: LEFT;
|
|
183
|
+
font: var(--scw-type-text-06-font);
|
|
184
|
+
color: var(--scw-color-02, var(--scw-color-grey-02));
|
|
185
|
+
align-self: stretch;
|
|
186
|
+
}
|
|
187
|
+
:host .action {
|
|
188
|
+
width: 83px;
|
|
189
|
+
height: 32px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:host([action=none]) {
|
|
193
|
+
pointer-events: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:host([action=whole]) {
|
|
197
|
+
pointer-events: all;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:host([action=whole]:hover) {
|
|
201
|
+
cursor: pointer;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([action=whole]:focus-visible) {
|
|
205
|
+
outline: none;
|
|
206
|
+
box-shadow: var(--scw-effect-focus-shadow);
|
|
207
|
+
border-radius: 10px 10px 4px 4px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:host([action=link]) {
|
|
211
|
+
pointer-events: none;
|
|
212
|
+
}
|
|
213
|
+
:host([action=link]) scw-link {
|
|
214
|
+
pointer-events: all;
|
|
215
|
+
}`;var t=class extends c{constructor(){super();this.preload=!1;this.size="large";this.action="none";this.element="card",this.clickHandler=this.clickHandler.bind(this);let o=g();this.headerNodeName=r(`scw-${"heading"}${o}`),this.imageNodeName=r(`scw-${"image"}${o}`),this.linkNodeName=r(`scw-${"link"}${o}`)}static get styles(){return[super.styles,p]}parseAndValidateLightDom(){d(this),super.parseAndValidateLightDom()}clickHandler(o){o.stopPropagation(),this.click()}warn(o){this.heading=`error: ${o}`,l.prototype.warn.call(this,o)}renderImage(){if((this.src||this.srcset)&&this.alt)return s`
|
|
216
|
+
<scw-image
|
|
217
|
+
class="image-box"
|
|
218
|
+
src="${n(this.src)}"
|
|
219
|
+
srcset="${n(this.srcset)}"
|
|
220
|
+
alt="${this.alt}"
|
|
221
|
+
preload="${this.preload}"
|
|
222
|
+
object-fit="cover">
|
|
223
|
+
</scw-image>
|
|
224
|
+
`}renderButton(){return this.action==="link"?s`
|
|
225
|
+
<scw-link
|
|
226
|
+
aria-label="${this.linkLabel?this.linkLabel:"no label"}"
|
|
227
|
+
@click="${this.clickHandler}">
|
|
228
|
+
</scw-link>`:null}getSizeStringForHeader(){switch(this.size){case"large":return"h1";case"medium":return"h2";case"small":return"h3"}}renderBody(){return s`
|
|
229
|
+
${this.renderImage()}
|
|
230
|
+
${this.superHeading?s`
|
|
231
|
+
<div class="super-heading">
|
|
232
|
+
${this.superHeading}
|
|
233
|
+
</div>`:""}
|
|
234
|
+
<scw-heading
|
|
235
|
+
style="--scw-color-04: var( --scw-color-grey-02 );"
|
|
236
|
+
dynamic class="heading"
|
|
237
|
+
aria-label="${n(this.heading)}"
|
|
238
|
+
size="${this.getSizeStringForHeader()}">
|
|
239
|
+
</scw-heading>
|
|
240
|
+
${this.description?s`
|
|
241
|
+
<div class="description">
|
|
242
|
+
${this.description}
|
|
243
|
+
</div>`:""}`}render(){return this.action==="whole"?this.renderBody():s`
|
|
244
|
+
${this.renderBody()}
|
|
245
|
+
${this.renderButton()}`}};e([i()],t.prototype,"src",2),e([i()],t.prototype,"srcset",2),e([i()],t.prototype,"alt",2),e([i()],t.prototype,"heading",2),e([i()],t.prototype,"superHeading",2),e([i()],t.prototype,"description",2),e([i()],t.prototype,"linkLabel",2),e([i({type:Boolean})],t.prototype,"preload",2),e([i({type:String,reflect:!0})],t.prototype,"size",2),e([i({type:String,reflect:!0})],t.prototype,"action",2);export{t as a};
|
|
246
|
+
//# sourceMappingURL=chunk.PXGXIL4I.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sass-plugin-0:/Users/scottrouse/Workspace/scu-design-system-mono/scu-web-components/src/scw-card/scss/scw-card.scss", "../../src/scw-card/ScwCard.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from \"lit-element/lit-element.js\";\nexport default css`\n:host {\n /* scw element */\n position: relative;\n box-sizing: border-box;\n --margin-right: initial;\n --margin-bottom: initial;\n --gap-h-int: initial;\n --gap-v-int: initial;\n margin-right: var(--margin-right, var(--gap-h-int, initial));\n margin-bottom: var(--margin-bottom, var(--gap-v-int, initial));\n display: block;\n}\n\n:host([warning]) {\n outline: 2px solid red !important;\n}\n\n:host([size=medium]) {\n display: block;\n background-color: rgba(0, 0, 0, 0);\n display: flex;\n flex-flow: column nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-left: 0px;\n padding-right: 0px;\n padding-top: 0px;\n padding-bottom: 0px;\n /*.image-box {\n width: 100%;\n padding-bottom: 38.8888888889%;\n position: relative;\n }*/\n /*.image {\n @include size-medium-image-mixins.box;\n\n position: absolute;\n inset: 0;\n background-position: center;\n background-size: cover;\n }*/\n /*.action {\n @include size-medium-action-mixins.box;\n @include size-medium-action-mixins.sizing;\n }*/\n}\n:host([size=medium]) > *:not(:last-child) {\n margin-bottom: calc(var(--scw-spacing-1) * 0.8);\n --margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );\n}\n:host([size=medium]) .image-box {\n height: 161px;\n}\n:host([size=medium]) .description {\n text-align: LEFT;\n font: var(--scw-type-text-font);\n color: var(--scw-color-grey-02);\n align-self: stretch;\n}\n\n:host([size=small]) {\n display: block;\n background-color: rgba(0, 0, 0, 0);\n display: flex;\n flex-flow: column nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-left: 0px;\n padding-right: 0px;\n padding-top: 0px;\n padding-bottom: 0px;\n /*.image-box {\n width: 100%;\n padding-bottom: 88.9473684211%;\n position: relative;\n }*/\n /*.image {\n @include size-small-image-mixins.box;\n\n position: absolute;\n inset: 0;\n background-position: center;\n background-size: cover;\n }*/\n}\n:host([size=small]) > *:not(:last-child) {\n margin-bottom: calc(var(--scw-spacing-1) * 0.8);\n --margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );\n}\n:host([size=small]) .image-box {\n height: 169px;\n}\n:host([size=small]) .description {\n display: none;\n}\n:host([size=small]) .action {\n display: none;\n}\n\n:host .super-heading.mortgage {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-mortgage-04));\n align-self: stretch;\n}\n:host .super-heading.savings {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-savings-04));\n align-self: stretch;\n}\n:host .super-heading.student {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-student-04));\n align-self: stretch;\n}\n:host .super-heading.investments {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-investments-04));\n align-self: stretch;\n}\n:host .super-heading.checking {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-checking-04));\n align-self: stretch;\n}\n:host .super-heading.credit-cards {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-credit-cards-04));\n align-self: stretch;\n}\n\n:host {\n display: block;\n background-color: var(--scw-color, rgba(0, 0, 0, 0));\n display: flex;\n flex-flow: column nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-left: 0px;\n padding-right: 0px;\n padding-top: 0px;\n padding-bottom: 0px;\n /*.image {\n @include default-image-mixins.box;\n\n position: absolute;\n inset: 0;\n background-position: center;\n background-size: cover;\n }*/\n}\n:host > *:not(:last-child) {\n margin-bottom: calc(var(--scw-spacing-1) * 0.8);\n --margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );\n}\n:host .image-box {\n background-color: var(--scw-color-09, var(--scw-color-grey-09));\n border-radius: 10px 10px 10px 10px;\n align-self: stretch;\n flex: 1;\n flex: initial;\n overflow: hidden;\n height: 345px;\n}\n:host .heading {\n background-color: rgba(0, 0, 0, 0);\n align-self: stretch;\n}\n:host .super-heading {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-03, var(--scw-color-primary-03));\n align-self: stretch;\n}\n:host .description {\n text-align: LEFT;\n font: var(--scw-type-text-06-font);\n color: var(--scw-color-02, var(--scw-color-grey-02));\n align-self: stretch;\n}\n:host .action {\n width: 83px;\n height: 32px;\n}\n\n:host([action=none]) {\n pointer-events: none;\n}\n\n:host([action=whole]) {\n pointer-events: all;\n}\n\n:host([action=whole]:hover) {\n cursor: pointer;\n}\n\n:host([action=whole]:focus-visible) {\n outline: none;\n box-shadow: var(--scw-effect-focus-shadow);\n border-radius: 10px 10px 4px 4px;\n}\n\n:host([action=link]) {\n pointer-events: none;\n}\n:host([action=link]) scw-link {\n pointer-events: all;\n}`;\n", "import {property} from 'lit/decorators.js';\nimport {html} from 'lit/static-html.js';// import {html} from 'lit';\nimport {unsafeStatic} from 'lit/static-html.js';// USE DIFFERENT 'html'!!!!\nimport styles from './scss/scw-card.scss';\nimport ScwComponent from '../scw-component/ScwComponent';\nimport {ScwCardSizes, ScwCardActions} from './scw-card-enums';\nimport parseLightDomCard from './scw-card-light-dom';\nimport ScwLinkBase from '../scw-link-base/ScwLinkBase';\nimport {Components} from '../utils/enums/Components';\nimport getSuffix from '../utils/suffix';\nimport {ScwHeadingSizes} from '../scw-heading/scw-heading-enums';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\n/**\n * ScwCard a first LitElement web component\n * @class\n * @tag scw-card\n *\n * @slot [default=\"<img src alt /><h1, h2, h3 /><sup /><p />\"]\n The parts of scw-card are configured via nested html elements.\n img defines the image, heading the main heading, sup the category heading,\n and p the descriptive text. Only headings is required (with src, srcset,\n and alt attributes).\n * @slot [default=\"<img src alt /><h1, h2, h3 /><sup /><p /><a />\"]\n Adding an anchor will show a link.\n * @slot [default=\"<a><img src alt /><h1, h2, h3 /><sup /><p /></a>\"]\n Wrapping the entire content in an anchor will make it interactive\n */\nexport default class ScwCard extends ScwLinkBase {\n /**\n * styles\n */\n static get styles() {\n return [\n super.styles,\n styles,\n ];\n }\n\n // ============== ScwCard ====================================================\n /** (ScwCard) The src of the image within the card */\n @property() src: string | undefined;\n\n /** (ScwCard) The srcset of the image within the card */\n @property() srcset: string | undefined;\n\n /** (ScwCard) Alternative description of the image. */\n @property() alt: string | undefined;\n\n /** (ScwCard) Main title or header of the card (determined by\n * <h1, h2, h3> content) */\n @property() heading: string | undefined;\n\n /** (ScwCard) Super title, describing a category or area pertaining to title\n * (determined by <sup> content) */\n @property() superHeading: string | undefined;\n\n /** (ScwCard) Fuller description of what the card is about (determined by\n * <p> content) */\n @property() description: string | undefined;\n\n /** (ScwCard) Label on the link */\n @property() linkLabel : string | undefined;\n\n /** (ScwCard) whether to preload image or not */\n @property({type: Boolean}) preload: boolean = false;\n\n // ----------- END STATES ----------------------------------------------------\n /** (ScwCard) Readonly - Size of the card. This\n * is determined by the nested html content (h1 = large,\n * h2 = medium, h3 = small). */\n @property({type: String, reflect: true})\n size: ScwCardSizes = ScwCardSizes.large;\n\n /** (ScwCard) Readonly - The type of action (whole card, link, or none).\n * This is determined by the use of an anchor tag. */\n @property({type: String, reflect: true})\n action: ScwCardActions = ScwCardActions.none;\n\n /** scw-header with versioning suffix */\n headerNodeName : any;\n\n /** scw-image with versioning suffix */\n imageNodeName : any;\n\n /** scw-link with versioning suffix */\n linkNodeName : any;\n\n /**\n * Constructor\n */\n constructor() {\n super();\n this.element = Components.card;\n this.clickHandler = this.clickHandler.bind(this);\n\n const suffix = getSuffix();\n this.headerNodeName = unsafeStatic(`scw-${Components.heading}${suffix}`);\n this.imageNodeName = unsafeStatic(`scw-${Components.image}${suffix}`);\n this.linkNodeName = unsafeStatic(`scw-${Components.link}${suffix}`);\n }\n\n /** parseAndValidateLightDom, just adding local parsing and validation */\n parseAndValidateLightDom() {\n parseLightDomCard(this);\n super.parseAndValidateLightDom();\n }\n\n /**\n * Handle click event from link so it doesn't trigger twice\n * @param {Event} evt\n */\n clickHandler(evt : Event) {\n evt.stopPropagation();\n this.click();\n }\n\n /**\n * change the main heading to be the error.\n * @param {string} message describing warning\n */\n warn( message: string ) {\n this.heading = `error: ${message}`;\n ScwComponent.prototype.warn.call(this, message );\n }\n\n /**\n * Render image area\n * @return {object} component DOM\n */\n renderImage() {\n if (\n ( this.src || this.srcset ) &&\n this.alt ) {\n return html`\n <scw-image\n class=\"image-box\"\n src=\"${ifDefined(this.src)}\"\n srcset=\"${ifDefined(this.srcset)}\"\n alt=\"${this.alt}\"\n preload=\"${this.preload}\"\n object-fit=\"cover\">\n </scw-image>\n `;\n }\n }\n\n /**\n * Render link area\n * @return {object} component DOM\n */\n renderButton() {\n if ( this.action === ScwCardActions.link) {\n return html`\n <scw-link\n aria-label=\"${this.linkLabel ? this.linkLabel : 'no label'}\" \n @click=\"${this.clickHandler}\">\n </scw-link>`;\n }\n return null;\n }\n\n /**\n * get string to use in the size attribute of scw-header\n * @return {string}\n */\n getSizeStringForHeader() {\n switch (this.size) {\n case ScwCardSizes.large:\n return 'h1';\n case ScwCardSizes.medium:\n return 'h2';\n case ScwCardSizes.small:\n return 'h3';\n }\n }\n\n /**\n * render body\n * @return {object} component DOM\n */\n renderBody() : object {\n return html`\n ${this.renderImage()}\n ${this.superHeading ?\n html`\n <div class=\"super-heading\">\n ${this.superHeading}\n </div>` : ''\n }\n <scw-heading\n style=\"--scw-color-04: var( --scw-color-grey-02 );\"\n dynamic class=\"heading\"\n aria-label=\"${ifDefined(this.heading)}\"\n size=\"${this.getSizeStringForHeader() as ScwHeadingSizes}\">\n </scw-heading>\n ${this.description ?\n html`\n <div class=\"description\">\n ${this.description}\n </div>` : ''\n }`;\n }\n\n /**\n * render\n * @return {object} component DOM\n */\n render() : object {\n if (this.action === ScwCardActions.whole) {\n return this.renderBody();\n } else {\n return html`\n ${this.renderBody()}\n ${this.renderButton()}`;\n };\n }\n}\n"],
|
|
5
|
+
"mappings": "uQACA,GAAO,GAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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c,mBAIA,GAAZ,AAAC,EAAS,GAAE,AAvBd,EAuBc,uBAIA,GAAZ,AAAC,EAAS,GAAE,AA3Bd,EA2Bc,4BAIA,GAAZ,AAAC,EAAS,GAAE,AA/Bd,EA+Bc,2BAGA,GAAZ,AAAC,EAAS,GAAE,AAlCd,EAkCc,yBAGe,GAA3B,AAAC,EAAS,CAAC,KAAM,OAAO,CAAC,GAAE,AArC7B,EAqC6B,uBAOzB,GADF,AAAC,EAAS,CAAC,KAAM,OAAQ,QAAS,EAAI,CAAC,GACrC,AA5CJ,EA4CI,oBAKA,GADF,AAAC,EAAS,CAAC,KAAM,OAAQ,QAAS,EAAI,CAAC,GACrC,AAjDJ,EAiDI",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import{a as r,b as s}from"./chunk.RGGLFZST.js";import{a as g}from"./chunk.RXMGI7HR.js";import{a as n,d as l}from"./chunk.S4MESEBR.js";import{a,b as i,e as c}from"./chunk.HCMPRDIX.js";import{a as d}from"./chunk.Y2P62L7U.js";import{g as e}from"./chunk.5YJY6NT6.js";var p=a`
|
|
2
|
+
:host {
|
|
3
|
+
/* scw element */
|
|
4
|
+
position: relative;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
--margin-right: initial;
|
|
7
|
+
--margin-bottom: initial;
|
|
8
|
+
--gap-h-int: initial;
|
|
9
|
+
--gap-v-int: initial;
|
|
10
|
+
margin-right: var(--margin-right, var(--gap-h-int, initial));
|
|
11
|
+
margin-bottom: var(--margin-bottom, var(--gap-v-int, initial));
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([warning]) {
|
|
16
|
+
outline: 2px solid red !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([size=medium]) {
|
|
20
|
+
display: block;
|
|
21
|
+
background-color: rgba(0, 0, 0, 0);
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-flow: column nowrap;
|
|
24
|
+
justify-content: flex-start;
|
|
25
|
+
align-items: flex-start;
|
|
26
|
+
padding-left: 0px;
|
|
27
|
+
padding-right: 0px;
|
|
28
|
+
padding-top: 0px;
|
|
29
|
+
padding-bottom: 0px;
|
|
30
|
+
/*.image-box {
|
|
31
|
+
width: 100%;
|
|
32
|
+
padding-bottom: 38.8888888889%;
|
|
33
|
+
position: relative;
|
|
34
|
+
}*/
|
|
35
|
+
/*.image {
|
|
36
|
+
@include size-medium-image-mixins.box;
|
|
37
|
+
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
background-position: center;
|
|
41
|
+
background-size: cover;
|
|
42
|
+
}*/
|
|
43
|
+
/*.action {
|
|
44
|
+
@include size-medium-action-mixins.box;
|
|
45
|
+
@include size-medium-action-mixins.sizing;
|
|
46
|
+
}*/
|
|
47
|
+
}
|
|
48
|
+
:host([size=medium]) > *:not(:last-child) {
|
|
49
|
+
margin-bottom: calc(var(--scw-spacing-1) * 0.8);
|
|
50
|
+
--margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );
|
|
51
|
+
}
|
|
52
|
+
:host([size=medium]) .image-box {
|
|
53
|
+
height: 161px;
|
|
54
|
+
}
|
|
55
|
+
:host([size=medium]) .description {
|
|
56
|
+
text-align: LEFT;
|
|
57
|
+
font: var(--scw-type-text-font);
|
|
58
|
+
color: var(--scw-color-grey-02);
|
|
59
|
+
align-self: stretch;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([size=small]) {
|
|
63
|
+
display: block;
|
|
64
|
+
background-color: rgba(0, 0, 0, 0);
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-flow: column nowrap;
|
|
67
|
+
justify-content: flex-start;
|
|
68
|
+
align-items: flex-start;
|
|
69
|
+
padding-left: 0px;
|
|
70
|
+
padding-right: 0px;
|
|
71
|
+
padding-top: 0px;
|
|
72
|
+
padding-bottom: 0px;
|
|
73
|
+
/*.image-box {
|
|
74
|
+
width: 100%;
|
|
75
|
+
padding-bottom: 88.9473684211%;
|
|
76
|
+
position: relative;
|
|
77
|
+
}*/
|
|
78
|
+
/*.image {
|
|
79
|
+
@include size-small-image-mixins.box;
|
|
80
|
+
|
|
81
|
+
position: absolute;
|
|
82
|
+
inset: 0;
|
|
83
|
+
background-position: center;
|
|
84
|
+
background-size: cover;
|
|
85
|
+
}*/
|
|
86
|
+
}
|
|
87
|
+
:host([size=small]) > *:not(:last-child) {
|
|
88
|
+
margin-bottom: calc(var(--scw-spacing-1) * 0.8);
|
|
89
|
+
--margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );
|
|
90
|
+
}
|
|
91
|
+
:host([size=small]) .image-box {
|
|
92
|
+
height: 169px;
|
|
93
|
+
}
|
|
94
|
+
:host([size=small]) .description {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
:host([size=small]) .action {
|
|
98
|
+
display: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host .super-heading.mortgage {
|
|
102
|
+
text-align: LEFT;
|
|
103
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
104
|
+
color: var(--scw-color-04, var(--scw-color-mortgage-04));
|
|
105
|
+
align-self: stretch;
|
|
106
|
+
}
|
|
107
|
+
:host .super-heading.savings {
|
|
108
|
+
text-align: LEFT;
|
|
109
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
110
|
+
color: var(--scw-color-04, var(--scw-color-savings-04));
|
|
111
|
+
align-self: stretch;
|
|
112
|
+
}
|
|
113
|
+
:host .super-heading.student {
|
|
114
|
+
text-align: LEFT;
|
|
115
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
116
|
+
color: var(--scw-color-04, var(--scw-color-student-04));
|
|
117
|
+
align-self: stretch;
|
|
118
|
+
}
|
|
119
|
+
:host .super-heading.investments {
|
|
120
|
+
text-align: LEFT;
|
|
121
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
122
|
+
color: var(--scw-color-04, var(--scw-color-investments-04));
|
|
123
|
+
align-self: stretch;
|
|
124
|
+
}
|
|
125
|
+
:host .super-heading.checking {
|
|
126
|
+
text-align: LEFT;
|
|
127
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
128
|
+
color: var(--scw-color-04, var(--scw-color-checking-04));
|
|
129
|
+
align-self: stretch;
|
|
130
|
+
}
|
|
131
|
+
:host .super-heading.credit-cards {
|
|
132
|
+
text-align: LEFT;
|
|
133
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
134
|
+
color: var(--scw-color-04, var(--scw-color-credit-cards-04));
|
|
135
|
+
align-self: stretch;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host {
|
|
139
|
+
display: block;
|
|
140
|
+
background-color: var(--scw-color, rgba(0, 0, 0, 0));
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-flow: column nowrap;
|
|
143
|
+
justify-content: flex-start;
|
|
144
|
+
align-items: flex-start;
|
|
145
|
+
padding-left: 0px;
|
|
146
|
+
padding-right: 0px;
|
|
147
|
+
padding-top: 0px;
|
|
148
|
+
padding-bottom: 0px;
|
|
149
|
+
/*.image {
|
|
150
|
+
@include default-image-mixins.box;
|
|
151
|
+
|
|
152
|
+
position: absolute;
|
|
153
|
+
inset: 0;
|
|
154
|
+
background-position: center;
|
|
155
|
+
background-size: cover;
|
|
156
|
+
}*/
|
|
157
|
+
}
|
|
158
|
+
:host > *:not(:last-child) {
|
|
159
|
+
margin-bottom: calc(var(--scw-spacing-1) * 0.8);
|
|
160
|
+
--margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );
|
|
161
|
+
}
|
|
162
|
+
:host .image-box {
|
|
163
|
+
background-color: var(--scw-color-09, var(--scw-color-grey-09));
|
|
164
|
+
border-radius: 10px 10px 10px 10px;
|
|
165
|
+
align-self: stretch;
|
|
166
|
+
flex: 1;
|
|
167
|
+
flex: initial;
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
height: 345px;
|
|
170
|
+
}
|
|
171
|
+
:host .heading {
|
|
172
|
+
background-color: rgba(0, 0, 0, 0);
|
|
173
|
+
align-self: stretch;
|
|
174
|
+
}
|
|
175
|
+
:host .super-heading {
|
|
176
|
+
text-align: LEFT;
|
|
177
|
+
font: var(--scw-type-text-bold-condensed-font);
|
|
178
|
+
color: var(--scw-color-03, var(--scw-color-primary-03));
|
|
179
|
+
align-self: stretch;
|
|
180
|
+
}
|
|
181
|
+
:host .description {
|
|
182
|
+
text-align: LEFT;
|
|
183
|
+
font: var(--scw-type-text-06-font);
|
|
184
|
+
color: var(--scw-color-02, var(--scw-color-grey-02));
|
|
185
|
+
align-self: stretch;
|
|
186
|
+
}
|
|
187
|
+
:host .action {
|
|
188
|
+
width: 83px;
|
|
189
|
+
height: 32px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
:host([action=none]) {
|
|
193
|
+
pointer-events: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
:host([action=whole]) {
|
|
197
|
+
pointer-events: all;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:host([action=whole]:hover) {
|
|
201
|
+
cursor: pointer;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([action=whole]:focus-visible) {
|
|
205
|
+
outline: none;
|
|
206
|
+
box-shadow: var(--scw-effect-focus-shadow);
|
|
207
|
+
border-radius: 10px 10px 4px 4px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:host([action=link]) {
|
|
211
|
+
pointer-events: none;
|
|
212
|
+
}
|
|
213
|
+
:host([action=link]) scw-link {
|
|
214
|
+
pointer-events: all;
|
|
215
|
+
}`;var t=class extends l{constructor(){super();this.size="large";this.action="none";this.element="card",this.clickHandler=this.clickHandler.bind(this);let o=g();this.headerNodeName=r(`scw-${"heading"}${o}`),this.imageNodeName=r(`scw-${"image"}${o}`),this.linkNodeName=r(`scw-${"link"}${o}`)}static get styles(){return[super.styles,p]}parseAndValidateLightDom(){d(this),super.parseAndValidateLightDom()}clickHandler(o){o.stopPropagation(),this.click()}warn(o){this.heading=`error: ${o}`,c.prototype.warn.call(this,o)}renderImage(){if((this.src||this.srcset)&&this.alt)return s`
|
|
216
|
+
<scw-image
|
|
217
|
+
class="image-box"
|
|
218
|
+
src="${n(this.src)}"
|
|
219
|
+
srcset="${n(this.srcset)}"
|
|
220
|
+
alt="${this.alt}"
|
|
221
|
+
object-fit="cover">
|
|
222
|
+
</scw-image>
|
|
223
|
+
`}renderButton(){return this.action==="link"?s`
|
|
224
|
+
<scw-link
|
|
225
|
+
aria-label="${this.linkLabel?this.linkLabel:"no label"}"
|
|
226
|
+
@click="${this.clickHandler}">
|
|
227
|
+
</scw-link>`:null}getSizeStringForHeader(){switch(this.size){case"large":return"h1";case"medium":return"h2";case"small":return"h3"}}renderBody(){return s`
|
|
228
|
+
${this.renderImage()}
|
|
229
|
+
${this.superHeading?s`
|
|
230
|
+
<div class="super-heading">
|
|
231
|
+
${this.superHeading}
|
|
232
|
+
</div>`:""}
|
|
233
|
+
<scw-heading
|
|
234
|
+
style="--scw-color-04: var( --scw-color-grey-02 );"
|
|
235
|
+
dynamic class="heading"
|
|
236
|
+
aria-label="${n(this.heading)}"
|
|
237
|
+
size="${this.getSizeStringForHeader()}">
|
|
238
|
+
</scw-heading>
|
|
239
|
+
${this.description?s`
|
|
240
|
+
<div class="description">
|
|
241
|
+
${this.description}
|
|
242
|
+
</div>`:""}`}render(){return this.action==="whole"?this.renderBody():s`
|
|
243
|
+
${this.renderBody()}
|
|
244
|
+
${this.renderButton()}`}};e([i()],t.prototype,"src",2),e([i()],t.prototype,"srcset",2),e([i()],t.prototype,"alt",2),e([i()],t.prototype,"heading",2),e([i()],t.prototype,"superHeading",2),e([i()],t.prototype,"description",2),e([i()],t.prototype,"linkLabel",2),e([i({type:String,reflect:!0})],t.prototype,"size",2),e([i({type:String,reflect:!0})],t.prototype,"action",2);export{t as a};
|
|
245
|
+
//# sourceMappingURL=chunk.QXE7UNSK.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sass-plugin-0:/Users/scottrouse/Workspace/scu-design-system-mono/scu-web-components/src/scw-card/scss/scw-card.scss", "../../src/scw-card/ScwCard.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from \"lit-element/lit-element.js\";\nexport default css`\n:host {\n /* scw element */\n position: relative;\n box-sizing: border-box;\n --margin-right: initial;\n --margin-bottom: initial;\n --gap-h-int: initial;\n --gap-v-int: initial;\n margin-right: var(--margin-right, var(--gap-h-int, initial));\n margin-bottom: var(--margin-bottom, var(--gap-v-int, initial));\n display: block;\n}\n\n:host([warning]) {\n outline: 2px solid red !important;\n}\n\n:host([size=medium]) {\n display: block;\n background-color: rgba(0, 0, 0, 0);\n display: flex;\n flex-flow: column nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-left: 0px;\n padding-right: 0px;\n padding-top: 0px;\n padding-bottom: 0px;\n /*.image-box {\n width: 100%;\n padding-bottom: 38.8888888889%;\n position: relative;\n }*/\n /*.image {\n @include size-medium-image-mixins.box;\n\n position: absolute;\n inset: 0;\n background-position: center;\n background-size: cover;\n }*/\n /*.action {\n @include size-medium-action-mixins.box;\n @include size-medium-action-mixins.sizing;\n }*/\n}\n:host([size=medium]) > *:not(:last-child) {\n margin-bottom: calc(var(--scw-spacing-1) * 0.8);\n --margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );\n}\n:host([size=medium]) .image-box {\n height: 161px;\n}\n:host([size=medium]) .description {\n text-align: LEFT;\n font: var(--scw-type-text-font);\n color: var(--scw-color-grey-02);\n align-self: stretch;\n}\n\n:host([size=small]) {\n display: block;\n background-color: rgba(0, 0, 0, 0);\n display: flex;\n flex-flow: column nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-left: 0px;\n padding-right: 0px;\n padding-top: 0px;\n padding-bottom: 0px;\n /*.image-box {\n width: 100%;\n padding-bottom: 88.9473684211%;\n position: relative;\n }*/\n /*.image {\n @include size-small-image-mixins.box;\n\n position: absolute;\n inset: 0;\n background-position: center;\n background-size: cover;\n }*/\n}\n:host([size=small]) > *:not(:last-child) {\n margin-bottom: calc(var(--scw-spacing-1) * 0.8);\n --margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );\n}\n:host([size=small]) .image-box {\n height: 169px;\n}\n:host([size=small]) .description {\n display: none;\n}\n:host([size=small]) .action {\n display: none;\n}\n\n:host .super-heading.mortgage {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-mortgage-04));\n align-self: stretch;\n}\n:host .super-heading.savings {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-savings-04));\n align-self: stretch;\n}\n:host .super-heading.student {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-student-04));\n align-self: stretch;\n}\n:host .super-heading.investments {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-investments-04));\n align-self: stretch;\n}\n:host .super-heading.checking {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-checking-04));\n align-self: stretch;\n}\n:host .super-heading.credit-cards {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-04, var(--scw-color-credit-cards-04));\n align-self: stretch;\n}\n\n:host {\n display: block;\n background-color: var(--scw-color, rgba(0, 0, 0, 0));\n display: flex;\n flex-flow: column nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-left: 0px;\n padding-right: 0px;\n padding-top: 0px;\n padding-bottom: 0px;\n /*.image {\n @include default-image-mixins.box;\n\n position: absolute;\n inset: 0;\n background-position: center;\n background-size: cover;\n }*/\n}\n:host > *:not(:last-child) {\n margin-bottom: calc(var(--scw-spacing-1) * 0.8);\n --margin-bottom: calc( var( --scw-spacing-1 ) * 0.8 );\n}\n:host .image-box {\n background-color: var(--scw-color-09, var(--scw-color-grey-09));\n border-radius: 10px 10px 10px 10px;\n align-self: stretch;\n flex: 1;\n flex: initial;\n overflow: hidden;\n height: 345px;\n}\n:host .heading {\n background-color: rgba(0, 0, 0, 0);\n align-self: stretch;\n}\n:host .super-heading {\n text-align: LEFT;\n font: var(--scw-type-text-bold-condensed-font);\n color: var(--scw-color-03, var(--scw-color-primary-03));\n align-self: stretch;\n}\n:host .description {\n text-align: LEFT;\n font: var(--scw-type-text-06-font);\n color: var(--scw-color-02, var(--scw-color-grey-02));\n align-self: stretch;\n}\n:host .action {\n width: 83px;\n height: 32px;\n}\n\n:host([action=none]) {\n pointer-events: none;\n}\n\n:host([action=whole]) {\n pointer-events: all;\n}\n\n:host([action=whole]:hover) {\n cursor: pointer;\n}\n\n:host([action=whole]:focus-visible) {\n outline: none;\n box-shadow: var(--scw-effect-focus-shadow);\n border-radius: 10px 10px 4px 4px;\n}\n\n:host([action=link]) {\n pointer-events: none;\n}\n:host([action=link]) scw-link {\n pointer-events: all;\n}`;\n", "import {property} from 'lit/decorators.js';\nimport {html} from 'lit/static-html.js';// import {html} from 'lit';\nimport {unsafeStatic} from 'lit/static-html.js';// USE DIFFERENT 'html'!!!!\nimport styles from './scss/scw-card.scss';\nimport ScwComponent from '../scw-component/ScwComponent';\nimport {ScwCardSizes, ScwCardActions} from './scw-card-enums';\nimport parseLightDomCard from './scw-card-light-dom';\nimport ScwLinkBase from '../scw-link-base/ScwLinkBase';\nimport {Components} from '../utils/enums/Components';\nimport getSuffix from '../utils/suffix';\nimport {ScwHeadingSizes} from '../scw-heading/scw-heading-enums';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\n/**\n * ScwCard a first LitElement web component\n * @class\n * @tag scw-card\n *\n * @slot [default=\"<img src alt /><h1, h2, h3 /><sup /><p />\"]\n The parts of scw-card are configured via nested html elements.\n img defines the image, heading the main heading, sup the category heading,\n and p the descriptive text. Only headings is required (with src, srcset,\n and alt attributes).\n * @slot [default=\"<img src alt /><h1, h2, h3 /><sup /><p /><a />\"]\n Adding an anchor will show a link.\n * @slot [default=\"<a><img src alt /><h1, h2, h3 /><sup /><p /></a>\"]\n Wrapping the entire content in an anchor will make it interactive\n */\nexport default class ScwCard extends ScwLinkBase {\n /**\n * styles\n */\n static get styles() {\n return [\n super.styles,\n styles,\n ];\n }\n\n // ============== ScwCard ====================================================\n /** (ScwCard) The src of the image within the card */\n @property() src: string | undefined;\n\n /** (ScwCard) The srcset of the image within the card */\n @property() srcset: string | undefined;\n\n /** (ScwCard) Alternative description of the image. */\n @property() alt: string | undefined;\n\n /** (ScwCard) Main title or header of the card (determined by\n * <h1, h2, h3> content) */\n @property() heading: string | undefined;\n\n /** (ScwCard) Super title, describing a category or area pertaining to title\n * (determined by <sup> content) */\n @property() superHeading: string | undefined;\n\n /** (ScwCard) Fuller description of what the card is about (determined by\n * <p> content) */\n @property() description: string | undefined;\n\n /** (ScwCard) Label on the link */\n @property() linkLabel : string | undefined;\n\n // ----------- END STATES ----------------------------------------------------\n /** (ScwCard) Readonly - Size of the card. This\n * is determined by the nested html content (h1 = large,\n * h2 = medium, h3 = small). */\n @property({type: String, reflect: true})\n size: ScwCardSizes = ScwCardSizes.large;\n\n /** (ScwCard) Readonly - The type of action (whole card, link, or none).\n * This is determined by the use of an anchor tag. */\n @property({type: String, reflect: true})\n action: ScwCardActions = ScwCardActions.none;\n\n /** scw-header with versioning suffix */\n headerNodeName : any;\n\n /** scw-image with versioning suffix */\n imageNodeName : any;\n\n /** scw-link with versioning suffix */\n linkNodeName : any;\n\n /**\n * Constructor\n */\n constructor() {\n super();\n this.element = Components.card;\n this.clickHandler = this.clickHandler.bind(this);\n\n const suffix = getSuffix();\n this.headerNodeName = unsafeStatic(`scw-${Components.heading}${suffix}`);\n this.imageNodeName = unsafeStatic(`scw-${Components.image}${suffix}`);\n this.linkNodeName = unsafeStatic(`scw-${Components.link}${suffix}`);\n }\n\n /** parseAndValidateLightDom, just adding local parsing and validation */\n parseAndValidateLightDom() {\n parseLightDomCard(this);\n super.parseAndValidateLightDom();\n }\n\n /**\n * Handle click event from link so it doesn't trigger twice\n * @param {Event} evt\n */\n clickHandler(evt : Event) {\n evt.stopPropagation();\n this.click();\n }\n\n /**\n * change the main heading to be the error.\n * @param {string} message describing warning\n */\n warn( message: string ) {\n this.heading = `error: ${message}`;\n ScwComponent.prototype.warn.call(this, message );\n }\n\n /**\n * Render image area\n * @return {object} component DOM\n */\n renderImage() {\n if (\n ( this.src || this.srcset ) &&\n this.alt ) {\n return html`\n <scw-image\n class=\"image-box\"\n src=\"${ifDefined(this.src)}\"\n srcset=\"${ifDefined(this.srcset)}\"\n alt=\"${this.alt}\"\n object-fit=\"cover\">\n </scw-image>\n `;\n }\n }\n\n /**\n * Render link area\n * @return {object} component DOM\n */\n renderButton() {\n if ( this.action === ScwCardActions.link) {\n return html`\n <scw-link\n aria-label=\"${this.linkLabel ? this.linkLabel : 'no label'}\" \n @click=\"${this.clickHandler}\">\n </scw-link>`;\n }\n return null;\n }\n\n /**\n * get string to use in the size attribute of scw-header\n * @return {string}\n */\n getSizeStringForHeader() {\n switch (this.size) {\n case ScwCardSizes.large:\n return 'h1';\n case ScwCardSizes.medium:\n return 'h2';\n case ScwCardSizes.small:\n return 'h3';\n }\n }\n\n /**\n * render body\n * @return {object} component DOM\n */\n renderBody() : object {\n return html`\n ${this.renderImage()}\n ${this.superHeading ?\n html`\n <div class=\"super-heading\">\n ${this.superHeading}\n </div>` : ''\n }\n <scw-heading\n style=\"--scw-color-04: var( --scw-color-grey-02 );\"\n dynamic class=\"heading\"\n aria-label=\"${ifDefined(this.heading)}\"\n size=\"${this.getSizeStringForHeader() as ScwHeadingSizes}\">\n </scw-heading>\n ${this.description ?\n html`\n <div class=\"description\">\n ${this.description}\n </div>` : ''\n }`;\n }\n\n /**\n * render\n * @return {object} component DOM\n */\n render() : object {\n if (this.action === ScwCardActions.whole) {\n return this.renderBody();\n } else {\n return html`\n ${this.renderBody()}\n ${this.renderButton()}`;\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BAC5B,KAAK,uBAAuB;AAAA;AAAA,SAErC,KAAK,YACJ;AAAA;AAAA,cAEI,KAAK;AAAA,kBACC,IAElB,CAMA,QAAkB,CAChB,MAAI,MAAK,SAAW,QACX,KAAK,WAAW,EAEhB;AAAA,UACH,KAAK,WAAW;AAAA,UAChB,KAAK,aAAa,GAE1B,CACF,EA5Kc,GAAZ,AAAC,EAAS,GAAE,AAbd,EAac,mBAGA,GAAZ,AAAC,EAAS,GAAE,AAhBd,EAgBc,sBAGA,GAAZ,AAAC,EAAS,GAAE,AAnBd,EAmBc,mBAIA,GAAZ,AAAC,EAAS,GAAE,AAvBd,EAuBc,uBAIA,GAAZ,AAAC,EAAS,GAAE,AA3Bd,EA2Bc,4BAIA,GAAZ,AAAC,EAAS,GAAE,AA/Bd,EA+Bc,2BAGA,GAAZ,AAAC,EAAS,GAAE,AAlCd,EAkCc,yBAOV,GADF,AAAC,EAAS,CAAC,KAAM,OAAQ,QAAS,EAAI,CAAC,GACrC,AAzCJ,EAyCI,oBAKA,GADF,AAAC,EAAS,CAAC,KAAM,OAAQ,QAAS,EAAI,CAAC,GACrC,AA9CJ,EA8CI",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{a as h}from"./chunk.O3SA7BGC.js";import{a as g}from"./chunk.WPOS6KBC.js";import{a as l,d as m}from"./chunk.S4MESEBR.js";import{a as c,b as e,c as n}from"./chunk.HCMPRDIX.js";import{a as p}from"./chunk.WO7EIYQ3.js";import{b}from"./chunk.ZZQE6TG6.js";import{a as r}from"./chunk.ZS4C3T6Z.js";import{g as i}from"./chunk.5YJY6NT6.js";var u=c`
|
|
2
|
+
:host {
|
|
3
|
+
/* scw element */
|
|
4
|
+
position: relative;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
--margin-right: initial;
|
|
7
|
+
--margin-bottom: initial;
|
|
8
|
+
--gap-h-int: initial;
|
|
9
|
+
--gap-v-int: initial;
|
|
10
|
+
margin-right: var(--margin-right, var(--gap-h-int, initial));
|
|
11
|
+
margin-bottom: var(--margin-bottom, var(--gap-v-int, initial));
|
|
12
|
+
display: block;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([warning]) {
|
|
16
|
+
outline: 2px solid red !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host .scw-link-base {
|
|
20
|
+
display: block;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
position: relative;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
:host .scw-link-base img {
|
|
27
|
+
display: block;
|
|
28
|
+
position: absolute;
|
|
29
|
+
}`;var t=class extends m{constructor(){super();this.preload=!1;this.noLazyLoading=!1;this.resizeBreakpoints=`${"sm"}, ${"md"}, ${"lg"}`;this._isIntersecting=!1;this._hasIntersected=!1;this._resizeBreakpoints=[];this.element="image"}static get styles(){return[super.styles,u]}firstUpdated(s){super.firstUpdated(s),this._resizeHandler=this._resizeHandler.bind(this),this._intersectionHandler=this._intersectionHandler.bind(this),this.noLazyLoading?this._hasIntersected=!0:h.registerCallback(this,this._intersectionHandler),this.establishResizeBreakpoints()}parseAndValidateLightDom(){super.parseAndValidateLightDom(),g(this)}disconnectedCallback(){super.disconnectedCallback(),this._lightDomMutationObserver&&this._lightDomMutationObserver.disconnect(),h.unregisterCallback(this,this._intersectionHandler),p.removeBreakpointListener(this._resizeBreakpoints,this._resizeHandler)}establishResizeBreakpoints(){if(this.srcset){let s=this.resizeBreakpoints.split(","),o=b();this._resizeBreakpoints=[],s.map(d=>{let a=o[d.trim()];a&&this._resizeBreakpoints.push(a)}),p.addBreakpointListener(this._resizeBreakpoints,this._resizeHandler),this._resizeHandler()}}_resizeHandler(){this._imageSize=this.clientWidth}_intersectionHandler(s){this._isIntersecting=s,this._hasIntersected=this._hasIntersected?!0:s}renderContainerCss(){if(this.aspectRatio){let s=this.aspectRatio.split(":"),o=parseFloat(s[0]);return`
|
|
30
|
+
display: block;
|
|
31
|
+
padding-bottom: ${parseFloat(s[1])/o*100}%;
|
|
32
|
+
height: 0;`}return""}renderImgCss(){return this.objectFit||this.objectPosition?`
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 0; left: 0;
|
|
35
|
+
width: 100%; height: 100%;
|
|
36
|
+
object-fit: ${this.objectFit?this.objectFit:"contain"};
|
|
37
|
+
object-position: ${this.objectPosition?this.objectPosition:"center"}`:""}renderContent(){return this._hasIntersected?this._imageSize&&this.srcset?r`
|
|
38
|
+
<img
|
|
39
|
+
style="${this.renderImgCss()}"
|
|
40
|
+
srcset="${this.srcset}"
|
|
41
|
+
sizes="${this._imageSize}px"
|
|
42
|
+
preload="${l(this.preload)}"
|
|
43
|
+
alt="${this.alt?this.alt:"NO ALT!"}" />`:r`
|
|
44
|
+
<img
|
|
45
|
+
style="${this.renderImgCss()}"
|
|
46
|
+
src="${this.src?this.src:!1}"
|
|
47
|
+
preload="${l(this.preload)}"
|
|
48
|
+
alt="${this.alt?this.alt:"NO ALT!"}" />`:r``}render(){return this.renderLink(this.renderContent(),this.renderContainerCss())}};i([e({type:String,attribute:"aspect-ratio"})],t.prototype,"aspectRatio",2),i([e({type:String,attribute:"object-fit"})],t.prototype,"objectFit",2),i([e({type:String,attribute:"object-position"})],t.prototype,"objectPosition",2),i([e({type:String})],t.prototype,"srcset",2),i([e({type:String})],t.prototype,"src",2),i([e({type:String})],t.prototype,"alt",2),i([e({type:Boolean})],t.prototype,"preload",2),i([e({type:Boolean,attribute:"no-lazy-loading"})],t.prototype,"noLazyLoading",2),i([e({type:String,attribute:"resize-breakpoints"})],t.prototype,"resizeBreakpoints",2),i([n()],t.prototype,"_imageSize",2),i([n()],t.prototype,"_isIntersecting",2),i([n()],t.prototype,"_hasIntersected",2);export{t as a};
|
|
49
|
+
//# sourceMappingURL=chunk.R4YGOT4Y.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sass-plugin-0:/Users/scottrouse/Workspace/scu-design-system-mono/scu-web-components/src/scw-image/scss/scw-image.scss", "../../src/scw-image/ScwImage.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from \"lit-element/lit-element.js\";\nexport default css`\n:host {\n /* scw element */\n position: relative;\n box-sizing: border-box;\n --margin-right: initial;\n --margin-bottom: initial;\n --gap-h-int: initial;\n --gap-v-int: initial;\n margin-right: var(--margin-right, var(--gap-h-int, initial));\n margin-bottom: var(--margin-bottom, var(--gap-v-int, initial));\n display: block;\n}\n\n:host([warning]) {\n outline: 2px solid red !important;\n}\n\n:host .scw-link-base {\n display: block;\n overflow: hidden;\n position: relative;\n width: 100%;\n height: 100%;\n}\n:host .scw-link-base img {\n display: block;\n position: absolute;\n}`;\n", "import {html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport styles from './scss/scw-image.scss';\nimport {Components} from '../utils/enums/Components';\n// import resizeSingleton from '../utils/observers/resizeObserverSingleton';\nimport mediaQueryListSingleton\n from '../utils/observers/mediaQueryListSingleton';\nimport intersectionObserverSingleton\n from '../utils/observers/intersectionObserverSingleton';\nimport ScwLinkBase from '../scw-link-base/ScwLinkBase';\nimport validate from './scw-image-validate';\nimport {BreakpointNames, Breakpoint} from '../utils/responsive/BreakpointTypes';\n// import ResponsiveElement from '../utils/responsive/ResponsiveElement';\nimport {breakpointLookup} from '../utils/responsive/breakpoints';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\n/**\n * ScwImage\n * @class\n * @tag scw-image\n *\n * @slot [default=\"<img src alt />\"]\n Base image to display. This is generally a LQIP (Low Quality Image\n Placeholder)\n * @slot [default=\"<a href target><source /><img src alt /></a>\"]\n (OPTIONAL) anchor (for SEO) will determine the label, href, and target in\n addition to size and label.\n */\nexport default class ScwImage extends ScwLinkBase {\n /**\n * styles\n */\n static get styles() {\n return [\n super.styles,\n styles,\n ];\n }\n\n // ============== ScwImage =================================================\n /** (ScwImage) Width:Height ratio */\n @property({type: String, attribute: 'aspect-ratio'})\n aspectRatio: string | undefined;// = '2:1';\n\n /** (ScwImage) Object Fit CSS */\n @property({type: String, attribute: 'object-fit'})\n objectFit: string | undefined;// = 'contain';\n\n /** (ScwImage) Object Position CSS */\n @property({type: String, attribute: 'object-position'})\n objectPosition: string | undefined;// = 'center';\n\n /** (ScwImage) srcset of image */\n @property({type: String})\n srcset: string | undefined;\n\n /** (ScwImage) src of image */\n @property({type: String})\n src: string | undefined;// NOTE: \"#\" don't work in chrome w/ inline imgs\n\n /** (ScwImage) alt of image */\n @property({type: String})\n alt: string | undefined;\n\n /** (ScwImage) whether to preload image or not */\n @property({type: Boolean})\n preload: boolean = false;\n\n /** (ScwImage) turn off lazy loading */\n @property({type: Boolean, attribute: 'no-lazy-loading'})\n noLazyLoading: boolean = false;\n\n /** (ScwImage) establishes when (via the name of the breakpoint)\n * the image figures out it's sizing for srcset */\n @property({type: String, attribute: 'resize-breakpoints'})\n resizeBreakpoints: string = `${\n BreakpointNames.breakpointSM}, ${\n BreakpointNames.breakpointMD}, ${\n BreakpointNames.breakpointLG}`;\n\n // ====== STATES =============================================================\n /** (ScwImage) the image size derived from resize observer */\n @state()\n _imageSize : number | undefined;\n\n /** (ScwImage) determines whether element is intersecting */\n @state()\n _isIntersecting : boolean = false;\n\n /** (ScwImage) determines whether element has intersected once */\n @state()\n _hasIntersected : boolean = false;\n\n _resizeBreakpoints: Breakpoint[] = [];\n\n /** Constructor */\n constructor() {\n super();\n this.element = Components.image;\n }\n\n /**\n * first updated\n * @param {Map<string | number | symbol, unknown>} changedProps\n */\n firstUpdated(changedProps: Map<string | number | symbol, unknown>) {\n super.firstUpdated(changedProps);\n this._resizeHandler = this._resizeHandler.bind(this);\n this._intersectionHandler = this._intersectionHandler.bind(this);\n if (!this.noLazyLoading) {\n intersectionObserverSingleton.registerCallback(\n this, this._intersectionHandler,\n );\n } else {\n // resizeSingleton.registerCallback(this, this._resizeHandler);\n this._hasIntersected = true;\n }\n\n this.establishResizeBreakpoints();\n }\n\n /** parseAndValidateLightDom, just adding local parsing and validation */\n parseAndValidateLightDom() {\n super.parseAndValidateLightDom();\n validate( this );\n }\n\n /**\n * disconnect from dom\n */\n disconnectedCallback() {\n super.disconnectedCallback();\n if (this._lightDomMutationObserver) {\n this._lightDomMutationObserver.disconnect();\n }\n intersectionObserverSingleton.unregisterCallback(\n this, this._intersectionHandler,\n );\n mediaQueryListSingleton.removeBreakpointListener(\n this._resizeBreakpoints,\n this._resizeHandler,\n );\n }\n\n /**\n * Establish Resize Breakpoints\n */\n establishResizeBreakpoints() {\n if (this.srcset) {\n const resizeBreakpointsArr = this.resizeBreakpoints.split(',');\n const bpLookup = breakpointLookup();\n this._resizeBreakpoints = [];\n resizeBreakpointsArr.map((bp) => {\n const bpObj = bpLookup[bp.trim()];\n if (bpObj) {\n this._resizeBreakpoints.push(bpObj);\n }\n });\n mediaQueryListSingleton.addBreakpointListener(\n this._resizeBreakpoints,\n this._resizeHandler,\n );\n this._resizeHandler();// need a first _imageSize\n }\n }\n\n /**\n * handle resize events\n */\n _resizeHandler() {\n this._imageSize = this.clientWidth;\n }\n\n /**\n * handle resize events\n * @param {boolean} intersecting\n * @param {number} ratio\n */\n _intersectionHandler(intersecting: boolean) {// }, ratio: number) {\n this._isIntersecting = intersecting;\n // images only render once...\n this._hasIntersected = this._hasIntersected ? true : intersecting;\n }\n\n /**\n * Translate aspect ration string to a number (percent)\n * @return {string}\n */\n renderContainerCss() {\n if ( this.aspectRatio) {\n const aspectRatioArr = this.aspectRatio.split(':');\n const w = parseFloat(aspectRatioArr[0]);\n const h = parseFloat(aspectRatioArr[1]);\n const percent = (h / w) * 100;\n return `\n display: block;\n padding-bottom: ${percent}%;\n height: 0;`;\n }\n return ``;\n }\n\n /**\n * Css for image\n * @return {string}\n */\n renderImgCss() : string {\n if ( this.objectFit || this.objectPosition ) { // this.aspectRatio ) {\n return `\n position: absolute;\n top: 0; left: 0;\n width: 100%; height: 100%;\n object-fit: ${this.objectFit ? this.objectFit : 'contain'};\n object-position: ${this.objectPosition ?\n this.objectPosition : 'center'}`;\n } else {\n return ``;\n }\n }\n\n /**\n * render\n * @return {object} component DOM\n */\n renderContent(): object {\n if (this._hasIntersected) {\n if (this._imageSize && this.srcset) {\n return html`\n <img\n style=\"${this.renderImgCss()}\"\n srcset=\"${this.srcset}\"\n sizes=\"${this._imageSize}px\"\n preload=\"${ifDefined(this.preload)}\"\n alt=\"${this.alt ? this.alt : 'NO ALT!'}\" />`;\n } else {\n return html`\n <img\n style=\"${this.renderImgCss()}\"\n src=\"${this.src ? this.src : false}\"\n preload=\"${ifDefined(this.preload)}\"\n alt=\"${this.alt ? this.alt : 'NO ALT!'}\" />`;\n }\n } else {\n return html``;\n }\n }\n\n /**\n * render\n * @return {object} component DOM\n */\n render(): object {\n return this.renderLink(\n this.renderContent(),\n this.renderContainerCss(),\n );\n }\n}\n"],
|
|
5
|
+
"mappings": "gVACA,GAAO,GAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;GC2Bf,mBAAsC,EAAY,CAoEhD,aAAc,CACZ,MAAM,EA/BN,aAAmB,GAInB,mBAAyB,GAKzB,uBAA4B,GAC1B,SACA,SACA,OASJ,qBAA4B,GAI5B,qBAA4B,GAE5B,wBAAmC,CAAC,EAKlC,KAAK,QAAU,OACjB,WAnEY,SAAS,CACnB,MAAO,CACL,MAAM,OACN,CACF,CACF,CAoEA,aAAa,EAAsD,CACjE,MAAM,aAAa,CAAY,EAC/B,KAAK,eAAiB,KAAK,eAAe,KAAK,IAAI,EACnD,KAAK,qBAAuB,KAAK,qBAAqB,KAAK,IAAI,EAC/D,AAAK,KAAK,cAMR,KAAK,gBAAkB,GALvB,EAA8B,iBAC5B,KAAM,KAAK,oBACb,EAMF,KAAK,2BAA2B,CAClC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