@umbraco-ui/uui-pagination 1.2.0 → 1.3.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.
@@ -2,4 +2,5 @@ import { UUIEvent } from '@umbraco-ui/uui-base/lib/events';
2
2
  import { UUIPaginationElement } from './uui-pagination.element';
3
3
  export declare class UUIPaginationEvent extends UUIEvent<{}, UUIPaginationElement> {
4
4
  static readonly CHANGE = "change";
5
+ constructor(evName: string, eventInit?: any | null);
5
6
  }
package/lib/index.js CHANGED
@@ -4,7 +4,26 @@ 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
 
7
+ var __defProp$1 = Object.defineProperty;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
7
23
  class UUIPaginationEvent extends UUIEvent {
24
+ constructor(evName, eventInit = {}) {
25
+ super(evName, __spreadValues(__spreadValues({}, { bubbles: true }), eventInit));
26
+ }
8
27
  }
9
28
  UUIPaginationEvent.CHANGE = "change";
10
29
 
@@ -100,18 +119,32 @@ let UUIPaginationElement = class extends LitElement {
100
119
  this._visiblePages = this._generateVisiblePages(this._current);
101
120
  this.requestUpdate("current", oldValue);
102
121
  }
122
+ /**
123
+ * This method will change the page to a next one.
124
+ * @memberof UUIPaginationElement
125
+ */
103
126
  goToNextPage() {
104
127
  this.current++;
105
128
  this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
106
129
  }
130
+ /**
131
+ * Change the page to a previous one.
132
+ * @memberof UUIPaginationElement
133
+ */
107
134
  goToPreviousPage() {
108
135
  this.current--;
109
136
  this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
110
137
  }
138
+ /**
139
+ * Change the page to the one passed as an argument to this method.
140
+ * @param {number} page
141
+ * @memberof UUIPaginationElement
142
+ */
111
143
  goToPage(page) {
112
144
  this.current = page;
113
145
  this.dispatchEvent(new UUIPaginationEvent(UUIPaginationEvent.CHANGE));
114
146
  }
147
+ /** When having limited display of page-buttons and clicking a page-button that changes the current range, the focus stays on the position of the clicked button which is not anymore representing the number clicked, therefore we move focus to the button that represents the current page. */
115
148
  focusActivePage() {
116
149
  requestAnimationFrame(() => {
117
150
  const activeButtonElement = this.renderRoot.querySelector(".active");
@@ -225,7 +258,7 @@ UUIPaginationElement.styles = [
225
258
 
226
259
  uui-button {
227
260
  --uui-button-border-color: var(--uui-color-border-standalone,#c2c2c2);
228
- --uui-button-border-color-hover: var(--uui-color-interactive-emphasis,#3544b1);
261
+ --uui-button-border-color-hover: var(--uui-color-interactive-emphasis,var(--uui-palette-violet-blue));
229
262
  --uui-button-border-color-disabled: var(--uui-color-border-standalone,#c2c2c2);
230
263
  }
231
264
 
@@ -234,7 +267,7 @@ UUIPaginationElement.styles = [
234
267
  max-width: 72px;
235
268
  }
236
269
  .page.active {
237
- --uui-button-background-color: var(--uui-color-current,#f5c1bc);
270
+ --uui-button-background-color: var(--uui-color-current,var(--uui-palette-spanish-pink));
238
271
  }
239
272
 
240
273
  .nav {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ui/uui-pagination",
3
- "version": "1.2.0",
3
+ "version": "1.3.0-rc.0",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "Umbraco",
@@ -30,18 +30,18 @@
30
30
  "custom-elements.json"
31
31
  ],
32
32
  "dependencies": {
33
- "@umbraco-ui/uui-base": "1.2.0",
34
- "@umbraco-ui/uui-button": "1.2.0",
35
- "@umbraco-ui/uui-button-group": "1.2.0"
33
+ "@umbraco-ui/uui-base": "1.3.0-rc.0",
34
+ "@umbraco-ui/uui-button": "1.3.0-rc.0",
35
+ "@umbraco-ui/uui-button-group": "1.3.0-rc.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
39
- "clean": "tsc --build --clean && rimraf dist lib/*.js lib/**/*.js custom-elements.json",
39
+ "clean": "tsc --build --clean && rimraf -g dist lib/*.js lib/**/*.js custom-elements.json",
40
40
  "analyze": "web-component-analyzer **/*.element.ts --outFile custom-elements.json"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
45
  "homepage": "https://uui.umbraco.com/?path=/story/uui-pagination",
46
- "gitHead": "78ce6df4b259921ed47e25ce10812920f25cbc1c"
46
+ "gitHead": "45c3824056586d9817efb3f61dc0bef5478747f0"
47
47
  }