scb-wc-test 0.1.277 → 0.1.279
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/mvc/components/scb-card/scb-card.js +106 -57
- package/package.json +2 -2
- package/scb-card/scb-card.d.ts +6 -0
- package/scb-card/scb-card.js +144 -69
- package/scb-wc-test.bundle.js +111 -62
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_}from"../../vendor/preload-helper.js";import{a as
|
|
2
|
+
import{_ as S}from"../../vendor/preload-helper.js";import{a as L,n as a,i as E,x as r,E as m,t as C}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-list/scb-list-item.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(n,c,o){try{customElements.get(n)||e(n,c,o)}catch(h){var l=String(h||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var F=Object.defineProperty,H=Object.getOwnPropertyDescriptor,w=t=>{throw TypeError(t)},s=(t,e,n,c)=>{for(var o=c>1?void 0:c?H(e,n):e,l=t.length-1,h;l>=0;l--)(h=t[l])&&(o=(c?h(e,n,o):h(o))||o);return c&&o&&F(e,n,o),o},B=(t,e,n)=>e.has(t)||w("Cannot "+n),D=(t,e,n)=>e.has(t)?w("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),f=(t,e,n)=>(B(t,e,"access private method"),n),y,z,k;const d={fromAttribute:t=>t??"",toAttribute:t=>typeof t!="string"||t.trim()===""?null:t};let i=class extends E{constructor(){super(...arguments),D(this,y),this.__managedSocialAttributes=new Set(["social-comments-text","social-comments","social-comments-href","social-likes-text","social-likes","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href"]),this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="vertical",this.size="large",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.href="",this.title="",this.subtitle="",this.supportingText="",this.commentsText="",this.commentsDisabled=!1,this.commentsHref="",this.likesText="",this.likesDisabled=!1,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.editEnabled=!1,this.deleteEnabled=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=t=>{const e=t.currentTarget.closest(".media");e&&e.classList.add("is-loaded")},this.__onKeyDown=t=>{const e=this.__effectiveHref();(t.key==="Enter"||t.key===" ")&&e&&(t.preventDefault(),this.__navigate(e,t))},this.__handleHrefNavigation=t=>{const e=this.__effectiveHref();e&&(t.target.closest("a")||this.__navigate(e,t))}}attributeChangedCallback(t,e,n){this.__isSyncingManagedSocialAttributes&&this.__managedSocialAttributes.has(t)||super.attributeChangedCallback(t,e,n)}get likeButton(){return this.type!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(t){const e=(t||"").trim();if(!e)return{w:640,h:360};const n=e.includes("/")?e.split("/"):e.includes(":")?e.split(":"):e.includes("x")?e.split("x"):null;if(n&&n.length===2){const o=Number(n[0]),l=Number(n[1]);if(o>0&&l>0)return{w:o,h:l}}const c=Number(e);return isFinite(c)&&c>0?{w:1e3,h:Math.round(1e3/c)}:{w:640,h:360}}__noWrapText(t){return(t??"").replace(/ /g," ").replace(/-/g,"‑")}__dispatchLikeEvent(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e})),this.dispatchEvent(new CustomEvent(t.replace("-",""),{bubbles:!0,composed:!0,detail:e}))}__dispatchSocialActionEvent(t,e){this.dispatchEvent(new CustomEvent(`social-${t}`,{bubbles:!0,composed:!0,detail:{action:t,originalEvent:e}}))}__dispatchCardNavigate(t,e){const n={href:t,originalEvent:e},c=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:n});if(this.dispatchEvent(c),c.defaultPrevented)return!1;const o=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:n});return this.dispatchEvent(o),!o.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__navigate(t,e){t&&this.__dispatchCardNavigate(t,e)&&window.open(t,"_self")}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return r`
|
|
3
3
|
<div class="media">
|
|
4
4
|
<slot name="media">
|
|
5
5
|
<scb-avatar variant="icon" label="${this.title}" icon-name="person"></scb-avatar>
|
|
6
6
|
</slot>
|
|
7
7
|
</div>
|
|
8
|
-
`;if(this.mediaHref||this.mediaSrcset){let e=Number(this.mediaWidth)||0,n=Number(this.mediaHeight)||0;const c=(this.mediaAspect||"").trim();if(!e||!n){const
|
|
8
|
+
`;if(this.mediaHref||this.mediaSrcset){let e=Number(this.mediaWidth)||0,n=Number(this.mediaHeight)||0;const c=(this.mediaAspect||"").trim();if(!e||!n){const h=this.__calcAspectWH(c||"16/9");e||(e=h.w),n||(n=h.h)}const o=`aspect-ratio:${c||`${e}/${n}`};`,l=this.mediaPlaceholder?"has-ph":"";return r`
|
|
9
9
|
<div class="media ${l}" style="${o}">
|
|
10
10
|
<slot name="media-sources"></slot>
|
|
11
11
|
<img
|
|
@@ -21,27 +21,27 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
21
21
|
@load=${this.__onImgLoad}
|
|
22
22
|
/>
|
|
23
23
|
</div>
|
|
24
|
-
`}return null}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__syncStringAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="string"&&e.trim()!==""?this.setAttribute(t,e):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="number"&&Number.isFinite(e)?this.setAttribute(t,String(e)):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{e?this.setAttribute(t,""):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.type==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const t=this.variant?`${this.variant.toLowerCase()}`:"",e=this.type==="list"||this.type==="container"?"vertical":this.direction?this.direction.toLowerCase():"vertical",n=this.__effectiveHref(),c=(this.type==="standard"||this.type==="social")&&!!n,o=c?"clickable":"",l=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",
|
|
24
|
+
`}return null}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__syncStringAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="string"&&e.trim()!==""?this.setAttribute(t,e):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncNumberAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{typeof e=="number"&&Number.isFinite(e)?this.setAttribute(t,String(e)):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncBooleanAttribute(t,e){this.__isSyncingManagedSocialAttributes=!0;try{e?this.setAttribute(t,""):this.removeAttribute(t)}finally{this.__isSyncingManagedSocialAttributes=!1}}__syncSocialAttributes(){this.type==="social"&&(this.__syncStringAttribute("social-comments-text",this.commentsText),this.__syncNumberAttribute("social-comments",this.comments),this.__syncStringAttribute("social-comments-href",this.commentsHref),this.__syncStringAttribute("social-likes-text",this.likesText),this.__syncNumberAttribute("social-likes",this.likes),this.__syncStringAttribute("social-likes-hover-content",this.likesHoverContent),this.__syncBooleanAttribute("social-has-liked",this.hasLiked),this.__syncBooleanAttribute("social-likes-interactive",this.likesInteractive),this.__syncBooleanAttribute("social-author",this.author),this.__syncStringAttribute("social-author-text",this.authorText),this.__syncStringAttribute("social-author-href",this.authorHref))}render(){const t=this.variant?`${this.variant.toLowerCase()}`:"",e=this.type==="list"||this.type==="container"?"vertical":this.direction?this.direction.toLowerCase():"vertical",n=this.__effectiveHref(),c=(this.type==="standard"||this.type==="social")&&!!n,o=c?"clickable":"",l=this.date instanceof Date?this.date.toISOString().slice(0,10):this.date||"",h=(g=!1)=>g?r`<a class="title" href="${n}" tabindex="-1"
|
|
25
25
|
>${this.title}</a
|
|
26
|
-
><md-icon>arrow_forward</md-icon>`:r`<span class="title">${this.title}</span>`,
|
|
26
|
+
><md-icon>arrow_forward</md-icon>`:r`<span class="title">${this.title}</span>`,T=()=>this.type==="container"?null:this.__mediaTemplate(),b=g=>r`
|
|
27
27
|
<div
|
|
28
28
|
class="scb-card ${t} ${e} ${o}"
|
|
29
29
|
@click=${c?this.__handleHrefNavigation:null}
|
|
30
30
|
@keydown=${c?this.__onKeyDown:null}
|
|
31
31
|
style="cursor:${c?"pointer":"default"};"
|
|
32
|
-
role=${c?"link"
|
|
33
|
-
tabindex=${c?"0"
|
|
32
|
+
role=${c?"link":m}
|
|
33
|
+
tabindex=${c?"0":m}
|
|
34
34
|
aria-label=${this.title||this.subtitle||"Kort"}
|
|
35
35
|
>
|
|
36
36
|
${c?r`<md-ripple></md-ripple>`:""}
|
|
37
|
-
${
|
|
38
|
-
${
|
|
37
|
+
${T()}
|
|
38
|
+
${g}
|
|
39
39
|
</div>
|
|
40
40
|
<md-focus-ring></md-focus-ring>
|
|
41
41
|
`;switch(this.type){case"standard":return b(r`
|
|
42
42
|
<div class="full-content">
|
|
43
43
|
<div class="top-content">
|
|
44
|
-
${this.title?r`<div class="header">${
|
|
44
|
+
${this.title?r`<div class="header">${h(!!n)}</div>`:""}
|
|
45
45
|
${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
|
|
46
46
|
${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
47
47
|
${l?r`<div class="date">${l}</div>`:""}
|
|
@@ -59,29 +59,30 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
59
59
|
<slot></slot>
|
|
60
60
|
</div>
|
|
61
61
|
</div>
|
|
62
|
-
`);case"social":const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
62
|
+
`);case"social":const g=this.commentsHref,_=p=>{p.stopPropagation()},v=p=>{const u=this.renderRoot?.querySelector(".scb-card");u&&(p?u.classList.add("no-hover"):u.classList.remove("no-hover"))},P=this.commentsText?`${this.commentsText}: `:"",A=this.likesText?`${this.likesText}: `:"",x=p=>u=>{u.stopPropagation(),this.__dispatchSocialActionEvent(p,u)},$=this.likesDisabled?m:r`
|
|
63
|
+
<span
|
|
64
|
+
class="likes"
|
|
65
|
+
@mouseenter=${()=>v(!0)}
|
|
66
|
+
@mouseleave=${()=>v(!1)}
|
|
67
|
+
>
|
|
68
|
+
${this.likesInteractive?r`
|
|
69
|
+
<scb-icon-button
|
|
70
|
+
id="like-button"
|
|
71
|
+
variant="standard"
|
|
72
|
+
icon="thumb_up"
|
|
73
|
+
?icon-filled=${this.hasLiked}
|
|
74
|
+
aria-label="${this.likesText||"Gilla"}"
|
|
75
|
+
@click=${p=>{p.stopPropagation(),this.hasLiked=!this.hasLiked,this.__dispatchLikeEvent("like-click",{hasLiked:this.hasLiked,likes:this.likes??0})}}
|
|
76
|
+
@keydown=${p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),p.stopPropagation(),this.hasLiked=!this.hasLiked,this.__dispatchLikeEvent("like-click",{hasLiked:this.hasLiked,likes:this.likes??0}))}}
|
|
77
|
+
@hover=${p=>{p.preventDefault(),p.stopPropagation(),this.__dispatchLikeEvent("like-hover",{hasLiked:this.hasLiked,likes:this.likes??0})}}
|
|
78
|
+
></scb-icon-button>
|
|
79
|
+
`:r`<md-icon>thumb_up</md-icon>`}
|
|
80
|
+
<span class="social-text">${A}${this.likes??0}</span>
|
|
81
|
+
</span>
|
|
82
|
+
`;return b(r`
|
|
82
83
|
<div class="full-content">
|
|
83
84
|
<div class="top-content">
|
|
84
|
-
${this.title?r`<div class="header">${
|
|
85
|
+
${this.title?r`<div class="header">${h(!!n)}</div>`:""}
|
|
85
86
|
${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
|
|
86
87
|
${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
87
88
|
${l?r`<div class="date">${l}</div>`:""}
|
|
@@ -93,31 +94,33 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
93
94
|
class="author social-text"
|
|
94
95
|
href="${this.authorHref||"#"}"
|
|
95
96
|
tabindex="0"
|
|
96
|
-
@click=${
|
|
97
|
-
@mouseenter=${()=>
|
|
98
|
-
@mouseleave=${()=>
|
|
97
|
+
@click=${_}
|
|
98
|
+
@mouseenter=${()=>v(!0)}
|
|
99
|
+
@mouseleave=${()=>v(!1)}
|
|
99
100
|
>${this.authorText}</a
|
|
100
101
|
>
|
|
101
102
|
`:""}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
103
|
+
${this.commentsDisabled?m:r`
|
|
104
|
+
<span
|
|
105
|
+
class="comments"
|
|
106
|
+
@mouseenter=${()=>v(!0)}
|
|
107
|
+
@mouseleave=${()=>v(!1)}
|
|
108
|
+
>
|
|
109
|
+
${g!==""?r`
|
|
110
|
+
<scb-icon-button
|
|
111
|
+
href="${g}"
|
|
112
|
+
tabindex="0"
|
|
113
|
+
@click=${_}
|
|
114
|
+
variant="standard"
|
|
115
|
+
icon="comment"
|
|
116
|
+
aria-label="Gå till kommentarer"
|
|
117
|
+
></scb-icon-button>
|
|
118
|
+
`:r`
|
|
119
|
+
<md-icon>comment</md-icon>
|
|
120
|
+
`}
|
|
121
|
+
<span class="social-text">${P}${this.comments??0}</span>
|
|
122
|
+
</span>
|
|
123
|
+
`}
|
|
121
124
|
${this.likesHoverContent?r`
|
|
122
125
|
<scb-tooltip
|
|
123
126
|
variant="rich"
|
|
@@ -126,9 +129,42 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
126
129
|
trigger="hover"
|
|
127
130
|
position="right"
|
|
128
131
|
>
|
|
129
|
-
${
|
|
132
|
+
${$}
|
|
130
133
|
</scb-tooltip>
|
|
131
|
-
|
|
134
|
+
`:$}
|
|
135
|
+
${this.replyEnabled?r`
|
|
136
|
+
<span class="social-action">
|
|
137
|
+
<scb-icon-button
|
|
138
|
+
variant="standard"
|
|
139
|
+
icon="reply"
|
|
140
|
+
aria-label="Svara"
|
|
141
|
+
@click=${x("reply")}
|
|
142
|
+
></scb-icon-button>
|
|
143
|
+
<span class="social-text">Svara</span>
|
|
144
|
+
</span>
|
|
145
|
+
`:m}
|
|
146
|
+
${this.editEnabled?r`
|
|
147
|
+
<span class="social-action">
|
|
148
|
+
<scb-icon-button
|
|
149
|
+
variant="standard"
|
|
150
|
+
icon="edit"
|
|
151
|
+
aria-label="Redigera"
|
|
152
|
+
@click=${x("edit")}
|
|
153
|
+
></scb-icon-button>
|
|
154
|
+
<span class="social-text">Redigera</span>
|
|
155
|
+
</span>
|
|
156
|
+
`:m}
|
|
157
|
+
${this.deleteEnabled?r`
|
|
158
|
+
<span class="social-action">
|
|
159
|
+
<scb-icon-button
|
|
160
|
+
variant="standard"
|
|
161
|
+
icon="delete"
|
|
162
|
+
aria-label="Ta bort"
|
|
163
|
+
@click=${x("delete")}
|
|
164
|
+
></scb-icon-button>
|
|
165
|
+
<span class="social-text">Ta bort</span>
|
|
166
|
+
</span>
|
|
167
|
+
`:m}
|
|
132
168
|
</div>
|
|
133
169
|
</div>
|
|
134
170
|
</div>
|
|
@@ -169,13 +205,13 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
169
205
|
`);default:return b(r`
|
|
170
206
|
<div class="full-content">
|
|
171
207
|
<div class="top-content">
|
|
172
|
-
${this.title?r`<div class="header">${
|
|
208
|
+
${this.title?r`<div class="header">${h(!!n)}</div>`:""}
|
|
173
209
|
${this.subtitle?r`<div class="sub-label">${this.subtitle}</div>`:""}
|
|
174
210
|
${this.supportingText?r`<div class="supporting-text">${this.supportingText}</div>`:""}
|
|
175
211
|
${l?r`<div class="date">${l}</div>`:""}
|
|
176
212
|
</div>
|
|
177
213
|
</div>
|
|
178
|
-
`)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&
|
|
214
|
+
`)}}updated(t){super.updated(t),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),t.has("type")&&(this.type==="list"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")),this.mediaFit&&this.mediaFit!=="cover"?this.style.setProperty("--scb-card-media-fit",this.mediaFit):this.style.removeProperty("--scb-card-media-fit"),this.mediaPosition&&this.mediaPosition!=="center"?this.style.setProperty("--scb-card-media-position",this.mediaPosition):this.style.removeProperty("--scb-card-media-position"),this.__syncSocialAttributes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&f(this,y,z).call(this),(t.has("innerPadding")||t.has("paddingTop")||t.has("paddingBottom")||t.has("paddingLeft")||t.has("paddingRight"))&&f(this,y,k).call(this)}async firstUpdated(t){i.__iconLoaded||(await S(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),i.__iconLoaded=!0),i.__rippleLoaded||(await S(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),i.__rippleLoaded=!0),f(this,y,z).call(this),f(this,y,k).call(this),this.__syncSocialAttributes()}};y=new WeakSet;z=function(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,n=this.mapSpacingToken(this.spacingBottom)??t,c=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-card-spacing-block-start",e):this.style.removeProperty("--scb-card-spacing-block-start"),n?this.style.setProperty("--scb-card-spacing-block-end",n):this.style.removeProperty("--scb-card-spacing-block-end"),c?this.style.setProperty("--scb-card-spacing-inline-start",c):this.style.removeProperty("--scb-card-spacing-inline-start"),o?this.style.setProperty("--scb-card-spacing-inline-end",o):this.style.removeProperty("--scb-card-spacing-inline-end")};k=function(){const t=this.mapSpacingToken(this.innerPadding),e=this.mapSpacingToken(this.paddingTop)??t,n=this.mapSpacingToken(this.paddingBottom)??t,c=this.mapSpacingToken(this.paddingLeft)??t,o=this.mapSpacingToken(this.paddingRight)??t;e?this.style.setProperty("--scb-card-content-padding-block-start",e):this.style.removeProperty("--scb-card-content-padding-block-start"),n?this.style.setProperty("--scb-card-content-padding-block-end",n):this.style.removeProperty("--scb-card-content-padding-block-end"),c?this.style.setProperty("--scb-card-content-padding-inline-start",c):this.style.removeProperty("--scb-card-content-padding-inline-start"),o?this.style.setProperty("--scb-card-content-padding-inline-end",o):this.style.removeProperty("--scb-card-content-padding-inline-end")};i.__iconLoaded=!1;i.__rippleLoaded=!1;i.styles=L`
|
|
179
215
|
:host {
|
|
180
216
|
display: block;
|
|
181
217
|
box-sizing: border-box;
|
|
@@ -623,6 +659,19 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
623
659
|
gap: var(--spacing-2, 4px);
|
|
624
660
|
}
|
|
625
661
|
|
|
662
|
+
/* .social-actions {
|
|
663
|
+
display: flex;
|
|
664
|
+
align-items: center;
|
|
665
|
+
gap: var(--spacing-3, 8px);
|
|
666
|
+
flex-wrap: wrap;
|
|
667
|
+
} */
|
|
668
|
+
|
|
669
|
+
.social-action {
|
|
670
|
+
display: inline-flex;
|
|
671
|
+
align-items: center;
|
|
672
|
+
gap: var(--spacing-1, 2px);
|
|
673
|
+
}
|
|
674
|
+
|
|
626
675
|
.scb-card .content.list {
|
|
627
676
|
margin-top: var(--scb-card-size-list-offset);
|
|
628
677
|
}
|
|
@@ -652,4 +701,4 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
652
701
|
.scb-card.filled-alternative .content.list ::slotted(scb-list) {
|
|
653
702
|
--scb-list-bg: var(--md-sys-color-surface-container, #EEF3FF);
|
|
654
703
|
}
|
|
655
|
-
`;s([a({type:String,reflect:!0,converter:d})],i.prototype,"type",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"variant",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"direction",2);s([a({type:String,reflect:!0})],i.prototype,"size",2);s([a({type:String,attribute:"media-type"})],i.prototype,"mediaType",2);s([a({type:String,attribute:"media-href"})],i.prototype,"mediaHref",2);s([a({type:String,attribute:"media-alt"})],i.prototype,"mediaAlt",2);s([a({type:String,attribute:"media-srcset"})],i.prototype,"mediaSrcset",2);s([a({type:String,attribute:"media-sizes"})],i.prototype,"mediaSizes",2);s([a({type:String,attribute:"media-loading"})],i.prototype,"mediaLoading",2);s([a({type:String,attribute:"media-decoding"})],i.prototype,"mediaDecoding",2);s([a({type:String,attribute:"media-fetchpriority"})],i.prototype,"mediaFetchPriority",2);s([a({type:String,attribute:"media-fit"})],i.prototype,"mediaFit",2);s([a({type:String,attribute:"media-position"})],i.prototype,"mediaPosition",2);s([a({type:String,attribute:"media-width"})],i.prototype,"mediaWidth",2);s([a({type:String,attribute:"media-height"})],i.prototype,"mediaHeight",2);s([a({type:String,attribute:"media-aspect"})],i.prototype,"mediaAspect",2);s([a({type:Boolean,attribute:"media-placeholder"})],i.prototype,"mediaPlaceholder",2);s([a({type:String,attribute:"card-href",reflect:!0,converter:d})],i.prototype,"cardHref",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"href",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"title",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"subtitle",2);s([a({type:String,attribute:"supporting-text",reflect:!0,converter:d})],i.prototype,"supportingText",2);s([a({type:Date,reflect:!0})],i.prototype,"date",2);s([a({type:String,attribute:"social-comments-text"})],i.prototype,"commentsText",2);s([a({type:Number,attribute:"social-comments"})],i.prototype,"comments",2);s([a({type:String,attribute:"social-comments-href"})],i.prototype,"commentsHref",2);s([a({type:String,attribute:"social-likes-text"})],i.prototype,"likesText",2);s([a({type:Number,attribute:"social-likes"})],i.prototype,"likes",2);s([a({type:String,attribute:"social-likes-hover-content"})],i.prototype,"likesHoverContent",2);s([a({type:Boolean,attribute:"social-has-liked"})],i.prototype,"hasLiked",2);s([a({type:Boolean,attribute:"social-likes-interactive"})],i.prototype,"likesInteractive",2);s([a({type:Boolean,attribute:"social-author"})],i.prototype,"author",2);s([a({type:String,attribute:"social-author-text"})],i.prototype,"authorText",2);s([a({type:String,attribute:"social-author-href"})],i.prototype,"authorHref",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"sizing",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width",converter:d})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height",converter:d})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"spacing",2);s([a({type:String,attribute:"spacing-top",reflect:!0,converter:d})],i.prototype,"spacingTop",2);s([a({type:String,attribute:"spacing-bottom",reflect:!0,converter:d})],i.prototype,"spacingBottom",2);s([a({type:String,attribute:"spacing-left",reflect:!0,converter:d})],i.prototype,"spacingLeft",2);s([a({type:String,attribute:"spacing-right",reflect:!0,converter:d})],i.prototype,"spacingRight",2);s([a({type:String,attribute:"padding",reflect:!0,converter:d})],i.prototype,"innerPadding",2);s([a({type:String,attribute:"padding-top",reflect:!0,converter:d})],i.prototype,"paddingTop",2);s([a({type:String,attribute:"padding-bottom",reflect:!0,converter:d})],i.prototype,"paddingBottom",2);s([a({type:String,attribute:"padding-left",reflect:!0,converter:d})],i.prototype,"paddingLeft",2);s([a({type:String,attribute:"padding-right",reflect:!0,converter:d})],i.prototype,"paddingRight",2);i=s([
|
|
704
|
+
`;s([a({type:String,reflect:!0,converter:d})],i.prototype,"type",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"variant",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"direction",2);s([a({type:String,reflect:!0})],i.prototype,"size",2);s([a({type:String,attribute:"media-type"})],i.prototype,"mediaType",2);s([a({type:String,attribute:"media-href"})],i.prototype,"mediaHref",2);s([a({type:String,attribute:"media-alt"})],i.prototype,"mediaAlt",2);s([a({type:String,attribute:"media-srcset"})],i.prototype,"mediaSrcset",2);s([a({type:String,attribute:"media-sizes"})],i.prototype,"mediaSizes",2);s([a({type:String,attribute:"media-loading"})],i.prototype,"mediaLoading",2);s([a({type:String,attribute:"media-decoding"})],i.prototype,"mediaDecoding",2);s([a({type:String,attribute:"media-fetchpriority"})],i.prototype,"mediaFetchPriority",2);s([a({type:String,attribute:"media-fit"})],i.prototype,"mediaFit",2);s([a({type:String,attribute:"media-position"})],i.prototype,"mediaPosition",2);s([a({type:String,attribute:"media-width"})],i.prototype,"mediaWidth",2);s([a({type:String,attribute:"media-height"})],i.prototype,"mediaHeight",2);s([a({type:String,attribute:"media-aspect"})],i.prototype,"mediaAspect",2);s([a({type:Boolean,attribute:"media-placeholder"})],i.prototype,"mediaPlaceholder",2);s([a({type:String,attribute:"card-href",reflect:!0,converter:d})],i.prototype,"cardHref",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"href",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"title",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"subtitle",2);s([a({type:String,attribute:"supporting-text",reflect:!0,converter:d})],i.prototype,"supportingText",2);s([a({type:Date,reflect:!0})],i.prototype,"date",2);s([a({type:String,attribute:"social-comments-text"})],i.prototype,"commentsText",2);s([a({type:Number,attribute:"social-comments"})],i.prototype,"comments",2);s([a({type:Boolean,attribute:"social-comments-disabled"})],i.prototype,"commentsDisabled",2);s([a({type:String,attribute:"social-comments-href"})],i.prototype,"commentsHref",2);s([a({type:String,attribute:"social-likes-text"})],i.prototype,"likesText",2);s([a({type:Number,attribute:"social-likes"})],i.prototype,"likes",2);s([a({type:Boolean,attribute:"social-likes-disabled"})],i.prototype,"likesDisabled",2);s([a({type:String,attribute:"social-likes-hover-content"})],i.prototype,"likesHoverContent",2);s([a({type:Boolean,attribute:"social-has-liked"})],i.prototype,"hasLiked",2);s([a({type:Boolean,attribute:"social-likes-interactive"})],i.prototype,"likesInteractive",2);s([a({type:Boolean,attribute:"social-author"})],i.prototype,"author",2);s([a({type:String,attribute:"social-author-text"})],i.prototype,"authorText",2);s([a({type:String,attribute:"social-author-href"})],i.prototype,"authorHref",2);s([a({type:Boolean,attribute:"social-reply-enabled"})],i.prototype,"replyEnabled",2);s([a({type:Boolean,attribute:"social-edit-enabled"})],i.prototype,"editEnabled",2);s([a({type:Boolean,attribute:"social-delete-enabled"})],i.prototype,"deleteEnabled",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"sizing",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"width",2);s([a({type:String,reflect:!0,attribute:"max-width",converter:d})],i.prototype,"maxWidth",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"height",2);s([a({type:String,reflect:!0,attribute:"max-height",converter:d})],i.prototype,"maxHeight",2);s([a({type:String,reflect:!0,converter:d})],i.prototype,"spacing",2);s([a({type:String,attribute:"spacing-top",reflect:!0,converter:d})],i.prototype,"spacingTop",2);s([a({type:String,attribute:"spacing-bottom",reflect:!0,converter:d})],i.prototype,"spacingBottom",2);s([a({type:String,attribute:"spacing-left",reflect:!0,converter:d})],i.prototype,"spacingLeft",2);s([a({type:String,attribute:"spacing-right",reflect:!0,converter:d})],i.prototype,"spacingRight",2);s([a({type:String,attribute:"padding",reflect:!0,converter:d})],i.prototype,"innerPadding",2);s([a({type:String,attribute:"padding-top",reflect:!0,converter:d})],i.prototype,"paddingTop",2);s([a({type:String,attribute:"padding-bottom",reflect:!0,converter:d})],i.prototype,"paddingBottom",2);s([a({type:String,attribute:"padding-left",reflect:!0,converter:d})],i.prototype,"paddingLeft",2);s([a({type:String,attribute:"padding-right",reflect:!0,converter:d})],i.prototype,"paddingRight",2);i=s([C("scb-card")],i);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.279",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -386,5 +386,5 @@
|
|
|
386
386
|
},
|
|
387
387
|
"./mvc/*": "./mvc/*"
|
|
388
388
|
},
|
|
389
|
-
"buildHash": "
|
|
389
|
+
"buildHash": "6A9B72234934AF8D47C72D448656036B2B53B453A661FA3DDFC6F8DF4B9ABEBD"
|
|
390
390
|
}
|
package/scb-card/scb-card.d.ts
CHANGED
|
@@ -31,15 +31,20 @@ export declare class ScbCard extends LitElement {
|
|
|
31
31
|
date?: Date;
|
|
32
32
|
commentsText: string;
|
|
33
33
|
comments?: number;
|
|
34
|
+
commentsDisabled: boolean;
|
|
34
35
|
commentsHref: string;
|
|
35
36
|
likesText: string;
|
|
36
37
|
likes?: number;
|
|
38
|
+
likesDisabled: boolean;
|
|
37
39
|
likesHoverContent: string;
|
|
38
40
|
hasLiked: boolean;
|
|
39
41
|
likesInteractive: boolean;
|
|
40
42
|
author: boolean;
|
|
41
43
|
authorText: string;
|
|
42
44
|
authorHref: string;
|
|
45
|
+
replyEnabled: boolean;
|
|
46
|
+
editEnabled: boolean;
|
|
47
|
+
deleteEnabled: boolean;
|
|
43
48
|
sizing: 'stretch' | 'content-width' | 'content-height';
|
|
44
49
|
width: string;
|
|
45
50
|
maxWidth: string;
|
|
@@ -65,6 +70,7 @@ export declare class ScbCard extends LitElement {
|
|
|
65
70
|
private __onImgLoad;
|
|
66
71
|
private __noWrapText;
|
|
67
72
|
private __dispatchLikeEvent;
|
|
73
|
+
private __dispatchSocialActionEvent;
|
|
68
74
|
private __dispatchCardNavigate;
|
|
69
75
|
private __effectiveHref;
|
|
70
76
|
private __navigate;
|