@synergy-design-system/mcp 2.14.0 → 2.15.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/CHANGELOG.md +23 -0
- package/metadata/checksum.txt +1 -1
- package/metadata/packages/assets/CHANGELOG.md +10 -0
- package/metadata/packages/components/components/syn-dialog/component.styles.ts +43 -35
- package/metadata/packages/components/components/syn-dialog/component.ts +30 -22
- package/metadata/packages/components/components/syn-header/component.ts +1 -1
- package/metadata/packages/components/components/syn-pagination/component.angular.ts +201 -0
- package/metadata/packages/components/components/syn-pagination/component.react.ts +56 -0
- package/metadata/packages/components/components/syn-pagination/component.styles.ts +128 -0
- package/metadata/packages/components/components/syn-pagination/component.ts +452 -0
- package/metadata/packages/components/components/syn-pagination/component.vue +144 -0
- package/metadata/packages/components/static/CHANGELOG.md +26 -56
- package/metadata/packages/tokens/CHANGELOG.md +12 -0
- package/metadata/packages/tokens/dark.css +1 -1
- package/metadata/packages/tokens/index.js +1 -1
- package/metadata/packages/tokens/light.css +1 -1
- package/metadata/packages/tokens/sick2018_dark.css +1 -1
- package/metadata/packages/tokens/sick2018_light.css +1 -1
- package/metadata/packages/tokens/sick2025_dark.css +1 -1
- package/metadata/packages/tokens/sick2025_light.css +1 -1
- package/metadata/static/components/syn-pagination/docs.md +102 -0
- package/package.json +5 -5
- package/metadata/packages/components/components/syn-dialog/component.custom.styles.ts +0 -60
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1240](https://github.com/synergy-design-system/synergy-design-system/pull/1240) [`06c29d4`](https://github.com/synergy-design-system/synergy-design-system/commit/06c29d4be7b9297d34919646cfd71394abdc6f88) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-04-22
|
|
8
|
+
|
|
9
|
+
feat: ✨ Add new component `<syn-pagination>` (#684)
|
|
10
|
+
|
|
11
|
+
Adds a new component `<syn-pagination>` that may be used to paginate large datasets.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`06c29d4`](https://github.com/synergy-design-system/synergy-design-system/commit/06c29d4be7b9297d34919646cfd71394abdc6f88)]:
|
|
16
|
+
- @synergy-design-system/assets@2.1.0
|
|
17
|
+
|
|
18
|
+
## 2.14.1
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- [#1252](https://github.com/synergy-design-system/synergy-design-system/pull/1252) [`9d36167`](https://github.com/synergy-design-system/synergy-design-system/commit/9d36167d35ebbdd43820d520140d6823e1331ea1) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-04-20
|
|
23
|
+
|
|
24
|
+
fix: 🐛 syn-dialog has broken scrolling when slotting scrollable children (#1249)
|
|
25
|
+
|
|
3
26
|
## 2.14.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
package/metadata/checksum.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ca762755c51a403df85afe19edcbb5e0
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1240](https://github.com/synergy-design-system/synergy-design-system/pull/1240) [`06c29d4`](https://github.com/synergy-design-system/synergy-design-system/commit/06c29d4be7b9297d34919646cfd71394abdc6f88) Thanks [@schilchSICKAG](https://github.com/schilchSICKAG)! - Released on: 2026-04-22
|
|
8
|
+
|
|
9
|
+
feat: ✨ Add new component `<syn-pagination>` (#684)
|
|
10
|
+
|
|
11
|
+
Adds a new component `<syn-pagination>` that may be used to paginate large datasets.
|
|
12
|
+
|
|
3
13
|
## 2.0.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -1,39 +1,35 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
import { css } from 'lit';
|
|
3
2
|
|
|
4
3
|
export default css`
|
|
5
|
-
/* stylelint-disable */
|
|
6
4
|
:host {
|
|
7
5
|
--width: 31rem;
|
|
8
|
-
--header-spacing: var(--syn-spacing-large);
|
|
9
|
-
--body-spacing: var(--syn-spacing-large);
|
|
10
|
-
--footer-spacing: var(--syn-spacing-large);
|
|
6
|
+
--header-spacing: var(--syn-spacing-large) var(--syn-spacing-x-small) var(--syn-spacing-large) var(--syn-spacing-large);
|
|
7
|
+
--body-spacing: var(--syn-spacing-medium) var(--syn-spacing-large);
|
|
8
|
+
--footer-spacing: var(--syn-spacing-medium) var(--syn-spacing-large) var(--syn-spacing-large) var(--syn-spacing-medium);
|
|
11
9
|
|
|
12
10
|
display: contents;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
.dialog {
|
|
16
|
-
display: flex;
|
|
17
14
|
align-items: center;
|
|
15
|
+
display: flex;
|
|
16
|
+
inset: 0;
|
|
18
17
|
justify-content: center;
|
|
19
18
|
position: fixed;
|
|
20
|
-
top: 0;
|
|
21
|
-
right: 0;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
left: 0;
|
|
24
19
|
z-index: var(--syn-z-index-dialog);
|
|
25
20
|
}
|
|
26
21
|
|
|
27
22
|
.dialog__panel {
|
|
23
|
+
background-color: var(--syn-panel-background-color);
|
|
24
|
+
border: var(--syn-spacing-4x-small) solid var(--syn-panel-border-color);
|
|
25
|
+
border-radius: var(--syn-border-radius-none);
|
|
26
|
+
box-shadow: var(--syn-shadow-large);
|
|
28
27
|
display: flex;
|
|
29
28
|
flex-direction: column;
|
|
30
|
-
z-index: 2;
|
|
31
|
-
width: var(--width);
|
|
32
|
-
max-width: calc(100% - var(--syn-spacing-2x-large));
|
|
33
29
|
max-height: calc(100% - var(--syn-spacing-2x-large));
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
max-width: calc(100% - var(--syn-spacing-2x-large));
|
|
31
|
+
width: var(--width);
|
|
32
|
+
z-index: 2;
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
.dialog__panel:focus {
|
|
@@ -41,7 +37,7 @@ export default css`
|
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
/* Ensure there's enough vertical padding for phones that don't update vh when chrome appears (e.g. iPhone) */
|
|
44
|
-
@media screen and (
|
|
40
|
+
@media screen and (width <= 420px) {
|
|
45
41
|
.dialog__panel {
|
|
46
42
|
max-height: 80vh;
|
|
47
43
|
}
|
|
@@ -53,48 +49,62 @@ export default css`
|
|
|
53
49
|
}
|
|
54
50
|
|
|
55
51
|
.dialog__header {
|
|
56
|
-
flex: 0 0 auto;
|
|
57
52
|
display: flex;
|
|
53
|
+
flex: 0 0 auto;
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
.dialog__title {
|
|
61
57
|
flex: 1 1 auto;
|
|
62
58
|
font: inherit;
|
|
63
|
-
font-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
font-family: var(--syn-font-sans);
|
|
60
|
+
font-size: var(--syn-font-size-x-large);
|
|
61
|
+
font-weight: var(--syn-font-weight-bold);
|
|
62
|
+
line-height: var(--syn-line-height-normal);
|
|
66
63
|
margin: 0;
|
|
64
|
+
padding: var(--header-spacing);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
.dialog__header-actions {
|
|
70
|
-
|
|
68
|
+
align-items: flex-start;
|
|
71
69
|
display: flex;
|
|
70
|
+
flex-shrink: 0;
|
|
72
71
|
flex-wrap: wrap;
|
|
72
|
+
gap: var(--syn-spacing-x-small);
|
|
73
73
|
justify-content: end;
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
padding: var(--syn-spacing-large) var(--syn-spacing-small) var(--syn-spacing-large) 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* We need this to make sure we are big enough as defined in the layout
|
|
79
|
+
* When omitting this statement, we will get rounding problems via line-height
|
|
80
|
+
*/
|
|
81
|
+
.dialog__title,
|
|
82
|
+
.dialog__header-actions {
|
|
83
|
+
min-height: 88px;
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
.dialog__header-actions syn-icon-button,
|
|
79
87
|
.dialog__header-actions ::slotted(syn-icon-button) {
|
|
80
|
-
flex: 0 0 auto;
|
|
81
|
-
display: flex;
|
|
82
88
|
align-items: center;
|
|
83
|
-
|
|
89
|
+
color: var(--syn-color-neutral-950);
|
|
90
|
+
display: flex;
|
|
91
|
+
flex: 0 0 auto;
|
|
92
|
+
font-size: var(--syn-font-size-x-large);
|
|
84
93
|
}
|
|
85
94
|
|
|
86
95
|
.dialog__body {
|
|
87
|
-
flex: 1 1 auto;
|
|
88
96
|
display: block;
|
|
89
|
-
|
|
97
|
+
flex: 1 1 auto;
|
|
90
98
|
overflow: auto;
|
|
91
99
|
-webkit-overflow-scrolling: touch;
|
|
100
|
+
padding: var(--body-spacing);
|
|
101
|
+
will-change: transform; /* #1249: Fixes Chrome scroll issues when using multiple scrollable items as content */
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
.dialog__footer {
|
|
95
105
|
flex: 0 0 auto;
|
|
96
|
-
text-align: right;
|
|
97
106
|
padding: var(--footer-spacing);
|
|
107
|
+
text-align: right;
|
|
98
108
|
}
|
|
99
109
|
|
|
100
110
|
.dialog__footer ::slotted(syn-button:not(:first-of-type)) {
|
|
@@ -106,12 +116,10 @@ export default css`
|
|
|
106
116
|
}
|
|
107
117
|
|
|
108
118
|
.dialog__overlay {
|
|
109
|
-
|
|
110
|
-
top: 0;
|
|
111
|
-
right: 0;
|
|
112
|
-
bottom: 0;
|
|
113
|
-
left: 0;
|
|
119
|
+
backdrop-filter: blur(var(--syn-overlay-background-blur)); /* #946: Add background blur for sick 2025 */
|
|
114
120
|
background-color: var(--syn-overlay-background-color);
|
|
121
|
+
inset: 0;
|
|
122
|
+
position: fixed;
|
|
115
123
|
}
|
|
116
124
|
|
|
117
125
|
@media (forced-colors: active) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
2
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
|
+
import { property, query } from 'lit/decorators.js';
|
|
6
|
+
import type { CSSResultGroup } from 'lit';
|
|
2
7
|
import { animateTo, stopAnimations } from '../../internal/animate.js';
|
|
3
8
|
import { blurActiveElement } from '../../internal/closeActiveElement.js';
|
|
4
|
-
import { classMap } from 'lit/directives/class-map.js';
|
|
5
9
|
import { getAnimation, setDefaultAnimation } from '../../utilities/animation-registry.js';
|
|
6
10
|
import { HasSlotController } from '../../internal/slot.js';
|
|
7
|
-
import { html } from 'lit';
|
|
8
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
9
11
|
import { LocalizeController } from '../../utilities/localize.js';
|
|
10
12
|
import { lockBodyScrolling, unlockBodyScrolling } from '../../internal/scroll.js';
|
|
11
|
-
import { property, query } from 'lit/decorators.js';
|
|
12
13
|
import { waitForEvent } from '../../internal/event.js';
|
|
13
14
|
import { watch } from '../../internal/watch.js';
|
|
14
15
|
import componentStyles from '../../styles/component.styles.js';
|
|
@@ -16,8 +17,6 @@ import Modal from '../../internal/modal.js';
|
|
|
16
17
|
import SynergyElement from '../../internal/synergy-element.js';
|
|
17
18
|
import SynIconButton from '../icon-button/icon-button.component.js';
|
|
18
19
|
import styles from './dialog.styles.js';
|
|
19
|
-
import customStyles from './dialog.custom.styles.js';
|
|
20
|
-
import type { CSSResultGroup } from 'lit';
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* @summary Dialogs, sometimes called "modals", appear above the page and require the user's immediate attention.
|
|
@@ -70,26 +69,33 @@ import type { CSSResultGroup } from 'lit';
|
|
|
70
69
|
* the third-party modal opens. Upon closing, call `modal.deactivateExternal()` to restore Synergy's focus trapping.
|
|
71
70
|
*/
|
|
72
71
|
export default class SynDialog extends SynergyElement {
|
|
73
|
-
static styles: CSSResultGroup = [componentStyles, styles
|
|
72
|
+
static styles: CSSResultGroup = [componentStyles, styles];
|
|
73
|
+
|
|
74
74
|
static dependencies = {
|
|
75
|
-
'syn-icon-button': SynIconButton
|
|
75
|
+
'syn-icon-button': SynIconButton,
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
private readonly hasSlotController = new HasSlotController(this, 'footer');
|
|
79
|
+
|
|
79
80
|
private readonly localize = new LocalizeController(this);
|
|
81
|
+
|
|
80
82
|
private originalTrigger: HTMLElement | null;
|
|
83
|
+
|
|
81
84
|
public modal = new Modal(this);
|
|
85
|
+
|
|
82
86
|
private closeWatcher: CloseWatcher | null;
|
|
83
87
|
|
|
84
88
|
@query('.dialog') dialog: HTMLElement;
|
|
89
|
+
|
|
85
90
|
@query('.dialog__panel') panel: HTMLElement;
|
|
91
|
+
|
|
86
92
|
@query('.dialog__overlay') overlay: HTMLElement;
|
|
87
93
|
|
|
88
94
|
/**
|
|
89
95
|
* Indicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can
|
|
90
96
|
* use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.
|
|
91
97
|
*/
|
|
92
|
-
@property({
|
|
98
|
+
@property({ reflect: true, type: Boolean }) open = false;
|
|
93
99
|
|
|
94
100
|
/**
|
|
95
101
|
* The dialog's label as displayed in the header. You should always include a relevant label even when using
|
|
@@ -101,7 +107,7 @@ export default class SynDialog extends SynergyElement {
|
|
|
101
107
|
* Disables the header. This will also remove the default close button, so please ensure you provide an easy,
|
|
102
108
|
* accessible way for users to dismiss the dialog.
|
|
103
109
|
*/
|
|
104
|
-
@property({ attribute: 'no-header',
|
|
110
|
+
@property({ attribute: 'no-header', reflect: true, type: Boolean }) noHeader = false;
|
|
105
111
|
|
|
106
112
|
firstUpdated() {
|
|
107
113
|
this.dialog.hidden = !this.open;
|
|
@@ -123,7 +129,7 @@ export default class SynDialog extends SynergyElement {
|
|
|
123
129
|
private requestClose(source: 'close-button' | 'keyboard' | 'overlay') {
|
|
124
130
|
const slRequestClose = this.emit('syn-request-close', {
|
|
125
131
|
cancelable: true,
|
|
126
|
-
detail: { source }
|
|
132
|
+
detail: { source },
|
|
127
133
|
});
|
|
128
134
|
|
|
129
135
|
if (slRequestClose.defaultPrevented) {
|
|
@@ -205,7 +211,7 @@ export default class SynDialog extends SynergyElement {
|
|
|
205
211
|
const overlayAnimation = getAnimation(this, 'dialog.overlay.show', { dir: this.localize.dir() });
|
|
206
212
|
await Promise.all([
|
|
207
213
|
animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options),
|
|
208
|
-
animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options)
|
|
214
|
+
animateTo(this.overlay, overlayAnimation.keyframes, overlayAnimation.options),
|
|
209
215
|
]);
|
|
210
216
|
|
|
211
217
|
this.emit('syn-after-show');
|
|
@@ -229,7 +235,7 @@ export default class SynDialog extends SynergyElement {
|
|
|
229
235
|
}),
|
|
230
236
|
animateTo(this.panel, panelAnimation.keyframes, panelAnimation.options).then(() => {
|
|
231
237
|
this.panel.hidden = true;
|
|
232
|
-
})
|
|
238
|
+
}),
|
|
233
239
|
]);
|
|
234
240
|
|
|
235
241
|
this.dialog.hidden = true;
|
|
@@ -271,13 +277,14 @@ export default class SynDialog extends SynergyElement {
|
|
|
271
277
|
}
|
|
272
278
|
|
|
273
279
|
render() {
|
|
280
|
+
/* eslint-disable lit-a11y/click-events-have-key-events */
|
|
274
281
|
return html`
|
|
275
282
|
<div
|
|
276
283
|
part="base"
|
|
277
284
|
class=${classMap({
|
|
278
285
|
dialog: true,
|
|
286
|
+
'dialog--has-footer': this.hasSlotController.test('footer'),
|
|
279
287
|
'dialog--open': this.open,
|
|
280
|
-
'dialog--has-footer': this.hasSlotController.test('footer')
|
|
281
288
|
})}
|
|
282
289
|
>
|
|
283
290
|
<div part="overlay" class="dialog__overlay" @click=${() => this.requestClose('overlay')} tabindex="-1"></div>
|
|
@@ -324,36 +331,37 @@ export default class SynDialog extends SynergyElement {
|
|
|
324
331
|
</div>
|
|
325
332
|
</div>
|
|
326
333
|
`;
|
|
334
|
+
/* eslint-enable lit-a11y/click-events-have-key-events */
|
|
327
335
|
}
|
|
328
336
|
}
|
|
329
337
|
|
|
330
338
|
setDefaultAnimation('dialog.show', {
|
|
331
339
|
keyframes: [
|
|
332
340
|
{ opacity: 0, scale: 0.8 },
|
|
333
|
-
{ opacity: 1, scale: 1 }
|
|
341
|
+
{ opacity: 1, scale: 1 },
|
|
334
342
|
],
|
|
335
|
-
options: { duration: 250, easing: 'ease' }
|
|
343
|
+
options: { duration: 250, easing: 'ease' },
|
|
336
344
|
});
|
|
337
345
|
|
|
338
346
|
setDefaultAnimation('dialog.hide', {
|
|
339
347
|
keyframes: [
|
|
340
348
|
{ opacity: 1, scale: 1 },
|
|
341
|
-
{ opacity: 0, scale: 0.8 }
|
|
349
|
+
{ opacity: 0, scale: 0.8 },
|
|
342
350
|
],
|
|
343
|
-
options: { duration: 250, easing: 'ease' }
|
|
351
|
+
options: { duration: 250, easing: 'ease' },
|
|
344
352
|
});
|
|
345
353
|
|
|
346
354
|
setDefaultAnimation('dialog.denyClose', {
|
|
347
355
|
keyframes: [{ scale: 1 }, { scale: 1.02 }, { scale: 1 }],
|
|
348
|
-
options: { duration: 250 }
|
|
356
|
+
options: { duration: 250 },
|
|
349
357
|
});
|
|
350
358
|
|
|
351
359
|
setDefaultAnimation('dialog.overlay.show', {
|
|
352
360
|
keyframes: [{ opacity: 0 }, { opacity: 1 }],
|
|
353
|
-
options: { duration: 250 }
|
|
361
|
+
options: { duration: 250 },
|
|
354
362
|
});
|
|
355
363
|
|
|
356
364
|
setDefaultAnimation('dialog.overlay.hide', {
|
|
357
365
|
keyframes: [{ opacity: 1 }, { opacity: 0 }],
|
|
358
|
-
options: { duration: 250 }
|
|
366
|
+
options: { duration: 250 },
|
|
359
367
|
});
|
|
@@ -6,7 +6,7 @@ import SynergyElement from '../../internal/synergy-element.js';
|
|
|
6
6
|
import { HasSlotController } from '../../internal/slot.js';
|
|
7
7
|
import componentStyles from '../../styles/component.styles.js';
|
|
8
8
|
import styles from './header.styles.js';
|
|
9
|
-
import SynIcon from '../icon/icon.js';
|
|
9
|
+
import SynIcon from '../icon/icon.component.js';
|
|
10
10
|
import type SynSideNav from '../side-nav/side-nav.component.js';
|
|
11
11
|
import { LocalizeController } from '../../utilities/localize.js';
|
|
12
12
|
import { watch } from '../../internal/watch.js';
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------
|
|
2
|
+
// 🔒 AUTOGENERATED @synergy-design-system/angular wrappers for @synergy-design-system/components
|
|
3
|
+
// Please do not edit this file directly!
|
|
4
|
+
// It will get recreated when running pnpm build.
|
|
5
|
+
// ---------------------------------------------------------------------
|
|
6
|
+
import {
|
|
7
|
+
Component,
|
|
8
|
+
ElementRef,
|
|
9
|
+
NgZone,
|
|
10
|
+
Input,
|
|
11
|
+
Output,
|
|
12
|
+
EventEmitter,
|
|
13
|
+
AfterContentInit,
|
|
14
|
+
} from '@angular/core';
|
|
15
|
+
import type { SynPagination } from '@synergy-design-system/components';
|
|
16
|
+
import type { SynPaginationPageChangedEvent } from '@synergy-design-system/components';
|
|
17
|
+
import type { SynPaginationPageSizeChangedEvent } from '@synergy-design-system/components';
|
|
18
|
+
import '@synergy-design-system/components/components/pagination/pagination.js';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @summary <syn-pagination /> provides page navigation, direct page input, and page-size selection for large data sets.
|
|
22
|
+
*
|
|
23
|
+
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-pagination--docs
|
|
24
|
+
* @status stable
|
|
25
|
+
* @since 3.12.0
|
|
26
|
+
*
|
|
27
|
+
* @event syn-pagination-page-changed - Emitted when the current page changes
|
|
28
|
+
* @event syn-pagination-page-size-changed - Emitted when the page size changes
|
|
29
|
+
*
|
|
30
|
+
* @csspart base - The component's base wrapper.
|
|
31
|
+
* @csspart divider - The divider element displayed at the top of the pagination component.
|
|
32
|
+
* @csspart page-size-select-wrapper - The wrapper element containing the page size select and page item summary.
|
|
33
|
+
* @csspart page-size-select - The page size select element.
|
|
34
|
+
* @csspart page-item-summary - The text element displaying the current page item range and total items.
|
|
35
|
+
* @csspart page-input-section - The section containing the page number input and total pages display.
|
|
36
|
+
* @csspart page-input - The page number input element.
|
|
37
|
+
* @csspart navigation - The pagination navigation element.
|
|
38
|
+
* @csspart navigation-action - The individual navigation action buttons (first, previous, next, last).
|
|
39
|
+
*
|
|
40
|
+
* @accessibility
|
|
41
|
+
* The entire component is wrapped in a semantic `<nav>` landmark with an `aria-label` for screen reader accessibility.
|
|
42
|
+
* Use the `aria-label` attribute to provide a unique, descriptive label when multiple pagination controls exist on the page.
|
|
43
|
+
* Example: `<syn-pagination aria-label="Search results pagination"></syn-pagination>`
|
|
44
|
+
*/
|
|
45
|
+
@Component({
|
|
46
|
+
selector: 'syn-pagination',
|
|
47
|
+
standalone: true,
|
|
48
|
+
template: '<ng-content></ng-content>',
|
|
49
|
+
})
|
|
50
|
+
export class SynPaginationComponent {
|
|
51
|
+
public nativeElement: SynPagination;
|
|
52
|
+
private _ngZone: NgZone;
|
|
53
|
+
|
|
54
|
+
constructor(e: ElementRef, ngZone: NgZone) {
|
|
55
|
+
this.nativeElement = e.nativeElement;
|
|
56
|
+
this._ngZone = ngZone;
|
|
57
|
+
this.nativeElement.addEventListener(
|
|
58
|
+
'syn-pagination-page-changed',
|
|
59
|
+
(e: SynPaginationPageChangedEvent) => {
|
|
60
|
+
this.synPaginationPageChangedEvent.emit(e);
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
this.nativeElement.addEventListener(
|
|
64
|
+
'syn-pagination-page-size-changed',
|
|
65
|
+
(e: SynPaginationPageSizeChangedEvent) => {
|
|
66
|
+
this.synPaginationPageSizeChangedEvent.emit(e);
|
|
67
|
+
},
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* When true, a divider is displayed at the top of the pagination component.
|
|
73
|
+
*/
|
|
74
|
+
@Input()
|
|
75
|
+
set divider(v: '' | SynPagination['divider']) {
|
|
76
|
+
this._ngZone.runOutsideAngular(
|
|
77
|
+
() => (this.nativeElement.divider = v === '' || v),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
get divider(): SynPagination['divider'] {
|
|
81
|
+
return this.nativeElement.divider;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* When true, the pagination controls are disabled and non-interactive.
|
|
86
|
+
*/
|
|
87
|
+
@Input()
|
|
88
|
+
set disabled(v: '' | SynPagination['disabled']) {
|
|
89
|
+
this._ngZone.runOutsideAngular(
|
|
90
|
+
() => (this.nativeElement.disabled = v === '' || v),
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
get disabled(): SynPagination['disabled'] {
|
|
94
|
+
return this.nativeElement.disabled;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* The size of the pagination controls.
|
|
99
|
+
*/
|
|
100
|
+
@Input()
|
|
101
|
+
set size(v: SynPagination['size']) {
|
|
102
|
+
this._ngZone.runOutsideAngular(() => (this.nativeElement.size = v));
|
|
103
|
+
}
|
|
104
|
+
get size(): SynPagination['size'] {
|
|
105
|
+
return this.nativeElement.size;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The current page number.
|
|
110
|
+
* The default value is 1.
|
|
111
|
+
The component will emit a `syn-pagination-page-changed` event whenever the page changes, allowing you to respond to page changes in your application.
|
|
112
|
+
*/
|
|
113
|
+
@Input()
|
|
114
|
+
set currentPage(v: SynPagination['currentPage']) {
|
|
115
|
+
this._ngZone.runOutsideAngular(() => (this.nativeElement.currentPage = v));
|
|
116
|
+
}
|
|
117
|
+
get currentPage(): SynPagination['currentPage'] {
|
|
118
|
+
return this.nativeElement.currentPage;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* The number of items to display per page.
|
|
123
|
+
* The default value is 25.
|
|
124
|
+
The component will emit a `syn-pagination-page-size-changed` event whenever the page size changes, allowing you to respond to page size changes in your application.
|
|
125
|
+
*/
|
|
126
|
+
@Input()
|
|
127
|
+
set pageSize(v: SynPagination['pageSize']) {
|
|
128
|
+
this._ngZone.runOutsideAngular(() => (this.nativeElement.pageSize = v));
|
|
129
|
+
}
|
|
130
|
+
get pageSize(): SynPagination['pageSize'] {
|
|
131
|
+
return this.nativeElement.pageSize;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* An array of numbers representing the available options for the number of items to display per page.
|
|
136
|
+
* The default value is [10, 25, 50, 100].
|
|
137
|
+
The component will use this array to populate the rows-per-page selector, allowing users to choose from the specified options.
|
|
138
|
+
*/
|
|
139
|
+
@Input()
|
|
140
|
+
set pageSizeOptions(v: SynPagination['pageSizeOptions']) {
|
|
141
|
+
this._ngZone.runOutsideAngular(
|
|
142
|
+
() => (this.nativeElement.pageSizeOptions = v),
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
get pageSizeOptions(): SynPagination['pageSizeOptions'] {
|
|
146
|
+
return this.nativeElement.pageSizeOptions;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Total amount of items.
|
|
151
|
+
* The component will use this value to calculate the total number of pages based on the selected rows per page.
|
|
152
|
+
*/
|
|
153
|
+
@Input()
|
|
154
|
+
set totalItems(v: SynPagination['totalItems']) {
|
|
155
|
+
this._ngZone.runOutsideAngular(() => (this.nativeElement.totalItems = v));
|
|
156
|
+
}
|
|
157
|
+
get totalItems(): SynPagination['totalItems'] {
|
|
158
|
+
return this.nativeElement.totalItems;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The pagination variant to use.
|
|
163
|
+
* The "full" variant includes comprehensive controls for navigating between pages and adjusting the number of displayed rows,
|
|
164
|
+
while the "compact" variant offers a streamlined interface with essential navigation controls.
|
|
165
|
+
The default value is "full".
|
|
166
|
+
*/
|
|
167
|
+
@Input()
|
|
168
|
+
set variant(v: SynPagination['variant']) {
|
|
169
|
+
this._ngZone.runOutsideAngular(() => (this.nativeElement.variant = v));
|
|
170
|
+
}
|
|
171
|
+
get variant(): SynPagination['variant'] {
|
|
172
|
+
return this.nativeElement.variant;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* An accessible label for the navigation landmark.
|
|
177
|
+
* Customize for multiple paginations on a page.
|
|
178
|
+
*/
|
|
179
|
+
@Input()
|
|
180
|
+
set ariaLabel(v: SynPagination['ariaLabel']) {
|
|
181
|
+
this._ngZone.runOutsideAngular(() => (this.nativeElement.ariaLabel = v));
|
|
182
|
+
}
|
|
183
|
+
get ariaLabel(): SynPagination['ariaLabel'] {
|
|
184
|
+
return this.nativeElement.ariaLabel;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Emitted when the current page changes
|
|
189
|
+
*/
|
|
190
|
+
@Output() synPaginationPageChangedEvent =
|
|
191
|
+
new EventEmitter<SynPaginationPageChangedEvent>();
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Emitted when the page size changes
|
|
195
|
+
*/
|
|
196
|
+
@Output() synPaginationPageSizeChangedEvent =
|
|
197
|
+
new EventEmitter<SynPaginationPageSizeChangedEvent>();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export type { SynPaginationPageChangedEvent } from '@synergy-design-system/components';
|
|
201
|
+
export type { SynPaginationPageSizeChangedEvent } from '@synergy-design-system/components';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------
|
|
2
|
+
// 🔒 AUTOGENERATED @synergy-design-system/react wrappers for @synergy-design-system/components
|
|
3
|
+
// Please do not edit this file directly!
|
|
4
|
+
// It will get recreated when running pnpm build.
|
|
5
|
+
// ---------------------------------------------------------------------
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { createComponent } from '@lit/react';
|
|
8
|
+
import Component from '@synergy-design-system/components/components/pagination/pagination.component.js';
|
|
9
|
+
|
|
10
|
+
import { type EventName } from '@lit/react';
|
|
11
|
+
import type { SynPaginationPageChangedEvent } from '@synergy-design-system/components';
|
|
12
|
+
import type { SynPaginationPageSizeChangedEvent } from '@synergy-design-system/components';
|
|
13
|
+
|
|
14
|
+
const tagName = 'syn-pagination';
|
|
15
|
+
Component.define('syn-pagination');
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @summary <syn-pagination /> provides page navigation, direct page input, and page-size selection for large data sets.
|
|
19
|
+
*
|
|
20
|
+
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-pagination--docs
|
|
21
|
+
* @status stable
|
|
22
|
+
* @since 3.12.0
|
|
23
|
+
*
|
|
24
|
+
* @event syn-pagination-page-changed - Emitted when the current page changes
|
|
25
|
+
* @event syn-pagination-page-size-changed - Emitted when the page size changes
|
|
26
|
+
*
|
|
27
|
+
* @csspart base - The component's base wrapper.
|
|
28
|
+
* @csspart divider - The divider element displayed at the top of the pagination component.
|
|
29
|
+
* @csspart page-size-select-wrapper - The wrapper element containing the page size select and page item summary.
|
|
30
|
+
* @csspart page-size-select - The page size select element.
|
|
31
|
+
* @csspart page-item-summary - The text element displaying the current page item range and total items.
|
|
32
|
+
* @csspart page-input-section - The section containing the page number input and total pages display.
|
|
33
|
+
* @csspart page-input - The page number input element.
|
|
34
|
+
* @csspart navigation - The pagination navigation element.
|
|
35
|
+
* @csspart navigation-action - The individual navigation action buttons (first, previous, next, last).
|
|
36
|
+
*
|
|
37
|
+
* @accessibility
|
|
38
|
+
* The entire component is wrapped in a semantic `<nav>` landmark with an `aria-label` for screen reader accessibility.
|
|
39
|
+
* Use the `aria-label` attribute to provide a unique, descriptive label when multiple pagination controls exist on the page.
|
|
40
|
+
* Example: `<syn-pagination aria-label="Search results pagination"></syn-pagination>`
|
|
41
|
+
*/
|
|
42
|
+
export const SynPagination = createComponent({
|
|
43
|
+
displayName: 'SynPagination',
|
|
44
|
+
elementClass: Component,
|
|
45
|
+
events: {
|
|
46
|
+
onSynPaginationPageChanged:
|
|
47
|
+
'syn-pagination-page-changed' as EventName<SynPaginationPageChangedEvent>,
|
|
48
|
+
onSynPaginationPageSizeChanged:
|
|
49
|
+
'syn-pagination-page-size-changed' as EventName<SynPaginationPageSizeChangedEvent>,
|
|
50
|
+
},
|
|
51
|
+
react: React,
|
|
52
|
+
tagName,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export type { SynPaginationPageChangedEvent } from '@synergy-design-system/components';
|
|
56
|
+
export type { SynPaginationPageSizeChangedEvent } from '@synergy-design-system/components';
|