@refinitiv-ui/elements 5.9.0 → 5.10.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +48 -4
  2. package/lib/button/themes/solar/charcoal/index.js +1 -1
  3. package/lib/button/themes/solar/pearl/index.js +1 -1
  4. package/lib/checkbox/index.js +0 -1
  5. package/lib/combo-box/themes/halo/dark/index.js +1 -1
  6. package/lib/combo-box/themes/halo/light/index.js +1 -1
  7. package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
  8. package/lib/combo-box/themes/solar/pearl/index.js +1 -1
  9. package/lib/counter/themes/halo/dark/index.js +1 -1
  10. package/lib/counter/themes/halo/light/index.js +1 -1
  11. package/lib/label/index.js +2 -1
  12. package/lib/number-field/themes/solar/charcoal/index.js +1 -1
  13. package/lib/pagination/custom-elements.json +16 -33
  14. package/lib/pagination/custom-elements.md +8 -9
  15. package/lib/pagination/index.d.ts +142 -74
  16. package/lib/pagination/index.js +356 -202
  17. package/lib/pagination/themes/halo/dark/index.js +1 -1
  18. package/lib/pagination/themes/halo/light/index.js +1 -1
  19. package/lib/pagination/themes/solar/charcoal/index.js +1 -1
  20. package/lib/pagination/themes/solar/pearl/index.js +1 -1
  21. package/lib/radio-button/index.js +4 -1
  22. package/lib/toggle/themes/halo/dark/index.js +1 -1
  23. package/lib/toggle/themes/halo/light/index.js +1 -1
  24. package/lib/toggle/themes/solar/charcoal/index.js +1 -1
  25. package/lib/toggle/themes/solar/pearl/index.js +1 -1
  26. package/lib/tree/themes/halo/dark/index.js +1 -1
  27. package/lib/tree/themes/halo/light/index.js +1 -1
  28. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  29. package/lib/tree/themes/solar/pearl/index.js +1 -1
  30. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  31. package/lib/tree-select/themes/halo/light/index.js +1 -1
  32. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  33. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  34. package/lib/version.js +1 -1
  35. package/package.json +10 -10
  36. package/lib/pagination/helpers/types.d.ts +0 -9
  37. package/lib/pagination/helpers/types.js +0 -1
@@ -6,22 +6,14 @@
6
6
  "description": "Used to control and navigate through multiple pages",
7
7
  "attributes": [
8
8
  {
9
- "name": "page",
10
- "description": "Set current page",
11
- "type": "string",
12
- "default": "\"1\""
9
+ "name": "value",
10
+ "description": "Current page",
11
+ "type": "string"
13
12
  },
14
13
  {
15
- "name": "page-size",
16
- "description": "Number of item per page",
17
- "type": "string",
18
- "default": "\"10\""
19
- },
20
- {
21
- "name": "total-items",
22
- "description": "Total items",
23
- "type": "string",
24
- "default": "\"10\""
14
+ "name": "max",
15
+ "description": "Max page",
16
+ "type": "string"
25
17
  },
26
18
  {
27
19
  "name": "disabled",
@@ -32,25 +24,16 @@
32
24
  ],
33
25
  "properties": [
34
26
  {
35
- "name": "page",
36
- "attribute": "page",
37
- "description": "Set current page",
38
- "type": "string",
39
- "default": "\"1\""
40
- },
41
- {
42
- "name": "pageSize",
43
- "attribute": "page-size",
44
- "description": "Number of item per page",
45
- "type": "string",
46
- "default": "\"10\""
27
+ "name": "value",
28
+ "attribute": "value",
29
+ "description": "Current page",
30
+ "type": "string"
47
31
  },
48
32
  {
49
- "name": "totalItems",
50
- "attribute": "total-items",
51
- "description": "Total items",
52
- "type": "string",
53
- "default": "\"10\""
33
+ "name": "max",
34
+ "attribute": "max",
35
+ "description": "Max page",
36
+ "type": "string"
54
37
  },
55
38
  {
56
39
  "name": "disabled",
@@ -62,8 +45,8 @@
62
45
  ],
63
46
  "events": [
64
47
  {
65
- "name": "page-changed",
66
- "description": "Fired when the `page` property is changed"
48
+ "name": "value-changed",
49
+ "description": "Fired when the `value` property is changed"
67
50
  }
68
51
  ],
69
52
  "methods": [
@@ -4,12 +4,11 @@ Used to control and navigate through multiple pages
4
4
 
5
5
  ## Properties
6
6
 
7
- | Property | Attribute | Type | Default | Description |
8
- |--------------|---------------|-----------|---------|-------------------------|
9
- | `disabled` | `disabled` | `boolean` | false | Set state to disable |
10
- | `page` | `page` | `string` | "1" | Set current page |
11
- | `pageSize` | `page-size` | `string` | "10" | Number of item per page |
12
- | `totalItems` | `total-items` | `string` | "10" | Total items |
7
+ | Property | Attribute | Type | Default | Description |
8
+ |------------|------------|-----------|---------|----------------------|
9
+ | `disabled` | `disabled` | `boolean` | false | Set state to disable |
10
+ | `max` | `max` | `string` | | Max page |
11
+ | `value` | `value` | `string` | | Current page |
13
12
 
14
13
  ## Methods
15
14
 
@@ -22,6 +21,6 @@ Used to control and navigate through multiple pages
22
21
 
23
22
  ## Events
24
23
 
25
- | Event | Description |
26
- |----------------|-------------------------------------------|
27
- | `page-changed` | Fired when the `page` property is changed |
24
+ | Event | Description |
25
+ |-----------------|--------------------------------------------|
26
+ | `value-changed` | Fired when the `value` property is changed |
@@ -8,7 +8,7 @@ import '@refinitiv-ui/phrasebook/lib/locale/en/pagination.js';
8
8
  import { Translate } from '@refinitiv-ui/translate';
9
9
  /**
10
10
  * Used to control and navigate through multiple pages
11
- * @fires page-changed - Fired when the `page` property is changed
11
+ * @fires value-changed - Fired when the `value` property is changed
12
12
  */
13
13
  export declare class Pagination extends BasicElement {
14
14
  /**
@@ -17,126 +17,182 @@ export declare class Pagination extends BasicElement {
17
17
  */
18
18
  static get version(): string;
19
19
  /**
20
- * A `CSSResultGroup` that will be used
21
- * to style the host, slotted children
22
- * and the internal template of the element.
23
- * @return CSS template
20
+ * Current page internal current page value
24
21
  */
25
- static get styles(): CSSResultGroup;
22
+ private _value;
23
+ /**
24
+ * Internal current page
25
+ * @returns current page
26
+ */
27
+ private get internalValue();
28
+ /**
29
+ * Current page
30
+ */
31
+ get value(): string;
32
+ /**
33
+ * Set current page
34
+ * @param value current page
35
+ */
36
+ set value(value: string);
37
+ /**
38
+ * Max page
39
+ */
40
+ protected _max: string;
41
+ /**
42
+ * Internal max page
43
+ * @returns max page
44
+ */
45
+ private get internalMax();
46
+ /**
47
+ * Max page
48
+ * @returns max page
49
+ */
50
+ get max(): string;
51
+ /**
52
+ * Set max page
53
+ * @param value max page
54
+ */
55
+ set max(value: string);
56
+ /**
57
+ * Current page
58
+ * @returns current page
59
+ * @deprecated
60
+ * @ignore
61
+ */
62
+ get page(): string;
26
63
  /**
27
64
  * Set current page
65
+ * @param value - Set current page
66
+ * @deprecated
67
+ * @ignore
28
68
  */
29
- page: string;
69
+ set page(value: string);
30
70
  /**
31
71
  * Number of item per page
72
+ * @returns number of items per page
73
+ * @deprecated
74
+ * @ignore
32
75
  */
33
- pageSize: string;
76
+ get pageSize(): string;
34
77
  /**
35
- * Total items
78
+ * Set number of item per page
79
+ * @param value - number of item per page
80
+ * @deprecated
81
+ * @ignore
36
82
  */
37
- totalItems: string;
83
+ set pageSize(value: string);
38
84
  /**
39
- * Set state to disable
85
+ * Number of item per page internal value
86
+ * @deprecated
40
87
  */
41
- disabled: boolean;
88
+ private _pageSize;
42
89
  /**
43
- * Getter for info part
90
+ * Internal page size
91
+ * @deprecated
92
+ * @returns page size
44
93
  */
45
- private infoElement;
94
+ private get internalPageSize();
46
95
  /**
47
- * Getter for text field as input part
48
- */
49
- private input;
96
+ * Total items internal value
97
+ * @deprecated
98
+ */
99
+ private _totalItems;
50
100
  /**
51
- * Getter for first button as first part
52
- */
53
- private firstPageButton;
101
+ * Internal total items
102
+ * @returns total items
103
+ * @deprecated
104
+ */
105
+ private get internalTotalitems();
54
106
  /**
55
- * Getter for previous button as previous part
56
- */
57
- private previousPageButton;
107
+ * Total items
108
+ * @returns total items
109
+ * @deprecated
110
+ * @ignore
111
+ */
112
+ get totalItems(): string;
58
113
  /**
59
- * Getter for next button as next part
60
- */
61
- private nextPageButton;
114
+ * Set total items
115
+ * @param value total items
116
+ * @deprecated
117
+ * @ignore
118
+ */
119
+ set totalItems(value: string);
62
120
  /**
63
- * Getter for last button as last part
64
- */
65
- private lastPageButton;
121
+ * Set state to disable
122
+ */
123
+ disabled: boolean;
124
+ /**
125
+ * Get infinite pagination state
126
+ * @returns infinite pagination state
127
+ */
128
+ private get infinitePaginate();
129
+ /**
130
+ * Getter for text field as input part
131
+ */
132
+ private input;
66
133
  /**
67
134
  * Used for translations
68
135
  */
69
136
  protected t: Translate;
70
137
  /**
71
- * Invoked whenever the element is updated
72
- * @param changedProperties Map of changed properties with old values
73
- * @returns {void}
138
+ * Getter for display text in the input
139
+ * @returns input text
74
140
  */
75
- protected updated(changedProperties: PropertyValues): void;
141
+ protected get inputText(): string;
76
142
  /**
77
- * Handle when page-size property changed
78
- * @returns {void}
143
+ * State for check the input focus
79
144
  */
80
- private pageSizeChanged;
145
+ private inputFocused;
81
146
  /**
82
- * Handle when total-items property changed
83
- * @returns {void}
147
+ * State for checking the first page button is available
84
148
  */
85
- private totalItemsChanged;
149
+ protected get useFirstButton(): boolean;
86
150
  /**
87
- * Handle when disabled property changed
88
- * @returns {void}
151
+ * State for checking the previous page button is available
89
152
  */
90
- private disabledChanged;
153
+ protected get usePreviousButton(): boolean;
91
154
  /**
92
- * Update disable/enable state of first, previous, next, and last
93
- * First and previous should be disabled if showing first page
94
- * Next and last should be disabled if showing last page
95
- * @returns {void}
155
+ * State for checking the next page button is available
96
156
  */
97
- private updateButtons;
157
+ protected get useNextButton(): boolean;
98
158
  /**
99
- * Calculate and return total pages
100
- * Total pages should never less than 1
101
- * @returns {number} Number of total page
159
+ * State for checking the last page button is available
102
160
  */
103
- private get totalPage();
161
+ protected get useLastButton(): boolean;
104
162
  /**
105
- * Check a new page value to be usable
106
- * if a new page value is allow then return newPage
107
- * Condition to be old value is null or NaN or undefined or string or less than 1
108
- * @param oldPage a old page value
109
- * @param newPage a new page value
110
- * @return return a new page value
163
+ * @override
111
164
  */
112
- private validatePage;
165
+ protected updated(changedProperties: PropertyValues): void;
113
166
  /**
114
- * Get text to display in info part
115
- * @returns {PageInfo} Used for translations
167
+ * Validate page value which returns true when value is valid
168
+ * @param value value
169
+ * @param warning show warning message when value is invalid
170
+ * @param propName property name to show in warning message
171
+ * @returns result of validation
116
172
  */
117
- private get pageInfo();
173
+ private validatePage;
118
174
  /**
119
- * Hide info part when it's too small
175
+ * Handles action when Enter and Tab key is press onto the input
176
+ * @param event Keyboard event
120
177
  * @returns {void}
121
178
  */
122
- private onResize;
179
+ private onInputKeyDown;
123
180
  /**
124
- * Handle when input is focus
181
+ * Handles action when input focused change
182
+ * @param event focus change event
125
183
  * @returns {void}
126
184
  */
127
- private onInputFocus;
185
+ private onInputFocusedChanged;
128
186
  /**
129
- * Handle when input lost focus
130
- * @param event Event object
187
+ * Update page by using value from the input
131
188
  * @returns {void}
132
189
  */
133
- private onInputBlur;
190
+ private updatePageInput;
134
191
  /**
135
- * Handles action when Enter key is press onto the input
136
- * @param event Keyboard event
137
- * @returns {void}
192
+ * Select text in input when update element complete
193
+ * @returns returns a promise void
138
194
  */
139
- private onInputKeyDown;
195
+ private selectInput;
140
196
  /**
141
197
  * Updates page value depending on direction
142
198
  * @param direction page value direction
@@ -144,6 +200,11 @@ export declare class Pagination extends BasicElement {
144
200
  * @returns {void}
145
201
  */
146
202
  private updatePage;
203
+ /**
204
+ * Fires event when value change
205
+ * @returns {void}
206
+ */
207
+ private notifyValueChange;
147
208
  /**
148
209
  * Go to the next page
149
210
  * @returns {void}
@@ -160,7 +221,7 @@ export declare class Pagination extends BasicElement {
160
221
  */
161
222
  previous(): void;
162
223
  /**
163
- * Go to the previous page and fires evetn
224
+ * Go to the previous page and fires event
164
225
  * @returns {void}
165
226
  */
166
227
  private onPreviousTap;
@@ -184,10 +245,17 @@ export declare class Pagination extends BasicElement {
184
245
  * @returns {void}
185
246
  */
186
247
  private onLastTap;
248
+ /**
249
+ * A `CSSResultGroup` that will be used
250
+ * to style the host, slotted children
251
+ * and the internal template of the element.
252
+ * @return CSS template
253
+ */
254
+ static get styles(): CSSResultGroup;
187
255
  /**
188
256
  * A `TemplateResult` that will be used
189
257
  * to render the updated internal template.
190
- * @return {TemplateResult} Render template
258
+ * @return Render template
191
259
  */
192
260
  protected render(): TemplateResult;
193
261
  }