@refinitiv-ui/elements 6.8.7 → 6.8.9
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 +180 -433
- package/LICENSE +1 -1
- package/README.md +13 -11
- 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 +85 -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 +160 -125
- package/lib/calendar/utils.js +2 -2
- 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/helpers/legend.js +10 -8
- package/lib/chart/index.d.ts +3 -3
- package/lib/chart/index.js +17 -17
- package/lib/chart/plugins/doughnut-center-label.js +6 -5
- 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 +28 -19
- 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.d.ts +1 -1
- 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 +151 -132
- 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 +6 -6
- package/lib/dialog/index.js +48 -38
- 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 +6 -8
- package/lib/icon/utils/IconLoader.d.ts +1 -0
- package/lib/icon/utils/IconLoader.js +9 -1
- package/lib/interactive-chart/helpers/types.d.ts +3 -3
- package/lib/interactive-chart/index.d.ts +34 -34
- package/lib/interactive-chart/index.js +72 -57
- 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 +11 -8
- 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 +22 -14
- package/lib/notification/helpers/status.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 +154 -98
- 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 +15 -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 +4 -4
- 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 +70 -83
- 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 +36 -33
- package/lib/time-picker/index.d.ts +6 -6
- package/lib/time-picker/index.js +104 -90
- package/lib/toggle/index.d.ts +1 -1
- package/lib/toggle/index.js +4 -3
- 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 +1 -1
- 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 +16 -16
- package/tsconfig.tsbuildinfo +1 -1
package/lib/card/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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 { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
6
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
7
|
-
import
|
|
7
|
+
import '@refinitiv-ui/phrasebook/locale/en/card.js';
|
|
8
|
+
import { translate } from '@refinitiv-ui/translate';
|
|
8
9
|
import { isSlotEmpty } from '@refinitiv-ui/utils/is-slot-empty.js';
|
|
9
|
-
import '../label/index.js';
|
|
10
10
|
import '../button/index.js';
|
|
11
|
+
import '../label/index.js';
|
|
11
12
|
import '../overlay-menu/index.js';
|
|
12
|
-
import '
|
|
13
|
-
import { translate } from '@refinitiv-ui/translate';
|
|
13
|
+
import { VERSION } from '../version.js';
|
|
14
14
|
/**
|
|
15
15
|
* A card frame component.
|
|
16
16
|
*
|
|
@@ -63,14 +63,15 @@ let Card = class Card extends BasicElement {
|
|
|
63
63
|
display: flex;
|
|
64
64
|
flex-flow: column nowrap;
|
|
65
65
|
}
|
|
66
|
-
[part~=header] {
|
|
66
|
+
[part~='header'] {
|
|
67
67
|
display: flex;
|
|
68
68
|
}
|
|
69
|
-
[part~=header-body] {
|
|
69
|
+
[part~='header-body'] {
|
|
70
70
|
flex: 1;
|
|
71
71
|
min-width: 0px;
|
|
72
72
|
}
|
|
73
|
-
[part~=footer]:not([part~=
|
|
73
|
+
[part~='footer']:not([part~='has-content']),
|
|
74
|
+
[part~='header']:not([part~='has-content']) {
|
|
74
75
|
display: none;
|
|
75
76
|
}
|
|
76
77
|
`;
|
|
@@ -172,24 +173,25 @@ let Card = class Card extends BasicElement {
|
|
|
172
173
|
* @return menu template
|
|
173
174
|
*/
|
|
174
175
|
get menuTemplate() {
|
|
175
|
-
return html `${this.menuData
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
176
|
+
return html `${this.menuData
|
|
177
|
+
? html ` <ef-button
|
|
178
|
+
part="menu-button"
|
|
179
|
+
icon="more-vertical"
|
|
180
|
+
transparent
|
|
181
|
+
aria-label=${this.t('OPEN_MENU')}
|
|
182
|
+
aria-haspopup="true"
|
|
183
|
+
aria-controls="menu-popup"
|
|
184
|
+
aria-expanded=${this.menuOpened}
|
|
185
|
+
@tap=${this.openMenu}
|
|
186
|
+
></ef-button>
|
|
187
|
+
<ef-overlay-menu
|
|
188
|
+
id="menu-popup"
|
|
189
|
+
part="menu-popup"
|
|
190
|
+
.data=${this.menuData}
|
|
191
|
+
position="bottom-end"
|
|
192
|
+
@opened-changed=${this.onMenuOpenChanged}
|
|
193
|
+
></ef-overlay-menu>`
|
|
194
|
+
: undefined} `;
|
|
193
195
|
}
|
|
194
196
|
/**
|
|
195
197
|
* Template of header
|
|
@@ -200,7 +202,9 @@ let Card = class Card extends BasicElement {
|
|
|
200
202
|
<div part="header${this.withHeader ? ' has-content' : ''}">
|
|
201
203
|
<div part="header-body">
|
|
202
204
|
<slot name="header" @slotchange="${this.onHeaderSlotChange}"></slot>
|
|
203
|
-
${!this.headerHasContent && this.header
|
|
205
|
+
${!this.headerHasContent && this.header
|
|
206
|
+
? html `<ef-label line-clamp="3" part="header-text">${this.header}</ef-label>`
|
|
207
|
+
: null}
|
|
204
208
|
</div>
|
|
205
209
|
${this.menuTemplate}
|
|
206
210
|
</div>
|
|
@@ -215,7 +219,9 @@ let Card = class Card extends BasicElement {
|
|
|
215
219
|
<div part="footer${this.withFooter ? ' has-content' : ''}">
|
|
216
220
|
<div part="footer-body">
|
|
217
221
|
<slot name="footer" @slotchange="${this.onFooterSlotChange}"></slot>
|
|
218
|
-
${!this.footerHasContent && this.footer
|
|
222
|
+
${!this.footerHasContent && this.footer
|
|
223
|
+
? html `<ef-label line-clamp="3">${this.footer}</ef-label>`
|
|
224
|
+
: undefined}
|
|
219
225
|
</div>
|
|
220
226
|
</div>
|
|
221
227
|
`;
|
|
@@ -9,7 +9,7 @@ const isValidColor = (color) => {
|
|
|
9
9
|
* Force return to string type because Chart.js doesn't support typescript
|
|
10
10
|
* and some type of @types/chart.js isn't correct
|
|
11
11
|
*/
|
|
12
|
-
return
|
|
12
|
+
return color && color !== 'transparent' ? color : undefined;
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Get legend color by using point style
|
|
@@ -34,9 +34,9 @@ const getLegendColorUsePointStyle = (color1, color2) => {
|
|
|
34
34
|
*/
|
|
35
35
|
const getLegendColorDontUsePointStyle = (dataset, solidFill = false) => {
|
|
36
36
|
// Use background color for legend, if color of dataset or chart type is solid not opaque.
|
|
37
|
-
return isValidColor(solidFill ? dataset.backgroundColor : dataset.borderColor)
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
return (isValidColor(solidFill ? dataset.backgroundColor : dataset.borderColor) ||
|
|
38
|
+
isValidColor(dataset.pointBorderColor) ||
|
|
39
|
+
dataset.pointBackgroundColor);
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
42
|
* Get stroke style legend color
|
|
@@ -47,8 +47,9 @@ const getLegendColorDontUsePointStyle = (dataset, solidFill = false) => {
|
|
|
47
47
|
*/
|
|
48
48
|
const getLegendStrokeStyle = (dataset, usePointStyle) => {
|
|
49
49
|
if (usePointStyle) {
|
|
50
|
-
return getLegendColorUsePointStyle(dataset.pointBorderColor, dataset.pointBackgroundColor)
|
|
51
|
-
|
|
50
|
+
return (getLegendColorUsePointStyle(dataset.pointBorderColor, dataset.pointBackgroundColor) ||
|
|
51
|
+
isValidColor(dataset.borderColor) ||
|
|
52
|
+
dataset.backgroundColor);
|
|
52
53
|
}
|
|
53
54
|
else {
|
|
54
55
|
return isValidColor(dataset.borderColor) || getLegendColorDontUsePointStyle(dataset);
|
|
@@ -64,8 +65,9 @@ const getLegendStrokeStyle = (dataset, usePointStyle) => {
|
|
|
64
65
|
*/
|
|
65
66
|
const getLegendFillStyle = (dataset, usePointStyle, solidFill = false) => {
|
|
66
67
|
if (usePointStyle) {
|
|
67
|
-
return getLegendColorUsePointStyle(dataset.pointBackgroundColor, dataset.pointBorderColor)
|
|
68
|
-
|
|
68
|
+
return (getLegendColorUsePointStyle(dataset.pointBackgroundColor, dataset.pointBorderColor) ||
|
|
69
|
+
isValidColor(dataset.borderColor) ||
|
|
70
|
+
dataset.backgroundColor);
|
|
69
71
|
}
|
|
70
72
|
else {
|
|
71
73
|
return getLegendColorDontUsePointStyle(dataset, solidFill);
|
package/lib/chart/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
/// <reference types="chart.js" />
|
|
3
|
-
import { BasicElement, PropertyValues, TemplateResult, CSSResultGroup } from '@refinitiv-ui/core';
|
|
4
3
|
import 'chart.js/dist/Chart.bundle.min.js';
|
|
5
|
-
import
|
|
6
|
-
import type { Header } from '../header';
|
|
4
|
+
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
7
5
|
import '../header/index.js';
|
|
8
6
|
import '../layout/index.js';
|
|
7
|
+
import type { Header } from '../header';
|
|
8
|
+
import type { ChartConfig, ChartJS, ChartUpdateProps, DatasetColors } from './helpers/types';
|
|
9
9
|
declare global {
|
|
10
10
|
interface Window {
|
|
11
11
|
Chart: ChartJS;
|
package/lib/chart/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/* eslint @typescript-eslint/no-unsafe-call: 0 */
|
|
2
|
-
/* eslint @typescript-eslint/no-unsafe-member-access: 0 */
|
|
3
2
|
import { __decorate } from "tslib";
|
|
4
|
-
|
|
3
|
+
/* eslint @typescript-eslint/no-unsafe-member-access: 0 */
|
|
4
|
+
import 'chart.js/dist/Chart.bundle.min.js';
|
|
5
|
+
import { BasicElement, css, html } from '@refinitiv-ui/core';
|
|
5
6
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
6
7
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
7
8
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
8
|
-
import { VERSION } from '../version.js';
|
|
9
9
|
import { color as parseColor } from '@refinitiv-ui/utils/color.js';
|
|
10
|
-
import 'chart.js/dist/Chart.bundle.min.js';
|
|
11
|
-
import { legendHelper, merge } from './helpers/index.js';
|
|
12
10
|
import '../header/index.js';
|
|
13
11
|
import '../layout/index.js';
|
|
12
|
+
import { VERSION } from '../version.js';
|
|
13
|
+
import { legendHelper, merge } from './helpers/index.js';
|
|
14
14
|
// Register plugins
|
|
15
15
|
import doughnutCenterPlugin from './plugins/doughnut-center-label.js';
|
|
16
16
|
window.Chart.pluginService.register(doughnutCenterPlugin);
|
|
@@ -61,9 +61,7 @@ let Chart = class Chart extends BasicElement {
|
|
|
61
61
|
return [];
|
|
62
62
|
}
|
|
63
63
|
const chartOption = DEFAULT_CHART_CONFIG[this.config.type];
|
|
64
|
-
if (this.datasets.length
|
|
65
|
-
&& chartOption.legend
|
|
66
|
-
&& Array.isArray(this.datasets[0].backgroundColor)) {
|
|
64
|
+
if (this.datasets.length && chartOption.legend && Array.isArray(this.datasets[0].backgroundColor)) {
|
|
67
65
|
let legends = [];
|
|
68
66
|
if (chartOption.legend.labels?.generateLabels) {
|
|
69
67
|
legends = chartOption.legend.labels?.generateLabels(chart);
|
|
@@ -266,7 +264,9 @@ let Chart = class Chart extends BasicElement {
|
|
|
266
264
|
decorateConfig() {
|
|
267
265
|
this.mergeConfigs();
|
|
268
266
|
const extendColorsIfRequired = (currentColors, infoColors) => {
|
|
269
|
-
if (Array.isArray(currentColors) &&
|
|
267
|
+
if (Array.isArray(currentColors) &&
|
|
268
|
+
Array.isArray(infoColors) &&
|
|
269
|
+
currentColors.length < infoColors.length) {
|
|
270
270
|
merge(currentColors, infoColors);
|
|
271
271
|
}
|
|
272
272
|
};
|
|
@@ -291,7 +291,8 @@ let Chart = class Chart extends BasicElement {
|
|
|
291
291
|
datasetInfo(dataset) {
|
|
292
292
|
const type = dataset.type || this.config?.type;
|
|
293
293
|
let index = this.datasets.indexOf(dataset);
|
|
294
|
-
const isColorArray = (!!type && ['pie', 'doughnut', 'polarArea'].includes(type)) ||
|
|
294
|
+
const isColorArray = (!!type && ['pie', 'doughnut', 'polarArea'].includes(type)) ||
|
|
295
|
+
(type === 'bar' && this.datasets.length === 1);
|
|
295
296
|
const isSolidFill = !!type && !CHART_TYPE_OPAQUE.includes(type);
|
|
296
297
|
// Doughnut chart using same color sequence for each data in datasets
|
|
297
298
|
let borderColor = null;
|
|
@@ -461,13 +462,12 @@ let Chart = class Chart extends BasicElement {
|
|
|
461
462
|
* @return Render template
|
|
462
463
|
*/
|
|
463
464
|
render() {
|
|
464
|
-
return html `
|
|
465
|
-
<ef-
|
|
466
|
-
|
|
467
|
-
<
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
</ef-layout>`;
|
|
465
|
+
return html ` <ef-layout flex container>
|
|
466
|
+
<ef-header></ef-header>
|
|
467
|
+
<ef-layout part="chart" @resize="${this.onResize}">
|
|
468
|
+
<canvas id="canvas"></canvas>
|
|
469
|
+
</ef-layout>
|
|
470
|
+
</ef-layout>`;
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
473
|
__decorate([
|
|
@@ -51,8 +51,9 @@ const plugins = {
|
|
|
51
51
|
chart._select = [];
|
|
52
52
|
}
|
|
53
53
|
if (chart.active.length) {
|
|
54
|
-
if (chart._select.length &&
|
|
55
|
-
|
|
54
|
+
if (chart._select.length &&
|
|
55
|
+
chart._select[0]._datasetIndex === chart.active[0]._datasetIndex &&
|
|
56
|
+
chart._select[0]._index === chart.active[0]._index) {
|
|
56
57
|
// reset value if user clicked on selected segment
|
|
57
58
|
chart._select = [];
|
|
58
59
|
}
|
|
@@ -110,7 +111,7 @@ const plugins = {
|
|
|
110
111
|
}
|
|
111
112
|
const textAreaWidth = chart.innerRadius;
|
|
112
113
|
// Base font size is 30% and minus 4% per text lines ( if text has multiple lines ) of text area
|
|
113
|
-
const baseFontSize = textAreaWidth * (0.3 -
|
|
114
|
+
const baseFontSize = textAreaWidth * (0.3 - 0.04 * (texts.length - 1));
|
|
114
115
|
// Keep minimum font size equal 5% of text area
|
|
115
116
|
const computedFontSize = Math.max(textAreaWidth * 0.05, baseFontSize);
|
|
116
117
|
// Use font size ratio from user if --doughnut-center-font-size CSS variable is provided
|
|
@@ -148,7 +149,7 @@ const plugins = {
|
|
|
148
149
|
targetText += '...';
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
|
-
ctx.fillText(targetText, centerX, offsetY +
|
|
152
|
+
ctx.fillText(targetText, centerX, offsetY + i * fontLineHeight);
|
|
152
153
|
}
|
|
153
154
|
},
|
|
154
155
|
afterDatasetUpdate: function (chart) {
|
|
@@ -165,7 +166,7 @@ const plugins = {
|
|
|
165
166
|
const datasetIndex = Number(config.selected.datasetIndex || 0);
|
|
166
167
|
const visibleIndex = chart.getVisibleDatasetCount() - 1;
|
|
167
168
|
// Validate index and datasetIndex
|
|
168
|
-
if (isNaN(selectedIndex) ||
|
|
169
|
+
if (isNaN(selectedIndex) || isNaN(datasetIndex) || datasetIndex < 0 || datasetIndex > visibleIndex) {
|
|
169
170
|
return;
|
|
170
171
|
}
|
|
171
172
|
// Set selected item to the chart
|
package/lib/checkbox/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSResultGroup, ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import '../icon/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Form control for selecting one or several options
|
package/lib/checkbox/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement,
|
|
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
|
-
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
8
6
|
import '../icon/index.js';
|
|
7
|
+
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
8
|
+
import { VERSION } from '../version.js';
|
|
9
9
|
/**
|
|
10
10
|
* Form control for selecting one or several options
|
|
11
11
|
* @fires checked-changed - Fired when the user checks or unchecks the checkbox. The event is not fired if the `checked` property is changed programmatically.
|
|
@@ -47,24 +47,25 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
47
47
|
:host {
|
|
48
48
|
display: inline-block;
|
|
49
49
|
}
|
|
50
|
-
[part=check] {
|
|
50
|
+
[part='check'] {
|
|
51
51
|
visibility: hidden;
|
|
52
52
|
}
|
|
53
|
-
:host([checked]) [part=check],
|
|
54
|
-
:host([indeterminate]) [part=check] {
|
|
53
|
+
:host([checked]) [part='check'],
|
|
54
|
+
:host([indeterminate]) [part='check'] {
|
|
55
55
|
visibility: inherit;
|
|
56
56
|
}
|
|
57
|
-
[part=label],
|
|
58
|
-
[part=container] {
|
|
57
|
+
[part='label'],
|
|
58
|
+
[part='container'] {
|
|
59
59
|
display: inline-block;
|
|
60
60
|
vertical-align: middle;
|
|
61
61
|
}
|
|
62
|
-
[part=label] {
|
|
62
|
+
[part='label'] {
|
|
63
63
|
white-space: nowrap;
|
|
64
64
|
text-overflow: ellipsis;
|
|
65
65
|
overflow: hidden;
|
|
66
66
|
}
|
|
67
|
-
:host(:empty) [part=label],
|
|
67
|
+
:host(:empty) [part='label'],
|
|
68
|
+
[part='label']:empty {
|
|
68
69
|
display: none;
|
|
69
70
|
}
|
|
70
71
|
`;
|
|
@@ -147,9 +148,7 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
147
148
|
render() {
|
|
148
149
|
return html `
|
|
149
150
|
<div part="container">
|
|
150
|
-
<div part="check">
|
|
151
|
-
${!this.indeterminate ? html `<ef-icon icon="tick"></ef-icon>` : null}
|
|
152
|
-
</div>
|
|
151
|
+
<div part="check">${!this.indeterminate ? html `<ef-icon icon="tick"></ef-icon>` : null}</div>
|
|
153
152
|
</div>
|
|
154
153
|
<div part="label"><slot></slot></div>
|
|
155
154
|
`;
|
package/lib/clock/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSResultGroup, ElementSize, PropertyValues, ResponsiveElement, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import '@refinitiv-ui/phrasebook/locale/en/clock.js';
|
|
4
4
|
import { TranslatePromise } from '@refinitiv-ui/translate';
|
|
5
5
|
/**
|
|
@@ -92,8 +92,8 @@ export declare class Clock extends ResponsiveElement {
|
|
|
92
92
|
*/
|
|
93
93
|
showSeconds: boolean;
|
|
94
94
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
* Display clock in analogue style.
|
|
96
|
+
*/
|
|
97
97
|
analogue: boolean;
|
|
98
98
|
/**
|
|
99
99
|
* Enable interactive mode. Allowing the user to offset the value.
|
|
@@ -104,16 +104,16 @@ export declare class Clock extends ResponsiveElement {
|
|
|
104
104
|
*/
|
|
105
105
|
private hoursPart;
|
|
106
106
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
* Getter for minutes part.
|
|
108
|
+
*/
|
|
109
109
|
private minutesPart;
|
|
110
110
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
* Getter for seconds part.
|
|
112
|
+
*/
|
|
113
113
|
private secondsPart;
|
|
114
114
|
/**
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
* Size of the clock.
|
|
116
|
+
*/
|
|
117
117
|
private size;
|
|
118
118
|
/**
|
|
119
119
|
* Get the display time in seconds.
|
|
@@ -208,11 +208,11 @@ export declare class Clock extends ResponsiveElement {
|
|
|
208
208
|
*/
|
|
209
209
|
private getShiftAmountFromSegment;
|
|
210
210
|
/**
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
* Returns `true` or `false` depends on the offset value's effect on giving segment
|
|
212
|
+
*
|
|
213
|
+
* @param segment segment
|
|
214
|
+
* @returns Result
|
|
215
|
+
*/
|
|
216
216
|
private isSegmentShifted;
|
|
217
217
|
/**
|
|
218
218
|
* Handles any keydown events
|
|
@@ -229,59 +229,59 @@ export declare class Clock extends ResponsiveElement {
|
|
|
229
229
|
*/
|
|
230
230
|
private onTapStart;
|
|
231
231
|
/**
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
232
|
+
* Handle valid control keys and execute their corresponding commands
|
|
233
|
+
* Will stop when readonly is set
|
|
234
|
+
* @param event Event Object
|
|
235
|
+
* @returns {void}
|
|
236
|
+
*/
|
|
237
237
|
private manageControlKeys;
|
|
238
238
|
/**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
* Handles UP key press
|
|
240
|
+
* @returns {void}
|
|
241
|
+
*/
|
|
242
242
|
private handleUpKey;
|
|
243
243
|
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
* Handle DOWN key press
|
|
245
|
+
* @returns {void}
|
|
246
|
+
*/
|
|
247
247
|
private handleDownKey;
|
|
248
248
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
249
|
+
* Set aria-valuenow to display value and aria-valuetext to translated format
|
|
250
|
+
* @param updateAriaValueText condition to update aria-valueText
|
|
251
|
+
* @returns {void}
|
|
252
|
+
*/
|
|
253
253
|
private updateAriaValue;
|
|
254
254
|
/**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
* Get template of segment
|
|
256
|
+
* @param segment segment
|
|
257
|
+
* @param value segment's value
|
|
258
|
+
* @returns {TemplateResult} template
|
|
259
|
+
*/
|
|
260
260
|
private generateSegmentTemplate;
|
|
261
261
|
/**
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
* Template of divider
|
|
263
|
+
* @returns {TemplateResult} template
|
|
264
|
+
*/
|
|
265
265
|
private get dividerTemplate();
|
|
266
266
|
/**
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
* Template of amPm segment
|
|
268
|
+
* @returns {TemplateResult} template
|
|
269
|
+
*/
|
|
270
270
|
private get amPmTemplate();
|
|
271
271
|
/**
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
* Template of hours segment
|
|
273
|
+
* @returns {TemplateResult} template
|
|
274
|
+
*/
|
|
275
275
|
private get hoursSegmentTemplate();
|
|
276
276
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
* Template of minutes segment
|
|
278
|
+
* @returns {TemplateResult} template
|
|
279
|
+
*/
|
|
280
280
|
private get minutesSegmentTemplate();
|
|
281
281
|
/**
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
* Template of seconds segment
|
|
283
|
+
* @returns {TemplateResult} template
|
|
284
|
+
*/
|
|
285
285
|
private get secondsSegmentTemplate();
|
|
286
286
|
/**
|
|
287
287
|
* Called when the element's dimension have changed
|
|
@@ -317,14 +317,14 @@ export declare class Clock extends ResponsiveElement {
|
|
|
317
317
|
*/
|
|
318
318
|
protected willUpdate(changedProperties: PropertyValues): void;
|
|
319
319
|
/**
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
320
|
+
* Template for digital clock
|
|
321
|
+
* @returns {TemplateResult} template
|
|
322
|
+
*/
|
|
323
323
|
protected get digitalClockTemplate(): TemplateResult;
|
|
324
324
|
/**
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
325
|
+
* Template for analogue clock
|
|
326
|
+
* @returns {TemplateResult} template
|
|
327
|
+
*/
|
|
328
328
|
protected get analogueClockTemplate(): TemplateResult;
|
|
329
329
|
/**
|
|
330
330
|
* A `TemplateResult` that will be used
|