@sbb-esta/lyne-elements 2.10.1 → 2.11.1
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/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/calendar/calendar.component.d.ts +2 -0
- package/calendar/calendar.component.d.ts.map +1 -1
- package/calendar/calendar.component.js +5 -3
- package/card/card/card.component.d.ts +0 -6
- package/card/card/card.component.d.ts.map +1 -1
- package/card/card/card.component.js +11 -19
- package/container/sticky-bar/sticky-bar.component.d.ts +5 -0
- package/container/sticky-bar/sticky-bar.component.d.ts.map +1 -1
- package/container/sticky-bar/sticky-bar.component.js +49 -36
- package/core/styles/mixins/typo.scss +0 -1
- package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables.scss +2 -0
- package/core/styles/node_modules_@sbb-esta_lyne-design-tokens_dist_scss_sbb-variables_css--mixin.scss +7 -1
- package/core.css +7 -1
- package/custom-elements.json +53 -30
- package/development/autocomplete/autocomplete-base-element.d.ts.map +1 -1
- package/development/autocomplete/autocomplete-base-element.js +1 -1
- package/development/calendar/calendar.component.d.ts +2 -0
- package/development/calendar/calendar.component.d.ts.map +1 -1
- package/development/calendar/calendar.component.js +6 -5
- package/development/card/card/card.component.d.ts +0 -6
- package/development/card/card/card.component.d.ts.map +1 -1
- package/development/card/card/card.component.js +5 -13
- package/development/container/sticky-bar/sticky-bar.component.d.ts +5 -0
- package/development/container/sticky-bar/sticky-bar.component.d.ts.map +1 -1
- package/development/container/sticky-bar/sticky-bar.component.js +28 -5
- package/development/form-field/form-field/form-field.component.js +2 -2
- package/development/header/header/header.component.d.ts +2 -1
- package/development/header/header/header.component.d.ts.map +1 -1
- package/development/header/header/header.component.js +8 -2
- package/development/menu/menu/menu.component.d.ts +2 -1
- package/development/menu/menu/menu.component.d.ts.map +1 -1
- package/development/menu/menu/menu.component.js +8 -2
- package/development/navigation/navigation/navigation.component.d.ts +2 -1
- package/development/navigation/navigation/navigation.component.d.ts.map +1 -1
- package/development/navigation/navigation/navigation.component.js +8 -2
- package/development/navigation/navigation-section/navigation-section.component.d.ts +2 -1
- package/development/navigation/navigation-section/navigation-section.component.d.ts.map +1 -1
- package/development/navigation/navigation-section/navigation-section.component.js +10 -5
- package/development/paginator/common/paginator-common.d.ts.map +1 -1
- package/development/paginator/common/paginator-common.js +8 -3
- package/development/paginator/paginator/paginator.component.d.ts +0 -5
- package/development/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/development/paginator/paginator/paginator.component.js +2 -14
- package/development/popover/popover/popover.component.d.ts.map +1 -1
- package/development/popover/popover/popover.component.js +9 -4
- package/development/sbb-tokens-CVLcOi-S.js +1 -1
- package/development/select/select.component.d.ts +4 -0
- package/development/select/select.component.d.ts.map +1 -1
- package/development/select/select.component.js +12 -3
- package/development/sidebar/sidebar/sidebar.component.js +1 -1
- package/development/status/status.component.js +3 -2
- package/development/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/development/tabs/tab-group/tab-group.component.js +1 -1
- package/development/tabs/tab-label/tab-label.component.js +5 -2
- package/development/title/title-base.js +1 -2
- package/form-field/form-field/form-field.component.js +1 -1
- package/header/header/header.component.d.ts +2 -1
- package/header/header/header.component.d.ts.map +1 -1
- package/header/header/header.component.js +27 -24
- package/menu/menu/menu.component.d.ts +2 -1
- package/menu/menu/menu.component.d.ts.map +1 -1
- package/menu/menu/menu.component.js +10 -7
- package/navigation/navigation/navigation.component.d.ts +2 -1
- package/navigation/navigation/navigation.component.d.ts.map +1 -1
- package/navigation/navigation/navigation.component.js +9 -6
- package/navigation/navigation-section/navigation-section.component.d.ts +2 -1
- package/navigation/navigation-section/navigation-section.component.d.ts.map +1 -1
- package/navigation/navigation-section/navigation-section.component.js +33 -31
- package/package.json +1 -1
- package/paginator/common/paginator-common.d.ts.map +1 -1
- package/paginator/common/paginator-common.js +22 -19
- package/paginator/paginator/paginator.component.d.ts +0 -5
- package/paginator/paginator/paginator.component.d.ts.map +1 -1
- package/paginator/paginator/paginator.component.js +40 -48
- package/popover/popover/popover.component.d.ts.map +1 -1
- package/popover/popover/popover.component.js +30 -28
- package/select/select.component.d.ts +4 -0
- package/select/select.component.d.ts.map +1 -1
- package/select/select.component.js +12 -2
- package/sidebar/sidebar/sidebar.component.js +1 -1
- package/standard-theme.css +7 -1
- package/status/status.component.js +17 -17
- package/tabs/tab-group/tab-group.component.d.ts.map +1 -1
- package/tabs/tab-label/tab-label.component.js +1 -1
- package/title/title-base.js +1 -1
|
@@ -2,8 +2,8 @@ var K = (a) => {
|
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
4
|
var R = (a, n, s) => n.has(a) || K("Cannot " + s);
|
|
5
|
-
var _ = (a, n, s) => (R(a, n, "read from private field"), s ? s.call(a) : n.get(a)),
|
|
6
|
-
import { __esDecorate as
|
|
5
|
+
var _ = (a, n, s) => (R(a, n, "read from private field"), s ? s.call(a) : n.get(a)), p = (a, n, s) => n.has(a) ? K("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(a) : n.set(a, s), b = (a, n, s, r) => (R(a, n, "write to private field"), r ? r.call(a, s) : n.set(a, s), s);
|
|
6
|
+
import { __esDecorate as m, __runInitializers as c } from "tslib";
|
|
7
7
|
import { css as $, LitElement as P, isServer as Z, nothing as q, html as H } from "lit";
|
|
8
8
|
import { customElement as j, property as f } from "lit/decorators.js";
|
|
9
9
|
import { SbbFocusTrapController as F, sbbInputModalityDetector as Q, IS_FOCUSABLE_QUERY as W } from "../../core/a11y.js";
|
|
@@ -17,20 +17,20 @@ import "../../button/transparent-button.js";
|
|
|
17
17
|
import "../../divider.js";
|
|
18
18
|
const lt = $`*,:before,:after{box-sizing:border-box}:host{--sbb-navigation-section-display: none;--sbb-navigation-section-column: 1 / 5;--sbb-navigation-section-position: fixed;--sbb-navigation-section-pointer-events: none;--sbb-navigation-section-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-3x) );--sbb-navigation-section-animation-easing: ease-out;--sbb-navigation-section-padding-inline: var(--sbb-layout-base-offset-responsive);--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-l);--sbb-navigation-section-translate: 100%;--sbb-navigation-section-content-padding-inline-start: var(--sbb-spacing-fixed-12x);--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);--sbb-navigation-section-width: 100dvw;--sbb-navigation-section-height: 100dvh;display:var(--sbb-navigation-section-display);position:var(--sbb-navigation-section-position);grid-column:var(--sbb-navigation-section-column);inset-inline-start:0;inset-block-start:0;width:var(--sbb-navigation-section-width);height:var(--sbb-navigation-section-height);z-index:var(--sbb-navigation-z-index, var(--sbb-overlay-default-z-index))}@media (min-width: 64rem){:host{--sbb-navigation-section-column: 5 / 9;--sbb-navigation-section-animation-duration: var( --sbb-disable-animation-duration, var(--sbb-animation-duration-4x) );--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-xl);--sbb-navigation-section-padding-inline: var(--sbb-spacing-fixed-8x) var(--sbb-layout-base-offset-responsive);--sbb-navigation-section-position: relative;--sbb-navigation-section-translate: 0;--sbb-navigation-section-content-padding-inline-start: 0;--sbb-navigation-section-width: calc( 100% + var(--sbb-layout-base-offset-responsive) + var(--sbb-grid-base-gutter-responsive) );translate:calc(var(--sbb-grid-base-gutter-responsive) * -1) 0}}@media (min-width: 80rem){:host{--sbb-navigation-section-column: 5 / 13}}@media (min-width: 90rem){:host{--sbb-navigation-section-column: 6 / 17;--sbb-navigation-section-padding-block: var(--sbb-spacing-responsive-xxl) var(--sbb-spacing-responsive-l)}}:host([data-state=opened]){--sbb-navigation-section-pointer-events: all}:host([data-state=opening]){--sbb-navigation-section-position: absolute}:host(:is([data-state=opening],[data-state=closing])){--sbb-navigation-section-pointer-events: none}:host([data-state]:not([data-state=closed])){--sbb-navigation-section-display: block}::slotted(*){padding-inline-start:var(--sbb-navigation-section-content-padding-inline-start)}::slotted([data-sbb-button]){grid-column-start:1}.sbb-navigation-section__container{pointer-events:var(--sbb-navigation-section-pointer-events);height:var(--sbb-navigation-section-height)}.sbb-navigation-section{display:none;border:none;margin:0;width:100%;height:100%;color:var(--sbb-color-white);background-color:transparent;padding:0;overflow:hidden}:host([data-state]:not([data-state=closed])) .sbb-navigation-section{display:block;animation-name:open;animation-duration:var(--sbb-navigation-section-animation-duration);animation-timing-function:var(--sbb-navigation-section-animation-easing)}:host([data-state][data-state=closing]) .sbb-navigation-section{animation-name:close}@media (forced-colors: active){.sbb-navigation-section{outline:var(--sbb-border-width-1x) solid CanvasText}}.sbb-navigation-section__wrapper{--sbb-scrollbar-thumb-width: .125rem;--sbb-scrollbar-thumb-width-hover: .25rem;--sbb-scrollbar-width-firefox: thin;--sbb-scrollbar-color: var(--sbb-color-white-alpha-30);--sbb-scrollbar-color-hover: var(--sbb-color-white-alpha-60);--sbb-scrollbar-track-color: transparent;--sbb-scrollbar-width: var(--sbb-spacing-fixed-3x)}.sbb-navigation-section__wrapper::-webkit-scrollbar{width:var(--sbb-scrollbar-width);height:var(--sbb-scrollbar-width);background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation-section__wrapper::-webkit-scrollbar-corner{background-color:var(--sbb-scrollbar-track-color, transparent)}.sbb-navigation-section__wrapper::-webkit-scrollbar-thumb{background-color:var(--sbb-scrollbar-color, currentcolor);border:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width))) solid transparent;border-radius:var(--sbb-border-radius-4x);background-clip:padding-box}.sbb-navigation-section__wrapper::-webkit-scrollbar-thumb:hover{background-color:var(--sbb-scrollbar-color-hover, currentcolor);border-width:calc(.5 * (var(--sbb-scrollbar-width) - var(--sbb-scrollbar-thumb-width-hover)))}.sbb-navigation-section__wrapper::-webkit-scrollbar-button,.sbb-navigation-section__wrapper::-webkit-scrollbar-corner{display:none}@supports not selector(::-webkit-scrollbar){.sbb-navigation-section__wrapper{scrollbar-width:var(--sbb-scrollbar-width-firefox);scrollbar-color:var(--sbb-scrollbar-color, currentcolor) var(--sbb-scrollbar-track-color, transparent)}}.sbb-navigation-section__wrapper{height:100%;padding-block:var(--sbb-navigation-section-padding-block);outline:none;overflow-y:auto}:host(:is([data-state=opening],[data-state=closing])) .sbb-navigation-section__wrapper{--sbb-scrollbar-color: transparent;scrollbar-color:transparent transparent}.sbb-navigation-section__header{position:relative;display:flex;align-items:center;gap:var(--sbb-spacing-fixed-1x);margin-block-start:var(--sbb-spacing-responsive-xxl);padding-inline-start:var(--sbb-navigation-section-content-padding-inline-start)}@media (min-width: 64rem){.sbb-navigation-section__header{margin-block-start:0;padding-inline-start:0}}@media (min-width: 80rem){.sbb-navigation-section__header{grid-column:1/4}}.sbb-navigation-section__back{position:absolute;translate:calc((100% + var(--sbb-spacing-fixed-1x)) * -1) 0}@media (min-width: 64rem){.sbb-navigation-section__back{display:none}}.sbb-navigation-section__title{--sbb-title-line-height: var(--sbb-typo-line-height-titles);--sbb-title-margin-block-start: 0;--sbb-title-margin-block-end: 0;margin:0;margin-block:var(--sbb-title-margin-block-start) var(--sbb-title-margin-block-end);font-family:var(--sbb-typo-font-family);font-weight:700;line-height:var(--sbb-title-line-height);letter-spacing:var(--sbb-typo-letter-spacing-titles);font-size:var(--sbb-title-font-size);--sbb-title-font-size: var(--sbb-font-size-title-4)}@media (min-width: 64rem){.sbb-navigation-section__title{--sbb-title-line-height: var(--sbb-typo-line-height-titles);--sbb-title-margin-block-start: 0;--sbb-title-margin-block-end: 0;margin:0;margin-block:var(--sbb-title-margin-block-start) var(--sbb-title-margin-block-end);font-family:var(--sbb-typo-font-family);font-weight:700;line-height:var(--sbb-title-line-height);letter-spacing:var(--sbb-typo-letter-spacing-titles);font-size:var(--sbb-title-font-size);--sbb-title-font-size: var(--sbb-font-size-title-2)}}.sbb-navigation-section__content{display:grid;grid-template-columns:1fr;grid-gap:var(--sbb-spacing-responsive-l) var(--sbb-grid-base-gutter-responsive);padding-inline:var(--sbb-navigation-section-padding-inline)}@media (min-width: 64rem){.sbb-navigation-section__content{opacity:0;translate:0 var(--sbb-spacing-fixed-3x);transition-duration:var(--sbb-navigation-section-animation-duration);transition-delay:var(--sbb-navigation-section-animation-duration);transition-timing-function:var(--sbb-navigation-section-animation-easing);transition-property:opacity,translate}:host([data-state=opened]) .sbb-navigation-section__content{opacity:1;translate:0 0}}@media (min-width: 80rem){.sbb-navigation-section__content{grid-template-columns:repeat(3,1fr)}}:host([data-state=closing]) .sbb-navigation-section__content{transition-delay:0s}@keyframes open{0%{translate:var(--sbb-navigation-section-translate) 0}to{translate:0 0}}@keyframes close{0%{translate:0 0}to{translate:var(--sbb-navigation-section-translate) 0}}`;
|
|
19
19
|
let bt = 0, Ct = (() => {
|
|
20
|
-
var
|
|
20
|
+
var g, d, h, v, o;
|
|
21
21
|
let a = [j("sbb-navigation-section"), X({
|
|
22
22
|
slot: "navigation-section"
|
|
23
|
-
})], n, s = [], r, E = st(P), C, x = [], L = [], A, S = [], z = [], B, N = [],
|
|
23
|
+
})], n, s = [], r, E = st(P), C, x = [], L = [], A, S = [], z = [], B, N = [], T = [], I, U = [], M = [];
|
|
24
24
|
return o = class extends E {
|
|
25
25
|
constructor() {
|
|
26
26
|
var t, i;
|
|
27
27
|
super();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
e.composedPath().filter((
|
|
28
|
+
p(this, g);
|
|
29
|
+
p(this, d);
|
|
30
|
+
p(this, h);
|
|
31
|
+
p(this, v);
|
|
32
|
+
b(this, g, c(this, x, "")), b(this, d, (c(this, L), c(this, S, null))), b(this, h, (c(this, z), c(this, N, ""))), b(this, v, (c(this, T), c(this, U, ""))), this._firstLevelNavigation = (c(this, M), null), this._triggerElement = null, this._triggerIdReferenceController = new G(this, "trigger"), this._language = new Y(this), this._focusTrapController = new F(this), this._lastKeydownEvent = null, this._handleNavigationSectionClose = (e) => {
|
|
33
|
+
e.composedPath().filter((l) => l instanceof HTMLElement).some((l) => this._isCloseElement(l)) && this.close();
|
|
34
34
|
}, this.addController(new J(this, {
|
|
35
35
|
[V]: (e) => {
|
|
36
36
|
this._state !== "closed" && this._setNavigationInert(e);
|
|
@@ -38,8 +38,8 @@ let bt = 0, Ct = (() => {
|
|
|
38
38
|
})), (t = this.addEventListener) == null || t.call(this, "keydown", (e) => {
|
|
39
39
|
this._lastKeydownEvent = e;
|
|
40
40
|
}), (i = this.addEventListener) == null || i.call(this, "focusout", (e) => {
|
|
41
|
-
var
|
|
42
|
-
if (e.relatedTarget instanceof HTMLElement && !this.contains(e.relatedTarget) && Q.mostRecentModality === "keyboard" && ((
|
|
41
|
+
var l, O, D;
|
|
42
|
+
if (e.relatedTarget instanceof HTMLElement && !this.contains(e.relatedTarget) && Q.mostRecentModality === "keyboard" && ((l = this._lastKeydownEvent) == null ? void 0 : l.key) === "Tab" && this._triggerElement) {
|
|
43
43
|
const u = this.closest("sbb-navigation"), y = Array.from((u == null ? void 0 : u.querySelectorAll(W)) ?? []).filter((w) => !this.contains(w));
|
|
44
44
|
if (this._lastKeydownEvent.shiftKey || !y.length)
|
|
45
45
|
(O = this._triggerElement) == null || O.focus();
|
|
@@ -54,38 +54,38 @@ let bt = 0, Ct = (() => {
|
|
|
54
54
|
* The label to be shown before the action list.
|
|
55
55
|
*/
|
|
56
56
|
get titleContent() {
|
|
57
|
-
return _(this,
|
|
57
|
+
return _(this, g);
|
|
58
58
|
}
|
|
59
59
|
set titleContent(t) {
|
|
60
|
-
|
|
60
|
+
b(this, g, t);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* The element that will trigger the navigation section.
|
|
64
64
|
* Accepts both a string (id of an element) or an SbbNavigationButtonElement.
|
|
65
65
|
*/
|
|
66
66
|
get trigger() {
|
|
67
|
-
return _(this,
|
|
67
|
+
return _(this, d);
|
|
68
68
|
}
|
|
69
69
|
set trigger(t) {
|
|
70
|
-
|
|
70
|
+
b(this, d, t);
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* This will be forwarded as aria-label to the nav element and is read as a title of the navigation-section.
|
|
74
74
|
*/
|
|
75
75
|
get accessibilityLabel() {
|
|
76
|
-
return _(this,
|
|
76
|
+
return _(this, h);
|
|
77
77
|
}
|
|
78
78
|
set accessibilityLabel(t) {
|
|
79
|
-
|
|
79
|
+
b(this, h, t);
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
82
|
* This will be forwarded as aria-label to the back button element.
|
|
83
83
|
*/
|
|
84
84
|
get accessibilityBackLabel() {
|
|
85
|
-
return _(this,
|
|
85
|
+
return _(this, v);
|
|
86
86
|
}
|
|
87
87
|
set accessibilityBackLabel(t) {
|
|
88
|
-
|
|
88
|
+
b(this, v, t);
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* The state of the navigation section.
|
|
@@ -126,11 +126,11 @@ let bt = 0, Ct = (() => {
|
|
|
126
126
|
}
|
|
127
127
|
// Check if the trigger is valid and attach click event listeners.
|
|
128
128
|
_configureTrigger() {
|
|
129
|
-
var i;
|
|
129
|
+
var i, e, l;
|
|
130
130
|
const t = this.trigger instanceof HTMLElement ? this.trigger : this._triggerIdReferenceController.find();
|
|
131
131
|
t !== this._triggerElement && ((i = this._triggerAbortController) == null || i.abort(), ot(this._triggerElement), this._triggerElement = t, this._triggerElement && (rt(this._triggerElement, "menu", this.id, this._state), this._triggerAbortController = new AbortController(), this._isNavigationButton(this._triggerElement) && (this._triggerElement.connectedSection = this), this._triggerElement.addEventListener("click", () => this.open(), {
|
|
132
132
|
signal: this._triggerAbortController.signal
|
|
133
|
-
})));
|
|
133
|
+
}), this._firstLevelNavigation = (l = (e = this._triggerElement) == null ? void 0 : e.closest) == null ? void 0 : l.call(e, "sbb-navigation")));
|
|
134
134
|
}
|
|
135
135
|
_isNavigationButton(t) {
|
|
136
136
|
return (t == null ? void 0 : t.localName) === "sbb-navigation-button";
|
|
@@ -170,8 +170,7 @@ let bt = 0, Ct = (() => {
|
|
|
170
170
|
(t = this.querySelector(":is(sbb-navigation-button, sbb-navigation-link).sbb-active")) == null || t.toggleAttribute("data-action-active", !0);
|
|
171
171
|
}
|
|
172
172
|
connectedCallback() {
|
|
173
|
-
|
|
174
|
-
super.connectedCallback(), this.id || (this.id = `sbb-navigation-section-${bt++}`), this._state || (this._state = "closed"), this._configureTrigger(), this._firstLevelNavigation = (i = (t = this._triggerElement) == null ? void 0 : t.closest) == null ? void 0 : i.call(t, "sbb-navigation");
|
|
173
|
+
super.connectedCallback(), this.id || (this.id = `sbb-navigation-section-${bt++}`), this._state || (this._state = "closed"), this.hasUpdated && this._configureTrigger();
|
|
175
174
|
}
|
|
176
175
|
disconnectedCallback() {
|
|
177
176
|
var t, i;
|
|
@@ -180,6 +179,9 @@ let bt = 0, Ct = (() => {
|
|
|
180
179
|
requestUpdate(t, i, e) {
|
|
181
180
|
super.requestUpdate(t, i, e), !Z && (!t || t === "trigger") && this.hasUpdated && this._configureTrigger();
|
|
182
181
|
}
|
|
182
|
+
firstUpdated(t) {
|
|
183
|
+
super.firstUpdated(t), this._configureTrigger();
|
|
184
|
+
}
|
|
183
185
|
render() {
|
|
184
186
|
return H`
|
|
185
187
|
<div class="sbb-navigation-section__container">
|
|
@@ -215,18 +217,18 @@ let bt = 0, Ct = (() => {
|
|
|
215
217
|
</div>
|
|
216
218
|
`;
|
|
217
219
|
}
|
|
218
|
-
},
|
|
220
|
+
}, g = new WeakMap(), d = new WeakMap(), h = new WeakMap(), v = new WeakMap(), r = o, (() => {
|
|
219
221
|
const t = typeof Symbol == "function" && Symbol.metadata ? Object.create(E[Symbol.metadata] ?? null) : void 0;
|
|
220
|
-
C = [k(), f({ attribute: "title-content", reflect: !0, converter: tt })], A = [f()], B = [k(), f({ attribute: "accessibility-label" })],
|
|
222
|
+
C = [k(), f({ attribute: "title-content", reflect: !0, converter: tt })], A = [f()], B = [k(), f({ attribute: "accessibility-label" })], I = [k(), f({ attribute: "accessibility-back-label" })], m(o, null, C, { kind: "accessor", name: "titleContent", static: !1, private: !1, access: { has: (i) => "titleContent" in i, get: (i) => i.titleContent, set: (i, e) => {
|
|
221
223
|
i.titleContent = e;
|
|
222
|
-
} }, metadata: t }, x, L),
|
|
224
|
+
} }, metadata: t }, x, L), m(o, null, A, { kind: "accessor", name: "trigger", static: !1, private: !1, access: { has: (i) => "trigger" in i, get: (i) => i.trigger, set: (i, e) => {
|
|
223
225
|
i.trigger = e;
|
|
224
|
-
} }, metadata: t }, S, z),
|
|
226
|
+
} }, metadata: t }, S, z), m(o, null, B, { kind: "accessor", name: "accessibilityLabel", static: !1, private: !1, access: { has: (i) => "accessibilityLabel" in i, get: (i) => i.accessibilityLabel, set: (i, e) => {
|
|
225
227
|
i.accessibilityLabel = e;
|
|
226
|
-
} }, metadata: t }, N,
|
|
228
|
+
} }, metadata: t }, N, T), m(o, null, I, { kind: "accessor", name: "accessibilityBackLabel", static: !1, private: !1, access: { has: (i) => "accessibilityBackLabel" in i, get: (i) => i.accessibilityBackLabel, set: (i, e) => {
|
|
227
229
|
i.accessibilityBackLabel = e;
|
|
228
|
-
} }, metadata: t }, U, M),
|
|
229
|
-
})(), o.styles = lt,
|
|
230
|
+
} }, metadata: t }, U, M), m(null, n = { value: r }, a, { kind: "class", name: r.name, metadata: t }, null, s), r = n.value, t && Object.defineProperty(r, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: t });
|
|
231
|
+
})(), o.styles = lt, c(r, s), r;
|
|
230
232
|
})();
|
|
231
233
|
export {
|
|
232
234
|
Ct as SbbNavigationSectionElement
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paginator-common.d.ts","sourceRoot":"","sources":["../../../../src/elements/paginator/common/paginator-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAuB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAKlE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,KAAK,mBAA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AAmB,CAAC,kCAAkC,CAAC,GAAG,CAuM5D,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,mBAAmB;QAC3B,IAAI,EAAE,WAAW,CAAC,4BAA4B,CAAC,CAAC;KACjD;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var k = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var k = (i) => {
|
|
2
|
+
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var C = (
|
|
5
|
-
var
|
|
4
|
+
var C = (i, a, s) => a.has(i) || k("Cannot " + s);
|
|
5
|
+
var _ = (i, a, s) => (C(i, a, "read from private field"), s ? s.call(i) : a.get(i)), x = (i, a, s) => a.has(i) ? k("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(i) : a.set(i, s), d = (i, a, s, u) => (C(i, a, "write to private field"), u ? u.call(i, s) : a.set(i, s), s);
|
|
6
6
|
import { __runInitializers as h, __esDecorate as p } from "tslib";
|
|
7
7
|
import { html as O } from "lit";
|
|
8
|
-
import { property as
|
|
8
|
+
import { property as m } from "lit/decorators.js";
|
|
9
9
|
import { SbbLanguageController as w } from "../../core/controllers.js";
|
|
10
10
|
import { hostAttributes as D } from "../../core/decorators.js";
|
|
11
11
|
import { isLean as L } from "../../core/dom.js";
|
|
@@ -15,17 +15,17 @@ import { SbbNegativeMixin as B, SbbDisabledMixin as T } from "../../core/mixins.
|
|
|
15
15
|
import "../../button/mini-button.js";
|
|
16
16
|
import "../../button/mini-button-group.js";
|
|
17
17
|
import "../../divider.js";
|
|
18
|
-
const
|
|
18
|
+
const ie = (i) => (() => {
|
|
19
19
|
var o, l, n;
|
|
20
20
|
let s = [D({
|
|
21
21
|
role: "group"
|
|
22
|
-
})],
|
|
22
|
+
})], u, P = [], g, z = B(T(i)), c = [], S, I, f, v, y = [], N = [], E, M = [], $ = [];
|
|
23
23
|
var b = (n = class extends z {
|
|
24
24
|
constructor() {
|
|
25
25
|
super(...arguments);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this._length = (h(this, c), 0), this._pageSize = 10, this._pageIndex = 0, d(this, o, h(this, y, "start")), d(this, l, (h(this, N), h(this, M, L() ? "s" : "m"))), this._page = (h(this, $), new R(this, b.events.page, { composed: !0, bubbles: !0 })), this.language = new w(this);
|
|
26
|
+
x(this, o);
|
|
27
|
+
x(this, l);
|
|
28
|
+
this._length = (h(this, c), 0), this._pageSize = 10, this._pageIndex = 0, d(this, o, h(this, y, "start")), d(this, l, (h(this, N), h(this, M, L() ? "s" : "m"))), this._page = (h(this, $), new R(this, b.events.page, { composed: !0, bubbles: !0 })), this.language = new w(this), this._previousPageSize = this._pageSize;
|
|
29
29
|
}
|
|
30
30
|
/** Total number of items. */
|
|
31
31
|
set length(e) {
|
|
@@ -36,8 +36,7 @@ const ae = (a) => (() => {
|
|
|
36
36
|
}
|
|
37
37
|
/** Number of items per page. */
|
|
38
38
|
set pageSize(e) {
|
|
39
|
-
|
|
40
|
-
this._pageSize = Math.max(e, 0), this.pageIndex = Math.floor(this.pageIndex * t / this.pageSize) || 0;
|
|
39
|
+
this._previousPageSize = this.pageSize, this._pageSize = Math.max(e, 0), this.pageIndex = Math.floor(this.pageIndex * this._previousPageSize / this.pageSize) || 0;
|
|
41
40
|
}
|
|
42
41
|
get pageSize() {
|
|
43
42
|
return this._pageSize;
|
|
@@ -52,7 +51,7 @@ const ae = (a) => (() => {
|
|
|
52
51
|
}
|
|
53
52
|
/** Position of the prev/next buttons. */
|
|
54
53
|
get pagerPosition() {
|
|
55
|
-
return
|
|
54
|
+
return _(this, o);
|
|
56
55
|
}
|
|
57
56
|
set pagerPosition(e) {
|
|
58
57
|
d(this, o, e);
|
|
@@ -62,7 +61,7 @@ const ae = (a) => (() => {
|
|
|
62
61
|
* @default 'm' / 's' (lean)
|
|
63
62
|
*/
|
|
64
63
|
get size() {
|
|
65
|
-
return
|
|
64
|
+
return _(this, l);
|
|
66
65
|
}
|
|
67
66
|
set size(e) {
|
|
68
67
|
d(this, l, e);
|
|
@@ -122,6 +121,10 @@ const ae = (a) => (() => {
|
|
|
122
121
|
this.pageIndex = e;
|
|
123
122
|
}
|
|
124
123
|
emitPageEvent(e) {
|
|
124
|
+
if (!this.hasUpdated || this.pageIndex === e && this._previousPageSize === this.pageSize) {
|
|
125
|
+
this._previousPageSize = this.pageSize;
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
125
128
|
this._page.emit({
|
|
126
129
|
previousPageIndex: e,
|
|
127
130
|
pageIndex: this.pageIndex,
|
|
@@ -158,22 +161,22 @@ const ae = (a) => (() => {
|
|
|
158
161
|
}
|
|
159
162
|
}, o = new WeakMap(), l = new WeakMap(), g = n, (() => {
|
|
160
163
|
const e = typeof Symbol == "function" && Symbol.metadata ? Object.create(z[Symbol.metadata] ?? null) : void 0;
|
|
161
|
-
|
|
164
|
+
S = [m({ type: Number })], I = [m({ attribute: "page-size", type: Number })], f = [m({ attribute: "page-index", type: Number })], v = [m({ attribute: "pager-position", reflect: !0 })], E = [m({ reflect: !0 })], p(n, null, S, { kind: "setter", name: "length", static: !1, private: !1, access: { has: (t) => "length" in t, set: (t, r) => {
|
|
162
165
|
t.length = r;
|
|
163
|
-
} }, metadata: e }, null, c), p(n, null,
|
|
166
|
+
} }, metadata: e }, null, c), p(n, null, I, { kind: "setter", name: "pageSize", static: !1, private: !1, access: { has: (t) => "pageSize" in t, set: (t, r) => {
|
|
164
167
|
t.pageSize = r;
|
|
165
|
-
} }, metadata: e }, null, c), p(n, null,
|
|
168
|
+
} }, metadata: e }, null, c), p(n, null, f, { kind: "setter", name: "pageIndex", static: !1, private: !1, access: { has: (t) => "pageIndex" in t, set: (t, r) => {
|
|
166
169
|
t.pageIndex = r;
|
|
167
170
|
} }, metadata: e }, null, c), p(n, null, v, { kind: "accessor", name: "pagerPosition", static: !1, private: !1, access: { has: (t) => "pagerPosition" in t, get: (t) => t.pagerPosition, set: (t, r) => {
|
|
168
171
|
t.pagerPosition = r;
|
|
169
172
|
} }, metadata: e }, y, N), p(n, null, E, { kind: "accessor", name: "size", static: !1, private: !1, access: { has: (t) => "size" in t, get: (t) => t.size, set: (t, r) => {
|
|
170
173
|
t.size = r;
|
|
171
|
-
} }, metadata: e }, M, $), p(null,
|
|
174
|
+
} }, metadata: e }, M, $), p(null, u = { value: g }, s, { kind: "class", name: g.name, metadata: e }, null, P), b = g = u.value, e && Object.defineProperty(g, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: e });
|
|
172
175
|
})(), n.events = {
|
|
173
176
|
page: "page"
|
|
174
177
|
}, h(g, P), n);
|
|
175
178
|
return b = g;
|
|
176
179
|
})();
|
|
177
180
|
export {
|
|
178
|
-
|
|
181
|
+
ie as SbbPaginatorCommonElementMixin
|
|
179
182
|
};
|
|
@@ -17,11 +17,6 @@ export declare class SbbPaginatorElement extends SbbPaginatorElement_base {
|
|
|
17
17
|
accessor pagerPosition: 'start' | 'end';
|
|
18
18
|
private _markForFocus;
|
|
19
19
|
protected updated(changedProperties: PropertyValues<this>): void;
|
|
20
|
-
/**
|
|
21
|
-
* If the `pageSize` changes due to user interaction with the `pageSizeOptions` select,
|
|
22
|
-
* emit the `page` event and then update the `pageSize` value.
|
|
23
|
-
*/
|
|
24
|
-
private _pageSizeChanged;
|
|
25
20
|
/** Returns the displayed page elements. */
|
|
26
21
|
private _getVisiblePages;
|
|
27
22
|
/**
|
|
@@ -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;AAWb,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,6BAA6B,CAAC;;AAIrC;;;;GAIG;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,OAAO,CAAC,aAAa,CAAuB;cAEzB,OAAO,CAAC,iBAAiB,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI;
|
|
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;AAWb,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,iBAAiB,CAAC;AACzB,OAAO,6BAA6B,CAAC;;AAIrC;;;;GAIG;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,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;IA8BlC,OAAO,CAAC,kBAAkB;cAiCP,eAAe,IAAI,cAAc;CAiBrD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAE7B,eAAe,EAAE,mBAAmB,CAAC;KACtC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var k = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var u = (t, r, i) => (
|
|
4
|
+
var P = (t, r, i) => r.has(t) || k("Cannot " + i);
|
|
5
|
+
var u = (t, r, i) => (P(t, r, "read from private field"), i ? i.call(t) : r.get(t)), m = (t, r, i) => r.has(t) ? k("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, i), c = (t, r, i, o) => (P(t, r, "write to private field"), o ? o.call(t, i) : r.set(t, i), i);
|
|
6
6
|
import { __runInitializers as d, __esDecorate as h } from "tslib";
|
|
7
7
|
import { css as E, LitElement as j, nothing as S, html as b } from "lit";
|
|
8
8
|
import { customElement as A, property as $ } from "lit/decorators.js";
|
|
@@ -29,8 +29,8 @@ let Q = (() => {
|
|
|
29
29
|
get pageSizeOptions() {
|
|
30
30
|
return u(this, p);
|
|
31
31
|
}
|
|
32
|
-
set pageSizeOptions(
|
|
33
|
-
c(this, p,
|
|
32
|
+
set pageSizeOptions(a) {
|
|
33
|
+
c(this, p, a);
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Position of the prev/next buttons: if `pageSizeOptions` is set,
|
|
@@ -39,23 +39,15 @@ let Q = (() => {
|
|
|
39
39
|
get pagerPosition() {
|
|
40
40
|
return u(this, g);
|
|
41
41
|
}
|
|
42
|
-
set pagerPosition(
|
|
43
|
-
c(this, g,
|
|
42
|
+
set pagerPosition(a) {
|
|
43
|
+
c(this, g, a);
|
|
44
44
|
}
|
|
45
|
-
updated(
|
|
46
|
-
if (super.updated(
|
|
47
|
-
const
|
|
48
|
-
|
|
45
|
+
updated(a) {
|
|
46
|
+
if (super.updated(a), this._markForFocus && F.mostRecentModality === "keyboard") {
|
|
47
|
+
const e = this._getVisiblePages().find((n) => this.pageIndex === +n.getAttribute("data-index"));
|
|
48
|
+
e && e.focus(), this._markForFocus = null;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
/**
|
|
52
|
-
* If the `pageSize` changes due to user interaction with the `pageSizeOptions` select,
|
|
53
|
-
* emit the `page` event and then update the `pageSize` value.
|
|
54
|
-
*/
|
|
55
|
-
_pageSizeChanged(e) {
|
|
56
|
-
const a = this.pageSize, n = this.pageIndex;
|
|
57
|
-
this.pageSize = e, a !== this.pageSize && this.emitPageEvent(n);
|
|
58
|
-
}
|
|
59
51
|
/** Returns the displayed page elements. */
|
|
60
52
|
_getVisiblePages() {
|
|
61
53
|
return Array.from(this.shadowRoot.querySelectorAll(".sbb-paginator__page--number-item"));
|
|
@@ -67,32 +59,32 @@ let Q = (() => {
|
|
|
67
59
|
* - if there are more than `MAX_PAGE_NUMBERS_DISPLAYED` other pages, ellipsis button must be used.
|
|
68
60
|
*/
|
|
69
61
|
_getVisiblePagesIndex() {
|
|
70
|
-
const
|
|
71
|
-
return
|
|
62
|
+
const a = this.numberOfPages(), e = this.pageIndex;
|
|
63
|
+
return a <= l + 2 ? this._range(a) : e < l ? [...this._range(l + 1), "ellipsis", a - 1] : e >= a - l ? [
|
|
72
64
|
0,
|
|
73
65
|
"ellipsis",
|
|
74
|
-
...this._range(l + 1,
|
|
66
|
+
...this._range(l + 1, a - 1 - l)
|
|
75
67
|
] : [
|
|
76
68
|
0,
|
|
77
69
|
"ellipsis",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
e - 1,
|
|
71
|
+
e,
|
|
72
|
+
e + 1,
|
|
81
73
|
"ellipsis",
|
|
82
|
-
|
|
74
|
+
a - 1
|
|
83
75
|
];
|
|
84
76
|
}
|
|
85
77
|
/** Creates an array of consecutive numbers given the length and the starting value. */
|
|
86
|
-
_range(
|
|
87
|
-
return Array.from({ length:
|
|
78
|
+
_range(a, e = 0) {
|
|
79
|
+
return Array.from({ length: a }, (n, O) => O + e);
|
|
88
80
|
}
|
|
89
|
-
_handleKeyUp(
|
|
90
|
-
if (
|
|
81
|
+
_handleKeyUp(a) {
|
|
82
|
+
if (a.key !== " " && a.key !== "Enter")
|
|
91
83
|
return;
|
|
92
|
-
this._getVisiblePages().find((n) => n ===
|
|
84
|
+
this._getVisiblePages().find((n) => n === a.target) && (this._markForFocus = this.pageIndex);
|
|
93
85
|
}
|
|
94
86
|
_renderItemPerPageTemplate() {
|
|
95
|
-
var
|
|
87
|
+
var a;
|
|
96
88
|
return this.pageSizeOptions && this.pageSizeOptions.length > 0 ? b`
|
|
97
89
|
<div class="sbb-paginator__page-size-options">
|
|
98
90
|
<label for="select">${D[this.language.current]}</label>
|
|
@@ -105,10 +97,10 @@ let Q = (() => {
|
|
|
105
97
|
<sbb-select
|
|
106
98
|
id="select"
|
|
107
99
|
?disabled=${this.disabled}
|
|
108
|
-
value=${((
|
|
109
|
-
@change=${(
|
|
100
|
+
value=${((a = this.pageSizeOptions) == null ? void 0 : a.find((e) => e === this.pageSize)) ?? this.pageSizeOptions[0]}
|
|
101
|
+
@change=${(e) => this.pageSize = +e.target.value}
|
|
110
102
|
>
|
|
111
|
-
${I(this.pageSizeOptions, (
|
|
103
|
+
${I(this.pageSizeOptions, (e) => b`<sbb-option value=${e}>${e}</sbb-option>`)}
|
|
112
104
|
</sbb-select>
|
|
113
105
|
</sbb-form-field>
|
|
114
106
|
</div>
|
|
@@ -117,23 +109,23 @@ let Q = (() => {
|
|
|
117
109
|
_renderPageNumbers() {
|
|
118
110
|
return b`
|
|
119
111
|
<ul class="sbb-paginator__pages">
|
|
120
|
-
${I(this._getVisiblePagesIndex(), (
|
|
112
|
+
${I(this._getVisiblePagesIndex(), (a) => a === "ellipsis" ? b`
|
|
121
113
|
<li class="sbb-paginator__page--ellipsis">
|
|
122
114
|
<span class="sbb-paginator__page--ellipsis-item">…</span>
|
|
123
115
|
</li>
|
|
124
116
|
` : b`
|
|
125
117
|
<li class="sbb-paginator__page--number">
|
|
126
118
|
<button
|
|
127
|
-
?data-selected=${this.pageIndex ===
|
|
119
|
+
?data-selected=${this.pageIndex === a}
|
|
128
120
|
?disabled=${this.disabled}
|
|
129
121
|
class="sbb-paginator__page--number-item"
|
|
130
|
-
data-index=${
|
|
131
|
-
aria-label="${N[this.language.current]} ${
|
|
132
|
-
aria-current=${this.pageIndex ===
|
|
133
|
-
@click=${() => this.pageIndex =
|
|
122
|
+
data-index=${a}
|
|
123
|
+
aria-label="${N[this.language.current]} ${a + 1}"
|
|
124
|
+
aria-current=${this.pageIndex === a ? "true" : S}
|
|
125
|
+
@click=${() => this.pageIndex = a}
|
|
134
126
|
@keyup=${this._handleKeyUp}
|
|
135
127
|
>
|
|
136
|
-
<span class="sbb-paginator__page--number-item-label">${
|
|
128
|
+
<span class="sbb-paginator__page--number-item-label">${a + 1}</span>
|
|
137
129
|
</button>
|
|
138
130
|
</li>
|
|
139
131
|
`)}
|
|
@@ -154,12 +146,12 @@ let Q = (() => {
|
|
|
154
146
|
`;
|
|
155
147
|
}
|
|
156
148
|
}, p = new WeakMap(), g = new WeakMap(), o = s, (() => {
|
|
157
|
-
const
|
|
158
|
-
f = [$({ attribute: "page-size-options", type: Array })], x = [$({ attribute: "pager-position", reflect: !0 })], h(s, null, f, { kind: "accessor", name: "pageSizeOptions", static: !1, private: !1, access: { has: (
|
|
159
|
-
|
|
160
|
-
} }, metadata:
|
|
161
|
-
|
|
162
|
-
} }, metadata:
|
|
149
|
+
const a = typeof Symbol == "function" && Symbol.metadata ? Object.create(v[Symbol.metadata] ?? null) : void 0;
|
|
150
|
+
f = [$({ attribute: "page-size-options", type: Array })], x = [$({ attribute: "pager-position", reflect: !0 })], h(s, null, f, { kind: "accessor", name: "pageSizeOptions", static: !1, private: !1, access: { has: (e) => "pageSizeOptions" in e, get: (e) => e.pageSizeOptions, set: (e, n) => {
|
|
151
|
+
e.pageSizeOptions = n;
|
|
152
|
+
} }, metadata: a }, _, y), h(s, null, x, { kind: "accessor", name: "pagerPosition", static: !1, private: !1, access: { has: (e) => "pagerPosition" in e, get: (e) => e.pagerPosition, set: (e, n) => {
|
|
153
|
+
e.pagerPosition = n;
|
|
154
|
+
} }, metadata: a }, z, w), h(null, r = { value: o }, t, { kind: "class", name: o.name, metadata: a }, null, i), o = r.value, a && Object.defineProperty(o, Symbol.metadata, { enumerable: !0, configurable: !0, writable: !0, value: a });
|
|
163
155
|
})(), s.styles = M, s.events = {
|
|
164
156
|
page: "page"
|
|
165
157
|
}, d(o, i), o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/popover/popover/popover.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"popover.component.d.ts","sourceRoot":"","sources":["../../../../src/elements/popover/popover/popover.component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAU/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAStE,OAAO,EAA4B,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAahF,OAAO,kCAAkC,CAAC;;AAU1C;;;;;;;;;;;;GAYG;AACH,qBAGM,iBAAkB,SAAQ,sBAA0C;IACxE,OAAuB,MAAM,EAAE,cAAc,CAAS;IAEtD;;;OAGG;IACH,SAA4B,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAAQ;IAExE,iDAAiD;IACjD,SAEgB,eAAe,EAAE,OAAO,CAAS;IAEjD,wDAAwD;IACxD,SAEgB,YAAY,EAAE,OAAO,CAAS;IAE9C,8CAA8C;IAC9C,SAEgB,SAAS,EAAE,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