scb-wc 0.1.37 → 0.1.39
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/README.md +41 -22
- package/all.js +0 -2
- package/index.js +88 -90
- package/mvc/components/all.js +0 -2
- package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +319 -24
- package/mvc/components/scb-toc/scb-toc-item.js +21 -3
- package/mvc/{components/scb-chevron → vendor}/scb-chevron.js +1 -1
- package/package.json +2 -2
- package/scb-chevron/scb-chevron.js +0 -1
- package/scb-datepicker/scb-datepicker.js +0 -1
- package/scb-toc/scb-toc-item.js +21 -2
- package/scb-wc-public-entry/index.d.ts +92 -0
- package/scb-wc.bundle.js +235 -217
- package/scb-wc.d.ts +184 -188
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -296
- package/scb-components/index.d.ts +0 -94
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -39
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import"../../vendor/vendor-material.js";import{_ as x,b as $,g as M,h as m,m as h,y as c}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as l}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-divider/scb-divider.js";(function(){try{var g=typeof globalThis<"u"?globalThis:window;if(!g.__scb_ce_guard_installed__){g.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,o,d){try{customElements.get(e)||t(e,o,d)}catch(r){var a=String(r||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var w,p=(w=class extends x{constructor(...t){super(...t),this._currentDate=new Date,this._selectedDate=null,this._showMonthDropdown=!1,this._showYearDropdown=!1,this.variant="date",this.lang="sv",this.selectedValue="",this.open=!0,this._selectedHour=0,this._selectedMinute=0,this._viewportMargin=8,this._popupOffset=4,this._onWindowReposition=()=>{this._positionPopupWithinViewport()},this._monthNames=[this.lang=="sv"?"Januari":"January",this.lang=="sv"?"Februari":"February",this.lang=="sv"?"Mars":"March",(this.lang=="sv","April"),this.lang=="sv"?"Maj":"May",this.lang=="sv"?"Juni":"June",this.lang=="sv"?"Juli":"July",this.lang=="sv"?"Augusti":"August",(this.lang=="sv","September"),this.lang=="sv"?"Oktober":"October",(this.lang=="sv","November"),(this.lang=="sv","December")],this._outsideClickHandler=e=>{this.open&&(e.composedPath().includes(this)||this._close())},this._prevMonth=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();o===0?this._currentDate=new Date(e-1,11,1):this._currentDate=new Date(e,o-1,1)},this._prevYear=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();this._currentDate=new Date(e-1,o,1)},this._nextMonth=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();o===11?this._currentDate=new Date(e+1,0,1):this._currentDate=new Date(e,o+1,1)},this._nextYear=()=>{const e=this._currentDate.getFullYear(),o=this._currentDate.getMonth();this._currentDate=new Date(e+1,o,1)},this._onTimeChange=e=>{const[o,d]=e.target.value.split(":"),a=parseInt(o,10),r=parseInt(d,10);this._selectedHour=isNaN(a)?0:Math.max(0,Math.min(23,a)),this._selectedMinute=isNaN(r)?0:Math.max(0,Math.min(59,r)),this._fireDateTimeChange()},this._close=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("datepicker-closed",{bubbles:!0,composed:!0}))}}_isRenderedInsideDialog(){const t=this.getRootNode(),e=t instanceof ShadowRoot?t.host:null;return e instanceof HTMLElement&&e.closest("scb-dialog")?!0:!!this.closest("scb-dialog")}_positionPopupWithinViewport(){if(!this.open)return;const t=this.renderRoot.querySelector(".datepicker-popup");if(!t)return;const e=this.parentElement?.getBoundingClientRect();if(!e)return;const o=window.innerWidth,d=window.innerHeight,a=Math.max(220,o-this._viewportMargin*2);if(this._isRenderedInsideDialog()){const v=Math.min(t.offsetWidth||380,a),_=t.offsetHeight||420,f=(o-v)/2,y=(d-_)/2,D=f-e.left,k=y-e.top;this.style.setProperty("--scb-datepicker-position","absolute"),this.style.setProperty("--scb-datepicker-top",`${k}px`),this.style.setProperty("--scb-datepicker-bottom","auto"),this.style.setProperty("--scb-datepicker-left",`${D}px`),this.style.setProperty("--scb-datepicker-transform","none"),this.style.setProperty("--scb-datepicker-computed-width",`${v}px`),this.style.setProperty("--scb-datepicker-max-height",`${Math.max(220,d-this._viewportMargin*2)}px`);return}const r=Math.min(t.offsetWidth||380,a),s=t.offsetHeight||420,i=Math.min(Math.max(e.left,this._viewportMargin),o-this._viewportMargin-r)-e.left,n=d-e.bottom-this._viewportMargin,u=e.top-this._viewportMargin,b=n<s+this._popupOffset&&u>n;this.style.setProperty("--scb-datepicker-position","absolute"),this.style.setProperty("--scb-datepicker-computed-width",`${r}px`),this.style.setProperty("--scb-datepicker-left","0"),this.style.setProperty("--scb-datepicker-transform",`translateX(${i}px)`),b?(this.style.setProperty("--scb-datepicker-top","auto"),this.style.setProperty("--scb-datepicker-bottom",`calc(100% + ${this._popupOffset}px)`),this.style.setProperty("--scb-datepicker-max-height",`${Math.max(0,u-this._popupOffset)}px`)):(this.style.setProperty("--scb-datepicker-top",`calc(100% + ${this._popupOffset}px)`),this.style.setProperty("--scb-datepicker-bottom","auto"),this.style.setProperty("--scb-datepicker-max-height",`${Math.max(0,n-this._popupOffset)}px`))}updated(t){if(super.updated(t),this.open?(window.addEventListener("mousedown",this._outsideClickHandler),window.addEventListener("resize",this._onWindowReposition,{passive:!0}),window.addEventListener("scroll",this._onWindowReposition,{passive:!0,capture:!0}),requestAnimationFrame(()=>this._positionPopupWithinViewport())):(window.removeEventListener("mousedown",this._outsideClickHandler),window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0)),t.has("selectedValue")&&this.selectedValue){const e=new Date(this.selectedValue);isNaN(e.getTime())||(this._selectedDate=e,this._currentDate=new Date(e.getFullYear(),e.getMonth(),1),this.variant==="datetime-local"&&(this._selectedHour=e.getHours(),this._selectedMinute=e.getMinutes()))}this.open&&requestAnimationFrame(()=>this._positionPopupWithinViewport())}disconnectedCallback(){window.removeEventListener("mousedown",this._outsideClickHandler),window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0),super.disconnectedCallback()}render(){if(!this.open)return c``;const t=this._currentDate.getFullYear(),e=this._currentDate.getMonth(),o=new Date,d=this._getMonthDays(t,e),a=Array.from({length:101},(s,i)=>o.getFullYear()-50+i),r=this.variant==="datetime-local"&&!this._showMonthDropdown&&!this._showYearDropdown;return c`
|
|
2
|
-
<div class="datepicker-popup popup">
|
|
3
|
-
<div class="header">
|
|
4
|
-
<div class="month-selector ${this._showMonthDropdown?"open":""} ${this._showYearDropdown?"disable":""}">
|
|
5
|
-
<scb-icon-button icon="chevron_left" @click=${this._prevMonth} aria-label=${this.lang=="sv"?"Föregående månad":"Previous month"}></scb-icon-button>
|
|
6
|
-
<div class="custom-dropdown month-dropdown">
|
|
7
|
-
<div
|
|
8
|
-
tabindex=${this._showYearDropdown?-1:0}
|
|
9
|
-
class="dropdown-selected"
|
|
10
|
-
@click=${()=>this._toggleMonthDropdown()}
|
|
11
|
-
@keydown=${s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),this._toggleMonthDropdown())}}
|
|
12
|
-
>
|
|
13
|
-
${this._monthNames[e].slice(0,3)}
|
|
14
|
-
<md-icon>arrow_drop_down</md-icon>
|
|
15
|
-
<md-focus-ring></md-focus-ring>
|
|
16
|
-
<md-ripple></md-ripple>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<scb-icon-button icon="chevron_right" @click=${this._nextMonth} aria-label=${this.lang=="sv"?"Nästa månad":"Next month"}></scb-icon-button>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="year-selector ${this._showMonthDropdown?"disable":""} ${this._showYearDropdown?"open":""}">
|
|
22
|
-
<scb-icon-button icon="chevron_left" @click=${this._prevYear} aria-label=${this.lang=="sv"?"Föregående år":"Previous year"}></scb-icon-button>
|
|
23
|
-
<div class="custom-dropdown year-dropdown">
|
|
24
|
-
<div
|
|
25
|
-
tabindex=${this._showMonthDropdown?-1:0}
|
|
26
|
-
class="dropdown-selected"
|
|
27
|
-
@click=${()=>this._toggleYearDropdown()}
|
|
28
|
-
@keydown=${s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),this._toggleYearDropdown())}}
|
|
29
|
-
>
|
|
30
|
-
${t}
|
|
31
|
-
<md-icon>arrow_drop_down</md-icon>
|
|
32
|
-
<md-focus-ring></md-focus-ring>
|
|
33
|
-
<md-ripple></md-ripple>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
<scb-icon-button icon="chevron_right" @click=${this._nextYear} aria-label=${this.lang=="sv"?"Nästa år":"Next year"}></scb-icon-button>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
${this._showMonthDropdown||this._showYearDropdown?c`<scb-divider></scb-divider>`:""}
|
|
40
|
-
<div class="datepicker-content" style="position:relative;">
|
|
41
|
-
${this._showMonthDropdown?c`
|
|
42
|
-
<div class="dropdown-list">
|
|
43
|
-
${this._monthNames.map((s,i)=>c`
|
|
44
|
-
<div
|
|
45
|
-
@keydown=${n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this._onMonthChangeCustom(i))}}
|
|
46
|
-
tabindex="0"
|
|
47
|
-
class="dropdown-item${i===e?" selected":""}"
|
|
48
|
-
@click=${()=>this._onMonthChangeCustom(i)}
|
|
49
|
-
id=${i===e?"selected-month":""}
|
|
50
|
-
>
|
|
51
|
-
${i===e?c`<md-icon>check</md-icon>`:""}
|
|
52
|
-
${s}
|
|
53
|
-
<md-ripple></md-ripple><md-focus-ring inward></md-focus-ring>
|
|
54
|
-
</div>
|
|
55
|
-
`)}
|
|
56
|
-
</div>
|
|
57
|
-
`:""}
|
|
58
|
-
${this._showYearDropdown?c`
|
|
59
|
-
<div class="dropdown-list">
|
|
60
|
-
${a.map(s=>c`
|
|
61
|
-
<div
|
|
62
|
-
@keydown=${i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),this._onYearChangeCustom(s))}}
|
|
63
|
-
tabindex="0"
|
|
64
|
-
class="dropdown-item${s===t?" selected":""}"
|
|
65
|
-
@click=${()=>this._onYearChangeCustom(s)}
|
|
66
|
-
id=${s===t?"selected-year":""}
|
|
67
|
-
>
|
|
68
|
-
${s===t?c`<md-icon>check</md-icon>`:""}
|
|
69
|
-
${s}
|
|
70
|
-
<md-ripple></md-ripple><md-focus-ring inward></md-focus-ring>
|
|
71
|
-
</div>
|
|
72
|
-
`)}
|
|
73
|
-
</div>
|
|
74
|
-
`:""}
|
|
75
|
-
${!this._showMonthDropdown&&!this._showYearDropdown?c`
|
|
76
|
-
<div class="datepicker-calendar">
|
|
77
|
-
<table>
|
|
78
|
-
<thead>
|
|
79
|
-
<tr>
|
|
80
|
-
<th>${this.lang=="sv"?"Må":"Mo"}</th><th>${this.lang=="sv"?"Ti":"Tu"}</th><th>${this.lang=="sv"?"On":"We"}</th><th>${this.lang=="sv"?"To":"Th"}</th><th>${this.lang=="sv","Fr"}</th><th>${this.lang=="sv"?"Lö":"Sa"}</th><th>${this.lang=="sv"?"Sö":"Su"}</th>
|
|
81
|
-
</tr>
|
|
82
|
-
</thead>
|
|
83
|
-
<tbody>
|
|
84
|
-
${d.map(s=>c`
|
|
85
|
-
<tr>
|
|
86
|
-
${s.map(i=>i?c`
|
|
87
|
-
<td>
|
|
88
|
-
<div
|
|
89
|
-
@keydown=${n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),this._selectDate(i))}}
|
|
90
|
-
role="button"
|
|
91
|
-
tabindex="0"
|
|
92
|
-
class="day${this._isToday(i,o)?" today":""}${this._isSelected(i)?" selected":""}"
|
|
93
|
-
@click=${()=>this._selectDate(i)}
|
|
94
|
-
>${i.getDate()}<md-ripple></md-ripple><md-focus-ring></md-focus-ring></div>
|
|
95
|
-
</td>
|
|
96
|
-
`:c`<td></td>`)}
|
|
97
|
-
</tr>
|
|
98
|
-
`)}
|
|
99
|
-
</tbody>
|
|
100
|
-
</table>
|
|
101
|
-
</div>
|
|
102
|
-
`:""}
|
|
103
|
-
</div>
|
|
104
|
-
${r?c`
|
|
105
|
-
<div style="padding: 0 24px;">
|
|
106
|
-
<label style="display:flex;align-items:center;gap:8px;">
|
|
107
|
-
<span>${this.lang=="sv"?"Tid:":"Time:"}</span>
|
|
108
|
-
<scb-textfield type="time" .value=${`${String(this._selectedHour).padStart(2,"0")}:${String(this._selectedMinute).padStart(2,"0")}`} @blur=${this._onTimeChange} aria-label="${this.lang=="sv"?"Tid":"Time"}"></scb-textfield>
|
|
109
|
-
</label>
|
|
110
|
-
</div>
|
|
111
|
-
`:""}
|
|
112
|
-
<div class="datepicker-footer">
|
|
113
|
-
${!this._showMonthDropdown&&!this._showYearDropdown?c`
|
|
114
|
-
<scb-button variant="text" label=${this.lang=="sv"?"Stäng":"Close"} @click=${this._close}></scb-button>
|
|
115
|
-
`:""}
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
`}_getMonthDays(t,e){const o=new Date(Date.UTC(t,e,1)),d=new Date(Date.UTC(t,e+1,0)),a=[];let r=[],s=o.getUTCDay(),i=s===0?6:s-1;for(let n=0;n<i;n++)r.push(null);for(let n=1;n<=d.getUTCDate();n++){const u=new Date(Date.UTC(t,e,n));r.push(u),r.length===7&&(a.push(r),r=[])}if(r.length){for(;r.length<7;)r.push(null);a.push(r)}return a}_toggleMonthDropdown(){this._showMonthDropdown=!this._showMonthDropdown,this._showMonthDropdown&&(this._showYearDropdown=!1,setTimeout(()=>{const t=this.renderRoot.querySelector("#selected-month");t&&t.scrollIntoView({block:"center"})},0))}_toggleYearDropdown(){this._showYearDropdown=!this._showYearDropdown,this._showYearDropdown&&(this._showMonthDropdown=!1,setTimeout(()=>{const t=this.renderRoot.querySelector("#selected-year");t&&t.scrollIntoView({block:"center"})},0))}_onMonthChangeCustom(t){const e=this._currentDate.getFullYear();this._currentDate=new Date(e,t,1),this._showMonthDropdown=!1}_onYearChangeCustom(t){const e=this._currentDate.getMonth();this._currentDate=new Date(t,e,1),this._showYearDropdown=!1}_isToday(t,e){return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}_isSelected(t){return this._selectedDate&&t.getDate()===this._selectedDate.getDate()&&t.getMonth()===this._selectedDate.getMonth()&&t.getFullYear()===this._selectedDate.getFullYear()}_selectDate(t){if(this._selectedDate=t,this.variant==="datetime-local"){const e=new Date(t);e.setHours(this._selectedHour??0,this._selectedMinute??0,0,0),this._selectedHour=e.getHours(),this._selectedMinute=e.getMinutes();const o=a=>a.toString().padStart(2,"0"),d=`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`;this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:d},bubbles:!0,composed:!0}))}else{const e=t.toISOString().slice(0,10);this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:e},bubbles:!0,composed:!0}))}}_fireDateTimeChange(){if(this.variant==="datetime-local"&&this._selectedDate){const t=new Date(this._selectedDate);t.setHours(this._selectedHour??0,this._selectedMinute??0,0,0);const e=d=>d.toString().padStart(2,"0"),o=`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())} ${e(t.getHours())}:${e(t.getMinutes())}`;this.dispatchEvent(new CustomEvent("date-selected",{detail:{value:o},bubbles:!0,composed:!0}))}}},w.styles=[$`
|
|
119
|
-
:host {
|
|
120
|
-
--scb-datepicker-width: 380px;
|
|
121
|
-
--scb-datepicker-z-index: 1100;
|
|
122
|
-
--scb-datepicker-viewport-margin: 8px;
|
|
123
|
-
--scb-datepicker-offset: var(--spacing-2, 4px);
|
|
124
|
-
max-width: var(--scb-datepicker-computed-width, min(var(--scb-datepicker-width), calc(100vw - (var(--scb-datepicker-viewport-margin) * 2))));
|
|
125
|
-
font-family: var(--brand-font);
|
|
126
|
-
color: var(--md-sys-color-on-surface);
|
|
127
|
-
display: block;
|
|
128
|
-
position: var(--scb-datepicker-position, absolute);
|
|
129
|
-
top: var(--scb-datepicker-top, calc(100% + var(--scb-datepicker-offset)));
|
|
130
|
-
bottom: var(--scb-datepicker-bottom, auto);
|
|
131
|
-
left: var(--scb-datepicker-left, 0);
|
|
132
|
-
width: var(--scb-datepicker-computed-width, min(var(--scb-datepicker-width), calc(100vw - (var(--scb-datepicker-viewport-margin) * 2))));
|
|
133
|
-
transform: var(--scb-datepicker-transform, translateX(0px));
|
|
134
|
-
z-index: var(--scb-datepicker-z-index);
|
|
135
|
-
}
|
|
136
|
-
.month-selector, .year-selector {
|
|
137
|
-
display: flex;
|
|
138
|
-
align-items: center;
|
|
139
|
-
&.disable{
|
|
140
|
-
pointer-events: none;
|
|
141
|
-
opacity: 0.3;
|
|
142
|
-
scb-icon-button{
|
|
143
|
-
visibility: hidden;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
&.open{
|
|
147
|
-
scb-icon-button{
|
|
148
|
-
visibility: hidden;
|
|
149
|
-
}
|
|
150
|
-
.dropdown-selected{
|
|
151
|
-
background: var(--md-sys-color-secondary-container);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
.dropdown-selected {
|
|
156
|
-
position: relative;
|
|
157
|
-
border-radius: 8px;
|
|
158
|
-
font-size: 16px;
|
|
159
|
-
cursor: pointer;
|
|
160
|
-
text-align: left;
|
|
161
|
-
display: flex;
|
|
162
|
-
gap: 8px;
|
|
163
|
-
align-items: center;
|
|
164
|
-
padding: 4px 8px;
|
|
165
|
-
}
|
|
166
|
-
.dropdown-selected:focus {
|
|
167
|
-
outline: none;
|
|
168
|
-
}
|
|
169
|
-
.dropdown-selected md-focus-ring {
|
|
170
|
-
border-radius: 8px;
|
|
171
|
-
}
|
|
172
|
-
.dropdown-list {
|
|
173
|
-
position: relative;
|
|
174
|
-
background: var(--md-sys-color-surface);
|
|
175
|
-
padding: 4px 0;
|
|
176
|
-
}
|
|
177
|
-
.dropdown-item {
|
|
178
|
-
display: flex;
|
|
179
|
-
position: relative;
|
|
180
|
-
cursor: pointer;
|
|
181
|
-
padding: var(--spacing-3) 56px;
|
|
182
|
-
min-height: 40px;
|
|
183
|
-
align-items: center;
|
|
184
|
-
}
|
|
185
|
-
.dropdown-item:focus-within {
|
|
186
|
-
outline: none;
|
|
187
|
-
}
|
|
188
|
-
.dropdown-item md-focus-ring {
|
|
189
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
190
|
-
}
|
|
191
|
-
.dropdown-item.selected {
|
|
192
|
-
background: var(--md-sys-color-secondary-container, #e3f2fd);
|
|
193
|
-
font-weight: 500;
|
|
194
|
-
padding-left: 16px;
|
|
195
|
-
gap: 16px;
|
|
196
|
-
}
|
|
197
|
-
.datepicker-popup {
|
|
198
|
-
background: var(--md-sys-color-surface);
|
|
199
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
200
|
-
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.30), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
|
|
201
|
-
max-width: 100%;
|
|
202
|
-
width: 100%;
|
|
203
|
-
max-height: var(--scb-datepicker-max-height, 80vh);
|
|
204
|
-
overflow: auto;
|
|
205
|
-
font-family: var(--brand-font);
|
|
206
|
-
}
|
|
207
|
-
.datepicker-content{
|
|
208
|
-
overflow-y: auto;
|
|
209
|
-
max-height: 290px;
|
|
210
|
-
}
|
|
211
|
-
.datepicker-content::-webkit-scrollbar {
|
|
212
|
-
width: 12px;
|
|
213
|
-
background: var(--md-sys-color-surface);
|
|
214
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
215
|
-
}
|
|
216
|
-
.datepicker-content::-webkit-scrollbar-thumb {
|
|
217
|
-
background: var(--md-sys-color-outline);
|
|
218
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
219
|
-
border: 4px solid var(--md-sys-color-surface);
|
|
220
|
-
|
|
221
|
-
}
|
|
222
|
-
.datepicker-content::-webkit-scrollbar-track {
|
|
223
|
-
background: var(--md-sys-color-surface);
|
|
224
|
-
border-radius: var(--md-sys-shape-corner-small);
|
|
225
|
-
}
|
|
226
|
-
.popup {
|
|
227
|
-
position:absolute;
|
|
228
|
-
top:0;
|
|
229
|
-
left:0;
|
|
230
|
-
z-index:1;
|
|
231
|
-
}
|
|
232
|
-
.header {
|
|
233
|
-
display: flex;
|
|
234
|
-
align-items: center;
|
|
235
|
-
justify-content: space-between;
|
|
236
|
-
margin-bottom: 30px;
|
|
237
|
-
padding: 20px 16px 0px 16px;
|
|
238
|
-
flex-wrap: wrap;
|
|
239
|
-
}
|
|
240
|
-
.datepicker-footer{
|
|
241
|
-
padding: 8px 16px 24px 16px;
|
|
242
|
-
}
|
|
243
|
-
.month-label {
|
|
244
|
-
font-size: 18px;
|
|
245
|
-
font-weight: 500;
|
|
246
|
-
}
|
|
247
|
-
.datepicker-calendar{
|
|
248
|
-
padding: 0 16px;
|
|
249
|
-
}
|
|
250
|
-
table {
|
|
251
|
-
width: 100%;
|
|
252
|
-
border-collapse: collapse;
|
|
253
|
-
margin-bottom: 8px;
|
|
254
|
-
}
|
|
255
|
-
th {
|
|
256
|
-
color: var(--md-sys-color-on-surface-variant, #757575);
|
|
257
|
-
font-size: 16px;
|
|
258
|
-
font-weight: 600;
|
|
259
|
-
padding-bottom: 20px;
|
|
260
|
-
}
|
|
261
|
-
td {
|
|
262
|
-
text-align: center;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.day:focus-within{
|
|
266
|
-
outline: none;
|
|
267
|
-
}
|
|
268
|
-
.day {
|
|
269
|
-
position: relative;
|
|
270
|
-
width: 40px;
|
|
271
|
-
height: 40px;
|
|
272
|
-
border-radius: 50%;
|
|
273
|
-
border: none;
|
|
274
|
-
background: none;
|
|
275
|
-
font-size: 16px;
|
|
276
|
-
cursor: pointer;
|
|
277
|
-
font-family: 'Inter';
|
|
278
|
-
align-content: center;
|
|
279
|
-
}
|
|
280
|
-
.day.selected {
|
|
281
|
-
background: var(--md-sys-color-secondary-container);
|
|
282
|
-
}
|
|
283
|
-
.close-datepicker {
|
|
284
|
-
margin-top: 8px;
|
|
285
|
-
background: none;
|
|
286
|
-
border-color: none;
|
|
287
|
-
color: var(--md-sys-color-primary, #0057b8);
|
|
288
|
-
font-size: 16px;
|
|
289
|
-
cursor: pointer;
|
|
290
|
-
padding: 4px 12px;
|
|
291
|
-
border-radius: 8px;
|
|
292
|
-
}
|
|
293
|
-
.close-datepicker:hover {
|
|
294
|
-
background: var(--md-sys-color-primary-container, #e3f2fd);
|
|
295
|
-
}
|
|
296
|
-
`],w);l([h()],p.prototype,"_currentDate",void 0);l([h()],p.prototype,"_selectedDate",void 0);l([h()],p.prototype,"_showMonthDropdown",void 0);l([h()],p.prototype,"_showYearDropdown",void 0);l([m({type:String})],p.prototype,"variant",void 0);l([m({type:String})],p.prototype,"lang",void 0);l([m({type:String})],p.prototype,"selectedValue",void 0);l([m({type:Boolean})],p.prototype,"open",void 0);l([h()],p.prototype,"_selectedHour",void 0);l([h()],p.prototype,"_selectedMinute",void 0);p=l([M("scb-datepicker")],p);
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
export * from './scb-accordion/scb-accordion-item';
|
|
2
|
-
export * from './scb-accordion/scb-accordion';
|
|
3
|
-
export * from './scb-app-bar/scb-app-bar';
|
|
4
|
-
export * from './scb-avatar/scb-avatar';
|
|
5
|
-
export * from './scb-badge/scb-badge';
|
|
6
|
-
export * from './scb-breadcrumb/scb-breadcrumb-item';
|
|
7
|
-
export * from './scb-breadcrumb/scb-breadcrumb';
|
|
8
|
-
export * from './scb-button/scb-button';
|
|
9
|
-
export * from './scb-calendar/scb-calendar-event';
|
|
10
|
-
export * from './scb-calendar/scb-calendar';
|
|
11
|
-
export * from './scb-calendar-card/scb-calendar-card';
|
|
12
|
-
export * from './scb-card/scb-action-card';
|
|
13
|
-
export * from './scb-card/scb-card';
|
|
14
|
-
export * from './scb-card/scb-container-card';
|
|
15
|
-
export * from './scb-card/scb-link-card';
|
|
16
|
-
export * from './scb-card/scb-list-card';
|
|
17
|
-
export * from './scb-card/scb-social-card';
|
|
18
|
-
export * from './scb-checkbox/scb-checkbox-group';
|
|
19
|
-
export * from './scb-checkbox/scb-checkbox';
|
|
20
|
-
export * from './scb-chevron/scb-chevron';
|
|
21
|
-
export * from './scb-chip/scb-chip';
|
|
22
|
-
export * from './scb-collapse/scb-collapse';
|
|
23
|
-
export * from './scb-cookies-consent/scb-cookies-consent';
|
|
24
|
-
export * from './scb-datepicker/scb-datepicker';
|
|
25
|
-
export * from './scb-dialog/scb-dialog';
|
|
26
|
-
export * from './scb-divider/scb-divider';
|
|
27
|
-
export * from './scb-drawer/scb-drawer';
|
|
28
|
-
export * from './scb-drop-zone/scb-drop-zone';
|
|
29
|
-
export * from './scb-dropdown/scb-dropdown';
|
|
30
|
-
export * from './scb-fab/scb-fab';
|
|
31
|
-
export * from './scb-fact-card/scb-fact-card-content';
|
|
32
|
-
export * from './scb-fact-card/scb-fact-card';
|
|
33
|
-
export * from './scb-footer/scb-footer-section';
|
|
34
|
-
export * from './scb-footer/scb-footer';
|
|
35
|
-
export * from './scb-gallery-grid/scb-gallery-grid';
|
|
36
|
-
export * from './scb-grid/scb-grid-item';
|
|
37
|
-
export * from './scb-grid/scb-grid';
|
|
38
|
-
export * from './scb-grid/scb-stack';
|
|
39
|
-
export * from './scb-header/scb-header-menu-group';
|
|
40
|
-
export * from './scb-header/scb-header-menu-item';
|
|
41
|
-
export * from './scb-header/scb-header-tab';
|
|
42
|
-
export * from './scb-header/scb-header-utility';
|
|
43
|
-
export * from './scb-header/scb-header';
|
|
44
|
-
export * from './scb-horizontal-scroller/scb-horizontal-scroller';
|
|
45
|
-
export * from './scb-icon-button/scb-icon-button';
|
|
46
|
-
export * from './scb-keyfigure-card/scb-keyfigure-card';
|
|
47
|
-
export * from './scb-link/scb-link';
|
|
48
|
-
export * from './scb-list/scb-list-item';
|
|
49
|
-
export * from './scb-list/scb-list';
|
|
50
|
-
export * from './scb-menu/scb-menu-item';
|
|
51
|
-
export * from './scb-menu/scb-menu-section';
|
|
52
|
-
export * from './scb-menu/scb-menu';
|
|
53
|
-
export * from './scb-menu/scb-sub-menu';
|
|
54
|
-
export * from './scb-nav/scb-nav-item';
|
|
55
|
-
export * from './scb-nav/scb-nav';
|
|
56
|
-
export * from './scb-notification-card/scb-notification-card';
|
|
57
|
-
export * from './scb-options-menu/scb-options-menu-item';
|
|
58
|
-
export * from './scb-options-menu/scb-options-menu';
|
|
59
|
-
export * from './scb-options-menu/scb-options-sub-menu';
|
|
60
|
-
export * from './scb-overlay/scb-overlay';
|
|
61
|
-
export * from './scb-pagination/scb-pagination';
|
|
62
|
-
export * from './scb-progress-indicator/scb-progress-indicator';
|
|
63
|
-
export * from './scb-progress-stepper/scb-progress-step';
|
|
64
|
-
export * from './scb-progress-stepper/scb-progress-stepper';
|
|
65
|
-
export * from './scb-radio-button/scb-radio-button';
|
|
66
|
-
export * from './scb-radio-button/scb-radio-group';
|
|
67
|
-
export * from './scb-scrollspy/scb-scrollspy';
|
|
68
|
-
export * from './scb-search/scb-search';
|
|
69
|
-
export * from './scb-segmented-button/scb-segmented-button';
|
|
70
|
-
export * from './scb-segmented-button/scb-segmented-item';
|
|
71
|
-
export * from './scb-select/scb-select-option';
|
|
72
|
-
export * from './scb-select/scb-select';
|
|
73
|
-
export * from './scb-skeleton/scb-skeleton';
|
|
74
|
-
export * from './scb-slider/scb-slider';
|
|
75
|
-
export * from './scb-snackbar/scb-snackbar';
|
|
76
|
-
export * from './scb-status-pill/scb-status-pill';
|
|
77
|
-
export * from './scb-stepper/scb-step';
|
|
78
|
-
export * from './scb-stepper/scb-stepper';
|
|
79
|
-
export * from './scb-switch/scb-switch';
|
|
80
|
-
export * from './scb-table/scb-table';
|
|
81
|
-
export * from './scb-table-advanced/scb-table-advanced';
|
|
82
|
-
export * from './scb-tabs/scb-primary-tab';
|
|
83
|
-
export * from './scb-tabs/scb-secondary-tab';
|
|
84
|
-
export * from './scb-tabs/scb-tabs';
|
|
85
|
-
export * from './scb-textfield/scb-textfield';
|
|
86
|
-
export * from './scb-toc/scb-toc-item';
|
|
87
|
-
export * from './scb-toc/scb-toc';
|
|
88
|
-
export * from './scb-tooltip/scb-tooltip';
|
|
89
|
-
export * from './scb-viz/scb-viz-actions-runtime';
|
|
90
|
-
export * from './scb-viz/scb-viz-print-runtime';
|
|
91
|
-
export * from './scb-viz/scb-viz-series-differentiation-registry';
|
|
92
|
-
export * from './scb-viz/scb-viz-series-differentiation-runtime';
|
|
93
|
-
export * from './scb-viz/scb-viz-table-runtime';
|
|
94
|
-
export * from './scb-viz/scb-viz';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class ScbChevron extends LitElement {
|
|
3
|
-
open: boolean;
|
|
4
|
-
static styles: import('lit').CSSResult;
|
|
5
|
-
render(): import('lit-html').TemplateResult<1>;
|
|
6
|
-
}
|
|
7
|
-
declare global {
|
|
8
|
-
interface HTMLElementTagNameMap {
|
|
9
|
-
'scb-chevron': ScbChevron;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
-
export declare class ScbDatepicker extends LitElement {
|
|
3
|
-
private _currentDate;
|
|
4
|
-
private _selectedDate;
|
|
5
|
-
private _showMonthDropdown;
|
|
6
|
-
private _showYearDropdown;
|
|
7
|
-
variant: 'datetime-local' | 'date';
|
|
8
|
-
lang: 'sv' | 'en';
|
|
9
|
-
selectedValue: string;
|
|
10
|
-
open: boolean;
|
|
11
|
-
private _selectedHour;
|
|
12
|
-
private _selectedMinute;
|
|
13
|
-
private readonly _viewportMargin;
|
|
14
|
-
private readonly _popupOffset;
|
|
15
|
-
private _onWindowReposition;
|
|
16
|
-
private _isRenderedInsideDialog;
|
|
17
|
-
private _positionPopupWithinViewport;
|
|
18
|
-
static styles: import('lit').CSSResult[];
|
|
19
|
-
updated(changed: PropertyValues): void;
|
|
20
|
-
disconnectedCallback(): void;
|
|
21
|
-
private _monthNames;
|
|
22
|
-
render(): TemplateResult;
|
|
23
|
-
private _getMonthDays;
|
|
24
|
-
private _outsideClickHandler;
|
|
25
|
-
private _toggleMonthDropdown;
|
|
26
|
-
private _toggleYearDropdown;
|
|
27
|
-
private _onMonthChangeCustom;
|
|
28
|
-
private _onYearChangeCustom;
|
|
29
|
-
private _prevMonth;
|
|
30
|
-
private _prevYear;
|
|
31
|
-
private _nextMonth;
|
|
32
|
-
private _nextYear;
|
|
33
|
-
private _isToday;
|
|
34
|
-
private _isSelected;
|
|
35
|
-
private _selectDate;
|
|
36
|
-
private _fireDateTimeChange;
|
|
37
|
-
private _onTimeChange;
|
|
38
|
-
private _close;
|
|
39
|
-
}
|