scb-wc-test 0.1.257 → 0.1.258
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.
|
@@ -62,6 +62,7 @@ import{_}from"../../vendor/preload-helper.js";import{a as A,n as a,i as L,x as r
|
|
|
62
62
|
`);case"social":const m=this.commentsHref,z=h=>{h.stopPropagation()},g=h=>{const y=this.renderRoot?.querySelector(".scb-card");y&&(h?y.classList.add("no-hover"):y.classList.remove("no-hover"))},T=this.commentsText?`${this.commentsText}: `:"",P=this.likesText?`${this.likesText}: `:"",k=r`
|
|
63
63
|
<span
|
|
64
64
|
class="likes"
|
|
65
|
+
title=""
|
|
65
66
|
@mouseenter=${()=>g(!0)}
|
|
66
67
|
@mouseleave=${()=>g(!1)}
|
|
67
68
|
>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m,n as
|
|
1
|
+
import{a as m,n as s,i as g,E as p,x as c,t as f}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-group.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(e,n,r){try{customElements.get(e)||i(e,n,r)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var b=Object.defineProperty,v=Object.getOwnPropertyDescriptor,o=(t,i,e,n)=>{for(var r=n>1?void 0:n?v(i,e):i,d=t.length-1,l;d>=0;d--)(l=t[d])&&(r=(n?l(i,e,r):l(r))||r);return n&&r&&b(i,e,r),r};let a=class extends g{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{const t=this.shadowRoot?.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),(this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})??[]).forEach(e=>{const n=e.tagName;n==="SCB-TEXTFIELD"&&(e.value=""),n==="SCB-CHECKBOX"&&(e.checked=!1),n==="SCB-RADIO-BUTTON"&&(e.checked=!1),n==="SCB-SWITCH"&&(e.selected=!1),n==="SCB-CHIP"&&(e.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{const t=this.shadowRoot?.querySelector("form");if(t instanceof HTMLFormElement){if(this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const i=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled"));if(!i.length)return;const e=i[0],n=i[i.length-1];t.shiftKey&&document.activeElement===e?(n.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===n&&(e.focus(),t.preventDefault())}}__getActionFromEvent(t){if(!this.id)return null;for(const i of t.composedPath())if(i instanceof Element){if(i.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=i,"toggle";if(i.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=i,"toggle"}return null}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}__applyZIndex(){const t=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(t===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(t)),this.style.setProperty("--z-dialog",String(t+1))}__applyMaxSize(){const t=(this.maxW??"").trim(),i=(this.maxH??"").trim();t?(this.style.setProperty("--scb-dialog-max-w",t),this.style.setProperty("--scb-dialog-width",`min(${t}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),i?this.style.setProperty("--scb-dialog-max-h",i):this.style.removeProperty("--scb-dialog-max-h")}updated(t){if(t.has("zIndex")&&this.__applyZIndex(),(t.has("maxW")||t.has("maxH"))&&this.__applyMaxSize(),t.has("open")){const i=t.get("open");this.__updateTriggersExpanded(),this.open&&!i?this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');e?e.focus():this.shadowRoot?.querySelector(".container")?.focus()}):!this.open&&i&&this.__lastTriggerEl?.focus?.(),this.__toggleScrollLock(this.open)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(t){if(this.inSb)return;const i=document.documentElement,e=document.body;if(t){const n=window.innerWidth-i.clientWidth;i.style.overflow="hidden",e.style.paddingRight=n>0?`${n}px`:"";return}i.style.overflow="",e.style.paddingRight=""}mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}__applySpacing(){const t=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??t,e=this.mapSpacingToken(this.spacingBottom)??t,n=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-dialog-spacing-block-start",i):this.style.removeProperty("--scb-dialog-spacing-block-start"),e?this.style.setProperty("--scb-dialog-spacing-block-end",e):this.style.removeProperty("--scb-dialog-spacing-block-end"),n?this.style.setProperty("--scb-dialog-spacing-inline-start",n):this.style.removeProperty("--scb-dialog-spacing-inline-start"),r?this.style.setProperty("--scb-dialog-spacing-inline-end",r):this.style.removeProperty("--scb-dialog-spacing-inline-end")}__setOpen(t){this.open=t,this.__fire(t?"open":"close")}__fire(t,i){this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}__getSlottedElements(){const t=this.shadowRoot?.querySelector("slot");if(!(t instanceof HTMLSlotElement))return[];const i=t.assignedElements({flatten:!0}),e=[];for(const n of i)e.push(n,...Array.from(n.querySelectorAll("*")));return e}__appendHiddenFormValue(t,i,e){const n=document.createElement("input");n.type="hidden",n.name=i,n.value=e,n.setAttribute("data-scb-dialog-generated","true"),t.append(n)}__clearGeneratedFormValues(t){t.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(i=>i.remove())}__syncSlottedFormValues(t){this.__clearGeneratedFormValues(t),this.__getSlottedElements().forEach(e=>{if(!(e instanceof HTMLElement))return;const n=(e.getAttribute("name")??"").trim();if(!(!n||e.disabled===!0||e.hasAttribute("disabled"))){if(e instanceof HTMLInputElement){if(e.form===t)return;const d=(e.type||"").toLowerCase();if(d==="checkbox"||d==="radio"){e.checked&&this.__appendHiddenFormValue(t,n,e.value||"on");return}this.__appendHiddenFormValue(t,n,e.value??"");return}if(e instanceof HTMLTextAreaElement){if(e.form===t)return;this.__appendHiddenFormValue(t,n,e.value??"");return}if(e instanceof HTMLSelectElement){if(e.form===t)return;if(e.multiple){Array.from(e.selectedOptions).forEach(d=>{this.__appendHiddenFormValue(t,n,d.value)});return}this.__appendHiddenFormValue(t,n,e.value??"");return}switch(e.tagName){case"SCB-TEXTFIELD":this.__appendHiddenFormValue(t,n,String(e.value??""));return;case"SCB-CHECKBOX":e.checked&&this.__appendHiddenFormValue(t,n,String(e.value??e.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":e.checked&&this.__appendHiddenFormValue(t,n,String(e.value??e.getAttribute("value")??"on"));return;case"SCB-SWITCH":(e.selected||e.checked)&&this.__appendHiddenFormValue(t,n,String(e.value??e.getAttribute("value")??"on"));return;case"SCB-CHIP":e.selected&&this.__appendHiddenFormValue(t,n,String(e.value??e.getAttribute("value")??"on"));return;default:"value"in e&&this.__appendHiddenFormValue(t,n,String(e.value??""))}}})}__validateFormAndSlottedFields(t){const i=l=>l.disabled===!0||l.hasAttribute("disabled");let e=t.reportValidity(),n=null;const r=new Set;return this.__getSlottedElements().forEach(l=>{if(!(l instanceof HTMLElement)||r.has(l)||i(l))return;r.add(l);const u=l;if(typeof u.reportValidity=="function"){const h=!!u.reportValidity();!h&&!n&&(n=l),e=e&&h}}),!e&&n&&n.focus(),e}__slotIsEmpty(){const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements({flatten:!0}).length===0:!0}renderHeader(t){const i=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return c`
|
|
2
2
|
<div class="header">
|
|
3
3
|
<div class="title">
|
|
4
4
|
${this.icon?c`<md-icon class="dialog-icon">${this.icon}</md-icon>`:p}
|
|
@@ -51,7 +51,7 @@ import{a as m,n as o,i as g,E as p,x as c,t as f}from"../../vendor/vendor.js";im
|
|
|
51
51
|
>
|
|
52
52
|
${this.renderBody(t,i)}
|
|
53
53
|
</div>
|
|
54
|
-
`}};
|
|
54
|
+
`}};a.styles=m`
|
|
55
55
|
:host {
|
|
56
56
|
display:block;
|
|
57
57
|
position:relative;
|
|
@@ -262,4 +262,4 @@ import{a as m,n as o,i as g,E as p,x as c,t as f}from"../../vendor/vendor.js";im
|
|
|
262
262
|
to { opacity: 0; }
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
`;
|
|
265
|
+
`;o([s({type:Boolean,reflect:!0})],a.prototype,"open",2);o([s({type:String,attribute:"max-w",reflect:!0})],a.prototype,"maxW",2);o([s({type:String,attribute:"max-h",reflect:!0})],a.prototype,"maxH",2);o([s({type:Number,attribute:"z-index",reflect:!0})],a.prototype,"zIndex",2);o([s({type:Boolean,attribute:!1})],a.prototype,"inSb",2);o([s({type:Boolean,attribute:"scrim-close"})],a.prototype,"scrimClose",2);o([s({type:String,reflect:!0})],a.prototype,"spacing",2);o([s({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",2);o([s({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",2);o([s({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",2);o([s({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",2);o([s({type:String})],a.prototype,"variant",2);o([s({type:String})],a.prototype,"label",2);o([s({type:String})],a.prototype,"icon",2);o([s({type:String,attribute:"supporting-text"})],a.prototype,"supportingText",2);o([s({type:String,attribute:"ok-button"})],a.prototype,"okButton",2);o([s({type:String,attribute:"cancel-button"})],a.prototype,"cancelButton",2);o([s({type:String,attribute:"delete-button"})],a.prototype,"deleteButton",2);o([s({type:String,attribute:"confirm-button"})],a.prototype,"confirmButton",2);o([s({type:String,attribute:"deny-button"})],a.prototype,"denyButton",2);o([s({type:String,attribute:"reset-button"})],a.prototype,"resetButton",2);o([s({type:String,attribute:"submit-button"})],a.prototype,"submitButton",2);o([s({type:String,attribute:"form-id"})],a.prototype,"formId",2);o([s({type:String,attribute:"form-action"})],a.prototype,"formAction",2);o([s({type:String,attribute:"form-method"})],a.prototype,"formMethod",2);a=o([f("scb-dialog")],a);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.258",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -382,5 +382,5 @@
|
|
|
382
382
|
},
|
|
383
383
|
"./mvc/*": "./mvc/*"
|
|
384
384
|
},
|
|
385
|
-
"buildHash": "
|
|
385
|
+
"buildHash": "5FFCEEE532D2760DCC2D3413E17B668104A64E18E0800887F032E6386AA23E62"
|
|
386
386
|
}
|
package/scb-card/scb-card.js
CHANGED
package/scb-dialog/scb-dialog.js
CHANGED
|
@@ -8,10 +8,10 @@ import "../scb-radio-button/scb-radio-button.js";
|
|
|
8
8
|
import "../scb-switch/scb-switch.js";
|
|
9
9
|
import "../scb-chip/scb-chip.js";
|
|
10
10
|
import "@material/web/icon/icon.js";
|
|
11
|
-
var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor,
|
|
12
|
-
for (var
|
|
13
|
-
(c = t[l]) && (
|
|
14
|
-
return a &&
|
|
11
|
+
var b = Object.defineProperty, v = Object.getOwnPropertyDescriptor, o = (t, e, i, a) => {
|
|
12
|
+
for (var s = a > 1 ? void 0 : a ? v(e, i) : e, l = t.length - 1, c; l >= 0; l--)
|
|
13
|
+
(c = t[l]) && (s = (a ? c(e, i, s) : c(s)) || s);
|
|
14
|
+
return a && s && b(e, i, s), s;
|
|
15
15
|
};
|
|
16
16
|
let n = class extends g {
|
|
17
17
|
constructor() {
|
|
@@ -30,9 +30,9 @@ let n = class extends g {
|
|
|
30
30
|
}, this.__onDeny = () => {
|
|
31
31
|
this.__fire("deny"), this.__setOpen(!1);
|
|
32
32
|
}, this.__onReset = () => {
|
|
33
|
-
var i, a,
|
|
33
|
+
var i, a, s;
|
|
34
34
|
const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector("form");
|
|
35
|
-
t instanceof HTMLFormElement && (this.__clearGeneratedFormValues(t), t.reset()), (((
|
|
35
|
+
t instanceof HTMLFormElement && (this.__clearGeneratedFormValues(t), t.reset()), (((s = (a = this.shadowRoot) == null ? void 0 : a.querySelector("slot")) == null ? void 0 : s.assignedElements({ flatten: !0 })) ?? []).forEach((l) => {
|
|
36
36
|
const c = l.tagName;
|
|
37
37
|
c === "SCB-TEXTFIELD" && (l.value = ""), c === "SCB-CHECKBOX" && (l.checked = !1), c === "SCB-RADIO-BUTTON" && (l.checked = !1), c === "SCB-SWITCH" && (l.selected = !1), c === "SCB-CHIP" && (l.selected = !1);
|
|
38
38
|
}), this.__fire("reset");
|
|
@@ -51,7 +51,7 @@ let n = class extends g {
|
|
|
51
51
|
this.shadowRoot.querySelectorAll(
|
|
52
52
|
'button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])'
|
|
53
53
|
)
|
|
54
|
-
).filter((
|
|
54
|
+
).filter((s) => !s.hasAttribute("disabled"));
|
|
55
55
|
if (!e.length) return;
|
|
56
56
|
const i = e[0], a = e[e.length - 1];
|
|
57
57
|
t.shiftKey && document.activeElement === i ? (a.focus(), t.preventDefault()) : !t.shiftKey && document.activeElement === a && (i.focus(), t.preventDefault());
|
|
@@ -104,10 +104,10 @@ let n = class extends g {
|
|
|
104
104
|
const a = t.get("open");
|
|
105
105
|
this.__updateTriggersExpanded(), this.open && !a ? this.updateComplete.then(() => {
|
|
106
106
|
var l, c, p;
|
|
107
|
-
const
|
|
107
|
+
const s = (l = this.shadowRoot) == null ? void 0 : l.querySelector(
|
|
108
108
|
'button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])'
|
|
109
109
|
);
|
|
110
|
-
|
|
110
|
+
s ? s.focus() : (p = (c = this.shadowRoot) == null ? void 0 : c.querySelector(".container")) == null || p.focus();
|
|
111
111
|
}) : !this.open && a && ((i = (e = this.__lastTriggerEl) == null ? void 0 : e.focus) == null || i.call(e)), this.__toggleScrollLock(this.open);
|
|
112
112
|
}
|
|
113
113
|
(t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom") || t.has("spacingLeft") || t.has("spacingRight")) && this.__applySpacing();
|
|
@@ -121,8 +121,13 @@ let n = class extends g {
|
|
|
121
121
|
/* Sid-scroll låses upp/ner när dialogen är öppen – men aldrig i SB-läge. */
|
|
122
122
|
__toggleScrollLock(t) {
|
|
123
123
|
if (this.inSb) return;
|
|
124
|
-
const e = document.documentElement;
|
|
125
|
-
|
|
124
|
+
const e = document.documentElement, i = document.body;
|
|
125
|
+
if (t) {
|
|
126
|
+
const a = window.innerWidth - e.clientWidth;
|
|
127
|
+
e.style.overflow = "hidden", i.style.paddingRight = a > 0 ? `${a}px` : "";
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
e.style.overflow = "", i.style.paddingRight = "";
|
|
126
131
|
}
|
|
127
132
|
mapSpacingToken(t) {
|
|
128
133
|
if (!t) return;
|
|
@@ -131,8 +136,8 @@ let n = class extends g {
|
|
|
131
136
|
return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
|
|
132
137
|
}
|
|
133
138
|
__applySpacing() {
|
|
134
|
-
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, i = this.mapSpacingToken(this.spacingBottom) ?? t, a = this.mapSpacingToken(this.spacingLeft),
|
|
135
|
-
e ? this.style.setProperty("--scb-dialog-spacing-block-start", e) : this.style.removeProperty("--scb-dialog-spacing-block-start"), i ? this.style.setProperty("--scb-dialog-spacing-block-end", i) : this.style.removeProperty("--scb-dialog-spacing-block-end"), a ? this.style.setProperty("--scb-dialog-spacing-inline-start", a) : this.style.removeProperty("--scb-dialog-spacing-inline-start"),
|
|
139
|
+
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, i = this.mapSpacingToken(this.spacingBottom) ?? t, a = this.mapSpacingToken(this.spacingLeft), s = this.mapSpacingToken(this.spacingRight);
|
|
140
|
+
e ? this.style.setProperty("--scb-dialog-spacing-block-start", e) : this.style.removeProperty("--scb-dialog-spacing-block-start"), i ? this.style.setProperty("--scb-dialog-spacing-block-end", i) : this.style.removeProperty("--scb-dialog-spacing-block-end"), a ? this.style.setProperty("--scb-dialog-spacing-inline-start", a) : this.style.removeProperty("--scb-dialog-spacing-inline-start"), s ? this.style.setProperty("--scb-dialog-spacing-inline-end", s) : this.style.removeProperty("--scb-dialog-spacing-inline-end");
|
|
136
141
|
}
|
|
137
142
|
/* Helpers för att byta state och fire events på ett ställe. */
|
|
138
143
|
__setOpen(t) {
|
|
@@ -146,8 +151,8 @@ let n = class extends g {
|
|
|
146
151
|
const t = (a = this.shadowRoot) == null ? void 0 : a.querySelector("slot");
|
|
147
152
|
if (!(t instanceof HTMLSlotElement)) return [];
|
|
148
153
|
const e = t.assignedElements({ flatten: !0 }), i = [];
|
|
149
|
-
for (const
|
|
150
|
-
i.push(
|
|
154
|
+
for (const s of e)
|
|
155
|
+
i.push(s, ...Array.from(s.querySelectorAll("*")));
|
|
151
156
|
return i;
|
|
152
157
|
}
|
|
153
158
|
__appendHiddenFormValue(t, e, i) {
|
|
@@ -213,10 +218,10 @@ let n = class extends g {
|
|
|
213
218
|
__validateFormAndSlottedFields(t) {
|
|
214
219
|
const e = (c) => c.disabled === !0 || c.hasAttribute("disabled");
|
|
215
220
|
let i = t.reportValidity(), a = null;
|
|
216
|
-
const
|
|
221
|
+
const s = /* @__PURE__ */ new Set();
|
|
217
222
|
return this.__getSlottedElements().forEach((c) => {
|
|
218
|
-
if (!(c instanceof HTMLElement) ||
|
|
219
|
-
|
|
223
|
+
if (!(c instanceof HTMLElement) || s.has(c) || e(c)) return;
|
|
224
|
+
s.add(c);
|
|
220
225
|
const p = c;
|
|
221
226
|
if (typeof p.reportValidity == "function") {
|
|
222
227
|
const h = !!p.reportValidity();
|
|
@@ -539,82 +544,82 @@ n.styles = m`
|
|
|
539
544
|
}
|
|
540
545
|
|
|
541
546
|
`;
|
|
542
|
-
|
|
547
|
+
o([
|
|
543
548
|
r({ type: Boolean, reflect: !0 })
|
|
544
549
|
], n.prototype, "open", 2);
|
|
545
|
-
|
|
550
|
+
o([
|
|
546
551
|
r({ type: String, attribute: "max-w", reflect: !0 })
|
|
547
552
|
], n.prototype, "maxW", 2);
|
|
548
|
-
|
|
553
|
+
o([
|
|
549
554
|
r({ type: String, attribute: "max-h", reflect: !0 })
|
|
550
555
|
], n.prototype, "maxH", 2);
|
|
551
|
-
|
|
556
|
+
o([
|
|
552
557
|
r({ type: Number, attribute: "z-index", reflect: !0 })
|
|
553
558
|
], n.prototype, "zIndex", 2);
|
|
554
|
-
|
|
559
|
+
o([
|
|
555
560
|
r({ type: Boolean, attribute: !1 })
|
|
556
561
|
], n.prototype, "inSb", 2);
|
|
557
|
-
|
|
562
|
+
o([
|
|
558
563
|
r({ type: Boolean, attribute: "scrim-close" })
|
|
559
564
|
], n.prototype, "scrimClose", 2);
|
|
560
|
-
|
|
565
|
+
o([
|
|
561
566
|
r({ type: String, reflect: !0 })
|
|
562
567
|
], n.prototype, "spacing", 2);
|
|
563
|
-
|
|
568
|
+
o([
|
|
564
569
|
r({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
565
570
|
], n.prototype, "spacingTop", 2);
|
|
566
|
-
|
|
571
|
+
o([
|
|
567
572
|
r({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
568
573
|
], n.prototype, "spacingBottom", 2);
|
|
569
|
-
|
|
574
|
+
o([
|
|
570
575
|
r({ type: String, attribute: "spacing-left", reflect: !0 })
|
|
571
576
|
], n.prototype, "spacingLeft", 2);
|
|
572
|
-
|
|
577
|
+
o([
|
|
573
578
|
r({ type: String, attribute: "spacing-right", reflect: !0 })
|
|
574
579
|
], n.prototype, "spacingRight", 2);
|
|
575
|
-
|
|
580
|
+
o([
|
|
576
581
|
r({ type: String })
|
|
577
582
|
], n.prototype, "variant", 2);
|
|
578
|
-
|
|
583
|
+
o([
|
|
579
584
|
r({ type: String })
|
|
580
585
|
], n.prototype, "label", 2);
|
|
581
|
-
|
|
586
|
+
o([
|
|
582
587
|
r({ type: String })
|
|
583
588
|
], n.prototype, "icon", 2);
|
|
584
|
-
|
|
589
|
+
o([
|
|
585
590
|
r({ type: String, attribute: "supporting-text" })
|
|
586
591
|
], n.prototype, "supportingText", 2);
|
|
587
|
-
|
|
592
|
+
o([
|
|
588
593
|
r({ type: String, attribute: "ok-button" })
|
|
589
594
|
], n.prototype, "okButton", 2);
|
|
590
|
-
|
|
595
|
+
o([
|
|
591
596
|
r({ type: String, attribute: "cancel-button" })
|
|
592
597
|
], n.prototype, "cancelButton", 2);
|
|
593
|
-
|
|
598
|
+
o([
|
|
594
599
|
r({ type: String, attribute: "delete-button" })
|
|
595
600
|
], n.prototype, "deleteButton", 2);
|
|
596
|
-
|
|
601
|
+
o([
|
|
597
602
|
r({ type: String, attribute: "confirm-button" })
|
|
598
603
|
], n.prototype, "confirmButton", 2);
|
|
599
|
-
|
|
604
|
+
o([
|
|
600
605
|
r({ type: String, attribute: "deny-button" })
|
|
601
606
|
], n.prototype, "denyButton", 2);
|
|
602
|
-
|
|
607
|
+
o([
|
|
603
608
|
r({ type: String, attribute: "reset-button" })
|
|
604
609
|
], n.prototype, "resetButton", 2);
|
|
605
|
-
|
|
610
|
+
o([
|
|
606
611
|
r({ type: String, attribute: "submit-button" })
|
|
607
612
|
], n.prototype, "submitButton", 2);
|
|
608
|
-
|
|
613
|
+
o([
|
|
609
614
|
r({ type: String, attribute: "form-id" })
|
|
610
615
|
], n.prototype, "formId", 2);
|
|
611
|
-
|
|
616
|
+
o([
|
|
612
617
|
r({ type: String, attribute: "form-action" })
|
|
613
618
|
], n.prototype, "formAction", 2);
|
|
614
|
-
|
|
619
|
+
o([
|
|
615
620
|
r({ type: String, attribute: "form-method" })
|
|
616
621
|
], n.prototype, "formMethod", 2);
|
|
617
|
-
n =
|
|
622
|
+
n = o([
|
|
618
623
|
f("scb-dialog")
|
|
619
624
|
], n);
|
|
620
625
|
export {
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -4753,7 +4753,7 @@ ${this.value}</textarea
|
|
|
4753
4753
|
color: var(--md-sys-color-on-surface);
|
|
4754
4754
|
font-size: var(--md-sys-typescale-body-large-size);
|
|
4755
4755
|
}
|
|
4756
|
-
`,Ee([o({type:String,reflect:!0})],pe.prototype,"variant",2),Ee([o({type:String})],pe.prototype,"label",2),Ee([o({type:String})],pe.prototype,"icon",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"disabled",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"elevated",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"removable",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"selected",2),Ee([o({type:String})],pe.prototype,"href",2),Ee([o({type:String})],pe.prototype,"target",2),Ee([o({type:String})],pe.prototype,"name",2),Ee([o({type:String})],pe.prototype,"value",2),Ee([o({type:String,reflect:!0})],pe.prototype,"spacing",2),Ee([o({type:String,reflect:!0,attribute:"spacing-top"})],pe.prototype,"spacingTop",2),Ee([o({type:String,reflect:!0,attribute:"spacing-bottom"})],pe.prototype,"spacingBottom",2),Ee([o({type:String,reflect:!0,attribute:"spacing-left"})],pe.prototype,"spacingLeft",2),Ee([o({type:String,reflect:!0,attribute:"spacing-right"})],pe.prototype,"spacingRight",2),Ee([o({type:String,reflect:!0})],pe.prototype,"size",2),pe=Ee([y("scb-chip")],pe);var om=Object.defineProperty,nm=Object.getOwnPropertyDescriptor,j=(t,e,i,r)=>{for(var s=r>1?void 0:r?nm(e,i):e,a=t.length-1,n;a>=0;a--)(n=t[a])&&(s=(r?n(e,i,s):n(s))||s);return r&&s&&om(e,i,s),s};let q=class extends _{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{var i,r,s;const t=(i=this.shadowRoot)==null?void 0:i.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),(((s=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"))==null?void 0:s.assignedElements({flatten:!0}))??[]).forEach(a=>{const n=a.tagName;n==="SCB-TEXTFIELD"&&(a.value=""),n==="SCB-CHECKBOX"&&(a.checked=!1),n==="SCB-RADIO-BUTTON"&&(a.checked=!1),n==="SCB-SWITCH"&&(a.selected=!1),n==="SCB-CHIP"&&(a.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("form");if(t instanceof HTMLFormElement){if(this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const e=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(s=>!s.hasAttribute("disabled"));if(!e.length)return;const i=e[0],r=e[e.length-1];t.shiftKey&&document.activeElement===i?(r.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===r&&(i.focus(),t.preventDefault())}}__getActionFromEvent(t){if(!this.id)return null;for(const e of t.composedPath())if(e instanceof Element){if(e.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}__applyZIndex(){const t=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(t===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(t)),this.style.setProperty("--z-dialog",String(t+1))}__applyMaxSize(){const t=(this.maxW??"").trim(),e=(this.maxH??"").trim();t?(this.style.setProperty("--scb-dialog-max-w",t),this.style.setProperty("--scb-dialog-width",`min(${t}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),e?this.style.setProperty("--scb-dialog-max-h",e):this.style.removeProperty("--scb-dialog-max-h")}updated(t){var e,i;if(t.has("zIndex")&&this.__applyZIndex(),(t.has("maxW")||t.has("maxH"))&&this.__applyMaxSize(),t.has("open")){const r=t.get("open");this.__updateTriggersExpanded(),this.open&&!r?this.updateComplete.then(()=>{var a,n,l;const s=(a=this.shadowRoot)==null?void 0:a.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');s?s.focus():(l=(n=this.shadowRoot)==null?void 0:n.querySelector(".container"))==null||l.focus()}):!this.open&&r&&((i=(e=this.__lastTriggerEl)==null?void 0:e.focus)==null||i.call(e)),this.__toggleScrollLock(this.open)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(t){if(this.inSb)return;const e=document.documentElement;e.style.overflow=
|
|
4756
|
+
`,Ee([o({type:String,reflect:!0})],pe.prototype,"variant",2),Ee([o({type:String})],pe.prototype,"label",2),Ee([o({type:String})],pe.prototype,"icon",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"disabled",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"elevated",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"removable",2),Ee([o({type:Boolean,reflect:!0})],pe.prototype,"selected",2),Ee([o({type:String})],pe.prototype,"href",2),Ee([o({type:String})],pe.prototype,"target",2),Ee([o({type:String})],pe.prototype,"name",2),Ee([o({type:String})],pe.prototype,"value",2),Ee([o({type:String,reflect:!0})],pe.prototype,"spacing",2),Ee([o({type:String,reflect:!0,attribute:"spacing-top"})],pe.prototype,"spacingTop",2),Ee([o({type:String,reflect:!0,attribute:"spacing-bottom"})],pe.prototype,"spacingBottom",2),Ee([o({type:String,reflect:!0,attribute:"spacing-left"})],pe.prototype,"spacingLeft",2),Ee([o({type:String,reflect:!0,attribute:"spacing-right"})],pe.prototype,"spacingRight",2),Ee([o({type:String,reflect:!0})],pe.prototype,"size",2),pe=Ee([y("scb-chip")],pe);var om=Object.defineProperty,nm=Object.getOwnPropertyDescriptor,j=(t,e,i,r)=>{for(var s=r>1?void 0:r?nm(e,i):e,a=t.length-1,n;a>=0;a--)(n=t[a])&&(s=(r?n(e,i,s):n(s))||s);return r&&s&&om(e,i,s),s};let q=class extends _{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{var i,r,s;const t=(i=this.shadowRoot)==null?void 0:i.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),(((s=(r=this.shadowRoot)==null?void 0:r.querySelector("slot"))==null?void 0:s.assignedElements({flatten:!0}))??[]).forEach(a=>{const n=a.tagName;n==="SCB-TEXTFIELD"&&(a.value=""),n==="SCB-CHECKBOX"&&(a.checked=!1),n==="SCB-RADIO-BUTTON"&&(a.checked=!1),n==="SCB-SWITCH"&&(a.selected=!1),n==="SCB-CHIP"&&(a.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("form");if(t instanceof HTMLFormElement){if(this.__syncSlottedFormValues(t),!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const e=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(s=>!s.hasAttribute("disabled"));if(!e.length)return;const i=e[0],r=e[e.length-1];t.shiftKey&&document.activeElement===i?(r.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===r&&(i.focus(),t.preventDefault())}}__getActionFromEvent(t){if(!this.id)return null;for(const e of t.composedPath())if(e instanceof Element){if(e.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}__applyZIndex(){const t=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(t===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(t)),this.style.setProperty("--z-dialog",String(t+1))}__applyMaxSize(){const t=(this.maxW??"").trim(),e=(this.maxH??"").trim();t?(this.style.setProperty("--scb-dialog-max-w",t),this.style.setProperty("--scb-dialog-width",`min(${t}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),e?this.style.setProperty("--scb-dialog-max-h",e):this.style.removeProperty("--scb-dialog-max-h")}updated(t){var e,i;if(t.has("zIndex")&&this.__applyZIndex(),(t.has("maxW")||t.has("maxH"))&&this.__applyMaxSize(),t.has("open")){const r=t.get("open");this.__updateTriggersExpanded(),this.open&&!r?this.updateComplete.then(()=>{var a,n,l;const s=(a=this.shadowRoot)==null?void 0:a.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');s?s.focus():(l=(n=this.shadowRoot)==null?void 0:n.querySelector(".container"))==null||l.focus()}):!this.open&&r&&((i=(e=this.__lastTriggerEl)==null?void 0:e.focus)==null||i.call(e)),this.__toggleScrollLock(this.open)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(t){if(this.inSb)return;const e=document.documentElement,i=document.body;if(t){const r=window.innerWidth-e.clientWidth;e.style.overflow="hidden",i.style.paddingRight=r>0?`${r}px`:"";return}e.style.overflow="",i.style.paddingRight=""}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}__applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,i=this.mapSpacingToken(this.spacingBottom)??t,r=this.mapSpacingToken(this.spacingLeft),s=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-dialog-spacing-block-start",e):this.style.removeProperty("--scb-dialog-spacing-block-start"),i?this.style.setProperty("--scb-dialog-spacing-block-end",i):this.style.removeProperty("--scb-dialog-spacing-block-end"),r?this.style.setProperty("--scb-dialog-spacing-inline-start",r):this.style.removeProperty("--scb-dialog-spacing-inline-start"),s?this.style.setProperty("--scb-dialog-spacing-inline-end",s):this.style.removeProperty("--scb-dialog-spacing-inline-end")}__setOpen(t){this.open=t,this.__fire(t?"open":"close")}__fire(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}__getSlottedElements(){var r;const t=(r=this.shadowRoot)==null?void 0:r.querySelector("slot");if(!(t instanceof HTMLSlotElement))return[];const e=t.assignedElements({flatten:!0}),i=[];for(const s of e)i.push(s,...Array.from(s.querySelectorAll("*")));return i}__appendHiddenFormValue(t,e,i){const r=document.createElement("input");r.type="hidden",r.name=e,r.value=i,r.setAttribute("data-scb-dialog-generated","true"),t.append(r)}__clearGeneratedFormValues(t){t.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(e=>e.remove())}__syncSlottedFormValues(t){this.__clearGeneratedFormValues(t),this.__getSlottedElements().forEach(i=>{if(!(i instanceof HTMLElement))return;const r=(i.getAttribute("name")??"").trim();if(!(!r||i.disabled===!0||i.hasAttribute("disabled"))){if(i instanceof HTMLInputElement){if(i.form===t)return;const a=(i.type||"").toLowerCase();if(a==="checkbox"||a==="radio"){i.checked&&this.__appendHiddenFormValue(t,r,i.value||"on");return}this.__appendHiddenFormValue(t,r,i.value??"");return}if(i instanceof HTMLTextAreaElement){if(i.form===t)return;this.__appendHiddenFormValue(t,r,i.value??"");return}if(i instanceof HTMLSelectElement){if(i.form===t)return;if(i.multiple){Array.from(i.selectedOptions).forEach(a=>{this.__appendHiddenFormValue(t,r,a.value)});return}this.__appendHiddenFormValue(t,r,i.value??"");return}switch(i.tagName){case"SCB-TEXTFIELD":this.__appendHiddenFormValue(t,r,String(i.value??""));return;case"SCB-CHECKBOX":i.checked&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":i.checked&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-SWITCH":(i.selected||i.checked)&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;case"SCB-CHIP":i.selected&&this.__appendHiddenFormValue(t,r,String(i.value??i.getAttribute("value")??"on"));return;default:"value"in i&&this.__appendHiddenFormValue(t,r,String(i.value??""))}}})}__validateFormAndSlottedFields(t){const e=n=>n.disabled===!0||n.hasAttribute("disabled");let i=t.reportValidity(),r=null;const s=new Set;return this.__getSlottedElements().forEach(n=>{if(!(n instanceof HTMLElement)||s.has(n)||e(n))return;s.add(n);const l=n;if(typeof l.reportValidity=="function"){const d=!!l.reportValidity();!d&&!r&&(r=n),i=i&&d}}),!i&&r&&r.focus(),i}__slotIsEmpty(){var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("slot");return t?t.assignedElements({flatten:!0}).length===0:!0}renderHeader(t){const e=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return c`
|
|
4757
4757
|
<div class="header">
|
|
4758
4758
|
<div class="title">
|
|
4759
4759
|
${this.icon?c`<md-icon class="dialog-icon">${this.icon}</md-icon>`:u}
|
|
@@ -5783,6 +5783,7 @@ ${this.value}</textarea
|
|
|
5783
5783
|
`);case"social":const h=this.commentsHref,b=w=>{w.stopPropagation()},v=w=>{var C;const k=(C=this.renderRoot)==null?void 0:C.querySelector(".scb-card");k&&(w?k.classList.add("no-hover"):k.classList.remove("no-hover"))},m=this.commentsText?`${this.commentsText}: `:"",g=this.likesText?`${this.likesText}: `:"",x=c`
|
|
5784
5784
|
<span
|
|
5785
5785
|
class="likes"
|
|
5786
|
+
title=""
|
|
5786
5787
|
@mouseenter=${()=>v(!0)}
|
|
5787
5788
|
@mouseleave=${()=>v(!1)}
|
|
5788
5789
|
>
|