@umbraco-ui/uui-pagination 1.13.0 → 1.14.0-rc.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.
@@ -17,6 +17,30 @@
17
17
  "type": "string",
18
18
  "default": "\"\""
19
19
  },
20
+ {
21
+ "name": "firstLabel",
22
+ "description": "This property is used to generate the name of the first button",
23
+ "type": "string",
24
+ "default": "\"First\""
25
+ },
26
+ {
27
+ "name": "previousLabel",
28
+ "description": "This property is used to generate the name of the previous button",
29
+ "type": "string",
30
+ "default": "\"Previous\""
31
+ },
32
+ {
33
+ "name": "nextLabel",
34
+ "description": "This property is used to generate the name of the next button",
35
+ "type": "string",
36
+ "default": "\"Next\""
37
+ },
38
+ {
39
+ "name": "lastLabel",
40
+ "description": "This property is used to generate the name of the last button",
41
+ "type": "string",
42
+ "default": "\"Last\""
43
+ },
20
44
  {
21
45
  "name": "total",
22
46
  "description": "Set the amount of pages to navigate.",
@@ -44,6 +68,34 @@
44
68
  "type": "string",
45
69
  "default": "\"\""
46
70
  },
71
+ {
72
+ "name": "firstLabel",
73
+ "attribute": "firstLabel",
74
+ "description": "This property is used to generate the name of the first button",
75
+ "type": "string",
76
+ "default": "\"First\""
77
+ },
78
+ {
79
+ "name": "previousLabel",
80
+ "attribute": "previousLabel",
81
+ "description": "This property is used to generate the name of the previous button",
82
+ "type": "string",
83
+ "default": "\"Previous\""
84
+ },
85
+ {
86
+ "name": "nextLabel",
87
+ "attribute": "nextLabel",
88
+ "description": "This property is used to generate the name of the next button",
89
+ "type": "string",
90
+ "default": "\"Next\""
91
+ },
92
+ {
93
+ "name": "lastLabel",
94
+ "attribute": "lastLabel",
95
+ "description": "This property is used to generate the name of the last button",
96
+ "type": "string",
97
+ "default": "\"Last\""
98
+ },
47
99
  {
48
100
  "name": "total",
49
101
  "attribute": "total",
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
2
2
  import { demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
3
- import { LitElement, html, css } from 'lit';
3
+ import { css, LitElement, html } from 'lit';
4
4
  import { queryAll, query, property, state } from 'lit/decorators.js';
5
5
  import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
6
6
 
@@ -37,6 +37,10 @@ let UUIPaginationElement = class extends LitElement {
37
37
  this._observer = new ResizeObserver(this._calculateRange.bind(this));
38
38
  this.label = "";
39
39
  this.ariaLabel = "";
40
+ this.firstLabel = "First";
41
+ this.previousLabel = "Previous";
42
+ this.nextLabel = "Next";
43
+ this.lastLabel = "Last";
40
44
  this._total = 100;
41
45
  this._range = 0;
42
46
  this._visiblePages = [];
@@ -144,11 +148,9 @@ let UUIPaginationElement = class extends LitElement {
144
148
  look="outline"
145
149
  class="nav"
146
150
  role="listitem"
147
- label="Go to first page"
151
+ label=${this.firstLabel}
148
152
  ?disabled=${this._current === 1}
149
- @click=${() => this.goToPage(1)}>
150
- First
151
- </uui-button>`;
153
+ @click=${() => this.goToPage(1)}></uui-button>`;
152
154
  }
153
155
  renderPrevious() {
154
156
  return html`<uui-button
@@ -156,11 +158,9 @@ let UUIPaginationElement = class extends LitElement {
156
158
  look="outline"
157
159
  class="nav"
158
160
  role="listitem"
159
- label="Go to previous page"
161
+ label=${this.previousLabel}
160
162
  ?disabled=${this._current === 1}
161
- @click=${this.goToPreviousPage}>
162
- Previous
163
- </uui-button>`;
163
+ @click=${this.goToPreviousPage}></uui-button>`;
164
164
  }
165
165
  renderNext() {
166
166
  return html`<uui-button
@@ -168,11 +168,9 @@ let UUIPaginationElement = class extends LitElement {
168
168
  look="outline"
169
169
  role="listitem"
170
170
  class="nav"
171
- label="Go to next page"
171
+ label=${this.nextLabel}
172
172
  ?disabled=${this._current === this.total}
173
- @click=${this.goToNextPage}>
174
- Next
175
- </uui-button>`;
173
+ @click=${this.goToNextPage}></uui-button>`;
176
174
  }
177
175
  renderLast() {
178
176
  return html`
@@ -181,11 +179,9 @@ let UUIPaginationElement = class extends LitElement {
181
179
  look="outline"
182
180
  role="listitem"
183
181
  class="nav"
184
- label="Go to last page"
182
+ label=${this.lastLabel}
185
183
  ?disabled=${this.total === this._current}
186
- @click=${() => this.goToPage(this.total)}>
187
- Last
188
- </uui-button>
184
+ @click=${() => this.goToPage(this.total)}></uui-button>
189
185
  `;
190
186
  }
191
187
  renderDots() {
@@ -279,6 +275,18 @@ __decorateClass([
279
275
  __decorateClass([
280
276
  property({ reflect: true, attribute: "aria-label" })
281
277
  ], UUIPaginationElement.prototype, "ariaLabel", 2);
278
+ __decorateClass([
279
+ property()
280
+ ], UUIPaginationElement.prototype, "firstLabel", 2);
281
+ __decorateClass([
282
+ property()
283
+ ], UUIPaginationElement.prototype, "previousLabel", 2);
284
+ __decorateClass([
285
+ property()
286
+ ], UUIPaginationElement.prototype, "nextLabel", 2);
287
+ __decorateClass([
288
+ property()
289
+ ], UUIPaginationElement.prototype, "lastLabel", 2);
282
290
  __decorateClass([
283
291
  property({ type: Number })
284
292
  ], UUIPaginationElement.prototype, "total", 1);
@@ -27,6 +27,30 @@ export declare class UUIPaginationElement extends LitElement {
27
27
  * @attr
28
28
  */
29
29
  ariaLabel: string;
30
+ /**
31
+ * This property is used to generate the name of the first button
32
+ * @type {string}
33
+ * @attr
34
+ */
35
+ firstLabel: string;
36
+ /**
37
+ * This property is used to generate the name of the previous button
38
+ * @type {string}
39
+ * @attr
40
+ */
41
+ previousLabel: string;
42
+ /**
43
+ * This property is used to generate the name of the next button
44
+ * @type {string}
45
+ * @attr
46
+ */
47
+ nextLabel: string;
48
+ /**
49
+ * This property is used to generate the name of the last button
50
+ * @type {string}
51
+ * @attr
52
+ */
53
+ lastLabel: string;
30
54
  private _total;
31
55
  /**
32
56
  * Set the amount of pages to navigate.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-pagination",
3
- "version": "1.13.0",
3
+ "version": "1.14.0-rc.0",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,9 +30,9 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.13.0",
34
- "@umbraco-ui/uui-button": "1.13.0",
35
- "@umbraco-ui/uui-button-group": "1.13.0"
33
+ "@umbraco-ui/uui-base": "1.14.0-rc.0",
34
+ "@umbraco-ui/uui-button": "1.14.0-rc.0",
35
+ "@umbraco-ui/uui-button-group": "1.14.0-rc.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "npm run analyze && tsc --build && rollup -c rollup.config.js",
@@ -43,5 +43,5 @@
43
43
  "access": "public"
44
44
  },
45
45
  "homepage": "https://uui.umbraco.com/?path=/story/uui-pagination",
46
- "gitHead": "f57b1fdfea3678b843fbec706cecb3a220f6046f"
46
+ "gitHead": "3dd62a7dd7fc7a38c6333c113cd942393bb437f0"
47
47
  }