@refinitiv-ui/elements 5.7.0 → 5.9.0-alpha.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 (170) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/lib/autosuggest/custom-elements.json +14 -4
  3. package/lib/autosuggest/custom-elements.md +21 -14
  4. package/lib/autosuggest/index.d.ts +4 -0
  5. package/lib/autosuggest/index.js +4 -0
  6. package/lib/calendar/constants.d.ts +4 -0
  7. package/lib/calendar/constants.js +5 -0
  8. package/lib/calendar/custom-elements.json +4 -2
  9. package/lib/calendar/custom-elements.md +2 -2
  10. package/lib/calendar/index.d.ts +108 -17
  11. package/lib/calendar/index.js +488 -120
  12. package/lib/calendar/locales.js +2 -1
  13. package/lib/calendar/themes/halo/dark/index.js +1 -1
  14. package/lib/calendar/themes/halo/light/index.js +1 -1
  15. package/lib/calendar/themes/solar/charcoal/index.js +1 -1
  16. package/lib/calendar/themes/solar/pearl/index.js +1 -1
  17. package/lib/calendar/types.d.ts +11 -8
  18. package/lib/calendar/utils.js +2 -1
  19. package/lib/canvas/custom-elements.json +7 -5
  20. package/lib/canvas/custom-elements.md +8 -8
  21. package/lib/canvas/index.d.ts +1 -0
  22. package/lib/canvas/index.js +1 -0
  23. package/lib/card/custom-elements.json +3 -1
  24. package/lib/card/custom-elements.md +5 -5
  25. package/lib/card/index.d.ts +2 -0
  26. package/lib/card/index.js +2 -0
  27. package/lib/chart/custom-elements.json +1 -1
  28. package/lib/chart/custom-elements.md +4 -4
  29. package/lib/checkbox/custom-elements.json +8 -4
  30. package/lib/checkbox/custom-elements.md +2 -2
  31. package/lib/checkbox/index.d.ts +3 -1
  32. package/lib/checkbox/index.js +2 -0
  33. package/lib/clock/custom-elements.json +8 -4
  34. package/lib/clock/custom-elements.md +9 -9
  35. package/lib/clock/index.d.ts +2 -0
  36. package/lib/clock/index.js +2 -0
  37. package/lib/clock/themes/halo/dark/index.js +1 -1
  38. package/lib/clock/themes/halo/light/index.js +1 -1
  39. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  40. package/lib/clock/themes/solar/pearl/index.js +1 -1
  41. package/lib/color-dialog/custom-elements.json +21 -8
  42. package/lib/color-dialog/custom-elements.md +22 -22
  43. package/lib/color-dialog/index.d.ts +8 -8
  44. package/lib/color-dialog/index.js +8 -8
  45. package/lib/combo-box/custom-elements.json +19 -10
  46. package/lib/combo-box/custom-elements.md +20 -20
  47. package/lib/combo-box/index.d.ts +10 -2
  48. package/lib/combo-box/index.js +10 -1
  49. package/lib/combo-box/themes/halo/dark/index.js +1 -1
  50. package/lib/combo-box/themes/halo/light/index.js +1 -1
  51. package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
  52. package/lib/combo-box/themes/solar/pearl/index.js +1 -1
  53. package/lib/counter/custom-elements.json +8 -4
  54. package/lib/counter/custom-elements.md +4 -4
  55. package/lib/counter/index.d.ts +2 -0
  56. package/lib/counter/index.js +2 -0
  57. package/lib/datetime-picker/custom-elements.json +48 -19
  58. package/lib/datetime-picker/custom-elements.md +36 -28
  59. package/lib/datetime-picker/index.d.ts +15 -4
  60. package/lib/datetime-picker/index.js +15 -4
  61. package/lib/dialog/custom-elements.json +30 -8
  62. package/lib/dialog/custom-elements.md +16 -16
  63. package/lib/dialog/index.d.ts +7 -10
  64. package/lib/dialog/index.js +7 -10
  65. package/lib/email-field/custom-elements.json +80 -93
  66. package/lib/email-field/custom-elements.md +22 -20
  67. package/lib/email-field/index.d.ts +43 -115
  68. package/lib/email-field/index.js +44 -244
  69. package/lib/flag/custom-elements.md +4 -4
  70. package/lib/flag/index.d.ts +2 -0
  71. package/lib/flag/index.js +2 -0
  72. package/lib/icon/custom-elements.md +4 -4
  73. package/lib/icon/index.d.ts +2 -0
  74. package/lib/icon/index.js +2 -0
  75. package/lib/interactive-chart/custom-elements.json +6 -10
  76. package/lib/interactive-chart/custom-elements.md +6 -7
  77. package/lib/interactive-chart/index.d.ts +5 -2
  78. package/lib/interactive-chart/index.js +5 -2
  79. package/lib/item/custom-elements.json +8 -6
  80. package/lib/item/custom-elements.md +14 -14
  81. package/lib/item/index.d.ts +2 -1
  82. package/lib/item/index.js +2 -1
  83. package/lib/led-gauge/custom-elements.json +4 -4
  84. package/lib/led-gauge/custom-elements.md +2 -2
  85. package/lib/led-gauge/index.d.ts +1 -0
  86. package/lib/led-gauge/index.js +1 -0
  87. package/lib/list/custom-elements.json +18 -5
  88. package/lib/list/custom-elements.md +12 -10
  89. package/lib/list/helpers/list-renderer.js +2 -0
  90. package/lib/list/index.d.ts +19 -2
  91. package/lib/list/index.js +34 -1
  92. package/lib/multi-input/custom-elements.json +3 -2
  93. package/lib/multi-input/custom-elements.md +16 -16
  94. package/lib/multi-input/index.d.ts +4 -0
  95. package/lib/multi-input/index.js +4 -0
  96. package/lib/number-field/custom-elements.json +97 -52
  97. package/lib/number-field/custom-elements.md +27 -22
  98. package/lib/number-field/index.d.ts +92 -47
  99. package/lib/number-field/index.js +113 -80
  100. package/lib/overlay/custom-elements.json +23 -13
  101. package/lib/overlay/custom-elements.md +29 -29
  102. package/lib/overlay/elements/overlay.d.ts +5 -0
  103. package/lib/overlay-menu/custom-elements.json +66 -14
  104. package/lib/overlay-menu/custom-elements.md +19 -19
  105. package/lib/overlay-menu/index.d.ts +13 -11
  106. package/lib/overlay-menu/index.js +13 -11
  107. package/lib/password-field/custom-elements.json +62 -67
  108. package/lib/password-field/custom-elements.md +19 -11
  109. package/lib/password-field/index.d.ts +42 -94
  110. package/lib/password-field/index.js +48 -194
  111. package/lib/pill/custom-elements.json +4 -2
  112. package/lib/pill/custom-elements.md +1 -1
  113. package/lib/pill/index.d.ts +1 -1
  114. package/lib/pill/index.js +1 -1
  115. package/lib/radio-button/custom-elements.json +8 -6
  116. package/lib/radio-button/custom-elements.md +3 -3
  117. package/lib/radio-button/index.d.ts +6 -5
  118. package/lib/radio-button/index.js +5 -4
  119. package/lib/search-field/custom-elements.json +70 -74
  120. package/lib/search-field/custom-elements.md +24 -16
  121. package/lib/search-field/index.d.ts +43 -100
  122. package/lib/search-field/index.js +46 -215
  123. package/lib/select/custom-elements.json +3 -2
  124. package/lib/select/custom-elements.md +10 -10
  125. package/lib/select/index.d.ts +11 -3
  126. package/lib/select/index.js +65 -26
  127. package/lib/sidebar-layout/custom-elements.json +2 -6
  128. package/lib/sidebar-layout/custom-elements.md +5 -6
  129. package/lib/sidebar-layout/index.d.ts +2 -1
  130. package/lib/slider/custom-elements.json +2 -2
  131. package/lib/slider/custom-elements.md +1 -1
  132. package/lib/slider/index.d.ts +1 -1
  133. package/lib/slider/index.js +1 -1
  134. package/lib/sparkline/custom-elements.json +4 -4
  135. package/lib/sparkline/custom-elements.md +2 -2
  136. package/lib/sparkline/index.d.ts +3 -1
  137. package/lib/sparkline/index.js +2 -0
  138. package/lib/swing-gauge/custom-elements.json +5 -3
  139. package/lib/swing-gauge/custom-elements.md +11 -11
  140. package/lib/swing-gauge/index.d.ts +3 -1
  141. package/lib/swing-gauge/index.js +3 -1
  142. package/lib/text-field/custom-elements.json +76 -87
  143. package/lib/text-field/custom-elements.md +24 -26
  144. package/lib/text-field/index.d.ts +50 -92
  145. package/lib/text-field/index.js +81 -230
  146. package/lib/time-picker/custom-elements.md +3 -3
  147. package/lib/time-picker/index.d.ts +3 -0
  148. package/lib/time-picker/index.js +3 -0
  149. package/lib/toggle/custom-elements.json +4 -2
  150. package/lib/toggle/custom-elements.md +1 -1
  151. package/lib/toggle/index.d.ts +2 -1
  152. package/lib/toggle/index.js +1 -0
  153. package/lib/tree/custom-elements.json +2 -1
  154. package/lib/tree/custom-elements.md +1 -1
  155. package/lib/tree/elements/tree.d.ts +1 -0
  156. package/lib/tree/elements/tree.js +1 -0
  157. package/lib/tree/themes/halo/dark/index.js +1 -1
  158. package/lib/tree/themes/halo/light/index.js +1 -1
  159. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  160. package/lib/tree/themes/solar/pearl/index.js +1 -1
  161. package/lib/tree-select/custom-elements.json +8 -4
  162. package/lib/tree-select/custom-elements.md +3 -3
  163. package/lib/tree-select/index.d.ts +5 -3
  164. package/lib/tree-select/index.js +3 -2
  165. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  166. package/lib/tree-select/themes/halo/light/index.js +1 -1
  167. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  168. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  169. package/lib/version.js +1 -1
  170. package/package.json +292 -11
package/CHANGELOG.md CHANGED
@@ -3,6 +3,52 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [5.9.0-alpha.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.8.2-alpha.0...@refinitiv-ui/elements@5.9.0-alpha.0) (2021-12-14)
7
+
8
+
9
+ ### Features
10
+
11
+ * **calendar:** add accessibility ([#73](https://github.com/Refinitiv/refinitiv-ui/issues/73)) ([a2576cc](https://github.com/Refinitiv/refinitiv-ui/commit/a2576cc8a1f0229bb5988af0c9d0bbf8ce7f765c))
12
+
13
+
14
+
15
+
16
+
17
+ ## [5.8.2-alpha.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.8.1...@refinitiv-ui/elements@5.8.2-alpha.0) (2021-12-13)
18
+
19
+ **Note:** Version bump only for package @refinitiv-ui/elements
20
+
21
+
22
+
23
+
24
+
25
+ ## [5.8.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.8.0...@refinitiv-ui/elements@5.8.1) (2021-12-07)
26
+
27
+ **Note:** Version bump only for package @refinitiv-ui/elements
28
+
29
+
30
+
31
+
32
+
33
+ # [5.8.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.7.0...@refinitiv-ui/elements@5.8.0) (2021-12-03)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * change default role to more generic type for better extendibility ([#100](https://github.com/Refinitiv/refinitiv-ui/issues/100)) ([fe999dc](https://github.com/Refinitiv/refinitiv-ui/commit/fe999dc66b5f42581a37329ced697ae6ac2dc929))
39
+ * **combo-box:** fix arrow icon not show in Solar when disabled ([55c1008](https://github.com/Refinitiv/refinitiv-ui/commit/55c1008b7b63f915a7575059c6539e63a757e389))
40
+ * **combo-box:** import counter instead of pill ([6410c03](https://github.com/Refinitiv/refinitiv-ui/commit/6410c03dd12077f25347dddb249b6a6700186abc))
41
+
42
+
43
+ ### Features
44
+
45
+ * **list:** improve screen reader ([0bc3a8c](https://github.com/Refinitiv/refinitiv-ui/commit/0bc3a8c9c4051200cd1a5c8ed655d1d3ebbd9021))
46
+ * **select:** improve screen reader support ([#80](https://github.com/Refinitiv/refinitiv-ui/issues/80)) ([a43fbcd](https://github.com/Refinitiv/refinitiv-ui/commit/a43fbcd4b23b2f508ddc94b8007913f66da1ae89))
47
+
48
+
49
+
50
+
51
+
6
52
  # [5.7.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@5.6.0...@refinitiv-ui/elements@5.7.0) (2021-11-22)
7
53
 
8
54
 
@@ -26,7 +26,7 @@
26
26
  "name": "more-search-text",
27
27
  "description": "Custom text for More Search",
28
28
  "type": "string",
29
- "default": "\"defaultMoreSearchText\""
29
+ "default": "\"More results for {0}\""
30
30
  },
31
31
  {
32
32
  "name": "loading",
@@ -55,12 +55,12 @@
55
55
  ],
56
56
  "properties": [
57
57
  {
58
- "name": "defaultDebounceRate",
58
+ "name": "defaultDebounceRate (readonly)",
59
59
  "type": "100",
60
60
  "default": "100"
61
61
  },
62
62
  {
63
- "name": "defaultMoreSearchText",
63
+ "name": "defaultMoreSearchText (readonly)",
64
64
  "type": "\"More results for {0}\"",
65
65
  "default": "\"More results for {0}\""
66
66
  },
@@ -89,7 +89,7 @@
89
89
  "attribute": "more-search-text",
90
90
  "description": "Custom text for More Search",
91
91
  "type": "string",
92
- "default": "\"defaultMoreSearchText\""
92
+ "default": "\"More results for {0}\""
93
93
  },
94
94
  {
95
95
  "name": "loading",
@@ -177,6 +177,16 @@
177
177
  "description": "Fired when suggestions changed"
178
178
  }
179
179
  ],
180
+ "slots": [
181
+ {
182
+ "name": "header",
183
+ "description": "Slot to add custom contents at the top of autosuggest popup"
184
+ },
185
+ {
186
+ "name": "footer",
187
+ "description": "Slot to add custom contents at the bottom of autosuggest popup"
188
+ }
189
+ ],
180
190
  "methods": [
181
191
  {
182
192
  "name": "onInputValueChange",
@@ -8,20 +8,20 @@ custom rendering, pagination, asynchronous data request, etc.
8
8
 
9
9
  ## Properties
10
10
 
11
- | Property | Attribute | Type | Default | Description |
12
- |------------------|--------------------|----------------------------------------------|-------------------------|--------------------------------------------------|
13
- | `attach` | `attach` | `AutosuggestTargetElement \| string \| null` | null | An HTML Element or CSS selector |
14
- | `debounceRate` | `debounce-rate` | `number` | "100" | Debounce rate in ms of the filter as a number.<br />Used to throttle the filter rate so as not to trigger unneeded filtering |
15
- | `highlightable` | | `AutosuggestHighlightable` | "itemHighlightable" | A function that is applied to every suggestion during the render process<br />to say whether the item can be highlighted and selected. Only items that return true are considered.<br />By default the function checks for `item` `highlightable` property. |
16
- | `htmlRenderer` | `html-renderer` | `boolean` | false | If set to true, the render function is not called. Instead the wrapper element<br />should populate and destroy suggestion elements. Rendering items manually<br />may have performance benefits in frameworks that use virtual DOM (such as `Vue`, `React`, `hyperHTML` and others) |
17
- | `loading` | `loading` | `boolean` | false | If set to true show loading mask |
18
- | `moreResults` | `more-results` | `boolean` | false | If set to true display 'Has more results' item |
19
- | `moreSearchText` | `more-search-text` | `string` | "defaultMoreSearchText" | Custom text for More Search |
20
- | `opened` | `opened` | `boolean` | false | Auto suggest popup's open state |
21
- | `query` | | `AutosuggestQuery \| null` | null | An object that represents a query from attach target |
22
- | `renderer` | | `AutosuggestRenderer` | "itemRenderer" | A renderer applied to suggestion.<br />By default a render maps data to item attributes |
23
- | `requestOnFocus` | `request-on-focus` | `boolean` | false | Request suggestions when attach target is focused |
24
- | `suggestions` | | `AutosuggestItem[]` | [] | A list of suggestion items |
11
+ | Property | Attribute | Type | Default | Description |
12
+ |------------------|--------------------|----------------------------------------------|------------------------|--------------------------------------------------|
13
+ | `attach` | `attach` | `AutosuggestTargetElement \| string \| null` | null | An HTML Element or CSS selector |
14
+ | `debounceRate` | `debounce-rate` | `number` | "100" | Debounce rate in ms of the filter as a number.<br />Used to throttle the filter rate so as not to trigger unneeded filtering |
15
+ | `highlightable` | | `AutosuggestHighlightable` | "itemHighlightable" | A function that is applied to every suggestion during the render process<br />to say whether the item can be highlighted and selected. Only items that return true are considered.<br />By default the function checks for `item` `highlightable` property. |
16
+ | `htmlRenderer` | `html-renderer` | `boolean` | false | If set to true, the render function is not called. Instead the wrapper element<br />should populate and destroy suggestion elements. Rendering items manually<br />may have performance benefits in frameworks that use virtual DOM (such as `Vue`, `React`, `hyperHTML` and others) |
17
+ | `loading` | `loading` | `boolean` | false | If set to true show loading mask |
18
+ | `moreResults` | `more-results` | `boolean` | false | If set to true display 'Has more results' item |
19
+ | `moreSearchText` | `more-search-text` | `string` | "More results for {0}" | Custom text for More Search |
20
+ | `opened` | `opened` | `boolean` | false | Auto suggest popup's open state |
21
+ | `query` | | `AutosuggestQuery \| null` | null | An object that represents a query from attach target |
22
+ | `renderer` | | `AutosuggestRenderer` | "itemRenderer" | A renderer applied to suggestion.<br />By default a render maps data to item attributes |
23
+ | `requestOnFocus` | `request-on-focus` | `boolean` | false | Request suggestions when attach target is focused |
24
+ | `suggestions` | | `AutosuggestItem[]` | [] | A list of suggestion items |
25
25
 
26
26
  ## Methods
27
27
 
@@ -45,3 +45,10 @@ custom rendering, pagination, asynchronous data request, etc.
45
45
  | `suggestions-clear-requested` | Fired when auto suggest requests to clear the data. If used in reactive application, prevent default and set suggestions to [] |
46
46
  | `suggestions-fetch-requested` | Fired when auto suggest requests the data |
47
47
  | `suggestions-query` | Fired when input value has changed and the query must be set |
48
+
49
+ ## Slots
50
+
51
+ | Name | Description |
52
+ |----------|--------------------------------------------------|
53
+ | `footer` | Slot to add custom contents at the bottom of autosuggest popup |
54
+ | `header` | Slot to add custom contents at the top of autosuggest popup |
@@ -24,6 +24,9 @@ export { queryWordSelect, itemRenderer, escapeRegExp, itemHighlightable, updateE
24
24
  *
25
25
  * @attr {boolean} opened - Set to open auto suggest popup
26
26
  * @prop {boolean} [opened=false] - Auto suggest popup's open state
27
+ *
28
+ * @slot header - Slot to add custom contents at the top of autosuggest popup
29
+ * @slot footer - Slot to add custom contents at the bottom of autosuggest popup
27
30
  */
28
31
  export declare class Autosuggest extends Overlay {
29
32
  /**
@@ -83,6 +86,7 @@ export declare class Autosuggest extends Overlay {
83
86
  moreResults: boolean;
84
87
  /**
85
88
  * Custom text for More Search
89
+ * @default More results for {0}
86
90
  */
87
91
  moreSearchText: string;
88
92
  /**
@@ -31,6 +31,9 @@ export { queryWordSelect, itemRenderer, escapeRegExp, itemHighlightable, updateE
31
31
  *
32
32
  * @attr {boolean} opened - Set to open auto suggest popup
33
33
  * @prop {boolean} [opened=false] - Auto suggest popup's open state
34
+ *
35
+ * @slot header - Slot to add custom contents at the top of autosuggest popup
36
+ * @slot footer - Slot to add custom contents at the bottom of autosuggest popup
34
37
  */
35
38
  let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
36
39
  /**
@@ -53,6 +56,7 @@ let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
53
56
  this.moreResults = false;
54
57
  /**
55
58
  * Custom text for More Search
59
+ * @default More results for {0}
56
60
  */
57
61
  this.moreSearchText = Autosuggest_1.defaultMoreSearchText;
58
62
  /**
@@ -20,3 +20,7 @@ export declare const MONTH_VIEW: {
20
20
  columnCount: number;
21
21
  totalCount: number;
22
22
  };
23
+ /**
24
+ * A symbol to ensure these locales cannot be overridden
25
+ */
26
+ export declare const CalendarLocaleScope: string;
@@ -1,3 +1,4 @@
1
+ import { uuid } from '@refinitiv-ui/utils/lib/uuid.js';
1
2
  export var RenderView;
2
3
  (function (RenderView) {
3
4
  RenderView["DAY"] = "day";
@@ -21,3 +22,7 @@ export const MONTH_VIEW = {
21
22
  columnCount: 4,
22
23
  totalCount: 4 * 4
23
24
  };
25
+ /**
26
+ * A symbol to ensure these locales cannot be overridden
27
+ */
28
+ export const CalendarLocaleScope = uuid();
@@ -61,7 +61,8 @@
61
61
  {
62
62
  "name": "values",
63
63
  "description": "Set multiple selected values",
64
- "type": "string[]"
64
+ "type": "string[]",
65
+ "default": "[]"
65
66
  },
66
67
  {
67
68
  "name": "fill-cells",
@@ -154,7 +155,8 @@
154
155
  "name": "values",
155
156
  "attribute": "values",
156
157
  "description": "Set multiple selected values",
157
- "type": "string[]"
158
+ "type": "string[]",
159
+ "default": "[]"
158
160
  },
159
161
  {
160
162
  "name": "fillCells",
@@ -9,14 +9,14 @@ Standard calendar element
9
9
  | `disabled` | `disabled` | `boolean` | false | Set disabled state |
10
10
  | `fillCells` | `fill-cells` | `boolean` | false | Fill head and tail cell dates |
11
11
  | `filter` | | `CalendarFilter \| null` | null | Custom filter, used for enabling/disabling certain dates |
12
- | `firstDayOfWeek` | `first-day-of-week` | `number \| null` | | Set the first day of the week.<br />0 - for Sunday, 6 - for Saturday |
12
+ | `firstDayOfWeek` | `first-day-of-week` | `number \| null` | null | Set the first day of the week.<br />0 - for Sunday, 6 - for Saturday |
13
13
  | `max` | `max` | `string` | "" | Set maximum date |
14
14
  | `min` | `min` | `string` | "" | Set minimum date |
15
15
  | `multiple` | `multiple` | `boolean` | false | Set to switch to multiple select mode |
16
16
  | `range` | `range` | `boolean` | false | Set to switch to range select mode |
17
17
  | `readonly` | `readonly` | `boolean` | false | Set readonly state |
18
18
  | `value` | `value` | `string` | "" | Current date time value |
19
- | `values` | `values` | `string[]` | | Set multiple selected values |
19
+ | `values` | `values` | `string[]` | [] | Set multiple selected values |
20
20
  | `view` | `view` | `string` | "" | Current calendar view date |
21
21
  | `weekdaysOnly` | `weekdays-only` | `boolean` | false | Only enable weekdays |
22
22
  | `weekendsOnly` | `weekends-only` | `boolean` | false | Only enable weekends |
@@ -1,10 +1,11 @@
1
1
  import { JSXInterface } from '../jsx';
2
2
  import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues, MultiValue } from '@refinitiv-ui/core';
3
3
  import { TranslateDirective, TranslatePromise } from '@refinitiv-ui/translate';
4
- import type { CalendarFilter } from './types';
4
+ import { CalendarFilter } from './types';
5
5
  import './locales.js';
6
6
  import '../button/index.js';
7
- export type { CalendarFilter };
7
+ import '@refinitiv-ui/phrasebook/lib/locale/en/calendar.js';
8
+ export { CalendarFilter };
8
9
  /**
9
10
  * Standard calendar element
10
11
  *
@@ -25,6 +26,7 @@ export declare class Calendar extends ControlElement implements MultiValue {
25
26
  * @returns version number
26
27
  */
27
28
  static get version(): string;
29
+ protected readonly defaultRole: string | null;
28
30
  /**
29
31
  * A `CSSResultGroup` that will be used
30
32
  * to style the host, slotted children
@@ -32,6 +34,10 @@ export declare class Calendar extends ControlElement implements MultiValue {
32
34
  * @return CSS template
33
35
  */
34
36
  static get styles(): CSSResultGroup;
37
+ /**
38
+ * Reference to the view button
39
+ */
40
+ private viewBtnRef;
35
41
  private _min;
36
42
  /**
37
43
  * Set minimum date
@@ -78,6 +84,7 @@ export declare class Calendar extends ControlElement implements MultiValue {
78
84
  * 0 - for Sunday, 6 - for Saturday
79
85
  * @param firstDayOfWeek The first day of the week
80
86
  * @type {number | null}
87
+ * @default null
81
88
  */
82
89
  set firstDayOfWeek(firstDayOfWeek: number);
83
90
  get firstDayOfWeek(): number;
@@ -101,6 +108,7 @@ export declare class Calendar extends ControlElement implements MultiValue {
101
108
  * Set multiple selected values
102
109
  * @param values Values to set
103
110
  * @type {string[]}
111
+ * @default []
104
112
  */
105
113
  set values(values: string[]);
106
114
  get values(): string[];
@@ -108,25 +116,63 @@ export declare class Calendar extends ControlElement implements MultiValue {
108
116
  * Fill head and tail cell dates
109
117
  */
110
118
  fillCells: boolean;
119
+ /**
120
+ * Calendar internal translation strings
121
+ */
122
+ protected dateT: TranslateDirective;
123
+ protected dateTPromise: TranslatePromise;
111
124
  /**
112
125
  * Used for translations
113
126
  */
114
127
  protected t: TranslateDirective;
115
- protected tPromise: TranslatePromise;
116
128
  /**
117
129
  * Used for internal navigation between render views
118
130
  */
119
- private renderView;
120
- private isDateAvailable;
131
+ private _renderView;
132
+ private get renderView();
133
+ private set renderView(value);
121
134
  /**
122
- * Get weekday numbers.
123
- * Sort the list based on first day of the week
135
+ * Used for keyboard navigation when trying
136
+ * to restore focus on re-render and control navigation
124
137
  */
125
- private get weekdaysNames();
138
+ private _activeCellIndex;
139
+ private get activeCellIndex();
140
+ private set activeCellIndex(value);
126
141
  /**
127
- * Get localised month names from January to December
142
+ * Silently reset cell index without calling request update
143
+ * @returns {void}
128
144
  */
129
- private get monthsNames();
145
+ private resetActiveCellIndex;
146
+ private navigationGrid;
147
+ /**
148
+ * Connected to role. If false, the values are not announced in the screen reader
149
+ */
150
+ private announceValues;
151
+ /**
152
+ * Get an active element
153
+ */
154
+ private get activeElement();
155
+ /**
156
+ * Get selectable date button element by index
157
+ * @param index Cell index
158
+ * @returns button HTML date button element or null
159
+ */
160
+ private getDateButtonByIndex;
161
+ /**
162
+ * Get active date button element
163
+ * @returns button HTML date button element or null
164
+ */
165
+ private get activeDateButton();
166
+ /**
167
+ * Return true if passed target is HTML
168
+ * date button element that can be selected
169
+ * @param target Target to check
170
+ * @returns isDateButtonElement
171
+ */
172
+ private isDateButton;
173
+ private isDateAvailable;
174
+ static get observedAttributes(): string[];
175
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
130
176
  /**
131
177
  * Perform asynchronous update
132
178
  * @returns promise
@@ -138,6 +184,12 @@ export declare class Calendar extends ControlElement implements MultiValue {
138
184
  * @returns {void}
139
185
  */
140
186
  protected update(changedProperties: PropertyValues): void;
187
+ /**
188
+ * Called after render life-cycle finished
189
+ * @param changedProperties Properties which have changed
190
+ * @return {void}
191
+ */
192
+ protected updated(changedProperties: PropertyValues): void;
141
193
  /**
142
194
  * Run when an element has been first updated
143
195
  * @param changedProperties properties that was changed on first update
@@ -196,21 +248,30 @@ export declare class Calendar extends ControlElement implements MultiValue {
196
248
  * @returns cell selection model
197
249
  */
198
250
  private getCellSelection;
251
+ /**
252
+ * Set navigation map based on rows
253
+ * @param rows A collection of rows with cells
254
+ * @returns {void}
255
+ */
256
+ private setNavigationMap;
199
257
  /**
200
258
  * Run when next button is tapped.
201
259
  * Change current view to next view
260
+ * @param event Next view tap event
202
261
  * @returns {void}
203
262
  */
204
263
  private onNextTap;
205
264
  /**
206
265
  * Run when previous button is tapped.
207
266
  * Change current view to previous view
267
+ * @param event Previous view tap event
208
268
  * @returns {void}
209
269
  */
210
270
  private onPreviousTap;
211
271
  /**
212
272
  * Run when change view button is tapped.
213
273
  * Switch between views
274
+ * @param event Render view tap event
214
275
  * @returns {void}
215
276
  */
216
277
  private onRenderViewTap;
@@ -219,7 +280,7 @@ export declare class Calendar extends ControlElement implements MultiValue {
219
280
  * @param event Keyboard event
220
281
  * @returns {void}
221
282
  */
222
- private onTableKeyDown;
283
+ private onKeyDown;
223
284
  /**
224
285
  * Run when tap event happens ot table.
225
286
  * Select the values or switch the view
@@ -227,6 +288,22 @@ export declare class Calendar extends ControlElement implements MultiValue {
227
288
  * @returns {void}
228
289
  */
229
290
  private onTableTap;
291
+ /**
292
+ * Navigate over the grid
293
+ * @param key Navigation direction
294
+ * @returns navigation promise
295
+ */
296
+ private onNavigation;
297
+ /**
298
+ * Navigate to the next view
299
+ * @returns {void}
300
+ */
301
+ private toNextView;
302
+ /**
303
+ * Navigate to the previous view
304
+ * @returns {void}
305
+ */
306
+ private toPreviousView;
230
307
  /**
231
308
  * Run when tap event happened on DAY view and the cell has the values
232
309
  * Try to select/deselect cell value
@@ -259,13 +336,11 @@ export declare class Calendar extends ControlElement implements MultiValue {
259
336
  */
260
337
  private get formattedViewRender();
261
338
  /**
262
- * Render cell content template.
263
- * If the cell is selectable (aka has value) add selection part
264
- * @param text Text to render
265
- * @param selectable True if cell may be selected
266
- * @returns template result
339
+ * Set an active state of the cell based
340
+ * @param rows A collection of rows with cells
341
+ * @returns {void}
267
342
  */
268
- private renderContentBox;
343
+ private setActiveCell;
269
344
  /**
270
345
  * Get year view template
271
346
  */
@@ -286,6 +361,12 @@ export declare class Calendar extends ControlElement implements MultiValue {
286
361
  * Render a view based on the current render view
287
362
  */
288
363
  private get viewRender();
364
+ /**
365
+ * Get cell translate label key based on selected state
366
+ * @param cell Cell
367
+ * @returns key Translate label key
368
+ */
369
+ private getCellLabelKey;
289
370
  /**
290
371
  * Render cell template. Cell can be a day, month or year
291
372
  * @param cell Cell object
@@ -298,6 +379,16 @@ export declare class Calendar extends ControlElement implements MultiValue {
298
379
  * @returns template result
299
380
  */
300
381
  private renderRows;
382
+ /**
383
+ * Render button navigation template
384
+ * @returns template result
385
+ */
386
+ private get buttonNavigationTemplate();
387
+ /**
388
+ * A template used to notify currently selected value for screen readers
389
+ * @returns template result
390
+ */
391
+ private get selectionTemplate();
301
392
  /**
302
393
  * A `TemplateResult` that will be used
303
394
  * to render the updated internal template.