@bonniernews/dn-design-system-web 20.5.2 → 20.5.3
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
CHANGED
|
@@ -4,6 +4,19 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [20.5.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.2...@bonniernews/dn-design-system-web@20.5.3) (2024-10-09)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** pagination next and prev are invisible when disabled ([#1421](https://github.com/BonnierNews/dn-design-system/issues/1421)) ([030cafb](https://github.com/BonnierNews/dn-design-system/commit/030cafb2c9a649927c17aaa5aa87779e9546951c))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Maintenance
|
|
16
|
+
|
|
17
|
+
* **foundations:** update tokens from Figma ([#1424](https://github.com/BonnierNews/dn-design-system/issues/1424)) ([0800afd](https://github.com/BonnierNews/dn-design-system/commit/0800afdc87dcc5b732d3b1e62c57e9082818abcb))
|
|
18
|
+
* prerelease packages ([9a0b844](https://github.com/BonnierNews/dn-design-system/commit/9a0b844af17656dbbcf0ac40b7b61a6ef48a5d1d))
|
|
19
|
+
|
|
7
20
|
## [20.5.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.1...@bonniernews/dn-design-system-web@20.5.2) (2024-10-08)
|
|
8
21
|
|
|
9
22
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|parameter | type | required | options | default | description |
|
|
12
12
|
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
-
|pages | Array | no | | | Array with link objects. Ex. [ { label: '8' , url: 'https://www.dn.se/om/danmark/?
|
|
13
|
+
|pages | Array | no | | | Array with link objects. Ex. [ { label: '8' , url: 'https://www.dn.se/om/danmark/?page=8', current: true, attributes: {} } ] |
|
|
14
14
|
|previousLabel | String | no | 'Föregående' | | Previous button/link label |
|
|
15
15
|
|previousUrl | String | no | | | |
|
|
16
16
|
|previousAttributes | Object | no | | | |
|
|
@@ -33,19 +33,19 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
33
33
|
{% from '@bonniernews/dn-design-system-web/components/pagination/pagination.njk' import Pagination %}
|
|
34
34
|
|
|
35
35
|
{{ Pagination({
|
|
36
|
-
nextUrl: 'https://www.dn.se/om/danmark/?
|
|
36
|
+
nextUrl: 'https://www.dn.se/om/danmark/?page=8',
|
|
37
37
|
nextLabel: undefined,
|
|
38
|
-
previousUrl: 'https://www.dn.se/om/danmark/?
|
|
38
|
+
previousUrl: 'https://www.dn.se/om/danmark/?page=7',
|
|
39
39
|
previousLabel: undefined,
|
|
40
40
|
pages: [
|
|
41
|
-
{ label: '6'
|
|
42
|
-
{ label: '7'
|
|
43
|
-
{ label: '8'
|
|
44
|
-
{ label: '9'
|
|
45
|
-
{ label: '10'
|
|
41
|
+
{ label: '6', url: 'https://www.dn.se/om/danmark/?page=6', attributes: {} },
|
|
42
|
+
{ label: '7', url: 'https://www.dn.se/om/danmark/?page=7' },
|
|
43
|
+
{ label: '8', url: 'https://www.dn.se/om/danmark/?page=8', current: true },
|
|
44
|
+
{ label: '9', url: 'https://www.dn.se/om/danmark/?page=9' },
|
|
45
|
+
{ label: '10', url: 'https://www.dn.se/om/danmark/?page=10' },
|
|
46
46
|
],
|
|
47
47
|
attributes: {},
|
|
48
|
-
classNames: undefined
|
|
48
|
+
classNames: undefined,
|
|
49
49
|
})}}
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
{%- set attributes = getAttributes(params.attributes) %}
|
|
14
14
|
{%- set visiblePages = 5 %}
|
|
15
15
|
<nav class="{{ classes }}" {{- attributes | safe }}>
|
|
16
|
+
{% set isPrevDisabled = true if not params.previousUrl else false %}
|
|
16
17
|
{%- set prevClasses = [
|
|
17
18
|
componentClassName + "__prev ",
|
|
18
|
-
params.previousClassNames if params.previousClassNames
|
|
19
|
+
params.previousClassNames if params.previousClassNames,
|
|
20
|
+
"invisible" if isPrevDisabled
|
|
19
21
|
] | join(" ") %}
|
|
20
22
|
{{ TextButton({
|
|
21
23
|
text: params.previousLabel if params.previousLabel else 'Föregående',
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
classNames: prevClasses,
|
|
27
29
|
attributes: params.previousAttributes,
|
|
28
30
|
href: params.previousUrl,
|
|
29
|
-
disabled:
|
|
31
|
+
disabled: isPrevDisabled
|
|
30
32
|
})}}
|
|
31
33
|
{% if params.pages %}
|
|
32
34
|
<div class="{{ componentClassName }}__pages">
|
|
@@ -42,9 +44,11 @@
|
|
|
42
44
|
{% endfor %}
|
|
43
45
|
</div>
|
|
44
46
|
{% endif %}
|
|
47
|
+
{% set isNextDisabled = true if not params.nextUrl else false %}
|
|
45
48
|
{%- set nextClasses = [
|
|
46
49
|
componentClassName + "__next ",
|
|
47
|
-
params.nextClassNames if params.nextClassNames
|
|
50
|
+
params.nextClassNames if params.nextClassNames,
|
|
51
|
+
"invisible" if isNextDisabled
|
|
48
52
|
] | join(" ") %}
|
|
49
53
|
{{ TextButton({
|
|
50
54
|
text: params.nextLabel if params.nextLabel else 'Nästa',
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
classNames: nextClasses,
|
|
56
60
|
attributes: params.nextAttributes,
|
|
57
61
|
href: params.nextUrl,
|
|
58
|
-
disabled:
|
|
62
|
+
disabled: isNextDisabled
|
|
59
63
|
})}}
|
|
60
64
|
</nav>
|
|
61
65
|
{% endmacro %}
|
package/package.json
CHANGED