scb-wc-test 0.1.208 → 0.1.210
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.
|
@@ -102,7 +102,13 @@ import{a as W,n as w,i as j,x as D,t as R}from"../../vendor/vendor.js";import"./
|
|
|
102
102
|
border-radius: 6px;
|
|
103
103
|
}
|
|
104
104
|
.calendar-day--other {
|
|
105
|
-
|
|
105
|
+
color: light-dark(var(--n-40), var(--n-70));
|
|
106
|
+
}
|
|
107
|
+
.calendar-day--other .calendar-day-event-title {
|
|
108
|
+
color: inherit;
|
|
109
|
+
}
|
|
110
|
+
.calendar-day--other .calendar-day-number {
|
|
111
|
+
font-weight: var(--weight-regular);
|
|
106
112
|
}
|
|
107
113
|
.calendar-day-number {
|
|
108
114
|
font-size: var(--md-sys-typescale-label-small-size);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _,n as a,i as u,E as
|
|
1
|
+
import{a as _,n as a,i as u,E as d,x as f,t as h}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(r,s,i){try{customElements.get(r)||o(r,s,i)}catch(c){var l=String(c||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var p=Object.defineProperty,y=Object.getOwnPropertyDescriptor,n=(e,o,r,s)=>{for(var i=s>1?void 0:s?y(o,r):o,l=e.length-1,c;l>=0;l--)(c=e[l])&&(i=(s?c(o,r,i):c(i))||i);return s&&i&&p(o,r,i),i};let t=class extends u{constructor(){super(...arguments),this.floating=!0,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.__effectiveSide="left",this.__lastTriggerEl=null,this.__lastTriggerWasAriaControls=!1,this.__onDocumentClick=e=>{const o=this.__getActionFromEvent(e);if(o){o==="open"&&this.__setOpen(!0),o==="close"&&this.__setOpen(!1),o==="toggle"&&this.__setOpen(!this.open),e.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(e.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=e=>{if(this.open){if(e.key==="Escape"){this.__setOpen(!1);return}if(this.overlay&&e.key==="Tab"){const o=this.__getFocusable();if(o.length===0)return;const r=o[0],s=o[o.length-1],i=document.activeElement;e.shiftKey?(i===r||!i||!this.contains(i))&&(e.preventDefault(),s.focus()):(i===s||!i||!this.contains(i))&&(e.preventDefault(),r.focus())}}}}static __ensureOverlayStyles(){if(typeof document>"u"||document.getElementById("scb-drawer-overlay-styles"))return;const e=document.createElement("style");e.id="scb-drawer-overlay-styles",e.textContent=`
|
|
2
2
|
.scb-drawer-global-overlay {
|
|
3
3
|
position: fixed;
|
|
4
4
|
inset: 0;
|
|
@@ -15,15 +15,15 @@ import{a as _,n as a,i as u,E as c,x as f,t as h}from"../../vendor/vendor.js";im
|
|
|
15
15
|
@media (prefers-reduced-motion: reduce) {
|
|
16
16
|
.scb-drawer-global-overlay { transition: none; }
|
|
17
17
|
}
|
|
18
|
-
`,document.head.appendChild(e)}static __ensureOverlay(){if(typeof document>"u"||t.__overlayEl)return;t.__ensureOverlayStyles();const e=document.createElement("div");e.className="scb-drawer-global-overlay",e.addEventListener("pointerdown",()=>{const o=t.__overlayStack[t.__overlayStack.length-1];o&&o.closeOnOverlay&&o.__setOpen(!1)},{passive:!0}),document.body.appendChild(e),t.__overlayEl=e}static __showOverlay(e){t.__ensureOverlay(),t.__overlayEl&&(t.__overlayStack.includes(e)||t.__overlayStack.push(e),t.__overlayEl.classList.add("is-visible"))}static __hideOverlay(e){const o=t.__overlayStack.indexOf(e);o>=0&&t.__overlayStack.splice(o,1),t.__overlayStack.length===0&&t.__overlayEl&&t.__overlayEl.classList.remove("is-visible")}static __lockScrollEnable(){if(!(typeof document>"u")){if(t.__lockedCount===0){t.__prevDocOverflow=document.documentElement.style.overflow||"",t.__prevBodyOverflow=document.body.style.overflow||"",t.__prevDocPaddingRight=document.documentElement.style.paddingRight||"",t.__prevBodyPaddingRight=document.body.style.paddingRight||"";const e=Math.max(0,window.innerWidth-document.documentElement.clientWidth);if(e>0){const o=Number.parseFloat(getComputedStyle(document.documentElement).paddingRight||"0"),
|
|
18
|
+
`,document.head.appendChild(e)}static __ensureOverlay(){if(typeof document>"u"||t.__overlayEl)return;t.__ensureOverlayStyles();const e=document.createElement("div");e.className="scb-drawer-global-overlay",e.addEventListener("pointerdown",()=>{const o=t.__overlayStack[t.__overlayStack.length-1];o&&o.closeOnOverlay&&o.__setOpen(!1)},{passive:!0}),document.body.appendChild(e),t.__overlayEl=e}static __showOverlay(e){t.__ensureOverlay(),t.__overlayEl&&(t.__overlayStack.includes(e)||t.__overlayStack.push(e),t.__overlayEl.classList.add("is-visible"))}static __hideOverlay(e){const o=t.__overlayStack.indexOf(e);o>=0&&t.__overlayStack.splice(o,1),t.__overlayStack.length===0&&t.__overlayEl&&t.__overlayEl.classList.remove("is-visible")}static __lockScrollEnable(){if(!(typeof document>"u")){if(t.__lockedCount===0){t.__prevDocOverflow=document.documentElement.style.overflow||"",t.__prevBodyOverflow=document.body.style.overflow||"",t.__prevDocPaddingRight=document.documentElement.style.paddingRight||"",t.__prevBodyPaddingRight=document.body.style.paddingRight||"";const e=Math.max(0,window.innerWidth-document.documentElement.clientWidth);if(e>0){const o=Number.parseFloat(getComputedStyle(document.documentElement).paddingRight||"0"),r=Number.parseFloat(getComputedStyle(document.body).paddingRight||"0");document.documentElement.style.paddingRight=`${o+e}px`,document.body.style.paddingRight=`${r+e}px`}document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden"}t.__lockedCount++}}static __lockScrollDisable(){typeof document>"u"||(t.__lockedCount=Math.max(0,t.__lockedCount-1),t.__lockedCount===0&&(document.documentElement.style.overflow=t.__prevDocOverflow??"",document.body.style.overflow=t.__prevBodyOverflow??"",document.documentElement.style.paddingRight=t.__prevDocPaddingRight??"",document.body.style.paddingRight=t.__prevBodyPaddingRight??""))}render(){const e=this.modal&&this.overlay&&this.floating;return f`
|
|
19
19
|
<div
|
|
20
20
|
class="root"
|
|
21
|
-
role=${e?"dialog":
|
|
22
|
-
aria-modal=${e?"true":
|
|
21
|
+
role=${e?"dialog":d}
|
|
22
|
+
aria-modal=${e?"true":d}
|
|
23
23
|
>
|
|
24
24
|
<div class="panel"><slot></slot></div>
|
|
25
25
|
</div>
|
|
26
|
-
`}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener("click",this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(t.__hideOverlay(this),this.lockScroll&&t.__lockScrollDisable()),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;const o=e.composedPath();for(const
|
|
26
|
+
`}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener("click",this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(t.__hideOverlay(this),this.lockScroll&&t.__lockScrollDisable()),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;const o=e.composedPath();for(const r of o)if(r instanceof Element){if(r.getAttribute("data-drawer-open")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"open";if(r.getAttribute("data-drawer-close")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"close";if(r.getAttribute("data-drawer-toggle")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"toggle";if(r.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!0,"toggle"}return null}__getFocusable(){const e='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',o=new Set,r=s=>{s.querySelectorAll(e).forEach(i=>o.add(i))};return r(this),r(this.renderRoot),Array.from(o).filter(s=>!s.hasAttribute("disabled")&&s.tabIndex>=0)}__setOpen(e){this.open=e}__syncLastTriggerExpanded(e){this.__lastTriggerEl&&this.__lastTriggerWasAriaControls&&this.__lastTriggerEl.getAttribute("aria-controls")===this.id&&this.__lastTriggerEl.setAttribute("aria-expanded",String(e))}__syncEffectiveSide(e){const o=this.left&&this.right;let r;o?e.has("left")&&this.left&&!e.has("right")?r="left":r="right":this.right?r="right":r="left",this.__effectiveSide!==r&&(this.__effectiveSide=r),this.getAttribute("data-side")!==r&&this.setAttribute("data-side",r)}willUpdate(e){this.__syncEffectiveSide(e)}updated(e){if(e.has("open")){const o=!!e.get("open");this.__applyOpenSideEffects(o,this.open)}}__applyOpenSideEffects(e,o){o&&!e?(this.__syncLastTriggerExpanded(!0),this.floating&&this.overlay&&(t.__showOverlay(this),this.lockScroll&&t.__lockScrollEnable()),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.updateComplete.then(()=>{this.__getFocusable()[0]?.focus?.()}),this.dispatchEvent(new CustomEvent("scb-drawer-opened",{bubbles:!0,composed:!0}))):!o&&e&&(this.__syncLastTriggerExpanded(!1),this.floating&&this.overlay&&(t.__hideOverlay(this),this.lockScroll&&t.__lockScrollDisable()),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.__lastTriggerEl?.focus?.(),this.dispatchEvent(new CustomEvent("scb-drawer-closed",{bubbles:!0,composed:!0})))}};t.__overlayEl=null;t.__overlayStack=[];t.__lockedCount=0;t.__prevDocOverflow=null;t.__prevBodyOverflow=null;t.__prevDocPaddingRight=null;t.__prevBodyPaddingRight=null;t.styles=_`
|
|
27
27
|
:host {
|
|
28
28
|
display: block;
|
|
29
29
|
color: var(--md-sys-color-on-surface);
|
|
@@ -112,10 +112,17 @@ import{a as _,n as a,i as u,E as c,x as f,t as h}from"../../vendor/vendor.js";im
|
|
|
112
112
|
flex: 1 1 auto;
|
|
113
113
|
min-height: 0;
|
|
114
114
|
overflow: auto;
|
|
115
|
+
scrollbar-gutter: stable;
|
|
115
116
|
-webkit-overflow-scrolling: touch;
|
|
116
117
|
}
|
|
117
118
|
:host([floating]:not([open])) .panel {
|
|
118
119
|
content-visibility: auto;
|
|
119
120
|
contain-intrinsic-size: 0 600px;
|
|
120
121
|
}
|
|
122
|
+
|
|
123
|
+
@supports not (scrollbar-gutter: stable) {
|
|
124
|
+
.panel {
|
|
125
|
+
overflow-y: scroll;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
121
128
|
`;n([a({type:Boolean,reflect:!0})],t.prototype,"floating",2);n([a({type:Boolean,reflect:!0})],t.prototype,"left",2);n([a({type:Boolean,reflect:!0})],t.prototype,"right",2);n([a({type:Boolean,reflect:!0})],t.prototype,"open",2);n([a({type:Boolean,reflect:!0})],t.prototype,"overlay",2);n([a({type:Boolean,reflect:!0,attribute:"lock-scroll"})],t.prototype,"lockScroll",2);n([a({type:Boolean,reflect:!0,attribute:"close-on-overlay"})],t.prototype,"closeOnOverlay",2);n([a({type:Boolean,reflect:!0})],t.prototype,"modal",2);t=n([h("scb-drawer")],t);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.210",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -378,5 +378,5 @@
|
|
|
378
378
|
},
|
|
379
379
|
"./mvc/*": "./mvc/*"
|
|
380
380
|
},
|
|
381
|
-
"buildHash": "
|
|
381
|
+
"buildHash": "0258D3DB31E344F34846D7BE4EC69608053D34873F571F930DF4B7B94C9541F0"
|
|
382
382
|
}
|
|
@@ -8,15 +8,15 @@ import "@material/web/focus/md-focus-ring.js";
|
|
|
8
8
|
var J = Object.defineProperty, U = Object.getOwnPropertyDescriptor, q = (t) => {
|
|
9
9
|
throw TypeError(t);
|
|
10
10
|
}, _ = (t, e, s, i) => {
|
|
11
|
-
for (var
|
|
12
|
-
(d = t[a]) && (
|
|
13
|
-
return i &&
|
|
11
|
+
for (var l = i > 1 ? void 0 : i ? U(e, s) : e, a = t.length - 1, d; a >= 0; a--)
|
|
12
|
+
(d = t[a]) && (l = (i ? d(e, s, l) : d(l)) || l);
|
|
13
|
+
return i && l && J(e, s, l), l;
|
|
14
14
|
}, B = (t, e, s) => e.has(t) || q("Cannot " + s), I = (t, e, s) => e.has(t) ? q("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), L = (t, e, s) => (B(t, e, "access private method"), s), N, O;
|
|
15
15
|
let f = class extends j {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments), I(this, N), this._lastActiveDay = null, this.lang = "sv", this.disableWeekend = !1, this.publicHolidays = !0, this.displayYear = (/* @__PURE__ */ new Date()).getFullYear(), this.displayMonth = (/* @__PURE__ */ new Date()).getMonth() + 1, this.selectedDate = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0, this._mutationObserver = null, this._syncingDisplay = !1, this._onCalendarKeyDown = (t) => {
|
|
18
18
|
var k, v;
|
|
19
|
-
const s = Array.from(((k = this.shadowRoot) == null ? void 0 : k.querySelectorAll(".calendar-day.has-event")) ?? []), i = (v = this.shadowRoot) == null ? void 0 : v.activeElement,
|
|
19
|
+
const s = Array.from(((k = this.shadowRoot) == null ? void 0 : k.querySelectorAll(".calendar-day.has-event")) ?? []), i = (v = this.shadowRoot) == null ? void 0 : v.activeElement, l = i && s.includes(i) ? i : document.activeElement, a = s.indexOf(l);
|
|
20
20
|
if (a === -1) return;
|
|
21
21
|
let d = a;
|
|
22
22
|
const p = this.disableWeekend ? 5 : 7;
|
|
@@ -67,8 +67,8 @@ let f = class extends j {
|
|
|
67
67
|
if ((e = super.updated) == null || e.call(this, t), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom") || t.has("spacingLeft") || t.has("spacingRight")) && L(this, N, O).call(this), !this._syncingDisplay && (t.has("displayYear") || t.has("displayMonth"))) {
|
|
68
68
|
const s = Number(this.displayYear), i = Number(this.displayMonth);
|
|
69
69
|
if (!Number.isNaN(s) && !Number.isNaN(i) && i >= 1 && i <= 12) {
|
|
70
|
-
const
|
|
71
|
-
(
|
|
70
|
+
const l = this._current.getFullYear(), a = this._current.getMonth() + 1;
|
|
71
|
+
(l !== s || a !== i) && (this._current = new Date(s, i - 1, 1), this.dispatchEvent(
|
|
72
72
|
new CustomEvent("scb-calendar-month-change", {
|
|
73
73
|
bubbles: !0,
|
|
74
74
|
composed: !0,
|
|
@@ -116,8 +116,8 @@ let f = class extends j {
|
|
|
116
116
|
detail: { selectedDate: t.date }
|
|
117
117
|
})
|
|
118
118
|
), this._lastActiveDay = ((e = this.shadowRoot) == null ? void 0 : e.activeElement) || document.activeElement, this.requestUpdate(), this.updateComplete.then(() => {
|
|
119
|
-
var
|
|
120
|
-
const s = (
|
|
119
|
+
var l;
|
|
120
|
+
const s = (l = this.shadowRoot) == null ? void 0 : l.querySelector("scb-dialog");
|
|
121
121
|
s && (document.activeElement && (s.__lastTriggerEl = document.activeElement), requestAnimationFrame(() => {
|
|
122
122
|
requestAnimationFrame(() => {
|
|
123
123
|
s.open = !0;
|
|
@@ -144,7 +144,7 @@ let f = class extends j {
|
|
|
144
144
|
return new Date(this._easterDateCalculated["Ar" + t]);
|
|
145
145
|
let e = t;
|
|
146
146
|
e < 100 && (e = e + 1900), e < 1950 && (e = e + 100);
|
|
147
|
-
const s = e % 19, i = e % 4,
|
|
147
|
+
const s = e % 19, i = e % 4, l = e % 7, a = (19 * s + 24) % 30, d = (2 * i + 4 * l + 6 * a + 5) % 7;
|
|
148
148
|
let p = 22 + a + d, k = 0;
|
|
149
149
|
p == 57 && (p -= 7), p == 56 && a == 28 && d == 6 && s > 10 && (p -= 7), p > 31 ? (p -= 31, k = 4) : k = 3;
|
|
150
150
|
const v = new Date(e, k - 1, p);
|
|
@@ -156,7 +156,7 @@ let f = class extends j {
|
|
|
156
156
|
_swedishHolidayName(t) {
|
|
157
157
|
const e = t.getMonth();
|
|
158
158
|
if (e === 1 || e === 6 || e === 7 || e === 8) return null;
|
|
159
|
-
const s = t.getMonth() + 1, i = t.getDate(),
|
|
159
|
+
const s = t.getMonth() + 1, i = t.getDate(), l = t.getFullYear(), a = this._easterDay(l), d = this.lang === "en", p = [
|
|
160
160
|
// [svenska, engelska, villkor]
|
|
161
161
|
["Nyårsdagen", "New Year's Day", s === 1 && i === 1],
|
|
162
162
|
["Trettondedag jul", "Epiphany", s === 1 && i === 6],
|
|
@@ -164,9 +164,9 @@ let f = class extends j {
|
|
|
164
164
|
["Påskdagen", "Easter Sunday", +t == +a],
|
|
165
165
|
["Annandag påsk", "Easter Monday", +t == +this._addDays(a, 1)],
|
|
166
166
|
["Kristi himmelsfärdsdag", "Ascension Day", +t == +this._addDays(a, 39)],
|
|
167
|
-
["Pingstdagen", "Pentecost", +t == +this._addDays(a, 50) &&
|
|
167
|
+
["Pingstdagen", "Pentecost", +t == +this._addDays(a, 50) && l < 2005],
|
|
168
168
|
["Första maj", "May Day", s === 5 && i === 1],
|
|
169
|
-
["Nationaldagen", "National Day", s === 6 && i === 6 &&
|
|
169
|
+
["Nationaldagen", "National Day", s === 6 && i === 6 && l >= 2005],
|
|
170
170
|
["Midsommarafton", "Midsummer's Eve", s === 6 && i >= 19 && i <= 25 && t.getDay() === 5],
|
|
171
171
|
["Midsommardagen", "Midsummer's Day", s === 6 && i >= 20 && i <= 26 && t.getDay() === 6],
|
|
172
172
|
["Julafton", "Christmas Eve", s === 12 && i === 24],
|
|
@@ -181,7 +181,7 @@ let f = class extends j {
|
|
|
181
181
|
return null;
|
|
182
182
|
}
|
|
183
183
|
render() {
|
|
184
|
-
const t = this._current.getFullYear(), e = this._current.getMonth(), s = this._daysInMonth(t, e), i = this._firstDayOfWeek(t, e),
|
|
184
|
+
const t = this._current.getFullYear(), e = this._current.getMonth(), s = this._daysInMonth(t, e), i = this._firstDayOfWeek(t, e), l = this._today, a = this.lang === "en", d = a ? [
|
|
185
185
|
"January",
|
|
186
186
|
"February",
|
|
187
187
|
"March",
|
|
@@ -212,51 +212,51 @@ let f = class extends j {
|
|
|
212
212
|
this.disableWeekend && (p = p.slice(0, 5));
|
|
213
213
|
const k = Array.from(this.querySelectorAll("scb-calendar-event")), v = /* @__PURE__ */ new Map();
|
|
214
214
|
for (const n of k) {
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
217
|
-
const c = new Date(
|
|
215
|
+
const o = n.getAttribute("start-date") || "", u = n.getAttribute("end-date") || "";
|
|
216
|
+
if (o && u) {
|
|
217
|
+
const c = new Date(o), y = new Date(u);
|
|
218
218
|
for (let m = new Date(c); m <= y; m.setDate(m.getDate() + 1)) {
|
|
219
219
|
const g = m.toISOString().split("T")[0], E = v.get(g) || [];
|
|
220
220
|
E.push({
|
|
221
221
|
title: n.title,
|
|
222
222
|
description: n.description,
|
|
223
|
-
start:
|
|
223
|
+
start: o,
|
|
224
224
|
end: u
|
|
225
225
|
}), v.set(g, E);
|
|
226
226
|
}
|
|
227
|
-
} else if (
|
|
228
|
-
const c =
|
|
229
|
-
y.push({ title: n.title, description: n.description, start:
|
|
227
|
+
} else if (o && n.title) {
|
|
228
|
+
const c = o.split("T")[0], y = v.get(c) || [];
|
|
229
|
+
y.push({ title: n.title, description: n.description, start: o }), v.set(c, y);
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
const A = [];
|
|
233
233
|
let x = 1;
|
|
234
234
|
for (let n = 0; n < 6; n++) {
|
|
235
|
-
const
|
|
235
|
+
const o = [], u = this.disableWeekend ? [0, 1, 2, 3, 4] : [0, 1, 2, 3, 4, 5, 6];
|
|
236
236
|
let c = x;
|
|
237
237
|
for (let y = 0; y < u.length; y++) {
|
|
238
238
|
const m = u[y];
|
|
239
239
|
if (n === 0 && m < i) {
|
|
240
240
|
if (!this.disableWeekend || m < 5) {
|
|
241
241
|
const g = e === 0 ? 11 : e - 1, E = e === 0 ? t - 1 : t, F = this._daysInMonth(E, g) - (i - m - 1);
|
|
242
|
-
|
|
242
|
+
o.push(w`
|
|
243
243
|
<div class="calendar-day calendar-day--other">
|
|
244
244
|
<span class="calendar-day-number">${F}</span>
|
|
245
245
|
</div>
|
|
246
246
|
`);
|
|
247
247
|
}
|
|
248
248
|
} else if (c > s)
|
|
249
|
-
|
|
249
|
+
o.push(w`<div></div>`);
|
|
250
250
|
else {
|
|
251
251
|
let g = new Date(t, e, c);
|
|
252
252
|
if (this.disableWeekend)
|
|
253
253
|
for (; g.getDay() === 0 || g.getDay() === 6; )
|
|
254
254
|
c++, g = new Date(t, e, c);
|
|
255
255
|
if (c > s) {
|
|
256
|
-
|
|
256
|
+
o.push(w`<div></div>`);
|
|
257
257
|
continue;
|
|
258
258
|
}
|
|
259
|
-
const E =
|
|
259
|
+
const E = l.getFullYear() === t && l.getMonth() === e && l.getDate() === c, D = `${t}-${String(e + 1).padStart(2, "0")}-${String(c).padStart(2, "0")}`, F = new Date(t, e, c);
|
|
260
260
|
let P = !1, M = null;
|
|
261
261
|
this.publicHolidays && (M = this._swedishHolidayName(F), P = !!M);
|
|
262
262
|
let h = v.get(D) || [];
|
|
@@ -272,7 +272,7 @@ let f = class extends j {
|
|
|
272
272
|
} else r.start && r.start.includes("T") && (b = r.start.split("T")[1].substring(0, 5));
|
|
273
273
|
return { ...r, time: b, prefix: S };
|
|
274
274
|
});
|
|
275
|
-
|
|
275
|
+
o.push(w`
|
|
276
276
|
<div
|
|
277
277
|
class="calendar-day${E ? " today" : ""}${h.length ? " has-event" : ""}${P ? " calendar-day--holiday" : ""}"
|
|
278
278
|
tabindex=${h.length ? "0" : void 0}
|
|
@@ -293,7 +293,7 @@ let f = class extends j {
|
|
|
293
293
|
`), c++;
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
if (x = c, A.push(w`<div class="calendar-grid">${
|
|
296
|
+
if (x = c, A.push(w`<div class="calendar-grid">${o}</div>`), x > s) break;
|
|
297
297
|
}
|
|
298
298
|
return w`
|
|
299
299
|
<div class="calendar-header">
|
|
@@ -310,16 +310,16 @@ let f = class extends j {
|
|
|
310
310
|
${this._popupEvent && Array.isArray(this._popupEvent.events) ? w`
|
|
311
311
|
<scb-dialog variant="floating" open label="${a ? "Events" : "Händelser"} ${this._popupEvent.date}">
|
|
312
312
|
<scb-list>
|
|
313
|
-
${[...this._popupEvent.events].sort((n,
|
|
314
|
-
const u = n.start && n.start.includes("T") ? n.start : n.end && n.end.includes("T") ? n.end : "", c =
|
|
315
|
-
return y && m ? u.localeCompare(c) : y ? -1 : m ? 1 : n.title.localeCompare(
|
|
313
|
+
${[...this._popupEvent.events].sort((n, o) => {
|
|
314
|
+
const u = n.start && n.start.includes("T") ? n.start : n.end && n.end.includes("T") ? n.end : "", c = o.start && o.start.includes("T") ? o.start : o.end && o.end.includes("T") ? o.end : "", y = u && u.includes("T"), m = c && c.includes("T");
|
|
315
|
+
return y && m ? u.localeCompare(c) : y ? -1 : m ? 1 : n.title.localeCompare(o.title);
|
|
316
316
|
}).map((n) => {
|
|
317
317
|
var m;
|
|
318
|
-
const
|
|
318
|
+
const o = ((m = this._popupEvent) == null ? void 0 : m.date) ?? "";
|
|
319
319
|
let u = "", c = "", y = "";
|
|
320
320
|
if (n.start && n.end) {
|
|
321
321
|
const g = n.start.split("T")[0], E = n.end.split("T")[0];
|
|
322
|
-
g === E && n.start.includes("T") && n.end.includes("T") ? u = n.start.split("T")[1].substring(0, 5) + " – " + n.end.split("T")[1].substring(0, 5) :
|
|
322
|
+
g === E && n.start.includes("T") && n.end.includes("T") ? u = n.start.split("T")[1].substring(0, 5) + " – " + n.end.split("T")[1].substring(0, 5) : o === g && n.start.includes("T") && (u = "Start: " + n.start.split("T")[1].substring(0, 5) + (a ? " (Extended event) " : " (Flerdagsevenemang) ")), o === E && n.end.includes("T") && g !== E && (y = (a ? "End: " : "Slut: ") + n.end.split("T")[1].substring(0, 5)), o !== g && (c = a ? "cont. " : "fort. ");
|
|
323
323
|
} else n.start && n.start.includes("T") && (u = n.start.split("T")[1].substring(0, 5));
|
|
324
324
|
return w`
|
|
325
325
|
<scb-list-item label="${c}${n.title}" supporting-text="${n.description ? n.description : ""}" overline="${u || ""}${y || ""}">
|
|
@@ -333,8 +333,8 @@ let f = class extends j {
|
|
|
333
333
|
};
|
|
334
334
|
N = /* @__PURE__ */ new WeakSet();
|
|
335
335
|
O = function() {
|
|
336
|
-
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, s = this.mapSpacingToken(this.spacingBottom) ?? t, i = this.mapSpacingToken(this.spacingLeft),
|
|
337
|
-
e ? this.style.setProperty("--scb-calendar-spacing-block-start", e) : this.style.removeProperty("--scb-calendar-spacing-block-start"), s ? this.style.setProperty("--scb-calendar-spacing-block-end", s) : this.style.removeProperty("--scb-calendar-spacing-block-end"), i ? this.style.setProperty("--scb-calendar-spacing-inline-start", i) : this.style.removeProperty("--scb-calendar-spacing-inline-start"),
|
|
336
|
+
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, s = this.mapSpacingToken(this.spacingBottom) ?? t, i = this.mapSpacingToken(this.spacingLeft), l = this.mapSpacingToken(this.spacingRight);
|
|
337
|
+
e ? this.style.setProperty("--scb-calendar-spacing-block-start", e) : this.style.removeProperty("--scb-calendar-spacing-block-start"), s ? this.style.setProperty("--scb-calendar-spacing-block-end", s) : this.style.removeProperty("--scb-calendar-spacing-block-end"), i ? this.style.setProperty("--scb-calendar-spacing-inline-start", i) : this.style.removeProperty("--scb-calendar-spacing-inline-start"), l ? this.style.setProperty("--scb-calendar-spacing-inline-end", l) : this.style.removeProperty("--scb-calendar-spacing-inline-end");
|
|
338
338
|
};
|
|
339
339
|
f.styles = W`
|
|
340
340
|
:host {
|
|
@@ -399,7 +399,13 @@ f.styles = W`
|
|
|
399
399
|
border-radius: 6px;
|
|
400
400
|
}
|
|
401
401
|
.calendar-day--other {
|
|
402
|
-
|
|
402
|
+
color: light-dark(var(--n-40), var(--n-70));
|
|
403
|
+
}
|
|
404
|
+
.calendar-day--other .calendar-day-event-title {
|
|
405
|
+
color: inherit;
|
|
406
|
+
}
|
|
407
|
+
.calendar-day--other .calendar-day-number {
|
|
408
|
+
font-weight: var(--weight-regular);
|
|
403
409
|
}
|
|
404
410
|
.calendar-day-number {
|
|
405
411
|
font-size: var(--md-sys-typescale-label-small-size);
|
package/scb-drawer/scb-drawer.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { css as _, LitElement as u, nothing as c, html as f } from "lit";
|
|
2
|
-
import { property as
|
|
2
|
+
import { property as l, customElement as h } from "lit/decorators.js";
|
|
3
3
|
import "../scb-divider/scb-divider.js";
|
|
4
4
|
var p = Object.defineProperty, y = Object.getOwnPropertyDescriptor, n = (e, r, o, s) => {
|
|
5
|
-
for (var i = s > 1 ? void 0 : s ? y(r, o) : r,
|
|
6
|
-
(d = e[
|
|
5
|
+
for (var i = s > 1 ? void 0 : s ? y(r, o) : r, a = e.length - 1, d; a >= 0; a--)
|
|
6
|
+
(d = e[a]) && (i = (s ? d(r, o, i) : d(i)) || i);
|
|
7
7
|
return s && i && p(r, o, i), i;
|
|
8
8
|
};
|
|
9
9
|
let t = class extends u {
|
|
@@ -169,9 +169,9 @@ let t = class extends u {
|
|
|
169
169
|
this.__onDocumentKeydown,
|
|
170
170
|
!0
|
|
171
171
|
), this.updateComplete.then(() => {
|
|
172
|
-
var
|
|
172
|
+
var a;
|
|
173
173
|
const i = this.__getFocusable()[0];
|
|
174
|
-
(
|
|
174
|
+
(a = i == null ? void 0 : i.focus) == null || a.call(i);
|
|
175
175
|
}), this.dispatchEvent(
|
|
176
176
|
new CustomEvent("scb-drawer-opened", {
|
|
177
177
|
bubbles: !0,
|
|
@@ -285,36 +285,43 @@ t.styles = _`
|
|
|
285
285
|
flex: 1 1 auto;
|
|
286
286
|
min-height: 0;
|
|
287
287
|
overflow: auto;
|
|
288
|
+
scrollbar-gutter: stable;
|
|
288
289
|
-webkit-overflow-scrolling: touch;
|
|
289
290
|
}
|
|
290
291
|
:host([floating]:not([open])) .panel {
|
|
291
292
|
content-visibility: auto;
|
|
292
293
|
contain-intrinsic-size: 0 600px;
|
|
293
294
|
}
|
|
295
|
+
|
|
296
|
+
@supports not (scrollbar-gutter: stable) {
|
|
297
|
+
.panel {
|
|
298
|
+
overflow-y: scroll;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
294
301
|
`;
|
|
295
302
|
n([
|
|
296
|
-
|
|
303
|
+
l({ type: Boolean, reflect: !0 })
|
|
297
304
|
], t.prototype, "floating", 2);
|
|
298
305
|
n([
|
|
299
|
-
|
|
306
|
+
l({ type: Boolean, reflect: !0 })
|
|
300
307
|
], t.prototype, "left", 2);
|
|
301
308
|
n([
|
|
302
|
-
|
|
309
|
+
l({ type: Boolean, reflect: !0 })
|
|
303
310
|
], t.prototype, "right", 2);
|
|
304
311
|
n([
|
|
305
|
-
|
|
312
|
+
l({ type: Boolean, reflect: !0 })
|
|
306
313
|
], t.prototype, "open", 2);
|
|
307
314
|
n([
|
|
308
|
-
|
|
315
|
+
l({ type: Boolean, reflect: !0 })
|
|
309
316
|
], t.prototype, "overlay", 2);
|
|
310
317
|
n([
|
|
311
|
-
|
|
318
|
+
l({ type: Boolean, reflect: !0, attribute: "lock-scroll" })
|
|
312
319
|
], t.prototype, "lockScroll", 2);
|
|
313
320
|
n([
|
|
314
|
-
|
|
321
|
+
l({ type: Boolean, reflect: !0, attribute: "close-on-overlay" })
|
|
315
322
|
], t.prototype, "closeOnOverlay", 2);
|
|
316
323
|
n([
|
|
317
|
-
|
|
324
|
+
l({ type: Boolean, reflect: !0 })
|
|
318
325
|
], t.prototype, "modal", 2);
|
|
319
326
|
t = n([
|
|
320
327
|
h("scb-drawer")
|
package/scb-wc-test.bundle.js
CHANGED
|
@@ -4857,7 +4857,13 @@ ${this.value}</textarea
|
|
|
4857
4857
|
border-radius: 6px;
|
|
4858
4858
|
}
|
|
4859
4859
|
.calendar-day--other {
|
|
4860
|
-
|
|
4860
|
+
color: light-dark(var(--n-40), var(--n-70));
|
|
4861
|
+
}
|
|
4862
|
+
.calendar-day--other .calendar-day-event-title {
|
|
4863
|
+
color: inherit;
|
|
4864
|
+
}
|
|
4865
|
+
.calendar-day--other .calendar-day-number {
|
|
4866
|
+
font-weight: var(--weight-regular);
|
|
4861
4867
|
}
|
|
4862
4868
|
.calendar-day-number {
|
|
4863
4869
|
font-size: var(--md-sys-typescale-label-small-size);
|
|
@@ -6126,12 +6132,19 @@ ${this.value}</textarea
|
|
|
6126
6132
|
flex: 1 1 auto;
|
|
6127
6133
|
min-height: 0;
|
|
6128
6134
|
overflow: auto;
|
|
6135
|
+
scrollbar-gutter: stable;
|
|
6129
6136
|
-webkit-overflow-scrolling: touch;
|
|
6130
6137
|
}
|
|
6131
6138
|
:host([floating]:not([open])) .panel {
|
|
6132
6139
|
content-visibility: auto;
|
|
6133
6140
|
contain-intrinsic-size: 0 600px;
|
|
6134
6141
|
}
|
|
6142
|
+
|
|
6143
|
+
@supports not (scrollbar-gutter: stable) {
|
|
6144
|
+
.panel {
|
|
6145
|
+
overflow-y: scroll;
|
|
6146
|
+
}
|
|
6147
|
+
}
|
|
6135
6148
|
`,Ai([a({type:Boolean,reflect:!0})],T.prototype,"floating",2),Ai([a({type:Boolean,reflect:!0})],T.prototype,"left",2),Ai([a({type:Boolean,reflect:!0})],T.prototype,"right",2),Ai([a({type:Boolean,reflect:!0})],T.prototype,"open",2),Ai([a({type:Boolean,reflect:!0})],T.prototype,"overlay",2),Ai([a({type:Boolean,reflect:!0,attribute:"lock-scroll"})],T.prototype,"lockScroll",2),Ai([a({type:Boolean,reflect:!0,attribute:"close-on-overlay"})],T.prototype,"closeOnOverlay",2),Ai([a({type:Boolean,reflect:!0})],T.prototype,"modal",2),T=Ai([g("scb-drawer")],T);var ob=Object.defineProperty,ab=Object.getOwnPropertyDescriptor,Ji=(t,e,i,r)=>{for(var s=r>1?void 0:r?ab(e,i):e,o=t.length-1,n;o>=0;o--)(n=t[o])&&(s=(r?n(e,i,s):n(s))||s);return r&&s&&ob(e,i,s),s};let ci=class extends y{constructor(){super(...arguments),this.label="",this.hasSubMenu=!1,this.openLeft=!1,this.divider=!1,this.leadingIcon="",this.trailingIcon="",this.itemHref="",this._observedSubMenu=null,this._syncSubMenuFlags=()=>{var s;const t=this.nextElementSibling,e=!!(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"),i=!!(e&&t.hasAttribute("open-left"));e!==this.hasSubMenu&&(this.hasSubMenu=e),i!==this.openLeft&&(this.openLeft=i);const r=e?t:null;r!==this._observedSubMenu&&((s=this._subMenuAttrObserver)==null||s.disconnect(),this._subMenuAttrObserver=void 0,this._observedSubMenu=r,r&&(this._subMenuAttrObserver=new MutationObserver(()=>this._syncSubMenuFlags()),this._subMenuAttrObserver.observe(r,{attributes:!0,attributeFilter:["open-left"]})))},this.handleClick=t=>{this.itemHref?this._navigateToHref(t):this._toggleSubMenu()},this._onBlur=t=>{const e=this.closest("scb-options-sub-menu");if(e&&e.open){const i=t.relatedTarget;(!i||!e.contains(i))&&e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0}))}},this._onFocus=()=>{const t=this.nextElementSibling;this.classList.contains("open-submenu")&&(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&t.hasAttribute("open")||this.classList.remove("open-submenu"))},this._onKeyDown=t=>{var e,i,r,s,o,n;if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.handleClick(t);return}if(t.key==="ArrowDown"){t.preventDefault();let l=this.nextElementSibling;for(;l&&l.tagName!=="SCB-OPTIONS-MENU-ITEM";)l=l.nextElementSibling;l&&((i=(e=l.shadowRoot)==null?void 0:e.querySelector("li"))==null||i.focus());return}if(t.key==="ArrowUp"){t.preventDefault();let l=this.previousElementSibling;for(;l&&l.tagName!=="SCB-OPTIONS-MENU-ITEM";)l=l.previousElementSibling;l&&((s=(r=l.shadowRoot)==null?void 0:r.querySelector("li"))==null||s.focus());return}if(t.key==="ArrowRight"){t.preventDefault();const l=this.nextElementSibling;l&&l.tagName==="SCB-OPTIONS-SUB-MENU"&&(l.hasAttribute("open")||(this._toggleSubMenu(),l.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0}))),setTimeout(()=>{var u,v;const d=l.querySelector("scb-options-menu-item");d&&((v=(u=d.shadowRoot)==null?void 0:u.querySelector("li"))==null||v.focus())},0));return}if(t.key==="ArrowLeft"){t.preventDefault();const l=this.nextElementSibling;if(l&&l.tagName==="SCB-OPTIONS-SUB-MENU"&&l.hasAttribute("open")){this._toggleSubMenu(),l.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0}));return}const d=this.closest("scb-options-sub-menu");if(d){const u=d.previousElementSibling;u&&u.tagName==="SCB-OPTIONS-MENU-ITEM"&&((n=(o=u.shadowRoot)==null?void 0:o.querySelector("li"))==null||n.focus())}return}}}connectedCallback(){super.connectedCallback(),this._syncSubMenuFlags(),this._subMenuChildObserver??(this._subMenuChildObserver=new MutationObserver(()=>this._syncSubMenuFlags())),this._subMenuChildObserver.disconnect();const t=this.parentElement;t&&this._subMenuChildObserver.observe(t,{childList:!0})}disconnectedCallback(){var t,e;(t=this._subMenuChildObserver)==null||t.disconnect(),(e=this._subMenuAttrObserver)==null||e.disconnect(),this._subMenuChildObserver=void 0,this._subMenuAttrObserver=void 0,this._observedSubMenu=null,super.disconnectedCallback()}render(){return c`
|
|
6136
6149
|
${this.divider?c`<scb-divider></scb-divider>`:""}
|
|
6137
6150
|
<li @click=${this.handleClick} @keydown=${this._onKeyDown} @blur=${this._onBlur} @focus=${this._onFocus} role="menuitem" tabindex="0">
|