@refinitiv-ui/elements 5.6.0 → 5.8.2-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 +51 -0
- package/lib/accordion/custom-elements.md +18 -0
- package/lib/appstate-bar/custom-elements.md +22 -0
- package/lib/autosuggest/custom-elements.json +24 -4
- package/lib/autosuggest/custom-elements.md +54 -0
- package/lib/autosuggest/index.d.ts +4 -0
- package/lib/autosuggest/index.js +4 -0
- package/lib/button/custom-elements.json +2 -2
- package/lib/button/custom-elements.md +23 -0
- package/lib/button-bar/custom-elements.md +9 -0
- package/lib/calendar/custom-elements.json +8 -6
- package/lib/calendar/custom-elements.md +35 -0
- package/lib/calendar/index.d.ts +2 -0
- package/lib/calendar/index.js +2 -0
- package/lib/canvas/custom-elements.json +7 -5
- package/lib/canvas/custom-elements.md +27 -0
- 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 +24 -0
- 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 +16 -0
- package/lib/checkbox/custom-elements.json +12 -8
- package/lib/checkbox/custom-elements.md +18 -0
- 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 +28 -0
- 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/collapse/custom-elements.md +27 -0
- package/lib/color-dialog/custom-elements.json +29 -16
- package/lib/color-dialog/custom-elements.md +39 -0
- package/lib/color-dialog/index.d.ts +8 -8
- package/lib/color-dialog/index.js +8 -8
- package/lib/combo-box/custom-elements.json +28 -16
- package/lib/combo-box/custom-elements.md +35 -0
- 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 +11 -0
- package/lib/counter/index.d.ts +2 -0
- package/lib/counter/index.js +2 -0
- package/lib/datetime-picker/custom-elements.json +52 -23
- package/lib/datetime-picker/custom-elements.md +57 -0
- package/lib/datetime-picker/index.d.ts +15 -4
- package/lib/datetime-picker/index.js +15 -4
- package/lib/dialog/custom-elements.json +34 -12
- package/lib/dialog/custom-elements.md +47 -0
- package/lib/dialog/index.d.ts +7 -10
- package/lib/dialog/index.js +7 -10
- package/lib/email-field/custom-elements.json +81 -94
- package/lib/email-field/custom-elements.md +37 -0
- package/lib/email-field/index.d.ts +43 -115
- package/lib/email-field/index.js +44 -244
- package/lib/flag/custom-elements.md +10 -0
- package/lib/flag/index.d.ts +2 -0
- package/lib/flag/index.js +2 -0
- package/lib/header/custom-elements.md +18 -0
- package/lib/heatmap/custom-elements.md +26 -0
- package/lib/icon/custom-elements.md +8 -0
- 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 +31 -0
- package/lib/interactive-chart/index.d.ts +5 -2
- package/lib/interactive-chart/index.js +5 -2
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +29 -0
- package/lib/item/index.d.ts +11 -2
- package/lib/item/index.js +25 -4
- package/lib/label/custom-elements.md +11 -0
- package/lib/layout/custom-elements.md +26 -0
- package/lib/led-gauge/custom-elements.json +4 -4
- package/lib/led-gauge/custom-elements.md +17 -0
- 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 +32 -0
- 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/loader/custom-elements.md +5 -0
- package/lib/multi-input/custom-elements.json +7 -6
- package/lib/multi-input/custom-elements.md +43 -0
- package/lib/multi-input/index.d.ts +4 -0
- package/lib/multi-input/index.js +4 -0
- package/lib/notification/custom-elements.md +26 -0
- package/lib/number-field/custom-elements.json +99 -54
- package/lib/number-field/custom-elements.md +42 -0
- package/lib/number-field/index.d.ts +92 -47
- package/lib/number-field/index.js +113 -80
- package/lib/overlay/custom-elements.json +26 -13
- package/lib/overlay/custom-elements.md +54 -0
- package/lib/overlay/elements/overlay.d.ts +5 -0
- package/lib/overlay-menu/custom-elements.json +70 -20
- package/lib/overlay-menu/custom-elements.md +44 -0
- package/lib/overlay-menu/index.d.ts +13 -11
- package/lib/overlay-menu/index.js +13 -11
- package/lib/pagination/custom-elements.md +27 -0
- package/lib/panel/custom-elements.md +11 -0
- package/lib/password-field/custom-elements.json +62 -67
- package/lib/password-field/custom-elements.md +39 -0
- package/lib/password-field/index.d.ts +42 -94
- package/lib/password-field/index.js +48 -194
- package/lib/pill/custom-elements.json +8 -6
- package/lib/pill/custom-elements.md +22 -0
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +1 -1
- package/lib/progress-bar/custom-elements.md +18 -0
- package/lib/radio-button/custom-elements.json +8 -6
- package/lib/radio-button/custom-elements.md +19 -0
- package/lib/radio-button/index.d.ts +6 -5
- package/lib/radio-button/index.js +5 -4
- package/lib/rating/custom-elements.md +17 -0
- package/lib/search-field/custom-elements.json +70 -74
- package/lib/search-field/custom-elements.md +41 -0
- package/lib/search-field/index.d.ts +43 -100
- package/lib/search-field/index.js +46 -215
- package/lib/select/custom-elements.json +5 -4
- package/lib/select/custom-elements.md +24 -0
- 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 +21 -0
- package/lib/sidebar-layout/index.d.ts +2 -1
- package/lib/slider/custom-elements.json +4 -4
- package/lib/slider/custom-elements.md +28 -0
- 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 +16 -0
- 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 +17 -0
- package/lib/swing-gauge/index.d.ts +3 -1
- package/lib/swing-gauge/index.js +3 -1
- package/lib/tab/custom-elements.json +2 -2
- package/lib/tab/custom-elements.md +22 -0
- package/lib/tab-bar/custom-elements.md +11 -0
- package/lib/text-field/custom-elements.json +78 -89
- package/lib/text-field/custom-elements.md +35 -0
- package/lib/text-field/index.d.ts +50 -92
- package/lib/text-field/index.js +81 -230
- package/lib/time-picker/custom-elements.json +4 -4
- package/lib/time-picker/custom-elements.md +28 -0
- package/lib/time-picker/index.d.ts +3 -0
- package/lib/time-picker/index.js +3 -0
- package/lib/toggle/custom-elements.json +8 -6
- package/lib/toggle/custom-elements.md +19 -0
- package/lib/toggle/index.d.ts +2 -1
- package/lib/toggle/index.js +1 -0
- package/lib/tooltip/custom-elements.md +14 -0
- package/lib/tornado-chart/custom-elements.md +18 -0
- package/lib/tree/custom-elements.json +4 -3
- package/lib/tree/custom-elements.md +32 -0
- package/lib/tree/elements/tree.d.ts +1 -0
- package/lib/tree/elements/tree.js +1 -0
- package/lib/tree/managers/tree-manager.d.ts +20 -2
- package/lib/tree/managers/tree-manager.js +55 -28
- 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 +10 -6
- package/lib/tree-select/custom-elements.md +26 -0
- 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 +293 -12
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ef-multi-input
|
|
2
|
+
|
|
3
|
+
An input control component to display a selection of pills
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|---------------------|---------------|--------------------------|---------|------------------------------------------------|
|
|
9
|
+
| `data` | | `MultiInputData \| null` | null | The data object, used to render the list. |
|
|
10
|
+
| `disabled` | `disabled` | `boolean` | false | Set disabled state |
|
|
11
|
+
| `error` | `error` | `boolean` | false | Set state to error |
|
|
12
|
+
| `icon` | `icon` | `string` | "" | Specify icon to display inside input box |
|
|
13
|
+
| `maxLength` | `maxlength` | `number \| null` | null | Set character max limit |
|
|
14
|
+
| `minLength` | `minlength` | `number \| null` | null | Set character min limit |
|
|
15
|
+
| `pillsOnly` | `pills-only` | `boolean` | false | Hide text input box |
|
|
16
|
+
| `placeholder` | `placeholder` | `string` | "" | Placeholder text to display in input box |
|
|
17
|
+
| `readonly` | `readonly` | `boolean` | false | Hides text field and clear icon from all pills |
|
|
18
|
+
| `selectionEnd` | | `number \| null` | null | Selection end index |
|
|
19
|
+
| `selectionStart` | | `number \| null` | null | Selection start index |
|
|
20
|
+
| `value` | `value` | `string` | "" | Current value of text field |
|
|
21
|
+
| `values (readonly)` | | `string[]` | [] | Array of item's values ( readonly ) |
|
|
22
|
+
| `warning` | `warning` | `boolean` | false | Set state to warning |
|
|
23
|
+
|
|
24
|
+
## Methods
|
|
25
|
+
|
|
26
|
+
| Method | Type | Description |
|
|
27
|
+
|---------------------|--------------------------------------------------|--------------------------------------------------|
|
|
28
|
+
| `add` | `(item: any): MultiInputDataItem \| null` | Add a new item to the input. Return newly added object or null if added invalid object.<br /><br />**item**: to add. Object must have at least value and label |
|
|
29
|
+
| `removeByIndex` | `(index: number): MultiInputDataItem \| null` | Removes pill by index. Returns item that removed or null if list was empty<br /><br />**index**: of pill to be removed |
|
|
30
|
+
| `removeByValue` | `(value: string): string` | Removes the item by the value and returns array of removed items<br /><br />**value**: Value of item to remove |
|
|
31
|
+
| `removeLastItem` | `(): MultiInputDataItem \| null` | Removes last item. Returns item that removed or null if list was empty |
|
|
32
|
+
| `select` | `(): void` | Select the contents of input |
|
|
33
|
+
| `setSelectionRange` | `(startSelection: number, endSelection: number): void` | Set the selection range<br /><br />**startSelection**: Start of selection<br />**endSelection**: End of the selection |
|
|
34
|
+
|
|
35
|
+
## Events
|
|
36
|
+
|
|
37
|
+
| Event | Description |
|
|
38
|
+
|-----------------|--------------------------------------------------|
|
|
39
|
+
| `error-changed` | Dispatched when error state changes.<br />Property `detail.error` is error from validation. |
|
|
40
|
+
| `item-added` | Fired when new pill is added.<br />Property `detail.item` is new added pill.<br />Property `detail.items` is new list of all pills. |
|
|
41
|
+
| `item-error` | Fired when item that attempt to add is invalid.<br />Property `detail.item` is item with an error.<br />Property `detail.items` a current list of pills. |
|
|
42
|
+
| `item-removed` | Fired when item is removed.<br />Property `detail.item` is pill that removed.<br />Property `detail.items` is new list of all pills. |
|
|
43
|
+
| `value-changed` | Fired when new value of text field is changed.<br />Property `detail.value` will be the new value. |
|
|
@@ -52,6 +52,7 @@ export declare class MultiInput extends ControlElement implements MultiValue {
|
|
|
52
52
|
* Array of item's values ( readonly )
|
|
53
53
|
* @readonly
|
|
54
54
|
* @type {string[]}
|
|
55
|
+
* @default []
|
|
55
56
|
*/
|
|
56
57
|
get values(): string[];
|
|
57
58
|
/**
|
|
@@ -84,17 +85,20 @@ export declare class MultiInput extends ControlElement implements MultiValue {
|
|
|
84
85
|
minLength: number | null;
|
|
85
86
|
/**
|
|
86
87
|
* Selection start index
|
|
88
|
+
* @default null
|
|
87
89
|
*/
|
|
88
90
|
get selectionStart(): number | null;
|
|
89
91
|
set selectionStart(index: SelectionIndex);
|
|
90
92
|
/**
|
|
91
93
|
* Selection end index
|
|
94
|
+
* @default null
|
|
92
95
|
*/
|
|
93
96
|
get selectionEnd(): number | null;
|
|
94
97
|
set selectionEnd(index: SelectionIndex);
|
|
95
98
|
/**
|
|
96
99
|
* The data object, used to render the list.
|
|
97
100
|
* @type {MultiInputData | null}
|
|
101
|
+
* @default null
|
|
98
102
|
*/
|
|
99
103
|
get data(): MultiInputData | null;
|
|
100
104
|
set data(value: MultiInputData | null);
|
package/lib/multi-input/index.js
CHANGED
|
@@ -145,12 +145,14 @@ let MultiInput = class MultiInput extends ControlElement {
|
|
|
145
145
|
* Array of item's values ( readonly )
|
|
146
146
|
* @readonly
|
|
147
147
|
* @type {string[]}
|
|
148
|
+
* @default []
|
|
148
149
|
*/
|
|
149
150
|
get values() {
|
|
150
151
|
return this.composer.queryItems(() => true).map(({ value }) => value);
|
|
151
152
|
}
|
|
152
153
|
/**
|
|
153
154
|
* Selection start index
|
|
155
|
+
* @default null
|
|
154
156
|
*/
|
|
155
157
|
get selectionStart() {
|
|
156
158
|
if (this.search) {
|
|
@@ -165,6 +167,7 @@ let MultiInput = class MultiInput extends ControlElement {
|
|
|
165
167
|
}
|
|
166
168
|
/**
|
|
167
169
|
* Selection end index
|
|
170
|
+
* @default null
|
|
168
171
|
*/
|
|
169
172
|
get selectionEnd() {
|
|
170
173
|
if (this.search) {
|
|
@@ -180,6 +183,7 @@ let MultiInput = class MultiInput extends ControlElement {
|
|
|
180
183
|
/**
|
|
181
184
|
* The data object, used to render the list.
|
|
182
185
|
* @type {MultiInputData | null}
|
|
186
|
+
* @default null
|
|
183
187
|
*/
|
|
184
188
|
get data() {
|
|
185
189
|
return this._data;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ef-notification
|
|
2
|
+
|
|
3
|
+
Used to show informative content when something happens in the application
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|-------------|-------------|-----------|---------|------------------------------------------|
|
|
9
|
+
| `collapsed` | `collapsed` | `boolean` | false | Toggles the collapsed state. |
|
|
10
|
+
| `confirm` | `confirm` | `boolean` | false | Notification style: Confirm |
|
|
11
|
+
| `error` | `error` | `boolean` | false | Notification style: Error |
|
|
12
|
+
| `message` | `message` | `string` | "" | The message to show in the notification. |
|
|
13
|
+
| `warning` | `warning` | `boolean` | false | Notification style: Warning |
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
| Method | Type | Description |
|
|
18
|
+
|-----------|------------|--------------------------------------------------|
|
|
19
|
+
| `dismiss` | `(): void` | Dismisses the notification, firing a `dismiss` event and collapsing the notification. |
|
|
20
|
+
|
|
21
|
+
## Events
|
|
22
|
+
|
|
23
|
+
| Event | Description |
|
|
24
|
+
|-------------|-------------------------------------------|
|
|
25
|
+
| `collapsed` | Dispatched when notification is collapsed |
|
|
26
|
+
| `dismiss` | Dispatched when notification is dismissed |
|
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
"tags": [
|
|
4
4
|
{
|
|
5
5
|
"name": "ef-number-field",
|
|
6
|
-
"description": "Form control element for numbers",
|
|
6
|
+
"description": "Form control element for numbers.",
|
|
7
7
|
"attributes": [
|
|
8
|
-
{
|
|
9
|
-
"name": "placeholder",
|
|
10
|
-
"description": "Set placeholder text",
|
|
11
|
-
"type": "string | null"
|
|
12
|
-
},
|
|
13
8
|
{
|
|
14
9
|
"name": "no-spinner",
|
|
15
10
|
"description": "Set spinner's visibility",
|
|
@@ -32,26 +27,20 @@
|
|
|
32
27
|
"type": "string | null"
|
|
33
28
|
},
|
|
34
29
|
{
|
|
35
|
-
"name": "
|
|
36
|
-
"description": "Set state
|
|
30
|
+
"name": "disabled",
|
|
31
|
+
"description": "Set disabled state",
|
|
37
32
|
"type": "boolean",
|
|
38
33
|
"default": "false"
|
|
39
34
|
},
|
|
40
35
|
{
|
|
41
36
|
"name": "error",
|
|
42
|
-
"description": "Set state
|
|
37
|
+
"description": "Set error state",
|
|
43
38
|
"type": "boolean",
|
|
44
39
|
"default": "false"
|
|
45
40
|
},
|
|
46
41
|
{
|
|
47
|
-
"name": "
|
|
48
|
-
"description": "Set
|
|
49
|
-
"type": "boolean",
|
|
50
|
-
"default": "false"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "value",
|
|
54
|
-
"description": "The value of the number entered into the input.",
|
|
42
|
+
"name": "placeholder",
|
|
43
|
+
"description": "Set placeholder text",
|
|
55
44
|
"type": "string",
|
|
56
45
|
"default": "\"\""
|
|
57
46
|
},
|
|
@@ -59,22 +48,28 @@
|
|
|
59
48
|
"name": "readonly",
|
|
60
49
|
"description": "Set readonly state",
|
|
61
50
|
"type": "boolean",
|
|
62
|
-
"default": "
|
|
51
|
+
"default": "false"
|
|
63
52
|
},
|
|
64
53
|
{
|
|
65
|
-
"name": "
|
|
66
|
-
"description": "
|
|
54
|
+
"name": "transparent",
|
|
55
|
+
"description": "Disables all other states and border/background styles.",
|
|
67
56
|
"type": "boolean",
|
|
68
|
-
"default": "
|
|
57
|
+
"default": "false"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "warning",
|
|
61
|
+
"description": "Set warning state",
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"default": "false"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "value",
|
|
67
|
+
"description": "The value of the number entered into the input.",
|
|
68
|
+
"type": "string",
|
|
69
|
+
"default": "\"\""
|
|
69
70
|
}
|
|
70
71
|
],
|
|
71
72
|
"properties": [
|
|
72
|
-
{
|
|
73
|
-
"name": "placeholder",
|
|
74
|
-
"attribute": "placeholder",
|
|
75
|
-
"description": "Set placeholder text",
|
|
76
|
-
"type": "string | null"
|
|
77
|
-
},
|
|
78
73
|
{
|
|
79
74
|
"name": "noSpinner",
|
|
80
75
|
"attribute": "no-spinner",
|
|
@@ -101,35 +96,40 @@
|
|
|
101
96
|
"type": "string | null"
|
|
102
97
|
},
|
|
103
98
|
{
|
|
104
|
-
"name": "
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"type": "boolean",
|
|
108
|
-
"default": "false"
|
|
99
|
+
"name": "valueAsNumber (readonly)",
|
|
100
|
+
"description": "Returns the value of the element, interpreted as double number",
|
|
101
|
+
"type": "number"
|
|
109
102
|
},
|
|
110
103
|
{
|
|
111
|
-
"name": "
|
|
112
|
-
"
|
|
113
|
-
"description": "Set state to error",
|
|
114
|
-
"type": "boolean",
|
|
115
|
-
"default": "false"
|
|
104
|
+
"name": "selectionStart",
|
|
105
|
+
"type": "number | null"
|
|
116
106
|
},
|
|
117
107
|
{
|
|
118
|
-
"name": "
|
|
119
|
-
"
|
|
120
|
-
|
|
108
|
+
"name": "selectionEnd",
|
|
109
|
+
"type": "number | null"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "selectionDirection",
|
|
113
|
+
"type": "\"forward\" | \"backward\" | \"none\" | null"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "disabled",
|
|
117
|
+
"attribute": "disabled",
|
|
118
|
+
"description": "Set disabled state",
|
|
121
119
|
"type": "boolean",
|
|
122
120
|
"default": "false"
|
|
123
121
|
},
|
|
124
122
|
{
|
|
125
|
-
"name": "
|
|
126
|
-
"
|
|
127
|
-
"
|
|
123
|
+
"name": "error",
|
|
124
|
+
"attribute": "error",
|
|
125
|
+
"description": "Set error state",
|
|
126
|
+
"type": "boolean",
|
|
127
|
+
"default": "false"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
|
-
"name": "
|
|
131
|
-
"attribute": "
|
|
132
|
-
"description": "
|
|
130
|
+
"name": "placeholder",
|
|
131
|
+
"attribute": "placeholder",
|
|
132
|
+
"description": "Set placeholder text",
|
|
133
133
|
"type": "string",
|
|
134
134
|
"default": "\"\""
|
|
135
135
|
},
|
|
@@ -138,14 +138,28 @@
|
|
|
138
138
|
"attribute": "readonly",
|
|
139
139
|
"description": "Set readonly state",
|
|
140
140
|
"type": "boolean",
|
|
141
|
-
"default": "
|
|
141
|
+
"default": "false"
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
|
-
"name": "
|
|
145
|
-
"attribute": "
|
|
146
|
-
"description": "
|
|
144
|
+
"name": "transparent",
|
|
145
|
+
"attribute": "transparent",
|
|
146
|
+
"description": "Disables all other states and border/background styles.",
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"default": "false"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "warning",
|
|
152
|
+
"attribute": "warning",
|
|
153
|
+
"description": "Set warning state",
|
|
147
154
|
"type": "boolean",
|
|
148
|
-
"default": "
|
|
155
|
+
"default": "false"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "value",
|
|
159
|
+
"attribute": "value",
|
|
160
|
+
"description": "The value of the number entered into the input.",
|
|
161
|
+
"type": "string",
|
|
162
|
+
"default": "\"\""
|
|
149
163
|
}
|
|
150
164
|
],
|
|
151
165
|
"events": [
|
|
@@ -159,6 +173,26 @@
|
|
|
159
173
|
}
|
|
160
174
|
],
|
|
161
175
|
"methods": [
|
|
176
|
+
{
|
|
177
|
+
"name": "onInputInput",
|
|
178
|
+
"description": "",
|
|
179
|
+
"params": [
|
|
180
|
+
{
|
|
181
|
+
"name": "event",
|
|
182
|
+
"type": "InputEvent"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "onInputChange",
|
|
188
|
+
"description": "",
|
|
189
|
+
"params": [
|
|
190
|
+
{
|
|
191
|
+
"name": "event",
|
|
192
|
+
"type": "InputEvent"
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
},
|
|
162
196
|
{
|
|
163
197
|
"name": "stepUp",
|
|
164
198
|
"description": "Increases the input value by amount of step",
|
|
@@ -190,9 +224,20 @@
|
|
|
190
224
|
"params": []
|
|
191
225
|
},
|
|
192
226
|
{
|
|
193
|
-
"name": "
|
|
194
|
-
"description": "
|
|
195
|
-
"params": [
|
|
227
|
+
"name": "setSelectionRange",
|
|
228
|
+
"description": "",
|
|
229
|
+
"params": [
|
|
230
|
+
{
|
|
231
|
+
"name": "startSelection"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "endSelection"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"name": "selectionDirection",
|
|
238
|
+
"type": "SelectionDirection"
|
|
239
|
+
}
|
|
240
|
+
]
|
|
196
241
|
}
|
|
197
242
|
]
|
|
198
243
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# ef-number-field
|
|
2
|
+
|
|
3
|
+
Form control element for numbers.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|----------------------------|---------------|---------------------------------------------|---------|--------------------------------------------------|
|
|
9
|
+
| `disabled` | `disabled` | `boolean` | false | Set disabled state |
|
|
10
|
+
| `error` | `error` | `boolean` | false | Set error state |
|
|
11
|
+
| `max` | `max` | `string \| null` | null | Set maximum value.<br />This value must be greater than or equal to the value of the `min` attribute |
|
|
12
|
+
| `min` | `min` | `string \| null` | null | Set minimum value.<br />This value must be less than or equal to the value of the `max` attribute |
|
|
13
|
+
| `noSpinner` | `no-spinner` | `boolean` | false | Set spinner's visibility |
|
|
14
|
+
| `placeholder` | `placeholder` | `string` | "" | Set placeholder text |
|
|
15
|
+
| `readonly` | `readonly` | `boolean` | false | Set readonly state |
|
|
16
|
+
| `selectionDirection` | | `"forward" \| "backward" \| "none" \| null` | | |
|
|
17
|
+
| `selectionEnd` | | `number \| null` | | |
|
|
18
|
+
| `selectionStart` | | `number \| null` | | |
|
|
19
|
+
| `step` | `step` | `string \| null` | null | Set step value |
|
|
20
|
+
| `transparent` | `transparent` | `boolean` | false | Disables all other states and border/background styles. |
|
|
21
|
+
| `value` | `value` | `string` | "" | The value of the number entered into the input. |
|
|
22
|
+
| `valueAsNumber (readonly)` | | `number` | | Returns the value of the element, interpreted as double number |
|
|
23
|
+
| `warning` | `warning` | `boolean` | false | Set warning state |
|
|
24
|
+
|
|
25
|
+
## Methods
|
|
26
|
+
|
|
27
|
+
| Method | Type | Description |
|
|
28
|
+
|---------------------|--------------------------------------------------|--------------------------------------------------|
|
|
29
|
+
| `checkValidity` | `(): boolean` | Returns true if an input element contains valid data. |
|
|
30
|
+
| `onInputChange` | `(event: any): void` | |
|
|
31
|
+
| `onInputInput` | `(event: any): void` | |
|
|
32
|
+
| `reportValidity` | `(): boolean` | Validate input. Mark as error if input is invalid |
|
|
33
|
+
| `setSelectionRange` | `(startSelection: number \| null, endSelection: number \| null, selectionDirection?: "forward" \| "backward" \| "none" \| undefined): void` | |
|
|
34
|
+
| `stepDown` | `(stepIncrement?: number \| undefined): void` | Decreases the input value by amount of step<br /><br />**stepIncrement**: The stepIncrement parameter is a numeric value. If no parameter is passed, stepIncrement defaults to 1. |
|
|
35
|
+
| `stepUp` | `(stepIncrement?: number \| undefined): void` | Increases the input value by amount of step<br /><br />**stepIncrement**: The stepIncrement parameter is a numeric value. If no parameter is passed, stepIncrement defaults to 1. |
|
|
36
|
+
|
|
37
|
+
## Events
|
|
38
|
+
|
|
39
|
+
| Event | Description |
|
|
40
|
+
|-----------------|-------------------------------------|
|
|
41
|
+
| `error-changed` | Dispatched when error state changes |
|
|
42
|
+
| `value-changed` | Dispatched when value changes |
|
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { FormFieldElement, CSSResultGroup, TemplateResult, PropertyValues, TapEvent } from '@refinitiv-ui/core';
|
|
3
|
+
import { TemplateMap } from '@refinitiv-ui/core/lib/directives/template-map.js';
|
|
3
4
|
import '../icon/index.js';
|
|
5
|
+
declare type SelectionDirection = 'forward' | 'backward' | 'none';
|
|
6
|
+
declare enum Direction {
|
|
7
|
+
Up = 1,
|
|
8
|
+
Down = -1
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
|
-
* Form control element for numbers
|
|
11
|
+
* Form control element for numbers.
|
|
6
12
|
*
|
|
7
13
|
* @fires value-changed - Dispatched when value changes
|
|
8
14
|
* @fires error-changed - Dispatched when error state changes
|
|
9
15
|
*
|
|
10
|
-
* @attr {
|
|
11
|
-
* @prop {
|
|
16
|
+
* @attr {boolean} disabled - Set disabled state
|
|
17
|
+
* @prop {boolean} [disabled=false] - Set disabled state
|
|
18
|
+
*
|
|
19
|
+
* @attr {boolean} error - Set error state
|
|
20
|
+
* @prop {boolean} [error=false] - Set error state
|
|
21
|
+
*
|
|
22
|
+
* @attr {string} placeholder - Set placeholder text
|
|
23
|
+
* @prop {string} [placeholder=""] - Set placeholder text
|
|
12
24
|
*
|
|
13
25
|
* @attr {boolean} readonly - Set readonly state
|
|
14
26
|
* @prop {boolean} [readonly=false] - Set readonly state
|
|
15
27
|
*
|
|
16
|
-
* @attr {boolean}
|
|
17
|
-
* @prop {boolean} [
|
|
28
|
+
* @attr {boolean} transparent - Disables all other states and border/background styles.
|
|
29
|
+
* @prop {boolean} [transparent=false] - Disables all other states and border/background styles.
|
|
30
|
+
*
|
|
31
|
+
* @attr {boolean} warning - Set warning state
|
|
32
|
+
* @prop {boolean} [warning=false] - Set warning state
|
|
33
|
+
*
|
|
34
|
+
* @attr {string} value - Input's value
|
|
35
|
+
* @prop {string} [value=""] - Input's value
|
|
18
36
|
*/
|
|
19
|
-
export declare class NumberField extends
|
|
37
|
+
export declare class NumberField extends FormFieldElement {
|
|
20
38
|
/**
|
|
21
39
|
* Element version number
|
|
22
40
|
* @returns version number
|
|
@@ -29,10 +47,6 @@ export declare class NumberField extends ControlElement {
|
|
|
29
47
|
* @return CSS template
|
|
30
48
|
*/
|
|
31
49
|
static get styles(): CSSResultGroup;
|
|
32
|
-
/**
|
|
33
|
-
* Set placeholder text
|
|
34
|
-
*/
|
|
35
|
-
placeholder: string | null;
|
|
36
50
|
/**
|
|
37
51
|
* Set spinner's visibility
|
|
38
52
|
*/
|
|
@@ -51,22 +65,11 @@ export declare class NumberField extends ControlElement {
|
|
|
51
65
|
* This value must be greater than or equal to the value of the `min` attribute
|
|
52
66
|
*/
|
|
53
67
|
max: string | null;
|
|
54
|
-
/**
|
|
55
|
-
* Set state to transparent
|
|
56
|
-
*/
|
|
57
|
-
transparent: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Set state to error
|
|
60
|
-
*/
|
|
61
|
-
error: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Set state to warning
|
|
64
|
-
*/
|
|
65
|
-
warning: boolean;
|
|
66
68
|
private interimValueState;
|
|
67
69
|
/**
|
|
68
70
|
* The value of the number entered into the input.
|
|
69
71
|
* @param value number-field value
|
|
72
|
+
* @default -
|
|
70
73
|
*/
|
|
71
74
|
set value(value: string);
|
|
72
75
|
get value(): string;
|
|
@@ -74,10 +77,6 @@ export declare class NumberField extends ControlElement {
|
|
|
74
77
|
* Returns the value of the element, interpreted as double number
|
|
75
78
|
*/
|
|
76
79
|
get valueAsNumber(): number;
|
|
77
|
-
/**
|
|
78
|
-
* Get native input element from shadow root
|
|
79
|
-
*/
|
|
80
|
-
private inputEl;
|
|
81
80
|
/**
|
|
82
81
|
* Get spinner up element
|
|
83
82
|
*/
|
|
@@ -145,47 +144,49 @@ export declare class NumberField extends ControlElement {
|
|
|
145
144
|
* @returns string of input value
|
|
146
145
|
*/
|
|
147
146
|
private get internalValue();
|
|
148
|
-
/**
|
|
149
|
-
* Get native input value
|
|
150
|
-
* @returns string of input value
|
|
151
|
-
*/
|
|
152
|
-
private get inputValue();
|
|
153
|
-
/**
|
|
154
|
-
* Set native input value
|
|
155
|
-
* @param value input's value
|
|
156
|
-
*/
|
|
157
|
-
private set inputValue(value);
|
|
158
147
|
/**
|
|
159
148
|
* Handles key down input event
|
|
160
149
|
* @param event Key down event object
|
|
161
150
|
* @returns {void}
|
|
162
151
|
*/
|
|
163
|
-
|
|
152
|
+
protected onInputKeyDown(event: KeyboardEvent): void;
|
|
164
153
|
/**
|
|
165
154
|
* Run when spinner has been tapped
|
|
166
155
|
* @param event tap event
|
|
167
156
|
* @returns {void}
|
|
168
157
|
*/
|
|
169
|
-
|
|
158
|
+
protected onSpinnerTap(event: TapEvent): void;
|
|
170
159
|
/**
|
|
171
160
|
* Step down or up and notify value change
|
|
172
161
|
* @param direction Up or Down
|
|
173
162
|
* @returns {void}
|
|
174
163
|
*/
|
|
175
|
-
|
|
164
|
+
protected onApplyStep(direction: Direction): void;
|
|
176
165
|
/**
|
|
177
166
|
* Run before input changes
|
|
178
167
|
* Prevent invalid characters
|
|
179
168
|
* @param event before input event
|
|
180
169
|
* @returns {void}
|
|
181
170
|
*/
|
|
182
|
-
|
|
171
|
+
protected onBeforeInputChange(event: InputEvent): void;
|
|
172
|
+
/**
|
|
173
|
+
* Runs on input element `input` event
|
|
174
|
+
* @param event `input` event
|
|
175
|
+
* @returns {void}
|
|
176
|
+
*/
|
|
177
|
+
protected onInputInput(event: InputEvent): void;
|
|
178
|
+
/**
|
|
179
|
+
* Runs on input element `change` event
|
|
180
|
+
* @param event `change` event
|
|
181
|
+
* @returns {void}
|
|
182
|
+
*/
|
|
183
|
+
protected onInputChange(event: InputEvent): void;
|
|
183
184
|
/**
|
|
184
185
|
* Triggers when native input value change with input event or change event
|
|
185
186
|
* @param event Input event
|
|
186
187
|
* @returns {void}
|
|
187
188
|
*/
|
|
188
|
-
|
|
189
|
+
protected onNativeInputChange(event: InputEvent): void;
|
|
189
190
|
/**
|
|
190
191
|
* Stripe characters from input text based on previous input and data
|
|
191
192
|
* @param input The new input to process
|
|
@@ -262,15 +263,58 @@ export declare class NumberField extends ControlElement {
|
|
|
262
263
|
*/
|
|
263
264
|
reportValidity(): boolean;
|
|
264
265
|
/**
|
|
265
|
-
*
|
|
266
|
-
* @
|
|
266
|
+
* @ignore
|
|
267
|
+
* @inheritDoc
|
|
268
|
+
*/
|
|
269
|
+
get selectionStart(): number | null;
|
|
270
|
+
/**
|
|
271
|
+
* @ignore
|
|
272
|
+
* @inheritDoc
|
|
273
|
+
*/
|
|
274
|
+
set selectionStart(index: number | null);
|
|
275
|
+
/**
|
|
276
|
+
* @ignore
|
|
277
|
+
* @inheritDoc
|
|
267
278
|
*/
|
|
268
|
-
|
|
279
|
+
get selectionEnd(): number | null;
|
|
280
|
+
/**
|
|
281
|
+
* @ignore
|
|
282
|
+
* @inheritDoc
|
|
283
|
+
*/
|
|
284
|
+
set selectionEnd(index: number | null);
|
|
285
|
+
/**
|
|
286
|
+
* @ignore
|
|
287
|
+
* @inheritDoc
|
|
288
|
+
*/
|
|
289
|
+
get selectionDirection(): SelectionDirection | null;
|
|
290
|
+
/**
|
|
291
|
+
* @ignore
|
|
292
|
+
* @inheritDoc
|
|
293
|
+
*/
|
|
294
|
+
set selectionDirection(direction: SelectionDirection | null);
|
|
295
|
+
/**
|
|
296
|
+
* @ignore
|
|
297
|
+
* @inheritDoc
|
|
298
|
+
*/
|
|
299
|
+
setSelectionRange(startSelection: number | null, endSelection: number | null, selectionDirection?: SelectionDirection): void;
|
|
269
300
|
/**
|
|
270
301
|
* Renders spinner
|
|
271
302
|
* @returns {TemplateResult} spinner part template
|
|
272
303
|
*/
|
|
273
|
-
|
|
304
|
+
protected renderSpinner(): TemplateResult;
|
|
305
|
+
/**
|
|
306
|
+
* Decorate `<input>` element with common properties extended from form field element:
|
|
307
|
+
* type="text" - always `text`
|
|
308
|
+
* part="input" - always "input", used for styling
|
|
309
|
+
* inputmode="decimal" - show decimals keyboard by default
|
|
310
|
+
* pattern="'^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$'" - numbers only
|
|
311
|
+
* role="spinbutton" - number field is actually a spinner
|
|
312
|
+
* aria-valuenow - current value or 0
|
|
313
|
+
* @keydown - Listener for `keydown` event. Runs `this.onInputKeyDown`
|
|
314
|
+
* @beforeinput - Listener for `beforeinput` event. Runs `this.onBeforeInputChange`
|
|
315
|
+
* @returns template map
|
|
316
|
+
*/
|
|
317
|
+
protected get decorateInputMap(): TemplateMap;
|
|
274
318
|
/**
|
|
275
319
|
* A `TemplateResult` that will be used
|
|
276
320
|
* to render the updated internal template.
|
|
@@ -278,6 +322,7 @@ export declare class NumberField extends ControlElement {
|
|
|
278
322
|
*/
|
|
279
323
|
protected render(): TemplateResult;
|
|
280
324
|
}
|
|
325
|
+
export {};
|
|
281
326
|
|
|
282
327
|
declare global {
|
|
283
328
|
interface HTMLElementTagNameMap {
|
|
@@ -286,7 +331,7 @@ declare global {
|
|
|
286
331
|
|
|
287
332
|
namespace JSX {
|
|
288
333
|
interface IntrinsicElements {
|
|
289
|
-
'ef-number-field': Partial<NumberField> | JSXInterface.
|
|
334
|
+
'ef-number-field': Partial<NumberField> | JSXInterface.HTMLAttributes<NumberField>;
|
|
290
335
|
}
|
|
291
336
|
}
|
|
292
337
|
}
|