@refinitiv-ui/elements 6.8.0 → 6.9.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/CHANGELOG.md +8 -0
- package/lib/calendar/index.d.ts +1 -2
- package/lib/calendar/index.js +6 -7
- package/lib/collapse/index.d.ts +6 -0
- package/lib/collapse/index.js +26 -29
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/collapse/themes/solar/charcoal/index.js +1 -1
- package/lib/collapse/themes/solar/pearl/index.js +1 -1
- package/lib/color-dialog/helpers/value-model.js +1 -4
- package/lib/color-picker/index.js +2 -3
- package/lib/combo-box/index.js +2 -3
- package/lib/config/custom-elements.json +23 -0
- package/lib/config/custom-elements.md +8 -0
- package/lib/config/elements/config.d.ts +37 -0
- package/lib/config/elements/config.js +44 -0
- package/lib/config/helpers/context.d.ts +12 -0
- package/lib/config/helpers/context.js +2 -0
- package/lib/config/index.d.ts +2 -0
- package/lib/config/index.js +2 -0
- package/lib/datetime-field/index.d.ts +2 -2
- package/lib/datetime-field/index.js +7 -7
- package/lib/datetime-field/utils.d.ts +2 -2
- package/lib/datetime-field/utils.js +2 -2
- package/lib/datetime-picker/index.js +3 -4
- package/lib/icon/index.d.ts +11 -0
- package/lib/icon/index.js +16 -1
- package/lib/multi-input/index.js +3 -4
- package/lib/number-field/index.d.ts +1 -1
- package/lib/number-field/index.js +5 -5
- package/lib/overlay-menu/index.js +7 -8
- package/lib/pagination/index.js +2 -3
- package/lib/search-field/index.js +3 -4
- package/lib/sidebar-layout/index.js +2 -3
- package/lib/slider/index.js +3 -4
- package/lib/text-field/index.js +4 -5
- package/lib/time-picker/index.js +8 -9
- package/lib/toggle/index.js +0 -3
- package/lib/tooltip/index.js +2 -2
- package/lib/tornado-chart/elements/tornado-item.js +8 -9
- package/lib/tree-select/index.js +2 -3
- package/lib/version.js +1 -1
- package/package.json +16 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [6.8.1](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.8.0...@refinitiv-ui/elements@6.8.1) (2023-05-12)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @refinitiv-ui/elements
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [6.8.0](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.7.3...@refinitiv-ui/elements@6.8.0) (2023-05-08)
|
|
7
15
|
|
|
8
16
|
|
package/lib/calendar/index.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import type { CalendarFilter } from './types';
|
|
|
5
5
|
import './locales.js';
|
|
6
6
|
import '../button/index.js';
|
|
7
7
|
import '@refinitiv-ui/phrasebook/locale/en/calendar.js';
|
|
8
|
-
import { PropertyValueMap } from 'lit';
|
|
9
8
|
export { CalendarFilter };
|
|
10
9
|
/**
|
|
11
10
|
* Standard calendar element
|
|
@@ -185,7 +184,7 @@ export declare class Calendar extends ControlElement implements MultiValue {
|
|
|
185
184
|
* @param changedProperties Properties that will change
|
|
186
185
|
* @returns {void}
|
|
187
186
|
*/
|
|
188
|
-
protected willUpdate(changedProperties:
|
|
187
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
189
188
|
/**
|
|
190
189
|
* Updates the element
|
|
191
190
|
* @param changedProperties Properties that has changed
|
package/lib/calendar/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement, html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
2
|
+
import { ControlElement, html, css, nothing, WarningNotice } 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 { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
6
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
6
|
import { cache } from '@refinitiv-ui/core/directives/cache.js';
|
|
8
7
|
import { guard } from '@refinitiv-ui/core/directives/guard.js';
|
|
9
8
|
import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
|
|
@@ -1132,7 +1131,7 @@ let Calendar = class Calendar extends ControlElement {
|
|
|
1132
1131
|
return html `<div
|
|
1133
1132
|
role="gridcell"
|
|
1134
1133
|
part="cell ${cell.view}"
|
|
1135
|
-
aria-selected="${
|
|
1134
|
+
aria-selected="${isSelectable ? (cell.selected ? 'true' : 'false') : nothing}"
|
|
1136
1135
|
?active=${cell.active}
|
|
1137
1136
|
?disabled=${cell.disabled}
|
|
1138
1137
|
?idle=${cell.idle}
|
|
@@ -1143,13 +1142,13 @@ let Calendar = class Calendar extends ControlElement {
|
|
|
1143
1142
|
?range=${cell.range}
|
|
1144
1143
|
?range-from=${cell.rangeFrom}
|
|
1145
1144
|
?range-to=${cell.rangeTo}>
|
|
1146
|
-
<div role="${
|
|
1147
|
-
tabindex=${
|
|
1148
|
-
aria-label="${
|
|
1145
|
+
<div role="${cell.value ? 'button' : nothing}"
|
|
1146
|
+
tabindex=${isSelectable ? (cell.active ? 0 : -1) : nothing}
|
|
1147
|
+
aria-label="${isSelectable && !isIE ? this.t(this.getCellLabelKey(cell), {
|
|
1149
1148
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
1150
1149
|
value: parse(cell.value),
|
|
1151
1150
|
view: this.renderView
|
|
1152
|
-
}) :
|
|
1151
|
+
}) : nothing}"
|
|
1153
1152
|
part="cell-content${isSelection ? ' selection' : ''}${isSelectable ? ' selectable' : ''}"
|
|
1154
1153
|
.value=${cell.value}
|
|
1155
1154
|
.index=${cell.index}>${cell.text}</div>
|
package/lib/collapse/index.d.ts
CHANGED
|
@@ -100,6 +100,12 @@ export declare class Collapse extends BasicElement {
|
|
|
100
100
|
* @returns clientHeight of the panel so that the panel holder max-height can be set
|
|
101
101
|
*/
|
|
102
102
|
private getContentHeight;
|
|
103
|
+
/**
|
|
104
|
+
* Prevents expanding collapse when interactive element in slot is tapped
|
|
105
|
+
* @param event Tap event
|
|
106
|
+
* @returns {void}
|
|
107
|
+
*/
|
|
108
|
+
private handleSlotTap;
|
|
103
109
|
/**
|
|
104
110
|
* A `TemplateResult` that will be used
|
|
105
111
|
* to render the updated internal template.
|
package/lib/collapse/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement, css, html } from '@refinitiv-ui/core';
|
|
2
|
+
import { BasicElement, css, nothing, 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 { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
6
5
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
7
6
|
import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
|
|
8
7
|
import { VERSION } from '../version.js';
|
|
@@ -74,20 +73,6 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
74
73
|
:host(:not([expanded])) [part~=content] {
|
|
75
74
|
visibility: hidden;
|
|
76
75
|
}
|
|
77
|
-
[part~=header] {
|
|
78
|
-
position: relative;
|
|
79
|
-
z-index: 0;
|
|
80
|
-
}
|
|
81
|
-
[part~=header-toggle]::before {
|
|
82
|
-
content: '';
|
|
83
|
-
display: block;
|
|
84
|
-
position: absolute;
|
|
85
|
-
top: 0;
|
|
86
|
-
right: 0;
|
|
87
|
-
bottom: 0;
|
|
88
|
-
left: 0;
|
|
89
|
-
z-index: -1;
|
|
90
|
-
}
|
|
91
76
|
[part~=content] {
|
|
92
77
|
overflow: hidden;
|
|
93
78
|
box-sizing: border-box;
|
|
@@ -173,6 +158,14 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
173
158
|
const panelEl = this.panelRef.value;
|
|
174
159
|
return panelEl ? panelEl.clientHeight : 0;
|
|
175
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Prevents expanding collapse when interactive element in slot is tapped
|
|
163
|
+
* @param event Tap event
|
|
164
|
+
* @returns {void}
|
|
165
|
+
*/
|
|
166
|
+
handleSlotTap(event) {
|
|
167
|
+
event.stopPropagation();
|
|
168
|
+
}
|
|
176
169
|
/**
|
|
177
170
|
* A `TemplateResult` that will be used
|
|
178
171
|
* to render the updated internal template.
|
|
@@ -180,21 +173,25 @@ let Collapse = class Collapse extends BasicElement {
|
|
|
180
173
|
*/
|
|
181
174
|
render() {
|
|
182
175
|
return html `
|
|
183
|
-
<ef-header
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
176
|
+
<ef-header
|
|
177
|
+
part="header"
|
|
178
|
+
role="heading"
|
|
179
|
+
level=${this.level}
|
|
180
|
+
aria-level=${this.headingLevel ?? nothing}
|
|
181
|
+
@tap=${this.toggle}>
|
|
182
|
+
<div
|
|
183
|
+
id="header-label"
|
|
184
|
+
role="button"
|
|
185
|
+
tabindex="0"
|
|
186
|
+
aria-expanded="${this.expanded}"
|
|
187
|
+
aria-controls="content">
|
|
188
|
+
${this.header}
|
|
189
|
+
</div>
|
|
193
190
|
<ef-icon icon="right" part="toggle" slot="left" aria-hidden="true"></ef-icon>
|
|
194
|
-
<slot name="header-left" slot="left"></slot>
|
|
195
|
-
<slot name="header-right" slot="right"></slot>
|
|
191
|
+
<slot name="header-left" slot="left" @tap=${this.handleSlotTap}></slot>
|
|
192
|
+
<slot name="header-right" slot="right" @tap=${this.handleSlotTap}></slot>
|
|
196
193
|
</ef-header>
|
|
197
|
-
<div ${ref(this.panelHolderRef)} id="content" part="content" role="region" aria-labelledby="header-
|
|
194
|
+
<div ${ref(this.panelHolderRef)} id="content" part="content" role="region" aria-labelledby="header-label">
|
|
198
195
|
<ef-panel ${ref(this.panelRef)} part="content-data" ?spacing="${this.spacing}" transparent>
|
|
199
196
|
<slot></slot>
|
|
200
197
|
</ef-panel>
|
|
@@ -2,4 +2,4 @@ import '@refinitiv-ui/elements/panel/themes/halo/dark';
|
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/halo/dark';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
4
4
|
|
|
5
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{padding:0}:host [part~=header][focused=visible]{background-color:#1429bd}:host [part=header-
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#1429bd}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.1s;animation-timing-function:ease;text-transform:none}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}:host{text-transform:uppercase}:host [part=header]{text-transform:inherit}:host [part=header]:hover,:host [part~=header][focused=visible],:host([expanded]) [part=header]{color:#fff;background-color:#404040}:host [part=header]:hover[level="1"],:host [part~=header][focused=visible][level="1"],:host([expanded]) [part=header][level="1"]{background-color:#5a5a5a}:host [part=header]:hover[level="2"],:host [part~=header][focused=visible][level="2"],:host([expanded]) [part=header][level="2"]{background-color:#4d4d4d}:host [part=header]:hover[level="4"],:host [part~=header][focused=visible][level="4"],:host([expanded]) [part=header][level="4"]{background-color:#343434}' }}));
|
|
@@ -2,4 +2,4 @@ import '@refinitiv-ui/elements/panel/themes/halo/light';
|
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/halo/light';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
4
4
|
|
|
5
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{padding:0}:host [part~=header][focused=visible]{background-color:#1429bd}:host [part=header-
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.1s;opacity:.5;margin-right:.25em;margin-left:8px;flex-shrink:0;pointer-events:none;opacity:1}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#1429bd}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.1s;animation-timing-function:ease;text-transform:none}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}:host{text-transform:uppercase}:host [part=header]{text-transform:inherit}:host [part=header]:hover,:host [part~=header][focused=visible],:host([expanded]) [part=header]{color:#0d0d0d;background-color:#eaeaea}:host [part=header]:hover[level="1"],:host [part~=header][focused=visible][level="1"],:host([expanded]) [part=header][level="1"]{background-color:#d1d1d1}:host [part=header]:hover[level="2"],:host [part~=header][focused=visible][level="2"],:host([expanded]) [part=header][level="2"]{background-color:#dedede}:host [part=header]:hover[level="4"],:host [part~=header][focused=visible][level="4"],:host([expanded]) [part=header][level="4"]{background-color:#f2f2f2}' }}));
|
|
@@ -2,4 +2,4 @@ import '@refinitiv-ui/elements/panel/themes/solar/charcoal';
|
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/solar/charcoal';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
4
4
|
|
|
5
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{padding:0}:host [part~=header][focused=visible]{background-color:#4d4d55}:host [part=header-
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#4d4d55}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.2s;animation-timing-function:ease}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}' }}));
|
|
@@ -2,4 +2,4 @@ import '@refinitiv-ui/elements/panel/themes/solar/pearl';
|
|
|
2
2
|
import '@refinitiv-ui/elements/header/themes/solar/pearl';
|
|
3
3
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
4
4
|
|
|
5
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{padding:0}:host [part~=header][focused=visible]{background-color:#fff}:host [part=header-
|
|
5
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-collapse', styles: ':host [part=toggle]{transition:.2s;opacity:.5;margin-right:.25em;margin-left:10px;flex-shrink:0;pointer-events:none}:host([expanded]) [part=toggle]{transform:rotate(90deg)}:host [part~=header]{touch-action:manipulation;cursor:pointer;padding:0}:host [part~=header][focused=visible]{background-color:#fff}:host [part=header-label]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;outline:0}@keyframes expand{from{height:0}to{height:var(--target-height)}}@keyframes collapse{from{height:var(--target-height)}to{height:0}}:host [part=content]{animation-duration:.2s;animation-timing-function:ease}:host(:not([expanded])) [part=content]{height:0;animation-name:collapse}:host(:not([expanded])) [part=toggle]{transform:rotate(0)}:host([expanded]) [part=content]{animation-name:expand}:host [part=content] ef-panel{overflow:auto}:host [part=content] ef-panel:not([spacing]){padding:var(--panel-padding)}' }}));
|
|
@@ -17,10 +17,7 @@ class ValueModel {
|
|
|
17
17
|
this._hex = value.slice(1);
|
|
18
18
|
}
|
|
19
19
|
getHexValue() {
|
|
20
|
-
if (this.red === '' && this.green === '' && this.blue === '') {
|
|
21
|
-
return '';
|
|
22
|
-
}
|
|
23
|
-
else if (!this.isValidRGB()) {
|
|
20
|
+
if (!this.isValidRGB() || this.red === '' && this.green === '' && this.blue === '') {
|
|
24
21
|
return '';
|
|
25
22
|
}
|
|
26
23
|
const hex = rgb(Number(this.red), Number(this.green), Number(this.blue)).formatHex();
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement, html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
2
|
+
import { ControlElement, html, css, WarningNotice, nothing } 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';
|
|
6
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
7
|
import { isHex, readableColor } from '@refinitiv-ui/utils/color.js';
|
|
9
8
|
import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
|
|
@@ -247,7 +246,7 @@ let ColorPicker = class ColorPicker extends ControlElement {
|
|
|
247
246
|
return html `<ef-color-dialog
|
|
248
247
|
offset="4"
|
|
249
248
|
${ref(this.dialogRef)}
|
|
250
|
-
.lang=${
|
|
249
|
+
.lang=${this.lang || nothing}
|
|
251
250
|
.value=${this.value}
|
|
252
251
|
.focusBoundary=${this}
|
|
253
252
|
.positionTarget=${this}
|
package/lib/combo-box/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { FormFieldElement, css, html, WarningNotice, FocusedPropertyKey, triggerResize } from '@refinitiv-ui/core';
|
|
2
|
+
import { FormFieldElement, css, html, WarningNotice, FocusedPropertyKey, triggerResize, nothing } 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 { eventOptions } from '@refinitiv-ui/core/decorators/event-options.js';
|
|
7
7
|
import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
8
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
9
8
|
import { VERSION } from '../version.js';
|
|
10
9
|
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
11
10
|
import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
@@ -1026,7 +1025,7 @@ let ComboBox = class ComboBox extends FormFieldElement {
|
|
|
1026
1025
|
// benefit of being localised too
|
|
1027
1026
|
if (this.focused || selectionLength > 1) {
|
|
1028
1027
|
return html `
|
|
1029
|
-
<ef-counter part="selection-badge" tabindex="-1" .value=${selectionLength} title=${
|
|
1028
|
+
<ef-counter part="selection-badge" tabindex="-1" .value=${selectionLength} title=${selectionLength > 999 ? selectionLength.toLocaleString() : nothing} max="999"></ef-counter>
|
|
1030
1029
|
`;
|
|
1031
1030
|
}
|
|
1032
1031
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "experimental",
|
|
3
|
+
"tags": [
|
|
4
|
+
{
|
|
5
|
+
"name": "ef-config",
|
|
6
|
+
"attributes": [
|
|
7
|
+
{
|
|
8
|
+
"name": "icon"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"properties": [
|
|
12
|
+
{
|
|
13
|
+
"name": "config",
|
|
14
|
+
"default": "{\"icon\":{\"map\":{}}}"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "icon",
|
|
18
|
+
"attribute": "icon"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { JSXInterface } from '../../jsx';
|
|
2
|
+
import { BasicElement, TemplateResult } from '@refinitiv-ui/core';
|
|
3
|
+
import { type Config as ConfigType, type ConfigIcon } from '../helpers/context.js';
|
|
4
|
+
export declare class Config extends BasicElement {
|
|
5
|
+
/**
|
|
6
|
+
* Element version number
|
|
7
|
+
* @returns version number
|
|
8
|
+
*/
|
|
9
|
+
static get version(): string;
|
|
10
|
+
config: ConfigType;
|
|
11
|
+
set icon(icon: ConfigIcon);
|
|
12
|
+
/**
|
|
13
|
+
* A `TemplateResult` that will be used
|
|
14
|
+
* to render the updated internal template.
|
|
15
|
+
* @return Render template
|
|
16
|
+
*/
|
|
17
|
+
protected render(): TemplateResult;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'ef-config': Config;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'ef-config': Config;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
namespace JSX {
|
|
31
|
+
interface IntrinsicElements {
|
|
32
|
+
'ef-config': Partial<Config> | JSXInterface.HTMLAttributes<Config>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { BasicElement, html } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
+
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
5
|
+
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
6
|
+
import { VERSION } from '../../version.js';
|
|
7
|
+
import { efConfig } from '../helpers/context.js';
|
|
8
|
+
import { provide } from '@lit-labs/context';
|
|
9
|
+
const DEFAULT_CONFIG = { icon: { map: {} } };
|
|
10
|
+
let Config = class Config extends BasicElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.config = DEFAULT_CONFIG;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Element version number
|
|
17
|
+
* @returns version number
|
|
18
|
+
*/
|
|
19
|
+
static get version() {
|
|
20
|
+
return VERSION;
|
|
21
|
+
}
|
|
22
|
+
set icon(icon) {
|
|
23
|
+
this.config = { ...this.config, icon };
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A `TemplateResult` that will be used
|
|
27
|
+
* to render the updated internal template.
|
|
28
|
+
* @return Render template
|
|
29
|
+
*/
|
|
30
|
+
render() {
|
|
31
|
+
return html `<slot></slot>`;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
__decorate([
|
|
35
|
+
provide({ context: efConfig }),
|
|
36
|
+
state()
|
|
37
|
+
], Config.prototype, "config", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
property({ type: Object })
|
|
40
|
+
], Config.prototype, "icon", null);
|
|
41
|
+
Config = __decorate([
|
|
42
|
+
customElement('ef-config', { theme: false })
|
|
43
|
+
], Config);
|
|
44
|
+
export { Config };
|
|
@@ -262,11 +262,11 @@ export declare class DatetimeField extends TextField {
|
|
|
262
262
|
reportValidity(): boolean;
|
|
263
263
|
/**
|
|
264
264
|
* Select part
|
|
265
|
-
* @param index Part index
|
|
266
265
|
* @param parts The list of parts
|
|
266
|
+
* @param index Part index
|
|
267
267
|
* @returns {void}
|
|
268
268
|
*/
|
|
269
|
-
protected selectPart(
|
|
269
|
+
protected selectPart(parts: DateTimeFormatPart[], index?: number): void;
|
|
270
270
|
/**
|
|
271
271
|
* Change value or selection based on keyboard navigation
|
|
272
272
|
* @param key Navigation key
|
|
@@ -438,12 +438,12 @@ let DatetimeField = class DatetimeField extends TextField {
|
|
|
438
438
|
}
|
|
439
439
|
/**
|
|
440
440
|
* Select part
|
|
441
|
-
* @param index Part index
|
|
442
441
|
* @param parts The list of parts
|
|
442
|
+
* @param index Part index
|
|
443
443
|
* @returns {void}
|
|
444
444
|
*/
|
|
445
|
-
selectPart(index = 0
|
|
446
|
-
const { selectionStart, selectionEnd } = selectPart(
|
|
445
|
+
selectPart(parts, index = 0) {
|
|
446
|
+
const { selectionStart, selectionEnd } = selectPart(parts, index);
|
|
447
447
|
this.partLabel = parts[index] ? parts[index].type : '';
|
|
448
448
|
this.setSelectionRange(selectionStart, selectionEnd);
|
|
449
449
|
}
|
|
@@ -487,7 +487,7 @@ let DatetimeField = class DatetimeField extends TextField {
|
|
|
487
487
|
const selectedPartIndex = getSelectedPartIndex(selection, parts);
|
|
488
488
|
// If no segments selected, select the segment where the cursor is
|
|
489
489
|
if (this.selectionStart === this.selectionEnd) {
|
|
490
|
-
this.selectPart(
|
|
490
|
+
this.selectPart(parts, selectedPartIndex);
|
|
491
491
|
event.preventDefault();
|
|
492
492
|
return;
|
|
493
493
|
}
|
|
@@ -520,16 +520,16 @@ let DatetimeField = class DatetimeField extends TextField {
|
|
|
520
520
|
}
|
|
521
521
|
this.setValueAndNotify(newValue);
|
|
522
522
|
this.syncInputValue();
|
|
523
|
-
this.selectPart(
|
|
523
|
+
this.selectPart(this.formatToParts(newValue), selectedPartIndex);
|
|
524
524
|
this.resetError();
|
|
525
525
|
event.preventDefault();
|
|
526
526
|
}
|
|
527
527
|
break;
|
|
528
528
|
case 'ArrowRight':
|
|
529
529
|
case 'ArrowLeft':
|
|
530
|
-
const
|
|
530
|
+
const nextPartIndex = getNextSelectedPartIndex(selection, parts, this.inputValue, key === 'ArrowLeft' ? Direction.Down : Direction.Up);
|
|
531
531
|
this.selectPartFrame.schedule(() => {
|
|
532
|
-
this.selectPart(
|
|
532
|
+
this.selectPart(parts, nextPartIndex);
|
|
533
533
|
});
|
|
534
534
|
break;
|
|
535
535
|
// no default
|
|
@@ -18,8 +18,8 @@ export declare const getSelectedPartIndex: (selection: InputSelection, parts: Da
|
|
|
18
18
|
export declare const getNextSelectedPartIndex: (selection: InputSelection, parts: DateTimeFormatPart[], inputValue: string, direction?: Direction) => number;
|
|
19
19
|
/**
|
|
20
20
|
* Get part selectionStart and selectionEnd indexes
|
|
21
|
-
* @param index Part index
|
|
22
21
|
* @param parts The list of parts
|
|
22
|
+
* @param index Part index
|
|
23
23
|
* @returns selection
|
|
24
24
|
*/
|
|
25
|
-
export declare const selectPart: (
|
|
25
|
+
export declare const selectPart: (parts: DateTimeFormatPart[], index?: number) => InputSelection;
|
|
@@ -57,11 +57,11 @@ export const getNextSelectedPartIndex = (selection, parts, inputValue, direction
|
|
|
57
57
|
};
|
|
58
58
|
/**
|
|
59
59
|
* Get part selectionStart and selectionEnd indexes
|
|
60
|
-
* @param index Part index
|
|
61
60
|
* @param parts The list of parts
|
|
61
|
+
* @param index Part index
|
|
62
62
|
* @returns selection
|
|
63
63
|
*/
|
|
64
|
-
export const selectPart = (index = 0
|
|
64
|
+
export const selectPart = (parts, index = 0) => {
|
|
65
65
|
let selectionStart = 0;
|
|
66
66
|
let selectionEnd = 0;
|
|
67
67
|
for (let i = 0; i < parts.length; i += 1) {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement, html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
2
|
+
import { ControlElement, html, css, WarningNotice, nothing } 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 { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
7
|
import '../calendar/index.js';
|
|
9
8
|
import '../icon/index.js';
|
|
@@ -938,7 +937,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
938
937
|
return html `<ef-calendar
|
|
939
938
|
part="calendar"
|
|
940
939
|
id=${id}
|
|
941
|
-
lang=${
|
|
940
|
+
lang=${this.lang || nothing}
|
|
942
941
|
.fillCells=${!this.isDuplex()}
|
|
943
942
|
.range=${this.range}
|
|
944
943
|
.multiple=${this.multiple}
|
|
@@ -946,7 +945,7 @@ let DatetimePicker = class DatetimePicker extends ControlElement {
|
|
|
946
945
|
.max=${this.maxDate}
|
|
947
946
|
.weekdaysOnly=${this.weekdaysOnly}
|
|
948
947
|
.weekendsOnly=${this.weekendsOnly}
|
|
949
|
-
.firstDayOfWeek=${
|
|
948
|
+
.firstDayOfWeek=${this.firstDayOfWeek || nothing}
|
|
950
949
|
.values=${this.calendarValues}
|
|
951
950
|
.filter=${this.filter}
|
|
952
951
|
.view=${view}
|
package/lib/icon/index.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
import { BasicElement, CSSResultGroup, TemplateResult, PropertyValues } from '@refinitiv-ui/core';
|
|
3
3
|
export { preload } from './utils/IconLoader.js';
|
|
4
|
+
import { type Config } from '../config/index.js';
|
|
4
5
|
export declare class Icon extends BasicElement {
|
|
5
6
|
/**
|
|
6
7
|
* Element version number
|
|
7
8
|
* @returns version number
|
|
8
9
|
*/
|
|
9
10
|
static get version(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Icon map from ef-config
|
|
13
|
+
* @ignore
|
|
14
|
+
*/
|
|
15
|
+
config?: Config;
|
|
10
16
|
/**
|
|
11
17
|
* A `CSSResultGroup` that will be used
|
|
12
18
|
* to style the host, slotted children
|
|
@@ -37,6 +43,11 @@ export declare class Icon extends BasicElement {
|
|
|
37
43
|
*/
|
|
38
44
|
private get template();
|
|
39
45
|
private set template(value);
|
|
46
|
+
/**
|
|
47
|
+
* Check if the autosuggest has content
|
|
48
|
+
* @returns content exists
|
|
49
|
+
*/
|
|
50
|
+
private get iconMap();
|
|
40
51
|
/**
|
|
41
52
|
* Called after the component is first rendered
|
|
42
53
|
* @param changedProperties Properties which have changed
|
package/lib/icon/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import { unsafeSVG } from '@refinitiv-ui/core/directives/unsafe-svg.js';
|
|
|
6
6
|
import { VERSION } from '../version.js';
|
|
7
7
|
import { IconLoader } from './utils/IconLoader.js';
|
|
8
8
|
export { preload } from './utils/IconLoader.js';
|
|
9
|
+
import { consume } from '@lit-labs/context';
|
|
10
|
+
import { efConfig } from '../config/index.js';
|
|
9
11
|
const EmptyTemplate = svg ``;
|
|
10
12
|
/**
|
|
11
13
|
* Cache for reusing SVG template results across multiple icons.
|
|
@@ -76,7 +78,10 @@ let Icon = class Icon extends BasicElement {
|
|
|
76
78
|
if (this.src !== value) {
|
|
77
79
|
this._src = value;
|
|
78
80
|
this.clearIcon();
|
|
79
|
-
if (
|
|
81
|
+
if (this.icon && this.iconMap) {
|
|
82
|
+
void this.loadAndRenderIcon(this.iconMap);
|
|
83
|
+
}
|
|
84
|
+
else if (value) {
|
|
80
85
|
void this.loadAndRenderIcon(value);
|
|
81
86
|
}
|
|
82
87
|
}
|
|
@@ -93,6 +98,13 @@ let Icon = class Icon extends BasicElement {
|
|
|
93
98
|
this.requestUpdate();
|
|
94
99
|
}
|
|
95
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Check if the autosuggest has content
|
|
103
|
+
* @returns content exists
|
|
104
|
+
*/
|
|
105
|
+
get iconMap() {
|
|
106
|
+
return this.icon && this.config?.icon.map[this.icon] || null;
|
|
107
|
+
}
|
|
96
108
|
/**
|
|
97
109
|
* Called after the component is first rendered
|
|
98
110
|
* @param changedProperties Properties which have changed
|
|
@@ -157,6 +169,9 @@ let Icon = class Icon extends BasicElement {
|
|
|
157
169
|
return this.template;
|
|
158
170
|
}
|
|
159
171
|
};
|
|
172
|
+
__decorate([
|
|
173
|
+
consume({ context: efConfig, subscribe: true })
|
|
174
|
+
], Icon.prototype, "config", void 0);
|
|
160
175
|
__decorate([
|
|
161
176
|
property({ type: String, reflect: true })
|
|
162
177
|
], Icon.prototype, "icon", null);
|
package/lib/multi-input/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement, css, html } from '@refinitiv-ui/core';
|
|
2
|
+
import { ControlElement, css, html, nothing } 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 { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
|
|
6
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
7
|
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
9
8
|
import '../pill/index.js';
|
|
@@ -411,8 +410,8 @@ let MultiInput = class MultiInput extends ControlElement {
|
|
|
411
410
|
@keydown="${this.handleKeyDown}"
|
|
412
411
|
@change="${this.onInputChange}"
|
|
413
412
|
@input="${this.onInputChange}"
|
|
414
|
-
maxlength="${
|
|
415
|
-
minlength="${
|
|
413
|
+
maxlength="${this.maxLength || nothing}"
|
|
414
|
+
minlength="${this.minLength || nothing}"
|
|
416
415
|
?error="${this.error}"
|
|
417
416
|
.value="${this.value}"
|
|
418
417
|
.icon="${this.icon || null}"
|
|
@@ -235,8 +235,8 @@ export declare class NumberField extends FormFieldElement {
|
|
|
235
235
|
private findNearestSteppedValue;
|
|
236
236
|
/**
|
|
237
237
|
* Apply step up or step down on the input
|
|
238
|
-
* @param stepIncrement step increment factor
|
|
239
238
|
* @param direction either go up or down
|
|
239
|
+
* @param stepIncrement step increment factor
|
|
240
240
|
* @returns {void}
|
|
241
241
|
*/
|
|
242
242
|
private applyStepDirection;
|
|
@@ -276,7 +276,7 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
276
276
|
*/
|
|
277
277
|
onApplyStep(direction) {
|
|
278
278
|
try {
|
|
279
|
-
this.applyStepDirection(
|
|
279
|
+
this.applyStepDirection(direction);
|
|
280
280
|
this.setSilentlyValueAndNotify();
|
|
281
281
|
}
|
|
282
282
|
catch (error) {
|
|
@@ -502,11 +502,11 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
502
502
|
}
|
|
503
503
|
/**
|
|
504
504
|
* Apply step up or step down on the input
|
|
505
|
-
* @param stepIncrement step increment factor
|
|
506
505
|
* @param direction either go up or down
|
|
506
|
+
* @param stepIncrement step increment factor
|
|
507
507
|
* @returns {void}
|
|
508
508
|
*/
|
|
509
|
-
applyStepDirection(stepIncrement = 1
|
|
509
|
+
applyStepDirection(direction, stepIncrement = 1) {
|
|
510
510
|
const min = this.stringToNumber(this.min);
|
|
511
511
|
const max = this.stringToNumber(this.max);
|
|
512
512
|
// If the element has a minimum and a maximum and the minimum is greater than the maximum, then return.
|
|
@@ -564,7 +564,7 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
564
564
|
* @returns {void}
|
|
565
565
|
*/
|
|
566
566
|
stepUp(stepIncrement) {
|
|
567
|
-
this.applyStepDirection(
|
|
567
|
+
this.applyStepDirection(Direction.Up, stepIncrement);
|
|
568
568
|
}
|
|
569
569
|
/**
|
|
570
570
|
* Decreases the input value by amount of step
|
|
@@ -572,7 +572,7 @@ let NumberField = class NumberField extends FormFieldElement {
|
|
|
572
572
|
* @returns {void}
|
|
573
573
|
*/
|
|
574
574
|
stepDown(stepIncrement) {
|
|
575
|
-
this.applyStepDirection(
|
|
575
|
+
this.applyStepDirection(Direction.Down, stepIncrement);
|
|
576
576
|
}
|
|
577
577
|
/**
|
|
578
578
|
* Returns true if an input element contains valid data.
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
var OverlayMenu_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
3
|
+
import { html, css, nothing, WarningNotice } from '@refinitiv-ui/core';
|
|
4
4
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
5
5
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
6
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
7
|
import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
9
8
|
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
@@ -872,7 +871,7 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
872
871
|
return html `<ef-item
|
|
873
872
|
role="presentation"
|
|
874
873
|
type="header"
|
|
875
|
-
title=${
|
|
874
|
+
title=${tooltip || nothing}
|
|
876
875
|
.label=${label}
|
|
877
876
|
.icon=${icon}></ef-item>`;
|
|
878
877
|
}
|
|
@@ -886,9 +885,9 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
886
885
|
// type text
|
|
887
886
|
return html `<ef-item
|
|
888
887
|
role="menuitem"
|
|
889
|
-
aria-haspopup=${
|
|
890
|
-
aria-expanded=${
|
|
891
|
-
title=${
|
|
888
|
+
aria-haspopup=${forMenu ? true : nothing}
|
|
889
|
+
aria-expanded=${forMenu ? false : nothing}
|
|
890
|
+
title=${tooltip || nothing}
|
|
892
891
|
?disabled=${disabled}
|
|
893
892
|
?selected=${selected}
|
|
894
893
|
?highlighted=${highlighted}
|
|
@@ -896,8 +895,8 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
896
895
|
.label=${label}
|
|
897
896
|
.subLabel=${subLabel}
|
|
898
897
|
.icon=${icon}
|
|
899
|
-
.value=${
|
|
900
|
-
.for=${
|
|
898
|
+
.value=${value || nothing}
|
|
899
|
+
.for=${forMenu || nothing}>
|
|
901
900
|
</ef-item>`;
|
|
902
901
|
}
|
|
903
902
|
/**
|
package/lib/pagination/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement, html, css, WarningNotice } from '@refinitiv-ui/core';
|
|
2
|
+
import { BasicElement, html, css, nothing, WarningNotice } 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 { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
6
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
6
|
import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
|
|
8
7
|
import { VERSION } from '../version.js';
|
|
9
8
|
import '../button/index.js';
|
|
@@ -477,7 +476,7 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
477
476
|
role="spinbutton"
|
|
478
477
|
aria-valuenow=${this.internalValue}
|
|
479
478
|
aria-valuemin="1"
|
|
480
|
-
aria-valuemax=${
|
|
479
|
+
aria-valuemax=${this.max || nothing}
|
|
481
480
|
.value=${this.inputValue}
|
|
482
481
|
.disabled=${this.disabled}
|
|
483
482
|
@focus=${this.onFocusedChanged}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html } from '@refinitiv-ui/core';
|
|
2
|
+
import { html, nothing } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
5
4
|
import '../icon/index.js';
|
|
6
5
|
import { TextField } from '../text-field/index.js';
|
|
7
6
|
import { translate } from '@refinitiv-ui/translate';
|
|
@@ -66,13 +65,13 @@ let SearchField = class SearchField extends TextField {
|
|
|
66
65
|
return html `
|
|
67
66
|
<ef-icon
|
|
68
67
|
part="icon"
|
|
69
|
-
role="${
|
|
68
|
+
role="${this.iconHasAction ? 'button' : nothing}"
|
|
69
|
+
tabindex="${this.iconHasAction ? '0' : nothing}"
|
|
70
70
|
icon="search"
|
|
71
71
|
aria-label="${this.t('SEARCH')}"
|
|
72
72
|
?readonly="${this.readonly}"
|
|
73
73
|
?disabled="${this.disabled}"
|
|
74
74
|
@tap="${this.iconClick}"
|
|
75
|
-
tabindex="${ifDefined(this.iconHasAction ? '0' : undefined)}"
|
|
76
75
|
></ef-icon>
|
|
77
76
|
`;
|
|
78
77
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement, html, css } from '@refinitiv-ui/core';
|
|
2
|
+
import { BasicElement, html, css, nothing } 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 { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
7
|
import '../layout/index.js';
|
|
9
8
|
/**
|
|
@@ -82,7 +81,7 @@ let SidebarLayout = class SidebarLayout extends BasicElement {
|
|
|
82
81
|
return html `
|
|
83
82
|
<ef-layout flex nowrap part="container">
|
|
84
83
|
|
|
85
|
-
<ef-layout flex container part="sidebar" size="${
|
|
84
|
+
<ef-layout flex container part="sidebar" size="${this.sidebarWidth || nothing}">
|
|
86
85
|
<ef-layout size="auto">
|
|
87
86
|
<slot name="sidebar-header"></slot>
|
|
88
87
|
</ef-layout>
|
package/lib/slider/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, ControlElement, WarningNotice } from '@refinitiv-ui/core';
|
|
2
|
+
import { html, css, nothing, ControlElement, WarningNotice } 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 { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
8
7
|
import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
|
|
9
8
|
import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
10
9
|
import { translate } from '@refinitiv-ui/translate';
|
|
@@ -663,7 +662,7 @@ let Slider = class Slider extends ControlElement {
|
|
|
663
662
|
if (this.readonly || this.disabled) {
|
|
664
663
|
return;
|
|
665
664
|
}
|
|
666
|
-
if (event.key === '
|
|
665
|
+
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
667
666
|
event.target.blur();
|
|
668
667
|
}
|
|
669
668
|
}
|
|
@@ -1118,7 +1117,7 @@ let Slider = class Slider extends ControlElement {
|
|
|
1118
1117
|
${ref(this[`${name}ThumbRef`])}
|
|
1119
1118
|
@focus=${this.onThumbFocus}
|
|
1120
1119
|
@blur=${this.onThumbBlur}
|
|
1121
|
-
active=${
|
|
1120
|
+
active=${isActive || nothing}
|
|
1122
1121
|
name="${name}"
|
|
1123
1122
|
role="slider"
|
|
1124
1123
|
aria-label="${this.t(name.toUpperCase())}"
|
package/lib/text-field/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { FormFieldElement, css, html } from '@refinitiv-ui/core';
|
|
2
|
+
import { FormFieldElement, css, nothing, 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 { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
6
5
|
import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
|
|
7
6
|
import { VERSION } from '../version.js';
|
|
8
7
|
import { isIE } from '@refinitiv-ui/utils/browser.js';
|
|
@@ -236,14 +235,14 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
236
235
|
renderIcon() {
|
|
237
236
|
return this.icon ? html `
|
|
238
237
|
<ef-icon
|
|
239
|
-
role="${
|
|
238
|
+
role="${this.iconHasAction ? 'button' : nothing}"
|
|
239
|
+
tabindex="${this.iconHasAction ? '0' : nothing}"
|
|
240
|
+
aria-label="${this.iconHasAction ? this.icon : nothing}"
|
|
240
241
|
part="icon"
|
|
241
242
|
icon="${this.icon}"
|
|
242
|
-
aria-label="${ifDefined(this.iconHasAction ? this.icon : undefined)}"
|
|
243
243
|
?readonly="${this.readonly}"
|
|
244
244
|
?disabled="${this.disabled}"
|
|
245
245
|
@tap="${this.iconClick}"
|
|
246
|
-
tabindex="${ifDefined(this.iconHasAction ? '0' : undefined)}"
|
|
247
246
|
></ef-icon>
|
|
248
247
|
` : null;
|
|
249
248
|
}
|
package/lib/time-picker/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var TimePicker_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { ControlElement, html, css } from '@refinitiv-ui/core';
|
|
4
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
3
|
+
import { ControlElement, html, css, nothing } from '@refinitiv-ui/core';
|
|
5
4
|
import { guard } from '@refinitiv-ui/core/directives/guard.js';
|
|
6
5
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
7
6
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
@@ -706,13 +705,13 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
706
705
|
return html `<ef-number-field
|
|
707
706
|
id="hours"
|
|
708
707
|
part="input"
|
|
709
|
-
aria-label="${
|
|
708
|
+
aria-label="${!isIE ? this.t('SELECT_HOURS', { value: this.periodHours }) : nothing}"
|
|
710
709
|
no-spinner
|
|
711
710
|
transparent
|
|
712
711
|
min="${this.amPm ? 1 : MIN_UNIT}"
|
|
713
712
|
max="${this.amPm ? HOURS_OF_NOON : MAX_HOURS}"
|
|
714
713
|
.value="${hours}"
|
|
715
|
-
placeholder="${
|
|
714
|
+
placeholder="${hours ? nothing : Placeholder.HOURS}"
|
|
716
715
|
?disabled="${this.disabled}"
|
|
717
716
|
?readonly="${this.readonly}"
|
|
718
717
|
@value-changed="${this.onInputValueChanged}"
|
|
@@ -726,13 +725,13 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
726
725
|
const minutes = this.formattedMinutes;
|
|
727
726
|
return html `<ef-number-field
|
|
728
727
|
id="minutes"
|
|
729
|
-
aria-label="${
|
|
728
|
+
aria-label="${!isIE ? this.t('SELECT_MINUTES', { value: this.minutes }) : nothing}"
|
|
730
729
|
part="input"
|
|
731
730
|
no-spinner
|
|
732
731
|
min="${MIN_UNIT}"
|
|
733
732
|
max="${MAX_MINUTES}"
|
|
734
733
|
.value="${minutes}"
|
|
735
|
-
placeholder="${
|
|
734
|
+
placeholder="${minutes ? nothing : Placeholder.MINUTES}"
|
|
736
735
|
?readonly="${this.readonly}"
|
|
737
736
|
?disabled="${this.disabled}"
|
|
738
737
|
transparent
|
|
@@ -749,12 +748,12 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
749
748
|
<ef-number-field
|
|
750
749
|
id="seconds"
|
|
751
750
|
part="input"
|
|
752
|
-
aria-label="${
|
|
751
|
+
aria-label="${!isIE ? this.t('SELECT_SECONDS', { value: this.seconds }) : nothing}"
|
|
753
752
|
no-spinner
|
|
754
753
|
min="${MIN_UNIT}"
|
|
755
754
|
max="${MAX_SECONDS}"
|
|
756
755
|
.value="${seconds}"
|
|
757
|
-
placeholder="${
|
|
756
|
+
placeholder="${seconds ? nothing : Placeholder.SECONDS}"
|
|
758
757
|
?readonly="${this.readonly}"
|
|
759
758
|
?disabled="${this.disabled}"
|
|
760
759
|
transparent
|
|
@@ -770,7 +769,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
770
769
|
return this.amPm ? html `
|
|
771
770
|
<div role="listbox"
|
|
772
771
|
aria-label="${this.t('TOGGLE_TIME_PERIOD')}"
|
|
773
|
-
aria-activedescendant="${
|
|
772
|
+
aria-activedescendant="${hasHours ? this.isAM() ? 'toggle-am' : 'toggle-pm' : nothing}"
|
|
774
773
|
id="toggle"
|
|
775
774
|
part="toggle"
|
|
776
775
|
@tap=${this.toggle}
|
package/lib/toggle/index.js
CHANGED
|
@@ -103,9 +103,6 @@ let Toggle = class Toggle extends ControlElement {
|
|
|
103
103
|
if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
|
|
104
104
|
this.handleCheckedChange();
|
|
105
105
|
}
|
|
106
|
-
else if (event.keyCode && event.keyCode === 13 || event.keyCode === 32) { // For older browsers
|
|
107
|
-
this.handleCheckedChange();
|
|
108
|
-
}
|
|
109
106
|
}
|
|
110
107
|
/**
|
|
111
108
|
* A `TemplateResult` that will be used
|
package/lib/tooltip/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import './elements/title-tooltip.js';
|
|
|
11
11
|
import { register, deregister } from './managers/tooltip-manager.js';
|
|
12
12
|
import { tooltipRenderer } from './helpers/renderer.js';
|
|
13
13
|
import { register as registerOverflowTooltip, deregister as deregisterOverflowTooltip } from './helpers/overflow-tooltip.js';
|
|
14
|
-
const
|
|
14
|
+
const PositionMap = {
|
|
15
15
|
'auto': ['bottom-start', 'top-start'],
|
|
16
16
|
'above': ['top-middle'],
|
|
17
17
|
'right': ['right-middle'],
|
|
@@ -413,7 +413,7 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
413
413
|
* Get popup position based on tooltip position
|
|
414
414
|
*/
|
|
415
415
|
get tipPosition() {
|
|
416
|
-
return
|
|
416
|
+
return PositionMap[this.position];
|
|
417
417
|
}
|
|
418
418
|
/**
|
|
419
419
|
* A `TemplateResult` that will be used
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement, html, css } from '@refinitiv-ui/core';
|
|
2
|
+
import { BasicElement, html, css, nothing } 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 { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
6
5
|
import { VERSION } from '../../version.js';
|
|
7
6
|
import '../../progress-bar/index.js';
|
|
8
7
|
import '../../layout/index.js';
|
|
@@ -157,26 +156,26 @@ let TornadoItem = class TornadoItem extends BasicElement {
|
|
|
157
156
|
render() {
|
|
158
157
|
return html `
|
|
159
158
|
<ef-layout part="container" flex nowrap ?container="${this.isContainer}">
|
|
160
|
-
<ef-layout flex size="${
|
|
159
|
+
<ef-layout flex size="${this.labelLayoutSize || nothing}">
|
|
161
160
|
<div part="label">
|
|
162
161
|
<slot></slot>
|
|
163
162
|
</div>
|
|
164
163
|
</ef-layout>
|
|
165
|
-
<ef-layout flex basis="${
|
|
164
|
+
<ef-layout flex basis="${this.primaryLayoutFlexBasis || nothing}">
|
|
166
165
|
<ef-progress-bar
|
|
167
166
|
part="primary-bar"
|
|
168
167
|
alignment=${this.primaryBarAlignment}
|
|
169
|
-
label="${
|
|
170
|
-
value="${
|
|
168
|
+
label="${this.primaryLabel || nothing}"
|
|
169
|
+
value="${this.primaryValue || nothing}">
|
|
171
170
|
</ef-progress-bar>
|
|
172
171
|
</ef-layout>
|
|
173
172
|
<div part="seperator"></div>
|
|
174
|
-
<ef-layout flex basis="${
|
|
173
|
+
<ef-layout flex basis="${this.secondaryLayoutFlexBasis || nothing}">
|
|
175
174
|
<ef-progress-bar
|
|
176
175
|
part="secondary-bar"
|
|
177
176
|
alignment="${this.secondaryBarAlignment}"
|
|
178
|
-
label="${
|
|
179
|
-
value="${
|
|
177
|
+
label="${this.secondaryLabel || nothing}"
|
|
178
|
+
value="${this.secondaryValue || nothing}">
|
|
180
179
|
</ef-progress-bar>
|
|
181
180
|
</ef-layout>
|
|
182
181
|
</ef-layout>
|
package/lib/tree-select/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, triggerResize } from '@refinitiv-ui/core';
|
|
2
|
+
import { html, css, nothing, triggerResize } 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 { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
7
7
|
import { repeat } from '@refinitiv-ui/core/directives/repeat.js';
|
|
8
|
-
import { ifDefined } from '@refinitiv-ui/core/directives/if-defined.js';
|
|
9
8
|
import { VERSION } from '../version.js';
|
|
10
9
|
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
11
10
|
import { TimeoutTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
@@ -745,7 +744,7 @@ let TreeSelect = class TreeSelect extends ComboBox {
|
|
|
745
744
|
@tap="${this.fullClickHandler}">${this.t('FULL_LIST')}</div>
|
|
746
745
|
<div
|
|
747
746
|
role="button"
|
|
748
|
-
tabindex="${
|
|
747
|
+
tabindex="${this.hasActiveSelection ? 0 : nothing}"
|
|
749
748
|
part="control selected-filter${this.selectionFilterState ? ' active' : ''}${!this.hasActiveSelection ? ' disabled' : ''}"
|
|
750
749
|
@tap="${this.selectedClickHandler}">${this.t('SELECTED')}</div>
|
|
751
750
|
</div>` : html ``}
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '6.
|
|
1
|
+
export const VERSION = '6.9.0-next.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.0-next.0",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
5
|
"author": "LSEG",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
"./combo-box/themes/halo/light": "./lib/combo-box/themes/halo/light/index.js",
|
|
106
106
|
"./combo-box/themes/solar/charcoal": "./lib/combo-box/themes/solar/charcoal/index.js",
|
|
107
107
|
"./combo-box/themes/solar/pearl": "./lib/combo-box/themes/solar/pearl/index.js",
|
|
108
|
+
"./config": "./lib/config/index.js",
|
|
108
109
|
"./counter": "./lib/counter/index.js",
|
|
109
110
|
"./counter/themes/halo/dark": "./lib/counter/themes/halo/dark/index.js",
|
|
110
111
|
"./counter/themes/halo/light": "./lib/counter/themes/halo/light/index.js",
|
|
@@ -336,9 +337,10 @@
|
|
|
336
337
|
"version": "node ../../scripts/version"
|
|
337
338
|
},
|
|
338
339
|
"dependencies": {
|
|
340
|
+
"@lit-labs/context": "^0.3.1",
|
|
339
341
|
"@refinitiv-ui/browser-sparkline": "1.1.8",
|
|
340
|
-
"@refinitiv-ui/halo-theme": "^6.
|
|
341
|
-
"@refinitiv-ui/solar-theme": "^6.
|
|
342
|
+
"@refinitiv-ui/halo-theme": "^6.6.0-next.0",
|
|
343
|
+
"@refinitiv-ui/solar-theme": "^6.4.0-next.0",
|
|
342
344
|
"@types/chart.js": "^2.9.31",
|
|
343
345
|
"chart.js": "~2.9.4",
|
|
344
346
|
"d3-interpolate": "^3.0.1",
|
|
@@ -347,24 +349,24 @@
|
|
|
347
349
|
"tslib": "^2.3.1"
|
|
348
350
|
},
|
|
349
351
|
"devDependencies": {
|
|
350
|
-
"@refinitiv-ui/core": "^6.
|
|
351
|
-
"@refinitiv-ui/demo-block": "^6.
|
|
352
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
352
|
+
"@refinitiv-ui/core": "^6.5.0-next.0",
|
|
353
|
+
"@refinitiv-ui/demo-block": "^6.2.0-next.0",
|
|
354
|
+
"@refinitiv-ui/i18n": "^6.0.12",
|
|
353
355
|
"@refinitiv-ui/phrasebook": "^6.3.1",
|
|
354
|
-
"@refinitiv-ui/test-helpers": "^6.0.
|
|
355
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
356
|
-
"@refinitiv-ui/utils": "^6.
|
|
356
|
+
"@refinitiv-ui/test-helpers": "^6.0.9",
|
|
357
|
+
"@refinitiv-ui/translate": "^6.1.0-next.0",
|
|
358
|
+
"@refinitiv-ui/utils": "^6.3.0-next.0",
|
|
357
359
|
"@types/d3-interpolate": "^3.0.1"
|
|
358
360
|
},
|
|
359
361
|
"peerDependencies": {
|
|
360
|
-
"@refinitiv-ui/core": "^6.
|
|
361
|
-
"@refinitiv-ui/i18n": "^6.0.
|
|
362
|
+
"@refinitiv-ui/core": "^6.5.0-next.0",
|
|
363
|
+
"@refinitiv-ui/i18n": "^6.0.12",
|
|
362
364
|
"@refinitiv-ui/phrasebook": "^6.3.1",
|
|
363
|
-
"@refinitiv-ui/translate": "^6.0.
|
|
364
|
-
"@refinitiv-ui/utils": "^6.
|
|
365
|
+
"@refinitiv-ui/translate": "^6.1.0-next.0",
|
|
366
|
+
"@refinitiv-ui/utils": "^6.3.0-next.0"
|
|
365
367
|
},
|
|
366
368
|
"publishConfig": {
|
|
367
369
|
"access": "public"
|
|
368
370
|
},
|
|
369
|
-
"gitHead": "
|
|
371
|
+
"gitHead": "9c5e19ece59cf12e07ab7593f712b4184298b4af"
|
|
370
372
|
}
|