@refinitiv-ui/elements 5.12.2 → 6.0.0-next.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/README.md +4 -4
- package/lib/accordion/index.js +2 -2
- package/lib/appstate-bar/index.d.ts +6 -0
- package/lib/appstate-bar/index.js +8 -3
- package/lib/autosuggest/index.js +10 -11
- package/lib/button/index.d.ts +2 -13
- package/lib/button/index.js +7 -42
- package/lib/button-bar/index.js +4 -5
- package/lib/calendar/constants.js +1 -1
- package/lib/calendar/index.d.ts +1 -1
- package/lib/calendar/index.js +39 -15
- package/lib/calendar/locales.js +5 -5
- package/lib/calendar/types.d.ts +1 -1
- package/lib/calendar/utils.js +5 -5
- package/lib/canvas/index.js +3 -4
- package/lib/card/index.js +6 -7
- package/lib/chart/index.js +18 -22
- package/lib/chart/plugins/doughnut-center-label.js +6 -11
- package/lib/checkbox/index.js +3 -3
- package/lib/clock/index.js +6 -6
- package/lib/clock/utils/TickManager.js +2 -2
- package/lib/collapse/index.js +7 -9
- package/lib/color-dialog/elements/color-palettes.js +1 -1
- package/lib/color-dialog/elements/grayscale-palettes.js +2 -2
- package/lib/color-dialog/elements/palettes.js +4 -5
- package/lib/color-dialog/helpers/value-model.js +1 -1
- package/lib/color-dialog/index.d.ts +1 -1
- package/lib/color-dialog/index.js +6 -6
- package/lib/combo-box/helpers/filter.d.ts +1 -1
- package/lib/combo-box/helpers/types.d.ts +1 -1
- package/lib/combo-box/index.d.ts +4 -4
- package/lib/combo-box/index.js +31 -14
- package/lib/counter/index.d.ts +6 -6
- package/lib/counter/index.js +8 -8
- package/lib/datetime-field/constants.d.ts +4 -0
- package/lib/datetime-field/constants.js +5 -0
- package/lib/datetime-field/custom-elements.json +345 -0
- package/lib/datetime-field/custom-elements.md +61 -0
- package/lib/datetime-field/index.d.ts +317 -0
- package/lib/datetime-field/index.js +660 -0
- package/lib/datetime-field/themes/halo/dark/index.js +3 -0
- package/lib/datetime-field/themes/halo/light/index.js +3 -0
- package/lib/datetime-field/themes/solar/charcoal/index.js +3 -0
- package/lib/datetime-field/themes/solar/pearl/index.js +3 -0
- package/lib/datetime-field/types.d.ts +10 -0
- package/lib/datetime-field/types.js +1 -0
- package/lib/datetime-field/utils.d.ts +25 -0
- package/lib/datetime-field/utils.js +79 -0
- package/lib/datetime-picker/index.js +6 -7
- package/lib/datetime-picker/utils.js +1 -1
- package/lib/dialog/draggable-element.js +1 -2
- package/lib/dialog/index.d.ts +1 -1
- package/lib/dialog/index.js +5 -5
- package/lib/email-field/index.d.ts +1 -1
- package/lib/email-field/index.js +8 -3
- package/lib/flag/index.js +3 -3
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/index.js +2 -2
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +3 -5
- package/lib/heatmap/index.js +19 -28
- package/lib/icon/index.js +3 -3
- package/lib/icon/utils/IconLoader.d.ts +1 -1
- package/lib/icon/utils/IconLoader.js +1 -1
- package/lib/interactive-chart/helpers/types.d.ts +1 -1
- package/lib/interactive-chart/index.js +10 -14
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +19 -17
- package/lib/item/index.js +45 -48
- package/lib/label/index.d.ts +1 -1
- package/lib/label/index.js +6 -6
- package/lib/layout/index.js +2 -2
- package/lib/led-gauge/index.js +2 -2
- package/lib/list/custom-elements.json +0 -13
- package/lib/list/custom-elements.md +9 -10
- package/lib/list/helpers/item-id.d.ts +8 -0
- package/lib/list/helpers/item-id.js +13 -0
- package/lib/list/helpers/{list-renderer.d.ts → renderer.d.ts} +4 -0
- package/lib/list/helpers/{list-renderer.js → renderer.js} +8 -0
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/index.d.ts +13 -12
- package/lib/list/index.js +30 -29
- package/lib/list/renderer.d.ts +1 -1
- package/lib/list/themes/halo/dark/index.js +1 -1
- package/lib/list/themes/halo/light/index.js +1 -1
- package/lib/list/themes/solar/charcoal/index.js +1 -1
- package/lib/list/themes/solar/pearl/index.js +1 -1
- package/lib/loader/index.js +1 -1
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/index.js +6 -7
- package/lib/notification/elements/notification-tray.js +4 -4
- package/lib/notification/elements/notification.d.ts +10 -0
- package/lib/notification/elements/notification.js +12 -3
- package/lib/number-field/index.d.ts +3 -3
- package/lib/number-field/index.js +14 -4
- package/lib/overlay/elements/overlay-backdrop.js +2 -2
- package/lib/overlay/elements/overlay-viewport.js +1 -1
- package/lib/overlay/elements/overlay.js +7 -5
- package/lib/overlay/managers/focus-manager.js +2 -3
- package/lib/overlay/managers/interaction-lock-manager.js +1 -1
- package/lib/overlay/managers/viewport-manager.js +4 -5
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay-menu/helpers/types.d.ts +1 -1
- package/lib/overlay-menu/index.js +12 -15
- package/lib/overlay-menu/managers/menu-manager.js +1 -1
- package/lib/pagination/index.d.ts +74 -91
- package/lib/pagination/index.js +205 -239
- package/lib/pagination/themes/halo/dark/index.js +1 -2
- package/lib/pagination/themes/halo/light/index.js +1 -2
- package/lib/pagination/themes/solar/charcoal/index.js +1 -2
- package/lib/pagination/themes/solar/pearl/index.js +1 -2
- package/lib/panel/index.js +2 -2
- package/lib/password-field/index.d.ts +2 -2
- package/lib/password-field/index.js +7 -4
- package/lib/pill/index.d.ts +16 -0
- package/lib/pill/index.js +36 -5
- package/lib/pill/themes/halo/dark/index.js +1 -1
- package/lib/pill/themes/halo/light/index.js +1 -1
- package/lib/pill/themes/solar/charcoal/index.js +1 -1
- package/lib/pill/themes/solar/pearl/index.js +1 -1
- package/lib/progress-bar/index.js +3 -3
- package/lib/radio-button/index.js +3 -3
- package/lib/radio-button/radio-button-registry.d.ts +1 -1
- package/lib/radio-button/radio-button-registry.js +4 -2
- package/lib/rating/index.js +4 -4
- package/lib/search-field/index.d.ts +2 -2
- package/lib/search-field/index.js +8 -4
- package/lib/select/index.js +11 -14
- package/lib/sidebar-layout/index.js +4 -4
- package/lib/slider/index.js +6 -8
- package/lib/sparkline/index.js +9 -10
- package/lib/swing-gauge/index.js +14 -8
- package/lib/tab/index.js +4 -4
- package/lib/tab-bar/index.js +6 -6
- package/lib/text-field/index.d.ts +14 -1
- package/lib/text-field/index.js +35 -11
- package/lib/time-picker/index.d.ts +1 -1
- package/lib/time-picker/index.js +11 -11
- package/lib/toggle/index.js +2 -2
- package/lib/tooltip/index.js +6 -8
- package/lib/tooltip/managers/tooltip-manager.js +2 -2
- package/lib/tornado-chart/elements/tornado-chart.js +2 -2
- package/lib/tornado-chart/elements/tornado-item.js +3 -3
- package/lib/tree/elements/tree-item.d.ts +3 -3
- package/lib/tree/elements/tree-item.js +5 -6
- package/lib/tree/elements/tree.d.ts +2 -3
- package/lib/tree/elements/tree.js +6 -7
- package/lib/tree/helpers/renderer.d.ts +4 -0
- package/lib/tree/helpers/renderer.js +8 -0
- package/lib/tree/helpers/types.d.ts +1 -1
- package/lib/tree/managers/tree-manager.d.ts +1 -1
- 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/index.d.ts +3 -7
- package/lib/tree-select/index.js +39 -38
- package/lib/version.js +1 -1
- package/package.json +35 -295
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const CHART = window.Chart;
|
|
2
2
|
const getPluginConfig = (chart) => {
|
|
3
|
-
|
|
4
|
-
return (_b = (_a = chart.config.options) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.centerLabel;
|
|
3
|
+
return chart.config.options?.plugins?.centerLabel;
|
|
5
4
|
};
|
|
6
5
|
/**
|
|
7
6
|
* Draw line
|
|
@@ -10,18 +9,17 @@ const getPluginConfig = (chart) => {
|
|
|
10
9
|
* @returns {void}
|
|
11
10
|
*/
|
|
12
11
|
const drawItemBorder = function (chart, active) {
|
|
13
|
-
var _a, _b, _c;
|
|
14
12
|
if (!chart.data.datasets) {
|
|
15
13
|
return;
|
|
16
14
|
}
|
|
17
|
-
if (active
|
|
15
|
+
if (active?.length) {
|
|
18
16
|
const ctx = chart.ctx;
|
|
19
17
|
const chartItem = active[0];
|
|
20
18
|
const vm = chartItem._view;
|
|
21
19
|
const datasets = chart.data.datasets[chartItem._datasetIndex];
|
|
22
20
|
vm.backgroundColor = datasets.backgroundColor[chartItem._index];
|
|
23
21
|
vm.backgroundColor = CHART.helpers.getHoverColor(vm.backgroundColor); // we need to make color bolder
|
|
24
|
-
vm.borderWidth = (datasets.borderWidth ||
|
|
22
|
+
vm.borderWidth = (datasets.borderWidth || chart.config.options?.elements?.arc?.borderWidth);
|
|
25
23
|
vm.borderColor = (getComputedStyle(chart.canvas).getPropertyValue('--doughnut-border-color') || CHART.defaults.global.defaultFontColor);
|
|
26
24
|
const sA = vm.startAngle;
|
|
27
25
|
const eA = vm.endAngle;
|
|
@@ -73,7 +71,6 @@ const plugins = {
|
|
|
73
71
|
}
|
|
74
72
|
},
|
|
75
73
|
beforeDraw: function (chart) {
|
|
76
|
-
var _a;
|
|
77
74
|
const config = getPluginConfig(chart);
|
|
78
75
|
if (!config) {
|
|
79
76
|
return;
|
|
@@ -83,7 +80,7 @@ const plugins = {
|
|
|
83
80
|
if (chart._select) {
|
|
84
81
|
active = chart._select;
|
|
85
82
|
}
|
|
86
|
-
if (
|
|
83
|
+
if (chart.active?.length) {
|
|
87
84
|
active = chart.active;
|
|
88
85
|
}
|
|
89
86
|
const renderText = config.onRenderLabel(chart, active);
|
|
@@ -155,7 +152,6 @@ const plugins = {
|
|
|
155
152
|
}
|
|
156
153
|
},
|
|
157
154
|
afterDatasetUpdate: function (chart) {
|
|
158
|
-
var _a;
|
|
159
155
|
// Check chart already init selected.
|
|
160
156
|
if (chart.selected !== undefined) {
|
|
161
157
|
return;
|
|
@@ -165,7 +161,7 @@ const plugins = {
|
|
|
165
161
|
if (!config || !config.selected || !chart.data.datasets) {
|
|
166
162
|
return;
|
|
167
163
|
}
|
|
168
|
-
const selectedIndex = Number(
|
|
164
|
+
const selectedIndex = Number(config.selected?.index);
|
|
169
165
|
const datasetIndex = Number(config.selected.datasetIndex || 0);
|
|
170
166
|
const visibleIndexes = chart.getVisibleDatasetCount() - 1;
|
|
171
167
|
// Validate index and datasetIndex
|
|
@@ -177,14 +173,13 @@ const plugins = {
|
|
|
177
173
|
chart.selected = items ? [items] : [];
|
|
178
174
|
},
|
|
179
175
|
afterDraw: function (chart) {
|
|
180
|
-
var _a;
|
|
181
176
|
if (getPluginConfig(chart)) {
|
|
182
177
|
// Draw active element
|
|
183
178
|
// Note: use logic from chart.js - chart.js/src/elements/element.arc.js :draw()
|
|
184
179
|
// hover
|
|
185
180
|
drawItemBorder(chart, chart.active);
|
|
186
181
|
// selected
|
|
187
|
-
if (
|
|
182
|
+
if (chart.selected?.length) {
|
|
188
183
|
chart._select = chart.selected;
|
|
189
184
|
chart.selected = [];
|
|
190
185
|
}
|
package/lib/checkbox/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { ControlElement, html, css } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { query } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
6
|
import { VERSION } from '../version.js';
|
|
7
7
|
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
8
8
|
import '../icon/index.js';
|
package/lib/clock/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, css, WarningNotice, ResponsiveElement } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { query } from '@refinitiv-ui/core/
|
|
6
|
-
import { state } from '@refinitiv-ui/core/
|
|
7
|
-
import { ifDefined } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
|
+
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
7
|
+
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
8
8
|
import { VERSION } from '../version.js';
|
|
9
|
-
import { MILLISECONDS_IN_SECOND, HOURS_OF_NOON, isValidTime, toTimeSegment, TimeFormat, format, padNumber } from '@refinitiv-ui/utils/
|
|
9
|
+
import { MILLISECONDS_IN_SECOND, HOURS_OF_NOON, isValidTime, toTimeSegment, TimeFormat, format, padNumber } from '@refinitiv-ui/utils/date.js';
|
|
10
10
|
import { HOURS_IN_DAY, MINUTES_IN_HOUR, SECONDS_IN_DAY, SECONDS_IN_HOUR, SECONDS_IN_MINUTE } from './utils/timestamps.js';
|
|
11
11
|
import { register, deRegister } from './utils/TickManager.js';
|
|
12
12
|
const UP = 'Up';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TimeoutTaskRunner } from '@refinitiv-ui/utils/
|
|
2
|
-
import { MILLISECONDS_IN_SECOND } from '@refinitiv-ui/utils/
|
|
1
|
+
import { TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
2
|
+
import { MILLISECONDS_IN_SECOND } from '@refinitiv-ui/utils/date.js';
|
|
3
3
|
const tickSet = new Set();
|
|
4
4
|
let timeout = null;
|
|
5
5
|
/**
|
package/lib/collapse/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { BasicElement, css, html } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { ifDefined } from '@refinitiv-ui/core/
|
|
6
|
-
import { state } from '@refinitiv-ui/core/
|
|
7
|
-
import { ref, createRef } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
6
|
+
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
7
|
+
import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
|
|
8
8
|
import { VERSION } from '../version.js';
|
|
9
9
|
import { preload } from '../icon/index.js';
|
|
10
10
|
import '../header/index.js';
|
|
@@ -123,9 +123,8 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
123
123
|
* @returns {void}
|
|
124
124
|
*/
|
|
125
125
|
firstUpdated(changedProperties) {
|
|
126
|
-
var _a;
|
|
127
126
|
super.firstUpdated(changedProperties);
|
|
128
|
-
|
|
127
|
+
this.panelHolderRef.value?.setAttribute('no-animation', '');
|
|
129
128
|
}
|
|
130
129
|
/**
|
|
131
130
|
* Invoked whenever the element is updated
|
|
@@ -154,8 +153,7 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
154
153
|
* @returns {void}
|
|
155
154
|
*/
|
|
156
155
|
showHide() {
|
|
157
|
-
|
|
158
|
-
(_a = this.panelHolderRef.value) === null || _a === void 0 ? void 0 : _a.removeAttribute(('no-animation'));
|
|
156
|
+
this.panelHolderRef.value?.removeAttribute(('no-animation'));
|
|
159
157
|
this.setAnimationTargetHeight(this.getContentHeight());
|
|
160
158
|
}
|
|
161
159
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, css, svg } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { VERSION } from '../../version.js';
|
|
5
5
|
import { Palettes } from './palettes.js';
|
|
6
6
|
import { COLOR_ITEMS } from '../helpers/color-helpers.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, css, svg } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { VERSION } from '../../version.js';
|
|
6
6
|
import { Palettes } from './palettes.js';
|
|
7
7
|
import { GRAYSCALE_ITEMS, NOCOLOR_POINTS } from '../helpers/color-helpers.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { BasicElement, svg } from '@refinitiv-ui/core';
|
|
3
|
-
import { property } from '@refinitiv-ui/core/
|
|
4
|
-
import { query } from '@refinitiv-ui/core/
|
|
3
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
4
|
+
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
5
5
|
import { VERSION } from '../../version.js';
|
|
6
|
-
import { rgb } from '@refinitiv-ui/utils/
|
|
6
|
+
import { rgb } from '@refinitiv-ui/utils/color.js';
|
|
7
7
|
import { isHex } from '../helpers/color-helpers.js';
|
|
8
8
|
/**
|
|
9
9
|
* Element base class usually used
|
|
@@ -89,14 +89,13 @@ export class Palettes extends BasicElement {
|
|
|
89
89
|
* @return {void}
|
|
90
90
|
*/
|
|
91
91
|
onTouchmove(event) {
|
|
92
|
-
var _a;
|
|
93
92
|
const touchOffsets = event.changedTouches[0];
|
|
94
93
|
// TODO: it is a bug of TypeScript@4.4 remove ts-ignore once it is fixed
|
|
95
94
|
// https://github.com/microsoft/TypeScript/issues/45047
|
|
96
95
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
97
96
|
// @ts-ignore
|
|
98
97
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
99
|
-
const realTarget =
|
|
98
|
+
const realTarget = this.shadowRoot?.elementFromPoint(touchOffsets.clientX, touchOffsets.clientY);
|
|
100
99
|
this.updateValue(realTarget);
|
|
101
100
|
}
|
|
102
101
|
/**
|
|
@@ -7,7 +7,7 @@ import { Dialog } from '../dialog/index.js';
|
|
|
7
7
|
import './elements/color-palettes.js';
|
|
8
8
|
import './elements/grayscale-palettes.js';
|
|
9
9
|
import { Translate } from '@refinitiv-ui/translate';
|
|
10
|
-
import '@refinitiv-ui/phrasebook/
|
|
10
|
+
import '@refinitiv-ui/phrasebook/locale/en/color-dialog.js';
|
|
11
11
|
/**
|
|
12
12
|
* Displays a colour picker dialog,
|
|
13
13
|
* for selecting a predefined range of colours.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { query } from '@refinitiv-ui/core/
|
|
6
|
-
import { styleMap } from '@refinitiv-ui/core/
|
|
7
|
-
import { rgb } from '@refinitiv-ui/utils/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
|
+
import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
7
|
+
import { rgb } from '@refinitiv-ui/utils/color.js';
|
|
8
8
|
import { VERSION } from '../version.js';
|
|
9
9
|
import { ValueModel } from './helpers/value-model.js';
|
|
10
10
|
import { isHex, removeHashSign } from './helpers/color-helpers.js';
|
|
@@ -15,7 +15,7 @@ import { Dialog } from '../dialog/index.js';
|
|
|
15
15
|
import './elements/color-palettes.js';
|
|
16
16
|
import './elements/grayscale-palettes.js';
|
|
17
17
|
import { translate } from '@refinitiv-ui/translate';
|
|
18
|
-
import '@refinitiv-ui/phrasebook/
|
|
18
|
+
import '@refinitiv-ui/phrasebook/locale/en/color-dialog.js';
|
|
19
19
|
/**
|
|
20
20
|
* Displays a colour picker dialog,
|
|
21
21
|
* for selecting a predefined range of colours.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataItem } from '@refinitiv-ui/utils/
|
|
1
|
+
import type { DataItem } from '@refinitiv-ui/utils/collection.js';
|
|
2
2
|
import type { ComboBox } from '../index';
|
|
3
3
|
import type { ComboBoxFilter } from './types';
|
|
4
4
|
import type { ItemData } from '../../item';
|
package/lib/combo-box/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
import { FormFieldElement, CSSResultGroup, PropertyValues, TapEvent, TemplateResult, StyleMap } from '@refinitiv-ui/core';
|
|
3
|
-
import { TemplateMap } from '@refinitiv-ui/core/
|
|
4
|
-
import { CollectionComposer, DataItem } from '@refinitiv-ui/utils/
|
|
5
|
-
import { AnimationTaskRunner } from '@refinitiv-ui/utils/
|
|
3
|
+
import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
|
|
4
|
+
import { CollectionComposer, DataItem } from '@refinitiv-ui/utils/collection.js';
|
|
5
|
+
import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
6
6
|
import { ItemData } from '../item';
|
|
7
7
|
import { ComboBoxData, ComboBoxFilter } from './helpers/types';
|
|
8
8
|
import type { List } from '../list/index.js';
|
|
@@ -13,7 +13,7 @@ import '../overlay/index.js';
|
|
|
13
13
|
import '../list/index.js';
|
|
14
14
|
import '../counter/index.js';
|
|
15
15
|
import { TranslateDirective } from '@refinitiv-ui/translate';
|
|
16
|
-
import '@refinitiv-ui/phrasebook/
|
|
16
|
+
import '@refinitiv-ui/phrasebook/locale/en/combo-box.js';
|
|
17
17
|
export type { ComboBoxFilter, ComboBoxData };
|
|
18
18
|
export { ComboBoxRenderer };
|
|
19
19
|
/**
|
package/lib/combo-box/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { FormFieldElement, css, html, WarningNotice, FocusedPropertyKey } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
5
|
-
import { query } from '@refinitiv-ui/core/
|
|
6
|
-
import { eventOptions } from '@refinitiv-ui/core/
|
|
7
|
-
import { styleMap } from '@refinitiv-ui/core/
|
|
8
|
-
import { ifDefined } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
|
+
import { eventOptions } from '@refinitiv-ui/core/decorators/event-options.js';
|
|
7
|
+
import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
8
|
+
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
9
9
|
import { VERSION } from '../version.js';
|
|
10
|
-
import { CollectionComposer } from '@refinitiv-ui/utils/
|
|
11
|
-
import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/
|
|
10
|
+
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
11
|
+
import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
12
12
|
import { ComboBoxRenderer } from './helpers/renderer.js';
|
|
13
13
|
import { defaultFilter } from './helpers/filter.js';
|
|
14
14
|
import { CustomKeyboardEvent } from './helpers/keyboard-event.js';
|
|
@@ -17,7 +17,7 @@ import '../overlay/index.js';
|
|
|
17
17
|
import '../list/index.js';
|
|
18
18
|
import '../counter/index.js';
|
|
19
19
|
import { translate } from '@refinitiv-ui/translate';
|
|
20
|
-
import '@refinitiv-ui/phrasebook/
|
|
20
|
+
import '@refinitiv-ui/phrasebook/locale/en/combo-box.js';
|
|
21
21
|
export { ComboBoxRenderer };
|
|
22
22
|
const QUERY_DEBOUNCE_RATE = 0;
|
|
23
23
|
// Maximum number of characters to display in multiple mode
|
|
@@ -267,13 +267,19 @@ let ComboBox = class ComboBox extends FormFieldElement {
|
|
|
267
267
|
else {
|
|
268
268
|
// Clone value arrays
|
|
269
269
|
const newValues = values.slice(0, this.multiple ? values.length : 1);
|
|
270
|
-
const oldValues = this.
|
|
270
|
+
const oldValues = this.values.slice();
|
|
271
271
|
// Create comparison strings to check for differences
|
|
272
272
|
const newComparison = newValues.sort().toString();
|
|
273
273
|
const oldComparison = oldValues.sort().toString();
|
|
274
|
-
//
|
|
274
|
+
// Update the selection state when found new value
|
|
275
275
|
if (newComparison !== oldComparison) {
|
|
276
276
|
this.updateComposerValues(newValues);
|
|
277
|
+
if (this.freeText) {
|
|
278
|
+
// free text mode is only supported in single selection mode
|
|
279
|
+
// so if there is no valid selection in the composer, we can assume
|
|
280
|
+
// the first item can be used as the free text item.
|
|
281
|
+
this.freeTextValue = !this.composerValues.length ? newValues[0] : '';
|
|
282
|
+
}
|
|
277
283
|
this.requestUpdate('values', oldValues);
|
|
278
284
|
}
|
|
279
285
|
}
|
|
@@ -580,10 +586,9 @@ let ComboBox = class ComboBox extends FormFieldElement {
|
|
|
580
586
|
* @returns {void}
|
|
581
587
|
*/
|
|
582
588
|
scrollToSelected() {
|
|
583
|
-
var _a;
|
|
584
589
|
const item = this.selectedItem;
|
|
585
590
|
if (item) {
|
|
586
|
-
|
|
591
|
+
this.listEl?.scrollToItem(item);
|
|
587
592
|
}
|
|
588
593
|
}
|
|
589
594
|
/**
|
|
@@ -1041,6 +1046,7 @@ let ComboBox = class ComboBox extends FormFieldElement {
|
|
|
1041
1046
|
return html `
|
|
1042
1047
|
<ef-list
|
|
1043
1048
|
id="internal-list"
|
|
1049
|
+
tabindex="-1"
|
|
1044
1050
|
@value-changed="${this.onListValueChanged}"
|
|
1045
1051
|
.data="${this.composer}"
|
|
1046
1052
|
.multiple="${this.multiple}"
|
|
@@ -1087,7 +1093,18 @@ let ComboBox = class ComboBox extends FormFieldElement {
|
|
|
1087
1093
|
* @returns template map
|
|
1088
1094
|
*/
|
|
1089
1095
|
get decorateInputMap() {
|
|
1090
|
-
return
|
|
1096
|
+
return {
|
|
1097
|
+
...super.decorateInputMap,
|
|
1098
|
+
'part': 'input',
|
|
1099
|
+
'type': 'text',
|
|
1100
|
+
'role': 'combobox',
|
|
1101
|
+
'.value': this.focused ? this.inputText : this.freeTextValue || this.label,
|
|
1102
|
+
'aria-expanded': this.opened ? 'true' : 'false',
|
|
1103
|
+
'aria-haspopup': 'listbox',
|
|
1104
|
+
'aria-autocomplete': 'list',
|
|
1105
|
+
'aria-owns': 'internal-list',
|
|
1106
|
+
'aria-activedescendant': this.highlightedItemValue
|
|
1107
|
+
};
|
|
1091
1108
|
}
|
|
1092
1109
|
/**
|
|
1093
1110
|
* Returns a template for input field
|
package/lib/counter/index.d.ts
CHANGED
|
@@ -15,14 +15,14 @@ export declare class Counter extends BasicElement {
|
|
|
15
15
|
*/
|
|
16
16
|
private _value;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
* Internal max of the element.
|
|
19
|
+
*/
|
|
20
20
|
private _max;
|
|
21
21
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
* The value of counter as string number
|
|
23
|
+
* @param value counter value
|
|
24
|
+
* @default -
|
|
25
|
+
*/
|
|
26
26
|
set value(value: string);
|
|
27
27
|
/**
|
|
28
28
|
* The value of counter as string number
|
package/lib/counter/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { BasicElement, html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
3
|
-
import { customElement } from '@refinitiv-ui/core/
|
|
4
|
-
import { property } from '@refinitiv-ui/core/
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { VERSION } from '../version.js';
|
|
6
6
|
import { truncateDecimal, convertToCompactNotation } from './utils.js';
|
|
7
7
|
/**
|
|
@@ -16,8 +16,8 @@ let Counter = class Counter extends BasicElement {
|
|
|
16
16
|
*/
|
|
17
17
|
this._value = '';
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
* Internal max of the element.
|
|
20
|
+
*/
|
|
21
21
|
this._max = '';
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
@@ -28,10 +28,10 @@ let Counter = class Counter extends BasicElement {
|
|
|
28
28
|
return VERSION;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
* The value of counter as string number
|
|
32
|
+
* @param value counter value
|
|
33
|
+
* @default -
|
|
34
|
+
*/
|
|
35
35
|
set value(value) {
|
|
36
36
|
value = this.validateValue(value, 'value');
|
|
37
37
|
const oldValue = this._value;
|