@refinitiv-ui/elements 7.0.0 → 7.0.2
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 +195 -449
- package/LICENSE +2 -2
- package/README.md +12 -10
- package/cli.mjs +5 -3
- package/lib/accordion/index.d.ts +1 -1
- package/lib/accordion/index.js +4 -7
- package/lib/appstate-bar/index.d.ts +2 -2
- package/lib/appstate-bar/index.js +10 -4
- package/lib/autosuggest/index.d.ts +7 -7
- package/lib/autosuggest/index.js +80 -80
- package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
- package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
- package/lib/button/index.js +7 -10
- package/lib/button-bar/index.d.ts +1 -1
- package/lib/button-bar/index.js +12 -12
- package/lib/calendar/index.d.ts +39 -39
- package/lib/calendar/index.js +156 -123
- package/lib/calendar/utils.js +1 -1
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +2 -4
- package/lib/card/helpers/types.d.ts +2 -2
- package/lib/card/index.d.ts +5 -5
- package/lib/card/index.js +34 -28
- package/lib/chart/elements/chart.d.ts +4 -4
- package/lib/chart/elements/chart.js +39 -33
- package/lib/chart/plugins/doughnut-center-label.d.ts +3 -3
- package/lib/chart/plugins/doughnut-center-label.js +13 -9
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +12 -13
- package/lib/clock/index.d.ts +55 -55
- package/lib/clock/index.js +84 -95
- 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/index.d.ts +1 -1
- package/lib/collapse/index.js +27 -18
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/color-dialog/elements/color-palettes.d.ts +1 -1
- package/lib/color-dialog/elements/color-palettes.js +5 -6
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +1 -1
- package/lib/color-dialog/elements/grayscale-palettes.js +9 -9
- package/lib/color-dialog/elements/palettes.js +5 -4
- package/lib/color-dialog/helpers/value-model.js +7 -9
- package/lib/color-dialog/index.d.ts +6 -6
- package/lib/color-dialog/index.js +53 -37
- package/lib/color-picker/index.d.ts +2 -2
- package/lib/color-picker/index.js +40 -34
- package/lib/combo-box/helpers/filter.d.ts +2 -2
- package/lib/combo-box/helpers/types.d.ts +1 -1
- package/lib/combo-box/index.d.ts +9 -9
- package/lib/combo-box/index.js +61 -55
- package/lib/configuration/elements/configuration.js +2 -2
- package/lib/counter/index.d.ts +4 -4
- package/lib/counter/index.js +9 -7
- package/lib/datetime-field/index.d.ts +4 -5
- package/lib/datetime-field/index.js +32 -23
- package/lib/datetime-field/utils.js +11 -1
- package/lib/datetime-picker/index.d.ts +75 -75
- package/lib/datetime-picker/index.js +150 -131
- package/lib/datetime-picker/locales.js +5 -5
- package/lib/datetime-picker/utils.js +9 -9
- package/lib/dialog/draggable-element.js +1 -2
- package/lib/dialog/index.d.ts +5 -5
- package/lib/dialog/index.js +51 -47
- package/lib/email-field/index.d.ts +1 -1
- package/lib/email-field/index.js +6 -6
- package/lib/events.d.ts +1 -1
- package/lib/flag/index.d.ts +1 -1
- package/lib/flag/index.js +6 -5
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/index.d.ts +1 -1
- package/lib/header/index.js +2 -2
- package/lib/header/themes/halo/dark/index.js +1 -1
- package/lib/header/themes/halo/light/index.js +1 -1
- package/lib/header/themes/solar/charcoal/index.js +1 -1
- package/lib/header/themes/solar/pearl/index.js +1 -1
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +11 -5
- package/lib/heatmap/helpers/track.js +3 -3
- package/lib/heatmap/index.d.ts +9 -9
- package/lib/heatmap/index.js +51 -42
- package/lib/icon/index.d.ts +2 -2
- package/lib/icon/index.js +8 -10
- package/lib/interactive-chart/helpers/types.d.ts +3 -3
- package/lib/interactive-chart/index.d.ts +29 -29
- package/lib/interactive-chart/index.js +69 -55
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +3 -3
- package/lib/item/index.js +24 -20
- package/lib/jsx.d.ts +6 -4
- package/lib/label/index.d.ts +1 -1
- package/lib/label/index.js +10 -7
- package/lib/layout/index.d.ts +7 -7
- package/lib/layout/index.js +7 -7
- package/lib/led-gauge/index.d.ts +1 -1
- package/lib/led-gauge/index.js +10 -10
- package/lib/list/elements/list.d.ts +3 -3
- package/lib/list/elements/list.js +10 -12
- package/lib/list/helpers/renderer.js +2 -2
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/index.d.ts +1 -1
- package/lib/list/renderer.d.ts +7 -7
- package/lib/loader/index.js +7 -8
- package/lib/multi-input/index.d.ts +6 -6
- package/lib/multi-input/index.js +39 -45
- package/lib/notification/elements/notification-tray.d.ts +2 -2
- package/lib/notification/elements/notification-tray.js +3 -3
- package/lib/notification/elements/notification.d.ts +2 -2
- package/lib/notification/elements/notification.js +14 -13
- package/lib/notification/helpers/status.js +1 -1
- package/lib/notification/themes/halo/dark/index.js +1 -1
- package/lib/notification/themes/halo/light/index.js +1 -1
- package/lib/notification/themes/solar/charcoal/index.js +1 -1
- package/lib/notification/themes/solar/pearl/index.js +1 -1
- package/lib/number-field/index.d.ts +5 -6
- package/lib/number-field/index.js +37 -47
- package/lib/overlay/elements/overlay-viewport.d.ts +1 -1
- package/lib/overlay/elements/overlay.d.ts +2 -2
- package/lib/overlay/elements/overlay.js +152 -96
- package/lib/overlay/helpers/types.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.js +2 -2
- package/lib/overlay/managers/close-manager.js +2 -1
- package/lib/overlay/managers/focus-manager.js +23 -13
- package/lib/overlay/managers/interaction-lock-manager.d.ts +4 -4
- package/lib/overlay/managers/interaction-lock-manager.js +33 -25
- package/lib/overlay/managers/viewport-manager.d.ts +2 -2
- package/lib/overlay/managers/viewport-manager.js +3 -2
- package/lib/overlay/managers/zindex-manager.js +4 -2
- package/lib/overlay-menu/helpers/types.d.ts +2 -2
- package/lib/overlay-menu/index.d.ts +1 -1
- package/lib/overlay-menu/index.js +44 -33
- package/lib/overlay-menu/managers/menu-manager.d.ts +10 -10
- package/lib/overlay-menu/managers/menu-manager.js +14 -13
- package/lib/pagination/index.d.ts +4 -4
- package/lib/pagination/index.js +39 -14
- package/lib/panel/index.js +1 -1
- package/lib/password-field/index.d.ts +2 -2
- package/lib/password-field/index.js +3 -3
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +22 -19
- package/lib/progress-bar/index.d.ts +1 -1
- package/lib/progress-bar/index.js +38 -37
- package/lib/radio-button/index.d.ts +2 -2
- package/lib/radio-button/index.js +17 -12
- package/lib/radio-button/radio-button-registry.js +8 -5
- package/lib/rating/index.d.ts +1 -1
- package/lib/rating/index.js +2 -5
- package/lib/rating/utils.d.ts +6 -6
- package/lib/rating/utils.js +6 -6
- package/lib/search-field/index.d.ts +2 -2
- package/lib/search-field/index.js +4 -4
- package/lib/select/index.d.ts +34 -34
- package/lib/select/index.js +68 -81
- package/lib/sidebar-layout/index.d.ts +2 -2
- package/lib/sidebar-layout/index.js +7 -9
- package/lib/slider/index.d.ts +2 -2
- package/lib/slider/index.js +57 -45
- package/lib/slider/utils.d.ts +10 -10
- package/lib/slider/utils.js +10 -10
- package/lib/sparkline/index.d.ts +1 -1
- package/lib/sparkline/index.js +7 -8
- package/lib/swing-gauge/helpers.js +2 -2
- package/lib/swing-gauge/index.d.ts +19 -19
- package/lib/swing-gauge/index.js +91 -81
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +16 -27
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/helpers/animate.js +1 -1
- package/lib/tab-bar/index.d.ts +1 -1
- package/lib/tab-bar/index.js +34 -18
- package/lib/tab-bar/themes/halo/dark/index.js +1 -1
- package/lib/tab-bar/themes/halo/light/index.js +1 -1
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/index.js +34 -31
- package/lib/time-picker/index.d.ts +6 -6
- package/lib/time-picker/index.js +103 -89
- package/lib/toggle/index.d.ts +1 -1
- package/lib/toggle/index.js +4 -3
- package/lib/toggle/themes/halo/dark/index.js +1 -1
- package/lib/toggle/themes/halo/light/index.js +1 -1
- package/lib/toggle/themes/solar/charcoal/index.js +1 -1
- package/lib/toggle/themes/solar/pearl/index.js +1 -1
- package/lib/tooltip/elements/title-tooltip.js +2 -2
- package/lib/tooltip/index.d.ts +27 -27
- package/lib/tooltip/index.js +42 -38
- package/lib/tooltip/managers/tooltip-manager.d.ts +1 -1
- package/lib/tornado-chart/elements/tornado-chart.d.ts +1 -1
- package/lib/tornado-chart/elements/tornado-chart.js +2 -2
- package/lib/tornado-chart/elements/tornado-item.d.ts +2 -2
- package/lib/tornado-chart/elements/tornado-item.js +12 -10
- package/lib/tree/elements/tree-item.d.ts +3 -3
- package/lib/tree/elements/tree-item.js +21 -19
- package/lib/tree/elements/tree.d.ts +1 -1
- package/lib/tree/elements/tree.js +12 -11
- package/lib/tree/helpers/renderer.js +4 -3
- package/lib/tree/index.d.ts +1 -1
- package/lib/tree/managers/tree-manager.d.ts +1 -1
- package/lib/tree/managers/tree-manager.js +17 -18
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/index.d.ts +9 -9
- package/lib/tree-select/index.js +91 -82
- 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 +17 -17
- package/tsconfig.tsbuildinfo +1 -1
package/lib/pill/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { ControlElement, css, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
-
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
6
|
-
import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
|
|
7
5
|
import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
|
|
8
|
-
import {
|
|
6
|
+
import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
|
|
9
7
|
import '../icon/index.js';
|
|
8
|
+
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
9
|
+
import { VERSION } from '../version.js';
|
|
10
10
|
/**
|
|
11
11
|
* A small button style component
|
|
12
12
|
* which is used to show one or multiple selected item.
|
|
@@ -69,15 +69,15 @@ let Pill = class Pill extends ControlElement {
|
|
|
69
69
|
*/
|
|
70
70
|
static get styles() {
|
|
71
71
|
return css `
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
:host {
|
|
73
|
+
display: inline-block;
|
|
74
|
+
position: relative;
|
|
75
|
+
}
|
|
76
|
+
[part='content'] {
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
}
|
|
81
81
|
`;
|
|
82
82
|
}
|
|
83
83
|
firstUpdated(changedProperties) {
|
|
@@ -112,17 +112,20 @@ let Pill = class Pill extends ControlElement {
|
|
|
112
112
|
* @returns {void}
|
|
113
113
|
*/
|
|
114
114
|
onKeyDown(event) {
|
|
115
|
-
if (event.key === 'Delete' &&
|
|
115
|
+
if (event.key === 'Delete' && this.clears && !this.readonly) {
|
|
116
116
|
this.dispatchEvent(new CustomEvent('clear'));
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
get closeTemplate() {
|
|
120
|
-
return this.clears && !this.readonly
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
120
|
+
return this.clears && !this.readonly
|
|
121
|
+
? html `<ef-icon
|
|
122
|
+
${ref(this.closeIconRef)}
|
|
123
|
+
part="close"
|
|
124
|
+
icon="cross"
|
|
125
|
+
aria-hidden="true"
|
|
126
|
+
@tap="${this.clear}"
|
|
127
|
+
></ef-icon>`
|
|
128
|
+
: null;
|
|
126
129
|
}
|
|
127
130
|
/**
|
|
128
131
|
* A `TemplateResult` that will be used
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
4
|
* Data visualisation component,
|
|
5
5
|
* showing a simple percentage bar.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { css, html
|
|
2
|
+
import { BasicElement, css, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
@@ -45,36 +45,36 @@ let ProgressBar = class ProgressBar extends BasicElement {
|
|
|
45
45
|
*/
|
|
46
46
|
static get styles() {
|
|
47
47
|
return css `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
48
|
+
:host {
|
|
49
|
+
height: 10px;
|
|
50
|
+
display: flex;
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
[part~='bar'] {
|
|
54
|
+
height: 100%;
|
|
55
|
+
position: relative;
|
|
56
|
+
}
|
|
57
|
+
[part='label'] {
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: 50%;
|
|
60
|
+
left: 100%;
|
|
61
|
+
height: 0;
|
|
62
|
+
line-height: 0;
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
margin-left: 10px;
|
|
65
|
+
}
|
|
66
|
+
:host([alignment='right']) {
|
|
67
|
+
justify-content: flex-end;
|
|
68
|
+
}
|
|
69
|
+
:host([alignment='right']) [part='label'] {
|
|
70
|
+
left: auto;
|
|
71
|
+
right: 100%;
|
|
72
|
+
margin-left: 0;
|
|
73
|
+
margin-right: 10px;
|
|
74
|
+
}
|
|
75
|
+
:host [part~='bar-zero'] [part='label'] {
|
|
76
|
+
margin: 0;
|
|
77
|
+
}
|
|
78
78
|
`;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
@@ -83,7 +83,8 @@ let ProgressBar = class ProgressBar extends BasicElement {
|
|
|
83
83
|
*/
|
|
84
84
|
get valueNumber() {
|
|
85
85
|
const value = parseFloat(this.value);
|
|
86
|
-
if (!this.value || isNaN(value)) {
|
|
86
|
+
if (!this.value || isNaN(value)) {
|
|
87
|
+
// check value is invalid
|
|
87
88
|
const valuePrevious = parseFloat(this.valuePrevious);
|
|
88
89
|
// if valuePrevious is invalid return default value 100
|
|
89
90
|
return !valuePrevious || isNaN(valuePrevious) ? 100 : valuePrevious;
|
|
@@ -132,11 +133,11 @@ let ProgressBar = class ProgressBar extends BasicElement {
|
|
|
132
133
|
*/
|
|
133
134
|
render() {
|
|
134
135
|
return html `
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
<div part="${this.barParts}" style="${styleMap(this.barStyle)}">
|
|
137
|
+
<span part="label">
|
|
138
|
+
<slot name="label">${this.label}</slot>
|
|
139
|
+
</span>
|
|
140
|
+
</div>
|
|
140
141
|
`;
|
|
141
142
|
}
|
|
142
143
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { CSSResultGroup, ControlElement,
|
|
2
|
+
import { CSSResultGroup, ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
4
|
* Basic radio button
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ import { CSSResultGroup, ControlElement, TemplateResult, PropertyValues } from '
|
|
|
7
7
|
*
|
|
8
8
|
* @attr {string} value - Value of the radio button
|
|
9
9
|
* @prop {string} [value=""] - Value of the radio button
|
|
10
|
-
*
|
|
10
|
+
*
|
|
11
11
|
* @attr {string} name - Group multiple radio buttons by assigning the same name
|
|
12
12
|
* @prop {string} [name=""] - Group multiple radio buttons by assigning the same name
|
|
13
13
|
*
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { ControlElement, css, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
|
-
import { VERSION } from '../version.js';
|
|
7
6
|
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
8
|
-
import {
|
|
7
|
+
import { VERSION } from '../version.js';
|
|
8
|
+
import { applyRegistry, getRadioGroup, removeFromRegistry } from './radio-button-registry.js';
|
|
9
9
|
/**
|
|
10
10
|
* Basic radio button
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@ import { applyRegistry, removeFromRegistry, getRadioGroup } from './radio-button
|
|
|
13
13
|
*
|
|
14
14
|
* @attr {string} value - Value of the radio button
|
|
15
15
|
* @prop {string} [value=""] - Value of the radio button
|
|
16
|
-
*
|
|
16
|
+
*
|
|
17
17
|
* @attr {string} name - Group multiple radio buttons by assigning the same name
|
|
18
18
|
* @prop {string} [name=""] - Group multiple radio buttons by assigning the same name
|
|
19
19
|
*
|
|
@@ -50,21 +50,22 @@ let RadioButton = class RadioButton extends ControlElement {
|
|
|
50
50
|
:host {
|
|
51
51
|
display: inline-block;
|
|
52
52
|
}
|
|
53
|
-
[part=check] {
|
|
53
|
+
[part='check'] {
|
|
54
54
|
visibility: hidden;
|
|
55
55
|
}
|
|
56
|
-
:host([checked]) [part=check] {
|
|
56
|
+
:host([checked]) [part='check'] {
|
|
57
57
|
visibility: inherit;
|
|
58
58
|
}
|
|
59
|
-
[part=label],
|
|
60
|
-
[part=container] {
|
|
59
|
+
[part='label'],
|
|
60
|
+
[part='container'] {
|
|
61
61
|
display: inline-block;
|
|
62
62
|
white-space: nowrap;
|
|
63
63
|
vertical-align: middle;
|
|
64
64
|
overflow: hidden;
|
|
65
65
|
text-overflow: ellipsis;
|
|
66
66
|
}
|
|
67
|
-
:host(:empty) [part=label],
|
|
67
|
+
:host(:empty) [part='label'],
|
|
68
|
+
[part='label']:empty {
|
|
68
69
|
display: none;
|
|
69
70
|
}
|
|
70
71
|
`;
|
|
@@ -107,7 +108,9 @@ let RadioButton = class RadioButton extends ControlElement {
|
|
|
107
108
|
applyRegistry(this, changedProperties.get('name'));
|
|
108
109
|
}
|
|
109
110
|
// Ensure only one radio button is checked
|
|
110
|
-
if (this.isConnected &&
|
|
111
|
+
if (this.isConnected &&
|
|
112
|
+
this.hasUpdated &&
|
|
113
|
+
(changedProperties.has('checked') || changedProperties.has('name'))) {
|
|
111
114
|
this.manageGroupState();
|
|
112
115
|
}
|
|
113
116
|
super.updated(changedProperties);
|
|
@@ -131,7 +134,9 @@ let RadioButton = class RadioButton extends ControlElement {
|
|
|
131
134
|
if (this.checked && this.name) {
|
|
132
135
|
// restore tab index when checked
|
|
133
136
|
this.tabIndex = 0;
|
|
134
|
-
getRadioGroup(this)
|
|
137
|
+
getRadioGroup(this)
|
|
138
|
+
.filter((radio) => radio !== this)
|
|
139
|
+
.forEach((radio) => {
|
|
135
140
|
// uncheck and hide the rest of the group members from focusability
|
|
136
141
|
radio.checked = false;
|
|
137
142
|
radio.tabIndex = -1;
|
|
@@ -199,7 +204,7 @@ let RadioButton = class RadioButton extends ControlElement {
|
|
|
199
204
|
if (!this.name) {
|
|
200
205
|
return;
|
|
201
206
|
}
|
|
202
|
-
const group = getRadioGroup(this).filter(radio => !radio.disabled);
|
|
207
|
+
const group = getRadioGroup(this).filter((radio) => !radio.disabled);
|
|
203
208
|
const index = group.indexOf(this);
|
|
204
209
|
let element;
|
|
205
210
|
if (direction === 'next') {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// Keeps registration records of radio button group per its name
|
|
1
2
|
import { getElementScope } from '@refinitiv-ui/utils/element.js';
|
|
2
3
|
const registry = [];
|
|
3
4
|
/**
|
|
@@ -36,7 +37,7 @@ const applyRegistry = (radio, oldGroupName = '') => {
|
|
|
36
37
|
removeFromRegistry(radio);
|
|
37
38
|
radio.tabIndex = 0; // Restores tabIndex and switch to single mode
|
|
38
39
|
// Re-compute tabIndex for old radio group
|
|
39
|
-
const oldRadioGroup = registry.filter(radio => radio.name === oldGroupName);
|
|
40
|
+
const oldRadioGroup = registry.filter((radio) => radio.name === oldGroupName);
|
|
40
41
|
restoreTabIndex(oldRadioGroup);
|
|
41
42
|
}
|
|
42
43
|
// Changes group
|
|
@@ -46,7 +47,9 @@ const applyRegistry = (radio, oldGroupName = '') => {
|
|
|
46
47
|
if (radio.checked) {
|
|
47
48
|
radio.tabIndex = 0;
|
|
48
49
|
// uncheck and hide the rest of the group members from focusability
|
|
49
|
-
newRadioGroup
|
|
50
|
+
newRadioGroup
|
|
51
|
+
.filter((newRadio) => newRadio !== radio)
|
|
52
|
+
.forEach((newRadio) => {
|
|
50
53
|
newRadio.checked = false;
|
|
51
54
|
newRadio.tabIndex = -1;
|
|
52
55
|
});
|
|
@@ -56,7 +59,7 @@ const applyRegistry = (radio, oldGroupName = '') => {
|
|
|
56
59
|
restoreTabIndex(newRadioGroup);
|
|
57
60
|
}
|
|
58
61
|
// Re-compute tabIndex for old radio group when name attribute has changed.
|
|
59
|
-
const oldRadioGroup = registry.filter(radio => radio.name === oldGroupName);
|
|
62
|
+
const oldRadioGroup = registry.filter((radio) => radio.name === oldGroupName);
|
|
60
63
|
restoreTabIndex(oldRadioGroup);
|
|
61
64
|
}
|
|
62
65
|
};
|
|
@@ -71,7 +74,7 @@ const restoreTabIndex = (radioGroup) => {
|
|
|
71
74
|
if (!radioGroup.length) {
|
|
72
75
|
return;
|
|
73
76
|
}
|
|
74
|
-
const checkedRadio = radioGroup.filter(radio => radio.checked);
|
|
77
|
+
const checkedRadio = radioGroup.filter((radio) => radio.checked);
|
|
75
78
|
if (checkedRadio.length) {
|
|
76
79
|
return;
|
|
77
80
|
}
|
|
@@ -90,6 +93,6 @@ const getRadioGroup = (radio) => {
|
|
|
90
93
|
}
|
|
91
94
|
const groupName = radio.name;
|
|
92
95
|
const rootNode = getElementScope(radio);
|
|
93
|
-
return registry.filter(radio => rootNode === getElementScope(radio) && radio.name === groupName);
|
|
96
|
+
return registry.filter((radio) => rootNode === getElementScope(radio) && radio.name === groupName);
|
|
94
97
|
};
|
|
95
98
|
export { applyRegistry, removeFromRegistry, getRadioGroup };
|
package/lib/rating/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { BasicElement,
|
|
2
|
+
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
4
|
* Star visualisation component that is generally used for ranking
|
|
5
5
|
* @fires value-changed - Fired when the user commits a value change. The event is not triggered if `value` property is changed programmatically.
|
package/lib/rating/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement,
|
|
2
|
+
import { BasicElement, css, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { VERSION } from '../version.js';
|
|
@@ -259,10 +259,7 @@ let Rating = class Rating extends BasicElement {
|
|
|
259
259
|
* @return Render template
|
|
260
260
|
*/
|
|
261
261
|
render() {
|
|
262
|
-
return html `
|
|
263
|
-
<div part="container">
|
|
264
|
-
${this.starsTemplate}
|
|
265
|
-
</div>`;
|
|
262
|
+
return html ` <div part="container">${this.starsTemplate}</div>`;
|
|
266
263
|
}
|
|
267
264
|
};
|
|
268
265
|
__decorate([
|
package/lib/rating/utils.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
* Return value that never exceed the maximum boundary
|
|
3
|
+
* @param value value for check clamp
|
|
4
|
+
* @param min max value
|
|
5
|
+
* @param max min value
|
|
6
|
+
* @returns number between two numbers
|
|
7
|
+
*/
|
|
8
8
|
declare const clamp: (value: number, min: number, max: number) => number;
|
|
9
9
|
export { clamp };
|
package/lib/rating/utils.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
* Return value that never exceed the maximum boundary
|
|
3
|
+
* @param value value for check clamp
|
|
4
|
+
* @param min max value
|
|
5
|
+
* @param max min value
|
|
6
|
+
* @returns number between two numbers
|
|
7
|
+
*/
|
|
8
8
|
const clamp = function (value, min, max) {
|
|
9
9
|
return Math.max(min, Math.min(value, max));
|
|
10
10
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
import { TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
|
|
4
|
+
import '@refinitiv-ui/phrasebook/locale/en/search-field.js';
|
|
5
|
+
import { Translate } from '@refinitiv-ui/translate';
|
|
4
6
|
import '../icon/index.js';
|
|
5
7
|
import { TextField } from '../text-field/index.js';
|
|
6
|
-
import { Translate } from '@refinitiv-ui/translate';
|
|
7
|
-
import '@refinitiv-ui/phrasebook/locale/en/search-field.js';
|
|
8
8
|
/**
|
|
9
9
|
* Form control to get a search input from users.
|
|
10
10
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, nothing } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import '@refinitiv-ui/phrasebook/locale/en/search-field.js';
|
|
5
|
+
import { translate } from '@refinitiv-ui/translate';
|
|
4
6
|
import '../icon/index.js';
|
|
5
7
|
import { TextField } from '../text-field/index.js';
|
|
6
|
-
import { translate } from '@refinitiv-ui/translate';
|
|
7
|
-
import '@refinitiv-ui/phrasebook/locale/en/search-field.js';
|
|
8
8
|
/**
|
|
9
9
|
* Form control to get a search input from users.
|
|
10
10
|
*
|
|
@@ -53,8 +53,8 @@ let SearchField = class SearchField extends TextField {
|
|
|
53
53
|
get decorateInputMap() {
|
|
54
54
|
return {
|
|
55
55
|
...super.decorateInputMap,
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
type: 'search',
|
|
57
|
+
inputmode: 'search'
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
/**
|
package/lib/select/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import '../overlay/index.js';
|
|
4
|
-
import '../item/index.js';
|
|
2
|
+
import { CSSResultGroup, ControlElement, MultiValue, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
5
3
|
import '../icon/index.js';
|
|
4
|
+
import '../item/index.js';
|
|
5
|
+
import '../overlay/index.js';
|
|
6
6
|
import type { SelectData, SelectDataItem } from './helpers/types';
|
|
7
7
|
export type { SelectData, SelectDataItem };
|
|
8
8
|
/**
|
|
@@ -41,47 +41,47 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
41
41
|
private keySearchThrottler;
|
|
42
42
|
private resizeThrottler;
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
* Current text content of the selected value
|
|
45
|
+
* @readonly
|
|
46
|
+
*/
|
|
47
47
|
get label(): string;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
* Current text content of the selected values
|
|
50
|
+
* @ignore
|
|
51
|
+
* @readonly
|
|
52
|
+
*/
|
|
53
53
|
get labels(): string[];
|
|
54
54
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
* Placeholder to display when no value is set
|
|
56
|
+
*/
|
|
57
57
|
placeholder: string;
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
* Toggles the opened state of the list
|
|
60
|
+
*/
|
|
61
61
|
opened: boolean;
|
|
62
62
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
* Set state to error
|
|
64
|
+
*/
|
|
65
65
|
error: boolean;
|
|
66
66
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
* Set state to warning
|
|
68
|
+
*/
|
|
69
69
|
warning: boolean;
|
|
70
70
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
* Switch to multiple select input
|
|
72
|
+
* @ignore
|
|
73
|
+
* @param multiple True if element needs to support multi selection
|
|
74
|
+
*/
|
|
75
75
|
set multiple(multiple: boolean);
|
|
76
76
|
/**
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
* @ignore
|
|
78
|
+
*/
|
|
79
79
|
get multiple(): boolean;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
* Construct the menu from data object. Cannot be used with slotted content
|
|
82
|
+
* @type {SelectData | null}
|
|
83
|
+
* @default null
|
|
84
|
+
*/
|
|
85
85
|
get data(): SelectData | null;
|
|
86
86
|
set data(value: SelectData | null);
|
|
87
87
|
/**
|
|
@@ -91,10 +91,10 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
91
91
|
*/
|
|
92
92
|
private cachedValue;
|
|
93
93
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
* Value of the element
|
|
95
|
+
* @param value Element value
|
|
96
|
+
* @default -
|
|
97
|
+
*/
|
|
98
98
|
set value(value: string);
|
|
99
99
|
get value(): string;
|
|
100
100
|
/**
|
|
@@ -382,8 +382,8 @@ export declare class Select extends ControlElement implements MultiValue {
|
|
|
382
382
|
*/
|
|
383
383
|
private get dataContent();
|
|
384
384
|
/**
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
* Edit template when select is not readonly or disabled
|
|
386
|
+
*/
|
|
387
387
|
private get popupTemplate();
|
|
388
388
|
/**
|
|
389
389
|
* A `TemplateResult` that will be used
|