@sbb-esta/lyne-elements 3.3.2 → 3.5.0
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/core/i18n/i18n.d.ts +5 -0
- package/core/i18n/i18n.d.ts.map +1 -1
- package/core/i18n/i18n.js +108 -84
- package/core/i18n.js +84 -80
- package/core/mixins/element-internals-mixin.js +6 -6
- package/core/mixins/form-associated-input-mixin.d.ts +1 -0
- package/core/mixins/form-associated-input-mixin.d.ts.map +1 -1
- package/core/mixins/form-associated-input-mixin.js +2 -2
- package/core/styles/core/mediaqueries.scss +1 -1
- package/core/styles/core.scss +34 -1
- package/core/styles/mixins/typo.scss +88 -41
- package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables.scss +530 -0
- package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables_css--mixin.scss +1123 -0
- package/core.css +30 -0
- package/custom-elements.json +863 -147
- package/date-input/date-input.component.d.ts +5 -4
- package/date-input/date-input.component.d.ts.map +1 -1
- package/date-input/date-input.component.js +19 -21
- package/development/core/i18n/i18n.d.ts +5 -0
- package/development/core/i18n/i18n.d.ts.map +1 -1
- package/development/core/i18n/i18n.js +38 -10
- package/development/core/i18n.js +5 -1
- package/development/core/mixins/element-internals-mixin.js +3 -3
- package/development/core/mixins/form-associated-input-mixin.d.ts +1 -0
- package/development/core/mixins/form-associated-input-mixin.d.ts.map +1 -1
- package/development/core/mixins/form-associated-input-mixin.js +3 -2
- package/development/date-input/date-input.component.d.ts +5 -4
- package/development/date-input/date-input.component.d.ts.map +1 -1
- package/development/date-input/date-input.component.js +5 -8
- package/development/dialog/dialog/dialog.component.d.ts +2 -0
- package/development/dialog/dialog/dialog.component.d.ts.map +1 -1
- package/development/dialog/dialog/dialog.component.js +6 -2
- package/development/dialog/dialog-title/dialog-title.component.js +2 -6
- package/development/file-selector/common/file-selector-common.d.ts +2 -1
- package/development/file-selector/common/file-selector-common.d.ts.map +1 -1
- package/development/file-selector/common/file-selector-common.js +64 -19
- package/development/file-selector/common.js +1 -1
- package/development/file-selector/file-selector/file-selector.component.d.ts.map +1 -1
- package/development/file-selector/file-selector/file-selector.component.js +12 -17
- package/development/file-selector/file-selector-dropzone/file-selector-dropzone.component.d.ts +0 -7
- package/development/file-selector/file-selector-dropzone/file-selector-dropzone.component.d.ts.map +1 -1
- package/development/file-selector/file-selector-dropzone/file-selector-dropzone.component.js +32 -76
- package/development/{file-selector-common-csww18o8.js → file-selector-common-BxXdRZxt.js} +3 -3
- package/development/file-selector.js +1 -1
- package/development/form-field/form-field/form-field.component.d.ts.map +1 -1
- package/development/form-field/form-field/form-field.component.js +4 -4
- package/development/navigation/common/navigation-action-common.js +5 -8
- package/development/navigation/navigation/navigation.component.js +21 -4
- package/development/navigation/navigation-marker/navigation-marker.component.js +5 -8
- package/development/navigation/navigation-section/navigation-section.component.js +6 -19
- package/development/paginator/common/paginator-common.d.ts +3 -0
- package/development/paginator/common/paginator-common.d.ts.map +1 -1
- package/development/paginator/common/paginator-common.js +68 -10
- package/development/paginator/compact-paginator/compact-paginator.component.d.ts.map +1 -1
- package/development/paginator/compact-paginator/compact-paginator.component.js +8 -3
- package/development/paginator/paginator/paginator.component.d.ts +5 -0
- package/development/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/development/paginator/paginator/paginator.component.js +28 -6
- package/development/sidebar/sidebar-title/sidebar-title.component.js +1 -1
- package/development/tabs/tab-group/tab-group.component.js +3 -4
- package/development/time-input/time-input.component.d.ts +5 -4
- package/development/time-input/time-input.component.d.ts.map +1 -1
- package/development/time-input/time-input.component.js +5 -8
- package/development/title/title-base.js +14 -67
- package/development/title/title.component.js +17 -14
- package/development/toast/toast.component.js +6 -9
- package/development/train/train-wagon/train-wagon.component.js +6 -9
- package/dialog/dialog/dialog.component.d.ts +2 -0
- package/dialog/dialog/dialog.component.d.ts.map +1 -1
- package/dialog/dialog/dialog.component.js +14 -10
- package/dialog/dialog-title/dialog-title.component.js +1 -1
- package/file-selector/common/file-selector-common.d.ts +2 -1
- package/file-selector/common/file-selector-common.d.ts.map +1 -1
- package/file-selector/common/file-selector-common.js +88 -63
- package/file-selector/common.js +1 -1
- package/file-selector/file-selector/file-selector.component.d.ts.map +1 -1
- package/file-selector/file-selector/file-selector.component.js +26 -31
- package/file-selector/file-selector-dropzone/file-selector-dropzone.component.d.ts +0 -7
- package/file-selector/file-selector-dropzone/file-selector-dropzone.component.d.ts.map +1 -1
- package/file-selector/file-selector-dropzone/file-selector-dropzone.component.js +50 -74
- package/file-selector-common-Cn6U8goV.js +5 -0
- package/file-selector.js +1 -1
- package/form-field/form-field/form-field.component.d.ts.map +1 -1
- package/form-field/form-field/form-field.component.js +3 -3
- package/navigation/common/navigation-action-common.js +8 -8
- package/navigation/navigation/navigation.component.js +1 -1
- package/navigation/navigation-marker/navigation-marker.component.js +1 -1
- package/navigation/navigation-section/navigation-section.component.js +14 -14
- package/package.json +1 -1
- package/paginator/common/paginator-common.d.ts +3 -0
- package/paginator/common/paginator-common.d.ts.map +1 -1
- package/paginator/common/paginator-common.js +103 -63
- package/paginator/compact-paginator/compact-paginator.component.d.ts.map +1 -1
- package/paginator/compact-paginator/compact-paginator.component.js +13 -8
- package/paginator/paginator/paginator.component.d.ts +5 -0
- package/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/paginator/paginator/paginator.component.js +77 -61
- package/sidebar/sidebar-title/sidebar-title.component.js +14 -14
- package/standard-theme.css +30 -0
- package/tabs/tab-group/tab-group.component.js +7 -7
- package/time-input/time-input.component.d.ts +5 -4
- package/time-input/time-input.component.d.ts.map +1 -1
- package/time-input/time-input.component.js +21 -22
- package/title/title-base.js +33 -33
- package/title/title.component.js +9 -9
- package/toast/toast.component.js +1 -1
- package/train/train-wagon/train-wagon.component.js +6 -6
- package/file-selector-common-Dw5d8vA4.js +0 -5
|
@@ -1,76 +1,110 @@
|
|
|
1
|
-
var
|
|
1
|
+
var T = (i) => {
|
|
2
2
|
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { __runInitializers as
|
|
7
|
-
import { html as
|
|
8
|
-
import { property as
|
|
9
|
-
import { SbbLanguageController as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
var U = (i, r, l) => r.has(i) || T("Cannot " + l);
|
|
5
|
+
var x = (i, r, l) => (U(i, r, "read from private field"), l ? l.call(i) : r.get(i)), _ = (i, r, l) => r.has(i) ? T("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, l), n = (i, r, l, b) => (U(i, r, "write to private field"), b ? b.call(i, l) : r.set(i, l), l);
|
|
6
|
+
import { __runInitializers as g, __esDecorate as c } from "tslib";
|
|
7
|
+
import { html as A } from "lit";
|
|
8
|
+
import { property as h } from "lit/decorators.js";
|
|
9
|
+
import { SbbLanguageController as F } from "../../core/controllers.js";
|
|
10
|
+
import { forceType as m } from "../../core/decorators.js";
|
|
11
|
+
import { isLean as G } from "../../core/dom.js";
|
|
12
|
+
import { i18nPage as H, i18nPaginatorSelected as J, i18nPreviousPage as K, i18nNextPage as Q } from "../../core/i18n.js";
|
|
13
|
+
import { SbbNegativeMixin as V, SbbDisabledMixin as W, SbbElementInternalsMixin as X } from "../../core/mixins.js";
|
|
13
14
|
import "../../button/mini-button.js";
|
|
14
15
|
import "../../button/mini-button-group.js";
|
|
15
16
|
import "../../divider.js";
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
let
|
|
19
|
-
return
|
|
17
|
+
const ce = (i) => (() => {
|
|
18
|
+
var o, p, u, d, P, a;
|
|
19
|
+
let l = V(W(X(i))), b = [], y, z, v, f, L = [], I = [], S, N = [], $ = [], k, M = [], O = [], w, R = [], j = [], D, q = [], B = [];
|
|
20
|
+
return a = class extends l {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
_(this, o);
|
|
24
|
+
_(this, p);
|
|
25
|
+
_(this, u);
|
|
26
|
+
_(this, d);
|
|
27
|
+
_(this, P);
|
|
28
|
+
this._length = (g(this, b), 0), this._pageSize = 10, this._pageIndex = 0, n(this, o, g(this, L, "start")), n(this, p, (g(this, I), g(this, N, G() ? "s" : "m"))), n(this, u, (g(this, $), g(this, M, ""))), n(this, d, (g(this, O), g(this, R, ""))), n(this, P, (g(this, j), g(this, q, ""))), this.language = (g(this, B), new F(this)), this._previousPageSize = this._pageSize;
|
|
25
29
|
}
|
|
26
30
|
/** Total number of items. */
|
|
27
|
-
set length(
|
|
28
|
-
this._length = isNaN(
|
|
31
|
+
set length(t) {
|
|
32
|
+
this._length = isNaN(t) || t < 0 ? 0 : t, this.pageIndex = this.pageIndex;
|
|
29
33
|
}
|
|
30
34
|
get length() {
|
|
31
35
|
return this._length;
|
|
32
36
|
}
|
|
33
37
|
/** Number of items per page. */
|
|
34
|
-
set pageSize(
|
|
35
|
-
this._previousPageSize = this.pageSize, this._pageSize = Math.max(
|
|
38
|
+
set pageSize(t) {
|
|
39
|
+
this._previousPageSize = this.pageSize, this._pageSize = Math.max(t, 0), this.pageIndex = Math.floor(this.pageIndex * this._previousPageSize / this.pageSize) || 0;
|
|
36
40
|
}
|
|
37
41
|
get pageSize() {
|
|
38
42
|
return this._pageSize;
|
|
39
43
|
}
|
|
40
44
|
/** Current page index. */
|
|
41
|
-
set pageIndex(
|
|
42
|
-
const
|
|
43
|
-
this._pageIndex = this._coercePageIndexInRange(
|
|
45
|
+
set pageIndex(t) {
|
|
46
|
+
const e = this._pageIndex;
|
|
47
|
+
this._pageIndex = this._coercePageIndexInRange(t), this.emitPageEvent(e);
|
|
44
48
|
}
|
|
45
49
|
get pageIndex() {
|
|
46
50
|
return this._pageIndex;
|
|
47
51
|
}
|
|
48
52
|
/** Position of the prev/next buttons. */
|
|
49
53
|
get pagerPosition() {
|
|
50
|
-
return
|
|
54
|
+
return x(this, o);
|
|
51
55
|
}
|
|
52
|
-
set pagerPosition(
|
|
53
|
-
|
|
56
|
+
set pagerPosition(t) {
|
|
57
|
+
n(this, o, t);
|
|
54
58
|
}
|
|
55
59
|
/**
|
|
56
60
|
* Size variant, either m or s.
|
|
57
61
|
* @default 'm' / 's' (lean)
|
|
58
62
|
*/
|
|
59
63
|
get size() {
|
|
60
|
-
return
|
|
64
|
+
return x(this, p);
|
|
61
65
|
}
|
|
62
|
-
set size(
|
|
63
|
-
|
|
66
|
+
set size(t) {
|
|
67
|
+
n(this, p, t);
|
|
64
68
|
}
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Accessibility label for the page. Defaults to `page`.
|
|
71
|
+
* Can be set for cases like a carousel, where `slide` or `image` fits better.
|
|
72
|
+
*/
|
|
73
|
+
get accessibilityPageLabel() {
|
|
74
|
+
return x(this, u);
|
|
75
|
+
}
|
|
76
|
+
set accessibilityPageLabel(t) {
|
|
77
|
+
n(this, u, t);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Accessibility label for the previous page. Defaults to `previous page`.
|
|
81
|
+
* Can be set for cases like a carousel, where `slide` or `image` fits better.
|
|
82
|
+
*/
|
|
83
|
+
get accessibilityPreviousPageLabel() {
|
|
84
|
+
return x(this, d);
|
|
85
|
+
}
|
|
86
|
+
set accessibilityPreviousPageLabel(t) {
|
|
87
|
+
n(this, d, t);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Accessibility label for the next page. Defaults to `next page`.
|
|
91
|
+
* Can be set for cases like a carousel, where `slide` or `image` fits better.
|
|
92
|
+
*/
|
|
93
|
+
get accessibilityNextPageLabel() {
|
|
94
|
+
return x(this, P);
|
|
95
|
+
}
|
|
96
|
+
set accessibilityNextPageLabel(t) {
|
|
97
|
+
n(this, P, t);
|
|
98
|
+
}
|
|
99
|
+
updated(t) {
|
|
100
|
+
super.updated(t), this.shadowRoot.querySelector("sbb-screen-reader-only#status").textContent = this._currentPageLabel();
|
|
67
101
|
}
|
|
68
102
|
/** Evaluate `pageIndex` by excluding edge cases. */
|
|
69
|
-
_coercePageIndexInRange(
|
|
70
|
-
return Math.max(Math.min(Math.max(isNaN(
|
|
103
|
+
_coercePageIndexInRange(t) {
|
|
104
|
+
return Math.max(Math.min(Math.max(isNaN(t) ? 0 : t, 0), this.numberOfPages() - 1), 0);
|
|
71
105
|
}
|
|
72
106
|
_currentPageLabel() {
|
|
73
|
-
return
|
|
107
|
+
return `${this.accessibilityPageLabel ? this.accessibilityPageLabel : H[this.language.current]} ${this.pageIndex + 1} ${J[this.language.current]}.`;
|
|
74
108
|
}
|
|
75
109
|
/** Advances to the next page if it exists. */
|
|
76
110
|
nextPage() {
|
|
@@ -89,8 +123,8 @@ const V = (i) => (() => {
|
|
|
89
123
|
this.pageIndex = this.numberOfPages() - 1;
|
|
90
124
|
}
|
|
91
125
|
/** Move to a specific page index. */
|
|
92
|
-
selectPage(
|
|
93
|
-
this.pageIndex =
|
|
126
|
+
selectPage(t) {
|
|
127
|
+
this.pageIndex = t;
|
|
94
128
|
}
|
|
95
129
|
/** Whether there is a previous page. */
|
|
96
130
|
hasPreviousPage() {
|
|
@@ -98,8 +132,8 @@ const V = (i) => (() => {
|
|
|
98
132
|
}
|
|
99
133
|
/** Whether there is a next page. */
|
|
100
134
|
hasNextPage() {
|
|
101
|
-
const
|
|
102
|
-
return this.pageIndex <
|
|
135
|
+
const t = this.numberOfPages() - 1;
|
|
136
|
+
return this.pageIndex < t && this.pageSize !== 0;
|
|
103
137
|
}
|
|
104
138
|
/**
|
|
105
139
|
* Calculates the current number of pages based on the `length` and the `pageSize`;
|
|
@@ -108,8 +142,8 @@ const V = (i) => (() => {
|
|
|
108
142
|
numberOfPages() {
|
|
109
143
|
return this.pageSize ? Math.ceil(this.length / this.pageSize) : 0;
|
|
110
144
|
}
|
|
111
|
-
emitPageEvent(
|
|
112
|
-
if (!this.hasUpdated || this.pageIndex ===
|
|
145
|
+
emitPageEvent(t) {
|
|
146
|
+
if (!this.hasUpdated || this.pageIndex === t && this._previousPageSize === this.pageSize) {
|
|
113
147
|
this._previousPageSize = this.pageSize;
|
|
114
148
|
return;
|
|
115
149
|
}
|
|
@@ -117,7 +151,7 @@ const V = (i) => (() => {
|
|
|
117
151
|
bubbles: !0,
|
|
118
152
|
composed: !0,
|
|
119
153
|
detail: {
|
|
120
|
-
previousPageIndex:
|
|
154
|
+
previousPageIndex: t,
|
|
121
155
|
pageIndex: this.pageIndex,
|
|
122
156
|
length: this.length,
|
|
123
157
|
pageSize: this.pageSize
|
|
@@ -125,11 +159,11 @@ const V = (i) => (() => {
|
|
|
125
159
|
}));
|
|
126
160
|
}
|
|
127
161
|
renderPrevNextButtons() {
|
|
128
|
-
return
|
|
162
|
+
return A`
|
|
129
163
|
<sbb-mini-button-group ?negative=${this.negative} size=${this.size === "s" ? "s" : "l"}>
|
|
130
164
|
<sbb-mini-button
|
|
131
165
|
id="sbb-paginator-prev-page"
|
|
132
|
-
aria-label=${
|
|
166
|
+
aria-label=${this.accessibilityPreviousPageLabel ? this.accessibilityPreviousPageLabel : K[this.language.current]}
|
|
133
167
|
icon-name="chevron-small-left-small"
|
|
134
168
|
?disabled=${this.disabled || !this.hasPreviousPage()}
|
|
135
169
|
@click=${() => this.previousPage()}
|
|
@@ -137,7 +171,7 @@ const V = (i) => (() => {
|
|
|
137
171
|
<sbb-divider orientation="vertical"></sbb-divider>
|
|
138
172
|
<sbb-mini-button
|
|
139
173
|
id="sbb-paginator-next-page"
|
|
140
|
-
aria-label=${
|
|
174
|
+
aria-label=${this.accessibilityNextPageLabel ? this.accessibilityNextPageLabel : Q[this.language.current]}
|
|
141
175
|
icon-name="chevron-small-right-small"
|
|
142
176
|
?disabled=${this.disabled || !this.hasNextPage()}
|
|
143
177
|
@click=${() => this.nextPage()}
|
|
@@ -146,28 +180,34 @@ const V = (i) => (() => {
|
|
|
146
180
|
`;
|
|
147
181
|
}
|
|
148
182
|
render() {
|
|
149
|
-
return
|
|
183
|
+
return A`
|
|
150
184
|
${this.renderPaginator()}
|
|
151
|
-
<sbb-screen-reader-only role="status"></sbb-screen-reader-only>
|
|
185
|
+
<sbb-screen-reader-only id="status" role="status"></sbb-screen-reader-only>
|
|
152
186
|
`;
|
|
153
187
|
}
|
|
154
|
-
},
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
} }, metadata:
|
|
159
|
-
|
|
160
|
-
} }, metadata:
|
|
161
|
-
|
|
162
|
-
} }, metadata:
|
|
163
|
-
|
|
164
|
-
} }, metadata:
|
|
165
|
-
|
|
166
|
-
} }, metadata:
|
|
167
|
-
|
|
188
|
+
}, o = new WeakMap(), p = new WeakMap(), u = new WeakMap(), d = new WeakMap(), P = new WeakMap(), (() => {
|
|
189
|
+
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(l[Symbol.metadata] ?? null) : void 0;
|
|
190
|
+
y = [h({ type: Number })], z = [h({ attribute: "page-size", type: Number })], v = [h({ attribute: "page-index", type: Number })], f = [h({ attribute: "pager-position", reflect: !0 })], S = [h({ reflect: !0 })], k = [m(), h({ attribute: "accessibility-page-label" })], w = [m(), h({ attribute: "accessibility-previous-page-label" })], D = [m(), h({ attribute: "accessibility-next-page-label" })], c(a, null, y, { kind: "setter", name: "length", static: !1, private: !1, access: { has: (e) => "length" in e, set: (e, s) => {
|
|
191
|
+
e.length = s;
|
|
192
|
+
} }, metadata: t }, null, b), c(a, null, z, { kind: "setter", name: "pageSize", static: !1, private: !1, access: { has: (e) => "pageSize" in e, set: (e, s) => {
|
|
193
|
+
e.pageSize = s;
|
|
194
|
+
} }, metadata: t }, null, b), c(a, null, v, { kind: "setter", name: "pageIndex", static: !1, private: !1, access: { has: (e) => "pageIndex" in e, set: (e, s) => {
|
|
195
|
+
e.pageIndex = s;
|
|
196
|
+
} }, metadata: t }, null, b), c(a, null, f, { kind: "accessor", name: "pagerPosition", static: !1, private: !1, access: { has: (e) => "pagerPosition" in e, get: (e) => e.pagerPosition, set: (e, s) => {
|
|
197
|
+
e.pagerPosition = s;
|
|
198
|
+
} }, metadata: t }, L, I), c(a, null, S, { kind: "accessor", name: "size", static: !1, private: !1, access: { has: (e) => "size" in e, get: (e) => e.size, set: (e, s) => {
|
|
199
|
+
e.size = s;
|
|
200
|
+
} }, metadata: t }, N, $), c(a, null, k, { kind: "accessor", name: "accessibilityPageLabel", static: !1, private: !1, access: { has: (e) => "accessibilityPageLabel" in e, get: (e) => e.accessibilityPageLabel, set: (e, s) => {
|
|
201
|
+
e.accessibilityPageLabel = s;
|
|
202
|
+
} }, metadata: t }, M, O), c(a, null, w, { kind: "accessor", name: "accessibilityPreviousPageLabel", static: !1, private: !1, access: { has: (e) => "accessibilityPreviousPageLabel" in e, get: (e) => e.accessibilityPreviousPageLabel, set: (e, s) => {
|
|
203
|
+
e.accessibilityPreviousPageLabel = s;
|
|
204
|
+
} }, metadata: t }, R, j), c(a, null, D, { kind: "accessor", name: "accessibilityNextPageLabel", static: !1, private: !1, access: { has: (e) => "accessibilityNextPageLabel" in e, get: (e) => e.accessibilityNextPageLabel, set: (e, s) => {
|
|
205
|
+
e.accessibilityNextPageLabel = s;
|
|
206
|
+
} }, metadata: t }, q, B), t && Object.defineProperty(a, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
207
|
+
})(), a.role = "group", a.events = {
|
|
168
208
|
page: "page"
|
|
169
|
-
},
|
|
209
|
+
}, a;
|
|
170
210
|
})();
|
|
171
211
|
export {
|
|
172
|
-
|
|
212
|
+
ce as SbbPaginatorCommonElementMixin
|
|
173
213
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact-paginator.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/paginator/compact-paginator/compact-paginator.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"compact-paginator.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/paginator/compact-paginator/compact-paginator.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAQvC,OAAO,kBAAkB,CAAC;AAC1B,OAAO,6BAA6B,CAAC;;AAErC;;GAEG;AACH,qBAEM,0BAA2B,SAAQ,+BAA0C;IACjF,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1C;IAEX,OAAO,CAAC,kBAAkB;cAiBP,eAAe,IAAI,cAAc;CASrD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,uBAAuB,EAAE,0BAA0B,CAAC;KACrD;CACF"}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { __esDecorate as b, __runInitializers as c } from "tslib";
|
|
2
2
|
import { css as l, LitElement as p, html as a } from "lit";
|
|
3
3
|
import { customElement as m } from "lit/decorators.js";
|
|
4
|
-
import {
|
|
4
|
+
import { i18nPage as g, i18nPaginatorOf as d } from "../../core/i18n.js";
|
|
5
|
+
import { SbbPaginatorCommonElementMixin as h } from "../common.js";
|
|
5
6
|
import "../../divider.js";
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
import "../../screen-reader-only.js";
|
|
8
|
+
const u = l`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-compact-paginator-height: var(--sbb-size-element-m);--sbb-compact-paginator-color: var(--sbb-color-metal);--sbb-paginator-compact-justify-content: start}:host([size=s]){--sbb-compact-paginator-height: var(--sbb-size-element-xs)}:host([negative]){--sbb-compact-paginator-color: var(--sbb-color-storm)}:host([pager-position=end]){--sbb-paginator-compact-justify-content: end}.sbb-compact-paginator{display:flex;gap:var(--sbb-spacing-fixed-5x);justify-content:var(--sbb-paginator-compact-justify-content);min-height:var(--sbb-compact-paginator-height)}.sbb-paginator__pages{--sbb-text-font-size: var(--sbb-font-size-text-m);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;align-items:center;justify-content:center;gap:var(--sbb-spacing-fixed-2x);color:var(--sbb-compact-paginator-color)}.sbb-compact-paginator__divider{height:1rem}`;
|
|
9
|
+
let z = (() => {
|
|
8
10
|
var t;
|
|
9
|
-
let n = [m("sbb-compact-paginator")], i, r = [], e, o =
|
|
11
|
+
let n = [m("sbb-compact-paginator")], i, r = [], e, o = h(p);
|
|
10
12
|
return t = class extends o {
|
|
11
13
|
_renderPageNumbers() {
|
|
12
14
|
return a`
|
|
13
|
-
<span class="sbb-paginator__pages"
|
|
15
|
+
<span class="sbb-paginator__pages" aria-hidden="true"
|
|
14
16
|
>${this.pageIndex + 1}<sbb-divider
|
|
15
|
-
aria-hidden="true"
|
|
16
17
|
orientation="vertical"
|
|
17
18
|
class="sbb-compact-paginator__divider"
|
|
19
|
+
style="--sbb-divider-color: currentcolor"
|
|
18
20
|
?negative=${this.negative}
|
|
19
21
|
></sbb-divider
|
|
20
22
|
>${this.numberOfPages()}</span
|
|
21
23
|
>
|
|
24
|
+
<sbb-screen-reader-only>
|
|
25
|
+
${`${this.accessibilityPageLabel ? this.accessibilityPageLabel : g[this.language.current]} ${this.pageIndex + 1} ${d[this.language.current]} ${this.numberOfPages()}`}
|
|
26
|
+
</sbb-screen-reader-only>
|
|
22
27
|
`;
|
|
23
28
|
}
|
|
24
29
|
renderPaginator() {
|
|
@@ -31,10 +36,10 @@ let x = (() => {
|
|
|
31
36
|
}, e = t, (() => {
|
|
32
37
|
const s = typeof Symbol == "function" && Symbol.metadata ? Object.create(o[Symbol.metadata] ?? null) : void 0;
|
|
33
38
|
b(null, i = { value: e }, n, { kind: "class", name: e.name, metadata: s }, null, r), e = i.value, s && Object.defineProperty(e, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: s });
|
|
34
|
-
})(), t.styles =
|
|
39
|
+
})(), t.styles = u, t.events = {
|
|
35
40
|
page: "page"
|
|
36
41
|
}, c(e, r), e;
|
|
37
42
|
})();
|
|
38
43
|
export {
|
|
39
|
-
|
|
44
|
+
z as SbbCompactPaginatorElement
|
|
40
45
|
};
|
|
@@ -13,6 +13,11 @@ export declare class SbbPaginatorElement extends SbbPaginatorElement_base {
|
|
|
13
13
|
* the sbb-select for the pageSize change will be positioned oppositely, with the page numbers always in the center.
|
|
14
14
|
*/
|
|
15
15
|
accessor pagerPosition: 'start' | 'end';
|
|
16
|
+
/**
|
|
17
|
+
* Accessibility label for the items per page. Defaults to `Items per page.`.
|
|
18
|
+
* Can be set for cases like a carousel, where `slide` or `image` fits better.
|
|
19
|
+
*/
|
|
20
|
+
accessor accessibilityItemsPerPageLabel: string;
|
|
16
21
|
private _markForFocus;
|
|
17
22
|
protected updated(changedProperties: PropertyValues<this>): void;
|
|
18
23
|
/** Returns the displayed page elements. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginator.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/paginator/paginator/paginator.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"paginator.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/paginator/paginator/paginator.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,UAAU,EAEV,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,KAAK,CAAC;AAYb,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,6BAA6B,CAAC;;AAIrC;;GAEG;AACH,qBAEM,mBAAoB,SAAQ,wBAA0C;IAC1E,OAAuB,MAAM,EAAE,cAAc,CAAS;IACtD,gBAAuB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE1C;IAEX,wCAAwC;IACxC,SACgB,eAAe,EAAE,MAAM,EAAE,CAAM;IAE/C;;;OAGG;IACH,SAAmF,aAAa,EAC5F,OAAO,GACP,KAAK,CAAW;IAEpB;;;OAGG;IACH,SAEgB,8BAA8B,EAAE,MAAM,CAAM;IAE5D,OAAO,CAAC,aAAa,CAAuB;cAEzB,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;IAezE,2CAA2C;IAC3C,OAAO,CAAC,gBAAgB;IAIxB;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IA2B7B,uFAAuF;IACvF,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,0BAA0B;IAkClC,OAAO,CAAC,kBAAkB;cAmCP,eAAe,IAAI,cAAc;CAiBrD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,eAAe,EAAE,mBAAmB,CAAC;KACtC;CACF"}
|
|
@@ -1,51 +1,63 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var u = (t,
|
|
6
|
-
import { __runInitializers as
|
|
7
|
-
import { css as
|
|
8
|
-
import { customElement as
|
|
9
|
-
import { repeat as
|
|
10
|
-
import { sbbInputModalityDetector as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
var L = (t, i, r) => i.has(t) || O("Cannot " + r);
|
|
5
|
+
var u = (t, i, r) => (L(t, i, "read from private field"), r ? r.call(t) : i.get(t)), h = (t, i, r) => i.has(t) ? O("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(t) : i.set(t, r), p = (t, i, r, o) => (L(t, i, "write to private field"), o ? o.call(t, r) : i.set(t, r), r);
|
|
6
|
+
import { __runInitializers as g, __esDecorate as _ } from "tslib";
|
|
7
|
+
import { css as F, LitElement as T, nothing as E, html as b } from "lit";
|
|
8
|
+
import { customElement as D, property as f } from "lit/decorators.js";
|
|
9
|
+
import { repeat as j } from "lit/directives/repeat.js";
|
|
10
|
+
import { sbbInputModalityDetector as N } from "../../core/a11y.js";
|
|
11
|
+
import { forceType as M } from "../../core/decorators.js";
|
|
12
|
+
import { i18nItemsPerPage as V, i18nPage as B } from "../../core/i18n.js";
|
|
13
|
+
import { SbbPaginatorCommonElementMixin as G } from "../common.js";
|
|
13
14
|
import "../../form-field.js";
|
|
14
15
|
import "../../select.js";
|
|
15
16
|
import "../../option.js";
|
|
16
17
|
import "../../screen-reader-only.js";
|
|
17
|
-
const
|
|
18
|
-
let
|
|
19
|
-
var
|
|
20
|
-
let t = [
|
|
18
|
+
const H = F`*,:before,:after{box-sizing:border-box}:host{display:block;--sbb-paginator-height: var(--sbb-size-element-m);--sbb-paginator-page-color: var(--sbb-color-metal);--sbb-paginator-page-background-color: transparent;--sbb-paginator-page-border-width: 0;--sbb-paginator-page-border-style: none;--sbb-paginator-page-border-color: none;--sbb-paginator-page-cursor: pointer;--sbb-paginator-page-inset: 0;--sbb-paginator-animation-easing: var(--sbb-animation-easing);--sbb-paginator-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-2x) );--sbb-paginator-justify-content: start;--sbb-paginator-wrapping-group-wrap: wrap-reverse;--sbb-paginator-wrap: wrap}:host([size=s]){--sbb-paginator-height: var(--sbb-size-element-xs)}:host([negative]){--sbb-paginator-page-color: var(--sbb-color-smoke);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark)}:host([pager-position=end]){--sbb-paginator-justify-content: end;--sbb-paginator-wrapping-group-wrap: wrap;--sbb-paginator-wrap: wrap-reverse}.sbb-paginator,.sbb-paginator__wrapping-group{display:flex;gap:var(--sbb-spacing-fixed-3x) var(--sbb-spacing-fixed-6x);justify-content:var(--sbb-paginator-justify-content)}.sbb-paginator{flex-wrap:var(--sbb-paginator-wrap);min-height:var(--sbb-paginator-height)}.sbb-paginator__wrapping-group{flex-wrap:var(--sbb-paginator-wrapping-group-wrap)}.sbb-paginator__page-size-options{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);display:flex;align-items:center;gap:var(--sbb-spacing-fixed-2x);white-space:nowrap;color:var(--sbb-paginator-page-color)}.sbb-paginator__page-size-options sbb-select{--sbb-text-font-size: var(--sbb-font-size-text-m);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);color:var(--sbb-form-field-text-color);font-size:var(--sbb-form-field-input-text-size);padding-inline-end:var(--sbb-form-field-select-inline-padding-end)}.sbb-paginator__pages{list-style:none;margin:0;padding:0;font-size:inherit;display:flex;align-items:center;justify-content:center;gap:var(--sbb-spacing-fixed-1x);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.sbb-paginator__page--ellipsis,.sbb-paginator__page--number{--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:relative;color:var(--sbb-paginator-page-color)}.sbb-paginator__page--ellipsis-item,.sbb-paginator__page--number-item{display:flex;justify-content:center;align-items:center;width:var(--sbb-size-element-xxs);height:var(--sbb-size-element-xxs)}.sbb-paginator__page--number-item{-webkit-appearance:none;-moz-appearance:none;box-sizing:border-box;margin:0;outline:none;border:none;border-radius:0;padding:0;background:none;-webkit-tap-highlight-color:transparent;color:inherit;--sbb-text-font-size: var(--sbb-font-size-text-s);font-family:var(--sbb-typo-font-family);font-weight:400;line-height:var(--sbb-typo-line-height-body-text);letter-spacing:var(--sbb-typo-letter-spacing-body-text);font-size:var(--sbb-text-font-size);position:relative;cursor:var(--sbb-paginator-page-cursor);outline:none!important;color:var(--sbb-paginator-page-color);transition:color var(--sbb-paginator-animation-duration) var(--sbb-paginator-animation-easing)}.sbb-paginator__page--number-item:before{content:"";position:absolute;background-color:var(--sbb-paginator-page-background-color);border:var(--sbb-paginator-page-border-width) var(--sbb-paginator-page-border-style) var(--sbb-paginator-page-border-color);border-radius:var(--sbb-border-radius-infinity);inset:var(--sbb-paginator-page-inset);transition-property:background-color,border,inset;transition-duration:var(--sbb-paginator-animation-duration);transition-timing-function:var(--sbb-paginator-animation-easing)}.sbb-paginator__page--number-item:focus-visible:before{outline-offset:var(--sbb-focus-outline-offset);outline:var(--sbb-focus-outline-color) var(--sbb-focus-outline-style, solid) var(--sbb-focus-outline-width);outline-offset:var(--sbb-border-width-2x)}.sbb-paginator__page--number-item[data-selected]{font-weight:700;--sbb-paginator-page-color: var(--sbb-color-charcoal);--sbb-paginator-page-border-width: var(--sbb-border-width-2x);--sbb-paginator-page-border-style: solid;--sbb-paginator-page-border-color: var(--sbb-color-charcoal)}:host([negative]) .sbb-paginator__page--number-item[data-selected]{--sbb-paginator-page-color: var(--sbb-color-milk);--sbb-paginator-page-border-color: var(--sbb-color-white)}@media (forced-colors: active){.sbb-paginator__page--number-item[data-selected]{--sbb-paginator-page-border-color: Highlight !important}}.sbb-paginator__page--number-item:disabled{--sbb-paginator-page-color: var(--sbb-color-smoke);--sbb-paginator-page-border-style: dashed;--sbb-paginator-page-border-color: var(--sbb-color-smoke);--sbb-paginator-page-background-color: var(--sbb-color-milk);--sbb-paginator-page-cursor: default}.sbb-paginator__page--number-item:disabled:not([data-selected]){--sbb-paginator-page-border-width: var(--sbb-border-width-1x)}:host([negative]) .sbb-paginator__page--number-item:disabled{--sbb-paginator-page-color: var(--sbb-color-aluminium);--sbb-paginator-page-background-color: var(--sbb-color-charcoal)}@media (forced-colors: active){.sbb-paginator__page--number-item:disabled{--sbb-paginator-page-border-color: GrayText;--sbb-paginator-page-color: GrayText;--sbb-paginator-page-background-color: Canvas}}@media (any-hover: hover){.sbb-paginator__page--number-item:not(:disabled):hover{--sbb-paginator-page-background-color: var(--sbb-color-milk);--sbb-paginator-page-inset: calc(var(--sbb-border-width-2x) * -1);--sbb-paginator-translate-y-content-hover: -.0625rem}:host([negative]) .sbb-paginator__page--number-item:not(:disabled):hover{--sbb-paginator-page-background-color: var(--sbb-color-charcoal)}}@media (any-hover: hover) and (forced-colors: active){.sbb-paginator__page--number-item:not(:disabled):hover{--sbb-paginator-page-background-color: Highlight !important}}.sbb-paginator__page--number-item:not(:disabled):active{--sbb-paginator-page-color: var(--sbb-color-charcoal);--sbb-paginator-page-background-color: var(--sbb-color-cloud);--sbb-paginator-page-inset: 0;--sbb-paginator-translate-y-content-hover: 0}:host([negative]) .sbb-paginator__page--number-item:not(:disabled):active{--sbb-paginator-page-color: var(--sbb-color-milk);--sbb-paginator-page-background-color: var(--sbb-color-iron)}@media (forced-colors: active){.sbb-paginator__page--number-item:not(:disabled):active{--sbb-paginator-page-background-color: Highlight !important}}.sbb-paginator__page--number-item-label{transition:transform var(--sbb-paginator-animation-duration) var(--sbb-paginator-animation-easing);transform:translateY(var(--sbb-paginator-translate-y-content-hover, 0rem))}.sbb-screen-reader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}`, m = 3;
|
|
19
|
+
let ie = (() => {
|
|
20
|
+
var l, c, d, s;
|
|
21
|
+
let t = [D("sbb-paginator")], i, r = [], o, v = G(T), y, x = [], P = [], z, w = [], k = [], I, S = [], $ = [];
|
|
21
22
|
return s = class extends v {
|
|
22
23
|
constructor() {
|
|
23
24
|
super(...arguments);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
h(this, l);
|
|
26
|
+
h(this, c);
|
|
27
|
+
h(this, d);
|
|
28
|
+
p(this, l, g(this, x, [])), p(this, c, (g(this, P), g(this, w, "start"))), p(this, d, (g(this, k), g(this, S, ""))), this._markForFocus = (g(this, $), null);
|
|
27
29
|
}
|
|
28
30
|
/** The available `pageSize` choices. */
|
|
29
31
|
get pageSizeOptions() {
|
|
30
|
-
return u(this,
|
|
32
|
+
return u(this, l);
|
|
31
33
|
}
|
|
32
|
-
set pageSizeOptions(
|
|
33
|
-
|
|
34
|
+
set pageSizeOptions(e) {
|
|
35
|
+
p(this, l, e);
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
38
|
* Position of the prev/next buttons: if `pageSizeOptions` is set,
|
|
37
39
|
* the sbb-select for the pageSize change will be positioned oppositely, with the page numbers always in the center.
|
|
38
40
|
*/
|
|
39
41
|
get pagerPosition() {
|
|
40
|
-
return u(this,
|
|
42
|
+
return u(this, c);
|
|
41
43
|
}
|
|
42
|
-
set pagerPosition(
|
|
43
|
-
|
|
44
|
+
set pagerPosition(e) {
|
|
45
|
+
p(this, c, e);
|
|
44
46
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Accessibility label for the items per page. Defaults to `Items per page.`.
|
|
49
|
+
* Can be set for cases like a carousel, where `slide` or `image` fits better.
|
|
50
|
+
*/
|
|
51
|
+
get accessibilityItemsPerPageLabel() {
|
|
52
|
+
return u(this, d);
|
|
53
|
+
}
|
|
54
|
+
set accessibilityItemsPerPageLabel(e) {
|
|
55
|
+
p(this, d, e);
|
|
56
|
+
}
|
|
57
|
+
updated(e) {
|
|
58
|
+
if (super.updated(e), this._markForFocus && N.mostRecentModality === "keyboard") {
|
|
59
|
+
const a = this._getVisiblePages().find((n) => this.pageIndex === +n.getAttribute("data-index"));
|
|
60
|
+
a && a.focus(), this._markForFocus = null;
|
|
49
61
|
}
|
|
50
62
|
}
|
|
51
63
|
/** Returns the displayed page elements. */
|
|
@@ -59,34 +71,36 @@ let Q = (() => {
|
|
|
59
71
|
* - if there are more than `MAX_PAGE_NUMBERS_DISPLAYED` other pages, ellipsis button must be used.
|
|
60
72
|
*/
|
|
61
73
|
_getVisiblePagesIndex() {
|
|
62
|
-
const
|
|
63
|
-
return
|
|
74
|
+
const e = this.numberOfPages(), a = this.pageIndex;
|
|
75
|
+
return e <= m + 2 ? this._range(e) : a < m ? [...this._range(m + 1), "ellipsis", e - 1] : a >= e - m ? [
|
|
64
76
|
0,
|
|
65
77
|
"ellipsis",
|
|
66
|
-
...this._range(
|
|
78
|
+
...this._range(m + 1, e - 1 - m)
|
|
67
79
|
] : [
|
|
68
80
|
0,
|
|
69
81
|
"ellipsis",
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
a - 1,
|
|
83
|
+
a,
|
|
84
|
+
a + 1,
|
|
73
85
|
"ellipsis",
|
|
74
|
-
|
|
86
|
+
e - 1
|
|
75
87
|
];
|
|
76
88
|
}
|
|
77
89
|
/** Creates an array of consecutive numbers given the length and the starting value. */
|
|
78
|
-
_range(
|
|
79
|
-
return Array.from({ length:
|
|
90
|
+
_range(e, a = 0) {
|
|
91
|
+
return Array.from({ length: e }, (n, A) => A + a);
|
|
80
92
|
}
|
|
81
|
-
_handleKeyUp(
|
|
82
|
-
if (
|
|
93
|
+
_handleKeyUp(e) {
|
|
94
|
+
if (e.key !== " " && e.key !== "Enter")
|
|
83
95
|
return;
|
|
84
|
-
this._getVisiblePages().find((n) => n ===
|
|
96
|
+
this._getVisiblePages().find((n) => n === e.target) && (this._markForFocus = this.pageIndex);
|
|
85
97
|
}
|
|
86
98
|
_renderItemPerPageTemplate() {
|
|
87
99
|
return this.pageSizeOptions && this.pageSizeOptions.length > 0 ? b`
|
|
88
100
|
<div class="sbb-paginator__page-size-options">
|
|
89
|
-
<label for="select"
|
|
101
|
+
<label for="select"
|
|
102
|
+
>${this.accessibilityItemsPerPageLabel ? this.accessibilityItemsPerPageLabel : V[this.language.current]}</label
|
|
103
|
+
>
|
|
90
104
|
<sbb-form-field
|
|
91
105
|
borderless
|
|
92
106
|
width="collapse"
|
|
@@ -96,35 +110,35 @@ let Q = (() => {
|
|
|
96
110
|
<sbb-select
|
|
97
111
|
id="select"
|
|
98
112
|
?disabled=${this.disabled}
|
|
99
|
-
value=${this.pageSizeOptions?.find((
|
|
100
|
-
@change=${(
|
|
113
|
+
value=${this.pageSizeOptions?.find((e) => e === this.pageSize) ?? this.pageSizeOptions[0]}
|
|
114
|
+
@change=${(e) => this.pageSize = +e.target.value}
|
|
101
115
|
>
|
|
102
|
-
${
|
|
116
|
+
${j(this.pageSizeOptions, (e) => b`<sbb-option value=${e}>${e}</sbb-option>`)}
|
|
103
117
|
</sbb-select>
|
|
104
118
|
</sbb-form-field>
|
|
105
119
|
</div>
|
|
106
|
-
` :
|
|
120
|
+
` : E;
|
|
107
121
|
}
|
|
108
122
|
_renderPageNumbers() {
|
|
109
123
|
return b`
|
|
110
124
|
<ul class="sbb-paginator__pages">
|
|
111
|
-
${
|
|
125
|
+
${j(this._getVisiblePagesIndex(), (e) => e === "ellipsis" ? b`
|
|
112
126
|
<li class="sbb-paginator__page--ellipsis">
|
|
113
127
|
<span class="sbb-paginator__page--ellipsis-item">…</span>
|
|
114
128
|
</li>
|
|
115
129
|
` : b`
|
|
116
130
|
<li class="sbb-paginator__page--number">
|
|
117
131
|
<button
|
|
118
|
-
?data-selected=${this.pageIndex ===
|
|
132
|
+
?data-selected=${this.pageIndex === e}
|
|
119
133
|
?disabled=${this.disabled}
|
|
120
134
|
class="sbb-paginator__page--number-item"
|
|
121
|
-
data-index=${
|
|
122
|
-
aria-label="${
|
|
123
|
-
aria-current=${this.pageIndex ===
|
|
124
|
-
@click=${() => this.pageIndex =
|
|
135
|
+
data-index=${e}
|
|
136
|
+
aria-label="${this.accessibilityPageLabel ? this.accessibilityPageLabel : B[this.language.current]} ${e + 1}"
|
|
137
|
+
aria-current=${this.pageIndex === e ? "true" : E}
|
|
138
|
+
@click=${() => this.pageIndex = e}
|
|
125
139
|
@keyup=${this._handleKeyUp}
|
|
126
140
|
>
|
|
127
|
-
<span class="sbb-paginator__page--number-item-label">${
|
|
141
|
+
<span class="sbb-paginator__page--number-item-label">${e + 1}</span>
|
|
128
142
|
</button>
|
|
129
143
|
</li>
|
|
130
144
|
`)}
|
|
@@ -144,17 +158,19 @@ let Q = (() => {
|
|
|
144
158
|
</div>
|
|
145
159
|
`;
|
|
146
160
|
}
|
|
147
|
-
},
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} }, metadata:
|
|
152
|
-
|
|
153
|
-
} }, metadata:
|
|
154
|
-
|
|
161
|
+
}, l = new WeakMap(), c = new WeakMap(), d = new WeakMap(), o = s, (() => {
|
|
162
|
+
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(v[Symbol.metadata] ?? null) : void 0;
|
|
163
|
+
y = [f({ attribute: "page-size-options", type: Array })], z = [f({ attribute: "pager-position", reflect: !0 })], I = [M(), f({ attribute: "accessibility-items-per-page-label" })], _(s, null, y, { kind: "accessor", name: "pageSizeOptions", static: !1, private: !1, access: { has: (a) => "pageSizeOptions" in a, get: (a) => a.pageSizeOptions, set: (a, n) => {
|
|
164
|
+
a.pageSizeOptions = n;
|
|
165
|
+
} }, metadata: e }, x, P), _(s, null, z, { kind: "accessor", name: "pagerPosition", static: !1, private: !1, access: { has: (a) => "pagerPosition" in a, get: (a) => a.pagerPosition, set: (a, n) => {
|
|
166
|
+
a.pagerPosition = n;
|
|
167
|
+
} }, metadata: e }, w, k), _(s, null, I, { kind: "accessor", name: "accessibilityItemsPerPageLabel", static: !1, private: !1, access: { has: (a) => "accessibilityItemsPerPageLabel" in a, get: (a) => a.accessibilityItemsPerPageLabel, set: (a, n) => {
|
|
168
|
+
a.accessibilityItemsPerPageLabel = n;
|
|
169
|
+
} }, metadata: e }, S, $), _(null, i = { value: o }, t, { kind: "class", name: o.name, metadata: e }, null, r), o = i.value, e && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
170
|
+
})(), s.styles = H, s.events = {
|
|
155
171
|
page: "page"
|
|
156
|
-
},
|
|
172
|
+
}, g(o, r), o;
|
|
157
173
|
})();
|
|
158
174
|
export {
|
|
159
|
-
|
|
175
|
+
ie as SbbPaginatorElement
|
|
160
176
|
};
|