scb-wc-test 0.1.70 → 0.1.72
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/all.js +2 -0
- package/index.d.ts +1 -0
- package/index.js +42 -40
- package/mvc/components/all.js +1 -0
- package/mvc/components/scb-app-bar/scb-app-bar.js +5 -1
- package/mvc/components/scb-badge/scb-badge.js +64 -35
- package/mvc/components/scb-pagination/scb-pagination.js +175 -0
- package/package.json +6 -2
- package/scb-app-bar/scb-app-bar.js +5 -1
- package/scb-badge/scb-badge.d.ts +12 -2
- package/scb-badge/scb-badge.js +122 -60
- package/scb-pagination/scb-pagination.d.ts +18 -0
- package/scb-pagination/scb-pagination.js +264 -0
- package/scb-wc-test.bundle.js +557 -350
package/all.js
CHANGED
|
@@ -43,6 +43,7 @@ import './mvc/components/scb-menu/scb-menu.js';
|
|
|
43
43
|
import './mvc/components/scb-menu/scb-sub-menu.js';
|
|
44
44
|
import './mvc/components/scb-notification/scb-notification.js';
|
|
45
45
|
import './mvc/components/scb-notification-card/scb-notification-card.js';
|
|
46
|
+
import './mvc/components/scb-pagination/scb-pagination.js';
|
|
46
47
|
import './mvc/components/scb-progress-indicator/scb-progress-indicator.js';
|
|
47
48
|
import './mvc/components/scb-radio-button/scb-radio-button.js';
|
|
48
49
|
import './mvc/components/scb-radio-button/scb-radio-group.js';
|
|
@@ -105,6 +106,7 @@ import './scb-menu/scb-menu.js';
|
|
|
105
106
|
import './scb-menu/scb-sub-menu.js';
|
|
106
107
|
import './scb-notification/scb-notification.js';
|
|
107
108
|
import './scb-notification-card/scb-notification-card.js';
|
|
109
|
+
import './scb-pagination/scb-pagination.js';
|
|
108
110
|
import './scb-progress-indicator/scb-progress-indicator.js';
|
|
109
111
|
import './scb-radio-button/scb-radio-button.js';
|
|
110
112
|
import './scb-radio-button/scb-radio-group.js';
|
package/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export * from './scb-menu/scb-menu';
|
|
|
40
40
|
export * from './scb-menu/scb-sub-menu';
|
|
41
41
|
export * from './scb-notification/scb-notification';
|
|
42
42
|
export * from './scb-notification-card/scb-notification-card';
|
|
43
|
+
export * from './scb-pagination/scb-pagination';
|
|
43
44
|
export * from './scb-progress-indicator/scb-progress-indicator';
|
|
44
45
|
export * from './scb-radio-button/scb-radio-button';
|
|
45
46
|
export * from './scb-radio-button/scb-radio-group';
|
package/index.js
CHANGED
|
@@ -8,13 +8,13 @@ import { SCBBreadcrumb as n } from "./scb-breadcrumb/scb-breadcrumb.js";
|
|
|
8
8
|
import { ScbButton as C } from "./scb-button/scb-button.js";
|
|
9
9
|
import { ScbCalendarCard as l } from "./scb-calendar-card/scb-calendar-card.js";
|
|
10
10
|
import { ScbCard as D } from "./scb-card/scb-card.js";
|
|
11
|
-
import { ScbCheckboxGroup as
|
|
11
|
+
import { ScbCheckboxGroup as g } from "./scb-checkbox/scb-checkbox-group.js";
|
|
12
12
|
import { ScbCheckbox as s } from "./scb-checkbox/scb-checkbox.js";
|
|
13
13
|
import { ScbChip as H } from "./scb-chip/scb-chip.js";
|
|
14
14
|
import { ScbDialog as k } from "./scb-dialog/scb-dialog.js";
|
|
15
15
|
import { ScbDivider as y } from "./scb-divider/scb-divider.js";
|
|
16
|
-
import { ScbDrawerItem as
|
|
17
|
-
import { ScbDrawerSection as
|
|
16
|
+
import { ScbDrawerItem as P } from "./scb-drawer/scb-drawer-item.js";
|
|
17
|
+
import { ScbDrawerSection as M } from "./scb-drawer/scb-drawer-section.js";
|
|
18
18
|
import { ScbDrawer as N } from "./scb-drawer/scb-drawer.js";
|
|
19
19
|
import { ScbSubDrawer as z } from "./scb-drawer/scb-sub-drawer.js";
|
|
20
20
|
import { ScbFactCardContent as U } from "./scb-fact-card/scb-fact-card-content.js";
|
|
@@ -35,27 +35,28 @@ import { ScbKeyFigureCard as nr } from "./scb-keyfigure-card/scb-keyfigure-card.
|
|
|
35
35
|
import { ScbLink as Cr } from "./scb-link/scb-link.js";
|
|
36
36
|
import { ScbListItem as lr } from "./scb-list/scb-list-item.js";
|
|
37
37
|
import { ScbList as Dr } from "./scb-list/scb-list.js";
|
|
38
|
-
import { ScbMenuItem as
|
|
38
|
+
import { ScbMenuItem as gr } from "./scb-menu/scb-menu-item.js";
|
|
39
39
|
import { ScbMenu as sr } from "./scb-menu/scb-menu.js";
|
|
40
40
|
import { ScbSubMenu as Hr } from "./scb-menu/scb-sub-menu.js";
|
|
41
41
|
import { ScbNotification as kr } from "./scb-notification/scb-notification.js";
|
|
42
42
|
import { ScbNotificationCard as yr } from "./scb-notification-card/scb-notification-card.js";
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
43
|
+
import { ScbPagination as Pr } from "./scb-pagination/scb-pagination.js";
|
|
44
|
+
import { ScbProgressIndicator as Mr } from "./scb-progress-indicator/scb-progress-indicator.js";
|
|
45
|
+
import { ScbRadioButton as Nr } from "./scb-radio-button/scb-radio-button.js";
|
|
46
|
+
import { ScbRadioGroup as zr } from "./scb-radio-button/scb-radio-group.js";
|
|
47
|
+
import { ScbSearch as Ur } from "./scb-search/scb-search.js";
|
|
48
|
+
import { ScbSegmentedButton as qr } from "./scb-segmented-button/scb-segmented-button.js";
|
|
49
|
+
import { ScbSegmentedItem as Jr } from "./scb-segmented-button/scb-segmented-item.js";
|
|
50
|
+
import { ScbSnackbar as Qr } from "./scb-snackbar/scb-snackbar.js";
|
|
51
|
+
import { ScbStatusPill as Wr } from "./scb-status-pill/scb-status-pill.js";
|
|
52
|
+
import { ScbSwitch as Yr } from "./scb-switch/scb-switch.js";
|
|
53
|
+
import { ScbPrimaryTab as _r } from "./scb-tabs/scb-primary-tab.js";
|
|
54
|
+
import { ScbSecondaryTab as ro } from "./scb-tabs/scb-secondary-tab.js";
|
|
55
|
+
import { ScbTabs as eo } from "./scb-tabs/scb-tabs.js";
|
|
56
|
+
import { ScbTextField2 as co } from "./scb-textfield/scb-textfield.js";
|
|
57
|
+
import { ScbTocItem as So } from "./scb-toc/scb-toc-item.js";
|
|
58
|
+
import { ScbToc as po } from "./scb-toc/scb-toc.js";
|
|
59
|
+
import { ScbTooltip as fo } from "./scb-tooltip/scb-tooltip.js";
|
|
59
60
|
export {
|
|
60
61
|
n as SCBBreadcrumb,
|
|
61
62
|
i as SCBBreadcrumbItem,
|
|
@@ -68,13 +69,13 @@ export {
|
|
|
68
69
|
l as ScbCalendarCard,
|
|
69
70
|
D as ScbCard,
|
|
70
71
|
s as ScbCheckbox,
|
|
71
|
-
|
|
72
|
+
g as ScbCheckboxGroup,
|
|
72
73
|
H as ScbChip,
|
|
73
74
|
k as ScbDialog,
|
|
74
75
|
y as ScbDivider,
|
|
75
76
|
N as ScbDrawer,
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
P as ScbDrawerItem,
|
|
78
|
+
M as ScbDrawerSection,
|
|
78
79
|
q as ScbFactCard,
|
|
79
80
|
U as ScbFactCardContent,
|
|
80
81
|
Q as ScbFooter,
|
|
@@ -93,26 +94,27 @@ export {
|
|
|
93
94
|
Dr as ScbList,
|
|
94
95
|
lr as ScbListItem,
|
|
95
96
|
sr as ScbMenu,
|
|
96
|
-
|
|
97
|
+
gr as ScbMenuItem,
|
|
97
98
|
kr as ScbNotification,
|
|
98
99
|
yr as ScbNotificationCard,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Nr as
|
|
103
|
-
zr as
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
qr as
|
|
107
|
-
Jr as
|
|
100
|
+
Pr as ScbPagination,
|
|
101
|
+
_r as ScbPrimaryTab,
|
|
102
|
+
Mr as ScbProgressIndicator,
|
|
103
|
+
Nr as ScbRadioButton,
|
|
104
|
+
zr as ScbRadioGroup,
|
|
105
|
+
Ur as ScbSearch,
|
|
106
|
+
ro as ScbSecondaryTab,
|
|
107
|
+
qr as ScbSegmentedButton,
|
|
108
|
+
Jr as ScbSegmentedItem,
|
|
109
|
+
Qr as ScbSnackbar,
|
|
108
110
|
_ as ScbStack,
|
|
109
|
-
|
|
111
|
+
Wr as ScbStatusPill,
|
|
110
112
|
z as ScbSubDrawer,
|
|
111
113
|
Hr as ScbSubMenu,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
Yr as ScbSwitch,
|
|
115
|
+
eo as ScbTabs,
|
|
116
|
+
co as ScbTextField2,
|
|
117
|
+
po as ScbToc,
|
|
118
|
+
So as ScbTocItem,
|
|
119
|
+
fo as ScbTooltip
|
|
118
120
|
};
|
package/mvc/components/all.js
CHANGED
|
@@ -40,6 +40,7 @@ import './scb-menu/scb-menu-item.js';
|
|
|
40
40
|
import './scb-menu/scb-sub-menu.js';
|
|
41
41
|
import './scb-notification-card/scb-notification-card.js';
|
|
42
42
|
import './scb-notification/scb-notification.js';
|
|
43
|
+
import './scb-pagination/scb-pagination.js';
|
|
43
44
|
import './scb-progress-indicator/scb-progress-indicator.js';
|
|
44
45
|
import './scb-radio-button/scb-radio-button.js';
|
|
45
46
|
import './scb-radio-button/scb-radio-group.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,n as d,i as c,x as r,t as g}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-avatar/scb-avatar.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(i,e,t){try{customElements.get(i)||s(i,e,t)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var m=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(a,s,i,e)=>{for(var t=e>1?void 0:e?f(s,i):s,n=a.length-1,o;n>=0;n--)(o=a[n])&&(t=(e?o(s,i,t):o(t))||t);return e&&t&&m(s,i,t),t};let l=class extends c{constructor(){super(...arguments),this.title="
|
|
1
|
+
import{a as h,n as d,i as c,x as r,t as g}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-avatar/scb-avatar.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(i,e,t){try{customElements.get(i)||s(i,e,t)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var m=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(a,s,i,e)=>{for(var t=e>1?void 0:e?f(s,i):s,n=a.length-1,o;n>=0;n--)(o=a[n])&&(t=(e?o(s,i,t):o(t))||t);return e&&t&&m(s,i,t),t};let l=class extends c{constructor(){super(...arguments),this.title="",this.type="default",this.position="default",this.searchSupportingText=""}handleAvatarSlotChange(a){a.target.assignedElements({flatten:!0}).forEach(e=>{e.tagName==="SCB-AVATAR"&&e.setAttribute("size","small")})}render(){switch(this.type){case"small-flexible":return r`
|
|
2
2
|
<header class="small-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
3
3
|
<div class="leading">
|
|
4
4
|
<slot name="leading"></slot>
|
|
@@ -151,4 +151,8 @@ import{a as h,n as d,i as c,x as r,t as g}from"../../vendor/vendor.js";import"..
|
|
|
151
151
|
display: flex;
|
|
152
152
|
align-items: center;
|
|
153
153
|
}
|
|
154
|
+
.leading {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
}
|
|
154
158
|
`];p([d({type:String})],l.prototype,"title",2);p([d({type:String})],l.prototype,"type",2);p([d({type:String,reflect:!0})],l.prototype,"position",2);p([d({type:String,attribute:"search-supporting-text"})],l.prototype,"searchSupportingText",2);l=p([g("scb-app-bar")],l);
|
|
@@ -1,43 +1,72 @@
|
|
|
1
|
-
import{a as c,n,i as
|
|
2
|
-
<div class="badge-content"
|
|
3
|
-
.value=${this.value}
|
|
4
|
-
.label=${this.label}
|
|
5
|
-
?disabled=${this.disabled}
|
|
6
|
-
>
|
|
7
|
-
<div class="badge ${a}">${e}</div>
|
|
1
|
+
import{a as c,n as l,i as b,x as h,t as p}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,a,o){try{customElements.get(t)||s(t,a,o)}catch(d){var n=String(d||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var g=Object.defineProperty,u=Object.getOwnPropertyDescriptor,r=(e,s,t,a)=>{for(var o=a>1?void 0:a?u(s,t):s,n=e.length-1,d;n>=0;n--)(d=e[n])&&(o=(a?d(s,t,o):d(o))||o);return a&&o&&g(s,t,o),o};let i=class extends b{constructor(){super(...arguments),this._slotClickHandler=e=>{const s=this.shadowRoot?.querySelector("slot"),t=e.target;t&&t!==s&&t.dispatchEvent(new CustomEvent("hide-badge",{bubbles:!0,composed:!0}))},this.autoHide=!1,this.position="relative",this.positionTop=0,this.positionRight=12,this.value="",this.label="",this.hidden=!1,this.variant="dot",this._badgeVisible=!0,this._onHideBadge=()=>{this._badgeVisible=!1,this.requestUpdate()}}firstUpdated(){const e=this.shadowRoot?.querySelector("slot");this.autoHide&&e&&e.addEventListener("click",this._slotClickHandler)}updated(){const e=this.shadowRoot?.querySelector("slot");e&&(this.autoHide?e.addEventListener("click",this._slotClickHandler):e.removeEventListener("click",this._slotClickHandler))}connectedCallback(){super.connectedCallback(),this.addEventListener("hide-badge",this._onHideBadge)}disconnectedCallback(){this.removeEventListener("hide-badge",this._onHideBadge),super.disconnectedCallback()}render(){this.style.setProperty("--scb-badge-absolute-top",this.positionTop+"px"),this.style.setProperty("--scb-badge-absolute-right",this.positionRight+"px");let e=this.value;!isNaN(Number(this.value))&&this.value.length>4&&(e=this.value.slice(0,4)+"+");const s=this.variant==="value"&&!this.value?"badge-value-empty":"",t=this._badgeVisible?"":"badge--hide",a=this.label||(this.variant==="dot"?"Indikator":`Märke: ${e}`);return h`
|
|
2
|
+
<div class="badge-content">
|
|
8
3
|
<slot></slot>
|
|
4
|
+
<div
|
|
5
|
+
class="badge ${s} ${t}"
|
|
6
|
+
role="status"
|
|
7
|
+
aria-label="${this.variant==="dot",a}"
|
|
8
|
+
aria-hidden="${this.variant==="dot"&&!this.label?"true":"false"}">${this.variant==="dot"?"":e}</div>
|
|
9
9
|
</div>
|
|
10
|
-
`}};
|
|
10
|
+
`}};i.styles=c`
|
|
11
11
|
:host {
|
|
12
|
-
--scb-badge-top: 0;
|
|
13
|
-
--scb-badge-right: 12px;
|
|
14
12
|
display: block;
|
|
15
13
|
position: relative;
|
|
16
14
|
width: fit-content;
|
|
15
|
+
--scb-badge-font-size: var(--scale-01);
|
|
16
|
+
--scb-badge-line-height: 100%;
|
|
17
|
+
--scb-badge-relative-gap: 0px;
|
|
18
|
+
--scb-badge-background-color: var(--md-sys-color-error);
|
|
19
|
+
--scb-badge-color: var(--md-sys-color-on-error);
|
|
20
|
+
--scb-badge-width: 8px;
|
|
21
|
+
--scb-badge-height: 8px;
|
|
22
|
+
}
|
|
23
|
+
:host([variant="value"]) .badge {
|
|
24
|
+
width: fit-content;
|
|
25
|
+
padding: 6px;
|
|
26
|
+
}
|
|
27
|
+
:host([variant="value"]) .badge.badge-value-empty{
|
|
28
|
+
width: var(--scb-badge-width);
|
|
29
|
+
padding: var(--spacing-2);
|
|
30
|
+
}
|
|
31
|
+
:host([hidden]) .badge {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
34
|
+
.badge {
|
|
35
|
+
transition: transform 0.25s cubic-bezier(.4,2,.6,1), opacity 0.18s linear;
|
|
36
|
+
will-change: transform, opacity;
|
|
37
|
+
}
|
|
38
|
+
.badge--hide {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transform: scale(1.3);
|
|
41
|
+
pointer-events: none;
|
|
17
42
|
}
|
|
18
|
-
:host([variant="value"]) .badge {
|
|
19
|
-
width: fit-content;
|
|
20
|
-
padding: 6px;
|
|
21
|
-
}
|
|
22
|
-
:host([variant="value"]) .badge.badge-value-empty{
|
|
23
|
-
width: 8px;
|
|
24
|
-
padding: 4px;
|
|
25
|
-
}
|
|
26
43
|
.badge{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
background-color: var(--scb-badge-background-color);
|
|
45
|
+
color: var(--scb-badge-color);
|
|
46
|
+
font-size: var(--scb-badge-font-size);
|
|
47
|
+
font-weight: var(--weight-semibold);
|
|
48
|
+
line-height: var(--scb-badge-line-height);
|
|
49
|
+
letter-spacing: var(--md-sys-typescale-label-medium-tracking);
|
|
50
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
width: var(--scb-badge-width);
|
|
55
|
+
height: var(--scb-badge-height);
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: var(--scb-badge-absolute-top);
|
|
58
|
+
left: calc(100% - var(--scb-badge-absolute-right));
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
:host([position="relative"]) .badge {
|
|
62
|
+
position: relative;
|
|
63
|
+
top: unset;
|
|
64
|
+
left: unset;
|
|
65
|
+
}
|
|
66
|
+
:host([position="relative"]) .badge-content {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: center;
|
|
70
|
+
gap: var(--scb-badge-relative-gap);
|
|
71
|
+
}
|
|
72
|
+
`;r([l({type:Boolean,reflect:!0,attribute:"auto-hide"})],i.prototype,"autoHide",2);r([l({type:String,reflect:!0})],i.prototype,"position",2);r([l({type:Number,attribute:"position-top"})],i.prototype,"positionTop",2);r([l({type:Number,attribute:"position-right"})],i.prototype,"positionRight",2);r([l({type:String,reflect:!0})],i.prototype,"value",2);r([l({type:String,reflect:!0})],i.prototype,"label",2);r([l({type:Boolean,reflect:!0})],i.prototype,"hidden",2);r([l({type:String,reflect:!0})],i.prototype,"variant",2);i=r([p("scb-badge")],i);
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import{a as g,n as d,i as b,x as s,t as h}from"../../vendor/vendor.js";import"../scb-link/scb-link.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(n,i,r){try{customElements.get(n)||e(n,i,r)}catch(a){var o=String(a||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var u=Object.defineProperty,v=Object.getOwnPropertyDescriptor,c=(p,e,n,i)=>{for(var r=i>1?void 0:i?v(e,n):e,o=p.length-1,a;o>=0;o--)(a=p[o])&&(r=(i?a(e,n,r):a(r))||r);return i&&r&&u(e,n,r),r};let l=class extends b{constructor(){super(...arguments),this.variant="icon-text",this.page=1,this.totalPages=0,this.pagingHref="/products?page=",this.paginationAriaLabel="Paginering",this.currentAriaLabel="Nuvarande sida, ",this.pagingNumberAriaLabel="Gå till sida ",this.isNarrow=window.innerWidth<=768,this._onResize=()=>{this.isNarrow=window.innerWidth<=768}}_prevPage(){this.page>1&&this.page--,this.dispatchEvent(new CustomEvent("page-change",{detail:{page:this.page}}))}_nextPage(){this.page<this.totalPages&&this.page++,this.dispatchEvent(new CustomEvent("page-change",{detail:{page:this.page}}))}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize),this._onResize()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._onResize)}render(){if(this.totalPages===0)return null;const p=this.variant?`${this.variant.toLowerCase()}`:"",e=[],{page:n,totalPages:i}=this,r=window.innerWidth<=768,o=r?1:2,a=t=>t===n?s`
|
|
2
|
+
<li>
|
|
3
|
+
<span
|
|
4
|
+
class="page-number active"
|
|
5
|
+
aria-current="page"
|
|
6
|
+
aria-label="${this.currentAriaLabel} ${t}"
|
|
7
|
+
>${t}</span>
|
|
8
|
+
</li>
|
|
9
|
+
`:s`
|
|
10
|
+
<li>
|
|
11
|
+
<scb-link
|
|
12
|
+
class="page-number${t===n?" active":""}"
|
|
13
|
+
@click=${()=>{this.page=t,this.dispatchEvent(new CustomEvent("page-change",{detail:{page:t}}))}}
|
|
14
|
+
aria-current=${t===n?"page":void 0}
|
|
15
|
+
aria-label="${this.pagingNumberAriaLabel} ${t}"
|
|
16
|
+
href=${this.pagingHref}${t}
|
|
17
|
+
?disabled=${t===n}>${t}
|
|
18
|
+
</scb-link>
|
|
19
|
+
</li>
|
|
20
|
+
`;if(i<=8)for(let t=1;t<=i;t++)e.push(a(t));else if(e.push(a(1)),n<=4&&!r){for(let t=2;t<=5;t++)e.push(a(t));i>6?(e.push(s`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),e.push(a(i))):i===6&&e.push(a(i))}else if(n<=3&&r){for(let t=2;t<=3;t++)e.push(a(t));i>4?(e.push(s`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),e.push(a(i))):i===4&&e.push(a(i))}else if(n>=i-(o+1)){e.push(s`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let t=i-o*2;t<=i;t++)t>1&&e.push(a(t))}else{e.push(s`<li><span class="ellipsis" aria-hidden="true">…</span></li>`);for(let t=n-o;t<=n+o;t++)t>1&&t<i&&e.push(a(t));e.push(s`<li><span class="ellipsis" aria-hidden="true">…</span></li>`),e.push(a(i))}return r?s`
|
|
21
|
+
<nav aria-label="${this.paginationAriaLabel}" class="pagination ${p}">
|
|
22
|
+
<div class="pagination-row">
|
|
23
|
+
<div class="prev">
|
|
24
|
+
${this.variant==="icon"?s`<scb-icon-button icon="chevron_left" @click=${this._prevPage} ?disabled=${this.page===1} aria-label="Föregående sida"></scb-icon-button>`:s`<scb-button variant="text" label="Föregående" icon="chevron_left" @click=${this._prevPage} ?disabled=${this.page===1} aria-label="Föregående sida"></scb-button>`}
|
|
25
|
+
</div>
|
|
26
|
+
<ol>
|
|
27
|
+
${e}
|
|
28
|
+
</ol>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="next">
|
|
31
|
+
${this.variant==="icon"?s`<scb-icon-button icon="chevron_right" @click=${this._nextPage} ?disabled=${this.page===this.totalPages} aria-label="Nästa sida"></scb-icon-button>`:s`<scb-button variant="text" label="Nästa" icon="chevron_right" iconPosition="right" @click=${this._nextPage} ?disabled=${this.page===this.totalPages} aria-label="Nästa sida" trailing-icon></scb-button>`}
|
|
32
|
+
</div>
|
|
33
|
+
</nav>
|
|
34
|
+
`:s`
|
|
35
|
+
<nav aria-label="${this.paginationAriaLabel}" class="pagination ${p}">
|
|
36
|
+
<div class="pagination-row">
|
|
37
|
+
<div class="prev">
|
|
38
|
+
${this.variant==="icon"?s`<scb-icon-button icon="chevron_left" @click=${this._prevPage} ?disabled=${this.page===1} aria-label="Föregående sida"></scb-icon-button>`:s`<scb-button variant="text" label="Föregående" icon="chevron_left" @click=${this._prevPage} ?disabled=${this.page===1} aria-label="Föregående sida"></scb-button>`}
|
|
39
|
+
</div>
|
|
40
|
+
<ol>
|
|
41
|
+
${e}
|
|
42
|
+
</ol>
|
|
43
|
+
<div class="next">
|
|
44
|
+
${this.variant==="icon"?s`<scb-icon-button icon="chevron_right" @click=${this._nextPage} ?disabled=${this.page===this.totalPages} aria-label="Nästa sida"></scb-icon-button>`:s`<scb-button variant="text" label="Nästa" icon="chevron_right" iconPosition="right" @click=${this._nextPage} ?disabled=${this.page===this.totalPages} aria-label="Nästa sida" trailing-icon></scb-button>`}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</nav>
|
|
48
|
+
`}};l.styles=[g`
|
|
49
|
+
:host .pagination {
|
|
50
|
+
--md-text-button-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
51
|
+
--md-text-button-pressed-state-layer-color: var(--md-sys-color-on-surface, #0F0865);
|
|
52
|
+
--md-text-button-focus-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
53
|
+
--md-text-button-hover-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
54
|
+
--md-text-button-pressed-label-text-color: var(--md-sys-color-on-surface, #0F0865);
|
|
55
|
+
--md-text-button-label-text-weight: var(--weight-regular, 400);
|
|
56
|
+
--md-text-button-label-text-line-height: var(--md-sys-typescale-body-medium-line-height, 24px);
|
|
57
|
+
--md-text-button-label-text-size: var(--md-sys-typescale-body-medium-size, 16px);
|
|
58
|
+
--md-text-button-icon-color : var(--md-sys-color-on-surface, #0F0865);
|
|
59
|
+
--md-text-button-focus-icon-color : var(--md-sys-color-on-surface, #0F0865);
|
|
60
|
+
--md-text-button-hover-icon-color : var(--md-sys-color-on-surface, #0F0865);
|
|
61
|
+
--md-text-button-pressed-icon-color : var(--md-sys-color-on-surface, #0F0865);
|
|
62
|
+
--scb-link-decoration: none;
|
|
63
|
+
--scb-link-color: var(--md-sys-color-on-surface, #0F0865);
|
|
64
|
+
|
|
65
|
+
scb-link.page-number a {
|
|
66
|
+
cursor: pointer;
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.pagination {
|
|
73
|
+
width: 100%;
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
gap: 0;
|
|
77
|
+
}
|
|
78
|
+
.pagination-row {
|
|
79
|
+
width: 100%;
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: row;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: 4px;
|
|
84
|
+
}
|
|
85
|
+
.pagination-row .prev {
|
|
86
|
+
display: flex;
|
|
87
|
+
justify-content: flex-start;
|
|
88
|
+
width: auto;
|
|
89
|
+
}
|
|
90
|
+
.pagination-row ol {
|
|
91
|
+
width: auto;
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: row;
|
|
94
|
+
justify-content: flex-start;
|
|
95
|
+
gap: 4px;
|
|
96
|
+
margin: 0;
|
|
97
|
+
padding: 0;
|
|
98
|
+
list-style: none;
|
|
99
|
+
}
|
|
100
|
+
.pagination-row ol li {
|
|
101
|
+
min-width: 40px;
|
|
102
|
+
min-height: 40px;
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
}
|
|
107
|
+
.pagination-row .next {
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: flex-start;
|
|
110
|
+
align-items: center;
|
|
111
|
+
width: auto;
|
|
112
|
+
margin-top: 0;
|
|
113
|
+
}
|
|
114
|
+
scb-link.page-number a {
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
}
|
|
119
|
+
.page-number.active {
|
|
120
|
+
display: inline-flex;
|
|
121
|
+
align-items: center;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
border-radius: 50%;
|
|
124
|
+
background: var(--md-sys-color-primary, #1F44FF);
|
|
125
|
+
color: var(--md-sys-color-on-primary, #FFF);
|
|
126
|
+
text-align: center;
|
|
127
|
+
width: 40px;
|
|
128
|
+
height: 40px;
|
|
129
|
+
}
|
|
130
|
+
.page-number.active {
|
|
131
|
+
font-family: var(--brand-font, 'Inter', sans-serif);
|
|
132
|
+
}
|
|
133
|
+
.ellipsis {
|
|
134
|
+
margin: 0 4px;
|
|
135
|
+
color: #888;
|
|
136
|
+
user-select: none;
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
}
|
|
139
|
+
scb-button[disabled] {
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
pointer-events: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@media (max-width: 768px) {
|
|
145
|
+
|
|
146
|
+
.pagination .prev {
|
|
147
|
+
display: flex;
|
|
148
|
+
justify-content: flex-start;
|
|
149
|
+
}
|
|
150
|
+
.pagination .next {
|
|
151
|
+
width: 100%;
|
|
152
|
+
margin-top: 8px;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@media (max-width: 390px) {
|
|
157
|
+
.pagination-row {
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
gap: 0;
|
|
160
|
+
}
|
|
161
|
+
.pagination-row .prev {
|
|
162
|
+
width: 100%;
|
|
163
|
+
margin-bottom: 8px;
|
|
164
|
+
align-items: center;
|
|
165
|
+
}
|
|
166
|
+
.pagination-row ol {
|
|
167
|
+
width: 100%;
|
|
168
|
+
align-items: center;
|
|
169
|
+
}
|
|
170
|
+
.pagination-row .next {
|
|
171
|
+
width: 100%;
|
|
172
|
+
margin-top: 8px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`];c([d({type:String})],l.prototype,"variant",2);c([d({type:Number})],l.prototype,"page",2);c([d({type:Number,attribute:"total-pages"})],l.prototype,"totalPages",2);c([d({type:String,attribute:"paging-href"})],l.prototype,"pagingHref",2);c([d({type:String,attribute:"pagination-aria-label"})],l.prototype,"paginationAriaLabel",2);c([d({type:String,attribute:"current-aria-label"})],l.prototype,"currentAriaLabel",2);c([d({type:String,attribute:"paging-number-aria-label"})],l.prototype,"pagingNumberAriaLabel",2);c([d({type:Boolean})],l.prototype,"isNarrow",2);l=c([h("scb-pagination")],l);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.72",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -226,6 +226,10 @@
|
|
|
226
226
|
"import": "./scb-notification-card/scb-notification-card.js",
|
|
227
227
|
"require": "./scb-notification-card/scb-notification-card.js"
|
|
228
228
|
},
|
|
229
|
+
"./scb-pagination": {
|
|
230
|
+
"import": "./scb-pagination/scb-pagination.js",
|
|
231
|
+
"require": "./scb-pagination/scb-pagination.js"
|
|
232
|
+
},
|
|
229
233
|
"./scb-progress-indicator": {
|
|
230
234
|
"import": "./scb-progress-indicator/scb-progress-indicator.js",
|
|
231
235
|
"require": "./scb-progress-indicator/scb-progress-indicator.js"
|
|
@@ -292,5 +296,5 @@
|
|
|
292
296
|
},
|
|
293
297
|
"./mvc/*": "./mvc/*"
|
|
294
298
|
},
|
|
295
|
-
"buildHash": "
|
|
299
|
+
"buildHash": "33CE97F08BBD09532DCCF9A27161C746EE8DD54CC4DB0581E0FFCFE28A6BE144"
|
|
296
300
|
}
|
|
@@ -10,7 +10,7 @@ var m = Object.defineProperty, v = Object.getOwnPropertyDescriptor, l = (n, a, o
|
|
|
10
10
|
};
|
|
11
11
|
let i = class extends c {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(...arguments), this.title = "
|
|
13
|
+
super(...arguments), this.title = "", this.type = "default", this.position = "default", this.searchSupportingText = "";
|
|
14
14
|
}
|
|
15
15
|
handleAvatarSlotChange(n) {
|
|
16
16
|
n.target.assignedElements({ flatten: !0 }).forEach((e) => {
|
|
@@ -186,6 +186,10 @@ i.styles = [
|
|
|
186
186
|
display: flex;
|
|
187
187
|
align-items: center;
|
|
188
188
|
}
|
|
189
|
+
.leading {
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
}
|
|
189
193
|
`
|
|
190
194
|
];
|
|
191
195
|
l([
|
package/scb-badge/scb-badge.d.ts
CHANGED
|
@@ -4,11 +4,21 @@ import { LitElement } from 'lit';
|
|
|
4
4
|
* @slot - Innehåll som badgen placeras på (t.ex. ikon, text)
|
|
5
5
|
*/
|
|
6
6
|
export declare class ScbBadge extends LitElement {
|
|
7
|
+
private _slotClickHandler;
|
|
8
|
+
autoHide: boolean;
|
|
9
|
+
position: 'absolute' | 'relative';
|
|
10
|
+
positionTop: number;
|
|
11
|
+
positionRight: number;
|
|
7
12
|
value: string;
|
|
8
13
|
label: string;
|
|
9
|
-
|
|
14
|
+
hidden: boolean;
|
|
10
15
|
variant: 'dot' | 'value';
|
|
11
|
-
updated(): void;
|
|
12
16
|
static styles: import('lit').CSSResult;
|
|
17
|
+
firstUpdated(): void;
|
|
18
|
+
private _badgeVisible;
|
|
19
|
+
updated(): void;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
disconnectedCallback(): void;
|
|
22
|
+
private _onHideBadge;
|
|
13
23
|
render(): import('lit-html').TemplateResult<1>;
|
|
14
24
|
}
|