@refinitiv-ui/elements 5.12.2 → 6.0.0-next.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.
Files changed (160) hide show
  1. package/README.md +4 -4
  2. package/lib/accordion/index.js +2 -2
  3. package/lib/appstate-bar/index.d.ts +6 -0
  4. package/lib/appstate-bar/index.js +8 -3
  5. package/lib/autosuggest/index.js +10 -11
  6. package/lib/button/index.d.ts +2 -13
  7. package/lib/button/index.js +7 -42
  8. package/lib/button-bar/index.js +4 -5
  9. package/lib/calendar/constants.js +1 -1
  10. package/lib/calendar/index.d.ts +1 -1
  11. package/lib/calendar/index.js +39 -15
  12. package/lib/calendar/locales.js +5 -5
  13. package/lib/calendar/types.d.ts +1 -1
  14. package/lib/calendar/utils.js +5 -5
  15. package/lib/canvas/index.js +3 -4
  16. package/lib/card/index.js +6 -7
  17. package/lib/chart/index.js +18 -22
  18. package/lib/chart/plugins/doughnut-center-label.js +6 -11
  19. package/lib/checkbox/index.js +3 -3
  20. package/lib/clock/index.js +6 -6
  21. package/lib/clock/utils/TickManager.js +2 -2
  22. package/lib/collapse/index.js +7 -9
  23. package/lib/color-dialog/elements/color-palettes.js +1 -1
  24. package/lib/color-dialog/elements/grayscale-palettes.js +2 -2
  25. package/lib/color-dialog/elements/palettes.js +4 -5
  26. package/lib/color-dialog/helpers/value-model.js +1 -1
  27. package/lib/color-dialog/index.d.ts +1 -1
  28. package/lib/color-dialog/index.js +6 -6
  29. package/lib/combo-box/helpers/filter.d.ts +1 -1
  30. package/lib/combo-box/helpers/types.d.ts +1 -1
  31. package/lib/combo-box/index.d.ts +4 -4
  32. package/lib/combo-box/index.js +31 -14
  33. package/lib/counter/index.d.ts +6 -6
  34. package/lib/counter/index.js +8 -8
  35. package/lib/datetime-field/constants.d.ts +4 -0
  36. package/lib/datetime-field/constants.js +5 -0
  37. package/lib/datetime-field/custom-elements.json +345 -0
  38. package/lib/datetime-field/custom-elements.md +61 -0
  39. package/lib/datetime-field/index.d.ts +317 -0
  40. package/lib/datetime-field/index.js +660 -0
  41. package/lib/datetime-field/themes/halo/dark/index.js +3 -0
  42. package/lib/datetime-field/themes/halo/light/index.js +3 -0
  43. package/lib/datetime-field/themes/solar/charcoal/index.js +3 -0
  44. package/lib/datetime-field/themes/solar/pearl/index.js +3 -0
  45. package/lib/datetime-field/types.d.ts +10 -0
  46. package/lib/datetime-field/types.js +1 -0
  47. package/lib/datetime-field/utils.d.ts +25 -0
  48. package/lib/datetime-field/utils.js +79 -0
  49. package/lib/datetime-picker/index.js +6 -7
  50. package/lib/datetime-picker/utils.js +1 -1
  51. package/lib/dialog/draggable-element.js +1 -2
  52. package/lib/dialog/index.d.ts +1 -1
  53. package/lib/dialog/index.js +5 -5
  54. package/lib/email-field/index.d.ts +1 -1
  55. package/lib/email-field/index.js +8 -3
  56. package/lib/flag/index.js +3 -3
  57. package/lib/flag/utils/FlagLoader.d.ts +1 -1
  58. package/lib/flag/utils/FlagLoader.js +1 -1
  59. package/lib/header/index.js +2 -2
  60. package/lib/heatmap/helpers/color.d.ts +1 -1
  61. package/lib/heatmap/helpers/color.js +3 -5
  62. package/lib/heatmap/index.js +19 -28
  63. package/lib/icon/index.js +3 -3
  64. package/lib/icon/utils/IconLoader.d.ts +1 -1
  65. package/lib/icon/utils/IconLoader.js +1 -1
  66. package/lib/interactive-chart/helpers/types.d.ts +1 -1
  67. package/lib/interactive-chart/index.js +10 -14
  68. package/lib/item/helpers/types.d.ts +1 -1
  69. package/lib/item/index.d.ts +19 -17
  70. package/lib/item/index.js +45 -48
  71. package/lib/label/index.d.ts +1 -1
  72. package/lib/label/index.js +6 -6
  73. package/lib/layout/index.js +2 -2
  74. package/lib/led-gauge/index.js +2 -2
  75. package/lib/list/custom-elements.json +0 -13
  76. package/lib/list/custom-elements.md +9 -10
  77. package/lib/list/helpers/item-id.d.ts +8 -0
  78. package/lib/list/helpers/item-id.js +13 -0
  79. package/lib/list/helpers/{list-renderer.d.ts → renderer.d.ts} +4 -0
  80. package/lib/list/helpers/{list-renderer.js → renderer.js} +8 -0
  81. package/lib/list/helpers/types.d.ts +1 -1
  82. package/lib/list/index.d.ts +13 -12
  83. package/lib/list/index.js +30 -29
  84. package/lib/list/renderer.d.ts +1 -1
  85. package/lib/list/themes/halo/dark/index.js +1 -1
  86. package/lib/list/themes/halo/light/index.js +1 -1
  87. package/lib/list/themes/solar/charcoal/index.js +1 -1
  88. package/lib/list/themes/solar/pearl/index.js +1 -1
  89. package/lib/loader/index.js +1 -1
  90. package/lib/multi-input/helpers/types.d.ts +1 -1
  91. package/lib/multi-input/index.js +6 -7
  92. package/lib/notification/elements/notification-tray.js +4 -4
  93. package/lib/notification/elements/notification.d.ts +10 -0
  94. package/lib/notification/elements/notification.js +12 -3
  95. package/lib/number-field/index.d.ts +3 -3
  96. package/lib/number-field/index.js +14 -4
  97. package/lib/overlay/elements/overlay-backdrop.js +2 -2
  98. package/lib/overlay/elements/overlay-viewport.js +1 -1
  99. package/lib/overlay/elements/overlay.js +7 -5
  100. package/lib/overlay/managers/focus-manager.js +2 -3
  101. package/lib/overlay/managers/interaction-lock-manager.js +1 -1
  102. package/lib/overlay/managers/viewport-manager.js +4 -5
  103. package/lib/overlay/managers/zindex-manager.js +1 -1
  104. package/lib/overlay-menu/helpers/types.d.ts +1 -1
  105. package/lib/overlay-menu/index.js +12 -15
  106. package/lib/overlay-menu/managers/menu-manager.js +1 -1
  107. package/lib/pagination/index.d.ts +74 -91
  108. package/lib/pagination/index.js +205 -239
  109. package/lib/pagination/themes/halo/dark/index.js +1 -2
  110. package/lib/pagination/themes/halo/light/index.js +1 -2
  111. package/lib/pagination/themes/solar/charcoal/index.js +1 -2
  112. package/lib/pagination/themes/solar/pearl/index.js +1 -2
  113. package/lib/panel/index.js +2 -2
  114. package/lib/password-field/index.d.ts +2 -2
  115. package/lib/password-field/index.js +7 -4
  116. package/lib/pill/index.d.ts +16 -0
  117. package/lib/pill/index.js +36 -5
  118. package/lib/pill/themes/halo/dark/index.js +1 -1
  119. package/lib/pill/themes/halo/light/index.js +1 -1
  120. package/lib/pill/themes/solar/charcoal/index.js +1 -1
  121. package/lib/pill/themes/solar/pearl/index.js +1 -1
  122. package/lib/progress-bar/index.js +3 -3
  123. package/lib/radio-button/index.js +3 -3
  124. package/lib/radio-button/radio-button-registry.d.ts +1 -1
  125. package/lib/radio-button/radio-button-registry.js +4 -2
  126. package/lib/rating/index.js +4 -4
  127. package/lib/search-field/index.d.ts +2 -2
  128. package/lib/search-field/index.js +8 -4
  129. package/lib/select/index.js +11 -14
  130. package/lib/sidebar-layout/index.js +4 -4
  131. package/lib/slider/index.js +6 -8
  132. package/lib/sparkline/index.js +9 -10
  133. package/lib/swing-gauge/index.js +14 -8
  134. package/lib/tab/index.js +4 -4
  135. package/lib/tab-bar/index.js +6 -6
  136. package/lib/text-field/index.d.ts +14 -1
  137. package/lib/text-field/index.js +35 -11
  138. package/lib/time-picker/index.d.ts +1 -1
  139. package/lib/time-picker/index.js +11 -11
  140. package/lib/toggle/index.js +2 -2
  141. package/lib/tooltip/index.js +6 -8
  142. package/lib/tooltip/managers/tooltip-manager.js +2 -2
  143. package/lib/tornado-chart/elements/tornado-chart.js +2 -2
  144. package/lib/tornado-chart/elements/tornado-item.js +3 -3
  145. package/lib/tree/elements/tree-item.d.ts +3 -3
  146. package/lib/tree/elements/tree-item.js +5 -6
  147. package/lib/tree/elements/tree.d.ts +2 -3
  148. package/lib/tree/elements/tree.js +6 -7
  149. package/lib/tree/helpers/renderer.d.ts +4 -0
  150. package/lib/tree/helpers/renderer.js +8 -0
  151. package/lib/tree/helpers/types.d.ts +1 -1
  152. package/lib/tree/managers/tree-manager.d.ts +1 -1
  153. package/lib/tree/themes/halo/dark/index.js +1 -1
  154. package/lib/tree/themes/halo/light/index.js +1 -1
  155. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  156. package/lib/tree/themes/solar/pearl/index.js +1 -1
  157. package/lib/tree-select/index.d.ts +3 -7
  158. package/lib/tree-select/index.js +39 -38
  159. package/lib/version.js +1 -1
  160. package/package.json +35 -295
@@ -1,11 +1,16 @@
1
1
  import { JSXInterface } from '../jsx';
2
2
  import { BasicElement, PropertyValues, TemplateResult, CSSResultGroup } from '@refinitiv-ui/core';
3
+ import { Ref } from '@refinitiv-ui/core/directives/ref.js';
3
4
  import '../button/index.js';
4
5
  import '../button-bar/index.js';
5
6
  import '../layout/index.js';
6
7
  import '../text-field/index.js';
7
- import '@refinitiv-ui/phrasebook/lib/locale/en/pagination.js';
8
- import { Translate } from '@refinitiv-ui/translate';
8
+ import '@refinitiv-ui/phrasebook/locale/en/pagination.js';
9
+ import { Translate, TranslateDirectiveResult } from '@refinitiv-ui/translate';
10
+ declare enum Direction {
11
+ increment = "increment",
12
+ decrement = "decrement"
13
+ }
9
14
  /**
10
15
  * Used to control and navigate through multiple pages
11
16
  * @fires value-changed - Fired when the `value` property is changed
@@ -53,70 +58,6 @@ export declare class Pagination extends BasicElement {
53
58
  * @param value max page
54
59
  */
55
60
  set max(value: string);
56
- /**
57
- * Current page
58
- * @returns current page
59
- * @deprecated
60
- * @ignore
61
- */
62
- get page(): string;
63
- /**
64
- * Set current page
65
- * @param value - Set current page
66
- * @deprecated
67
- * @ignore
68
- */
69
- set page(value: string);
70
- /**
71
- * Number of item per page
72
- * @returns number of items per page
73
- * @deprecated
74
- * @ignore
75
- */
76
- get pageSize(): string;
77
- /**
78
- * Set number of item per page
79
- * @param value - number of item per page
80
- * @deprecated
81
- * @ignore
82
- */
83
- set pageSize(value: string);
84
- /**
85
- * Number of item per page internal value
86
- * @deprecated
87
- */
88
- private _pageSize;
89
- /**
90
- * Internal page size
91
- * @deprecated
92
- * @returns page size
93
- */
94
- private get internalPageSize();
95
- /**
96
- * Total items internal value
97
- * @deprecated
98
- */
99
- private _totalItems;
100
- /**
101
- * Internal total items
102
- * @returns total items
103
- * @deprecated
104
- */
105
- private get internalTotalitems();
106
- /**
107
- * Total items
108
- * @returns total items
109
- * @deprecated
110
- * @ignore
111
- */
112
- get totalItems(): string;
113
- /**
114
- * Set total items
115
- * @param value total items
116
- * @deprecated
117
- * @ignore
118
- */
119
- set totalItems(value: string);
120
61
  /**
121
62
  * Set state to disable
122
63
  */
@@ -127,18 +68,28 @@ export declare class Pagination extends BasicElement {
127
68
  */
128
69
  private get infinitePaginate();
129
70
  /**
130
- * Getter for text field as input part
71
+ * Reference input element
72
+ */
73
+ protected inputRef: Ref<HTMLInputElement>;
74
+ /**
75
+ * Getter for input element
76
+ * @returns input element
131
77
  */
132
- private input;
78
+ protected get inputElement(): HTMLInputElement | null;
133
79
  /**
134
80
  * Used for translations
135
81
  */
136
82
  protected t: Translate;
137
83
  /**
138
- * Getter for display text in the input
139
- * @returns input text
84
+ * Getter for display page number or text depends on focusing the input
85
+ * @returns string page number value or translate directive result
86
+ */
87
+ protected get inputValue(): string | TranslateDirectiveResult;
88
+ /**
89
+ * Get page text format in various translation
90
+ * @returns translate directive result
140
91
  */
141
- protected get inputText(): string;
92
+ protected get inputTextFormat(): TranslateDirectiveResult;
142
93
  /**
143
94
  * State for check the input focus
144
95
  */
@@ -163,6 +114,11 @@ export declare class Pagination extends BasicElement {
163
114
  * @override
164
115
  */
165
116
  protected updated(changedProperties: PropertyValues): void;
117
+ /**
118
+ * Select text in input when update element complete
119
+ * @returns returns a promise void
120
+ */
121
+ private selectInput;
166
122
  /**
167
123
  * Validate page value which returns true when value is valid
168
124
  * @param value value
@@ -172,34 +128,25 @@ export declare class Pagination extends BasicElement {
172
128
  */
173
129
  private validatePage;
174
130
  /**
175
- * Handles action when Enter and Tab key is press onto the input
176
- * @param event Keyboard event
131
+ * Set page to the pagination
132
+ * @param value page number
177
133
  * @returns {void}
178
134
  */
179
- private onInputKeyDown;
180
- /**
181
- * Handles action when input focused change
182
- * @param event focus change event
183
- * @returns {void}
184
- */
185
- private onInputFocusedChanged;
186
- /**
187
- * Update page by using value from the input
188
- * @returns {void}
189
- */
190
- private updatePageInput;
191
- /**
192
- * Select text in input when update element complete
193
- * @returns returns a promise void
194
- */
195
- private selectInput;
135
+ private setPage;
196
136
  /**
197
137
  * Updates page value depending on direction
198
138
  * @param direction page value direction
199
- * @param event whether the event page-changed should fire
139
+ * @param withEvent whether the event page-changed should fire
200
140
  * @returns {void}
201
141
  */
202
142
  private updatePage;
143
+ /**
144
+ * Update input value. Do not update pagination actual value until Enter key is pressed or blur event is fired
145
+ * @param value input value
146
+ * @param direction update from old value
147
+ * @returns void
148
+ */
149
+ protected updateInputValue(value?: number, direction?: Direction | null): void;
203
150
  /**
204
151
  * Fires event when value change
205
152
  * @returns {void}
@@ -245,6 +192,41 @@ export declare class Pagination extends BasicElement {
245
192
  * @returns {void}
246
193
  */
247
194
  private onLastTap;
195
+ /**
196
+ * Check pagination has a next page
197
+ * @param page current page number
198
+ * @returns true if pagination has a next page
199
+ */
200
+ protected hasNextPage(page: number): boolean;
201
+ /**
202
+ * Check pagination has a previous page
203
+ * @param page current page number
204
+ * @returns true if pagination has a previous page
205
+ */
206
+ protected hasPreviousPage(page: number): boolean;
207
+ /**
208
+ * Check pagination has a last page
209
+ * @returns true if pagination has a last page
210
+ */
211
+ protected hasLastPage(): boolean;
212
+ /**
213
+ * Handles action when input focused change
214
+ * @param event focus change event
215
+ * @returns {void}
216
+ */
217
+ private onFocusedChanged;
218
+ /**
219
+ * Runs on input element `input` event
220
+ * @param event `input` event
221
+ * @returns {void}
222
+ */
223
+ protected onInputInput(): void;
224
+ /**
225
+ * Handles key down event
226
+ * @param event Key down event object
227
+ * @returns {void}
228
+ */
229
+ private onKeyDown;
248
230
  /**
249
231
  * A `CSSResultGroup` that will be used
250
232
  * to style the host, slotted children
@@ -259,6 +241,7 @@ export declare class Pagination extends BasicElement {
259
241
  */
260
242
  protected render(): TemplateResult;
261
243
  }
244
+ export {};
262
245
 
263
246
  declare global {
264
247
  interface HTMLElementTagNameMap {