@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.
- package/CHANGELOG.md +46 -0
- package/lib/autosuggest/custom-elements.json +14 -4
- package/lib/autosuggest/custom-elements.md +21 -14
- package/lib/autosuggest/index.d.ts +4 -0
- package/lib/autosuggest/index.js +4 -0
- package/lib/calendar/constants.d.ts +4 -0
- package/lib/calendar/constants.js +5 -0
- package/lib/calendar/custom-elements.json +4 -2
- package/lib/calendar/custom-elements.md +2 -2
- package/lib/calendar/index.d.ts +108 -17
- package/lib/calendar/index.js +488 -120
- package/lib/calendar/locales.js +2 -1
- package/lib/calendar/themes/halo/dark/index.js +1 -1
- package/lib/calendar/themes/halo/light/index.js +1 -1
- package/lib/calendar/themes/solar/charcoal/index.js +1 -1
- package/lib/calendar/themes/solar/pearl/index.js +1 -1
- package/lib/calendar/types.d.ts +11 -8
- package/lib/calendar/utils.js +2 -1
- package/lib/canvas/custom-elements.json +7 -5
- package/lib/canvas/custom-elements.md +8 -8
- package/lib/canvas/index.d.ts +1 -0
- package/lib/canvas/index.js +1 -0
- package/lib/card/custom-elements.json +3 -1
- package/lib/card/custom-elements.md +5 -5
- package/lib/card/index.d.ts +2 -0
- package/lib/card/index.js +2 -0
- package/lib/chart/custom-elements.json +1 -1
- package/lib/chart/custom-elements.md +4 -4
- package/lib/checkbox/custom-elements.json +8 -4
- package/lib/checkbox/custom-elements.md +2 -2
- package/lib/checkbox/index.d.ts +3 -1
- package/lib/checkbox/index.js +2 -0
- package/lib/clock/custom-elements.json +8 -4
- package/lib/clock/custom-elements.md +9 -9
- package/lib/clock/index.d.ts +2 -0
- package/lib/clock/index.js +2 -0
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/color-dialog/custom-elements.json +21 -8
- package/lib/color-dialog/custom-elements.md +22 -22
- package/lib/color-dialog/index.d.ts +8 -8
- package/lib/color-dialog/index.js +8 -8
- package/lib/combo-box/custom-elements.json +19 -10
- package/lib/combo-box/custom-elements.md +20 -20
- package/lib/combo-box/index.d.ts +10 -2
- package/lib/combo-box/index.js +10 -1
- package/lib/combo-box/themes/halo/dark/index.js +1 -1
- package/lib/combo-box/themes/halo/light/index.js +1 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
- package/lib/combo-box/themes/solar/pearl/index.js +1 -1
- package/lib/counter/custom-elements.json +8 -4
- package/lib/counter/custom-elements.md +4 -4
- package/lib/counter/index.d.ts +2 -0
- package/lib/counter/index.js +2 -0
- package/lib/datetime-picker/custom-elements.json +48 -19
- package/lib/datetime-picker/custom-elements.md +36 -28
- package/lib/datetime-picker/index.d.ts +15 -4
- package/lib/datetime-picker/index.js +15 -4
- package/lib/dialog/custom-elements.json +30 -8
- package/lib/dialog/custom-elements.md +16 -16
- package/lib/dialog/index.d.ts +7 -10
- package/lib/dialog/index.js +7 -10
- package/lib/email-field/custom-elements.json +80 -93
- package/lib/email-field/custom-elements.md +22 -20
- package/lib/email-field/index.d.ts +43 -115
- package/lib/email-field/index.js +44 -244
- package/lib/flag/custom-elements.md +4 -4
- package/lib/flag/index.d.ts +2 -0
- package/lib/flag/index.js +2 -0
- package/lib/icon/custom-elements.md +4 -4
- package/lib/icon/index.d.ts +2 -0
- package/lib/icon/index.js +2 -0
- package/lib/interactive-chart/custom-elements.json +6 -10
- package/lib/interactive-chart/custom-elements.md +6 -7
- package/lib/interactive-chart/index.d.ts +5 -2
- package/lib/interactive-chart/index.js +5 -2
- package/lib/item/custom-elements.json +8 -6
- package/lib/item/custom-elements.md +14 -14
- package/lib/item/index.d.ts +2 -1
- package/lib/item/index.js +2 -1
- package/lib/led-gauge/custom-elements.json +4 -4
- package/lib/led-gauge/custom-elements.md +2 -2
- package/lib/led-gauge/index.d.ts +1 -0
- package/lib/led-gauge/index.js +1 -0
- package/lib/list/custom-elements.json +18 -5
- package/lib/list/custom-elements.md +12 -10
- package/lib/list/helpers/list-renderer.js +2 -0
- package/lib/list/index.d.ts +19 -2
- package/lib/list/index.js +34 -1
- package/lib/multi-input/custom-elements.json +3 -2
- package/lib/multi-input/custom-elements.md +16 -16
- package/lib/multi-input/index.d.ts +4 -0
- package/lib/multi-input/index.js +4 -0
- package/lib/number-field/custom-elements.json +97 -52
- package/lib/number-field/custom-elements.md +27 -22
- package/lib/number-field/index.d.ts +92 -47
- package/lib/number-field/index.js +113 -80
- package/lib/overlay/custom-elements.json +23 -13
- package/lib/overlay/custom-elements.md +29 -29
- package/lib/overlay/elements/overlay.d.ts +5 -0
- package/lib/overlay-menu/custom-elements.json +66 -14
- package/lib/overlay-menu/custom-elements.md +19 -19
- package/lib/overlay-menu/index.d.ts +13 -11
- package/lib/overlay-menu/index.js +13 -11
- package/lib/password-field/custom-elements.json +62 -67
- package/lib/password-field/custom-elements.md +19 -11
- package/lib/password-field/index.d.ts +42 -94
- package/lib/password-field/index.js +48 -194
- package/lib/pill/custom-elements.json +4 -2
- package/lib/pill/custom-elements.md +1 -1
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +1 -1
- package/lib/radio-button/custom-elements.json +8 -6
- package/lib/radio-button/custom-elements.md +3 -3
- package/lib/radio-button/index.d.ts +6 -5
- package/lib/radio-button/index.js +5 -4
- package/lib/search-field/custom-elements.json +70 -74
- package/lib/search-field/custom-elements.md +24 -16
- package/lib/search-field/index.d.ts +43 -100
- package/lib/search-field/index.js +46 -215
- package/lib/select/custom-elements.json +3 -2
- package/lib/select/custom-elements.md +10 -10
- package/lib/select/index.d.ts +11 -3
- package/lib/select/index.js +65 -26
- package/lib/sidebar-layout/custom-elements.json +2 -6
- package/lib/sidebar-layout/custom-elements.md +5 -6
- package/lib/sidebar-layout/index.d.ts +2 -1
- package/lib/slider/custom-elements.json +2 -2
- package/lib/slider/custom-elements.md +1 -1
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +1 -1
- package/lib/sparkline/custom-elements.json +4 -4
- package/lib/sparkline/custom-elements.md +2 -2
- package/lib/sparkline/index.d.ts +3 -1
- package/lib/sparkline/index.js +2 -0
- package/lib/swing-gauge/custom-elements.json +5 -3
- package/lib/swing-gauge/custom-elements.md +11 -11
- package/lib/swing-gauge/index.d.ts +3 -1
- package/lib/swing-gauge/index.js +3 -1
- package/lib/text-field/custom-elements.json +76 -87
- package/lib/text-field/custom-elements.md +24 -26
- package/lib/text-field/index.d.ts +50 -92
- package/lib/text-field/index.js +81 -230
- package/lib/time-picker/custom-elements.md +3 -3
- package/lib/time-picker/index.d.ts +3 -0
- package/lib/time-picker/index.js +3 -0
- package/lib/toggle/custom-elements.json +4 -2
- package/lib/toggle/custom-elements.md +1 -1
- package/lib/toggle/index.d.ts +2 -1
- package/lib/toggle/index.js +1 -0
- package/lib/tree/custom-elements.json +2 -1
- package/lib/tree/custom-elements.md +1 -1
- package/lib/tree/elements/tree.d.ts +1 -0
- package/lib/tree/elements/tree.js +1 -0
- package/lib/tree/themes/halo/dark/index.js +1 -1
- package/lib/tree/themes/halo/light/index.js +1 -1
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/custom-elements.json +8 -4
- package/lib/tree-select/custom-elements.md +3 -3
- package/lib/tree-select/index.d.ts +5 -3
- package/lib/tree-select/index.js +3 -2
- package/lib/tree-select/themes/halo/dark/index.js +1 -1
- package/lib/tree-select/themes/halo/light/index.js +1 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
- package/lib/tree-select/themes/solar/pearl/index.js +1 -1
- package/lib/version.js +1 -1
- 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": "\"
|
|
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": "\"
|
|
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
|
|
12
|
-
|
|
13
|
-
| `attach` | `attach` | `AutosuggestTargetElement \| string \| null` | null
|
|
14
|
-
| `debounceRate` | `debounce-rate` | `number` | "100"
|
|
15
|
-
| `highlightable` | | `AutosuggestHighlightable` | "itemHighlightable"
|
|
16
|
-
| `htmlRenderer` | `html-renderer` | `boolean` | false
|
|
17
|
-
| `loading` | `loading` | `boolean` | false
|
|
18
|
-
| `moreResults` | `more-results` | `boolean` | false
|
|
19
|
-
| `moreSearchText` | `more-search-text` | `string` | "
|
|
20
|
-
| `opened` | `opened` | `boolean` | false
|
|
21
|
-
| `query` | | `AutosuggestQuery \| null` | null
|
|
22
|
-
| `renderer` | | `AutosuggestRenderer` | "itemRenderer"
|
|
23
|
-
| `requestOnFocus` | `request-on-focus` | `boolean` | false
|
|
24
|
-
| `suggestions` | | `AutosuggestItem[]` | []
|
|
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
|
/**
|
package/lib/autosuggest/index.js
CHANGED
|
@@ -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
|
/**
|
|
@@ -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` |
|
|
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[]` |
|
|
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 |
|
package/lib/calendar/index.d.ts
CHANGED
|
@@ -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
|
|
4
|
+
import { CalendarFilter } from './types';
|
|
5
5
|
import './locales.js';
|
|
6
6
|
import '../button/index.js';
|
|
7
|
-
|
|
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
|
|
120
|
-
private
|
|
131
|
+
private _renderView;
|
|
132
|
+
private get renderView();
|
|
133
|
+
private set renderView(value);
|
|
121
134
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
135
|
+
* Used for keyboard navigation when trying
|
|
136
|
+
* to restore focus on re-render and control navigation
|
|
124
137
|
*/
|
|
125
|
-
private
|
|
138
|
+
private _activeCellIndex;
|
|
139
|
+
private get activeCellIndex();
|
|
140
|
+
private set activeCellIndex(value);
|
|
126
141
|
/**
|
|
127
|
-
*
|
|
142
|
+
* Silently reset cell index without calling request update
|
|
143
|
+
* @returns {void}
|
|
128
144
|
*/
|
|
129
|
-
private
|
|
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
|
|
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
|
-
*
|
|
263
|
-
*
|
|
264
|
-
* @
|
|
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
|
|
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.
|