@refinitiv-ui/elements 6.8.0 → 6.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
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.2](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@6.8.1...@refinitiv-ui/elements@6.8.2) (2023-05-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * remove `z-index` from collapse implementation ([#682](https://github.com/Refinitiv/refinitiv-ui/issues/682)) ([c3b6f76](https://github.com/Refinitiv/refinitiv-ui/commit/c3b6f76b178a0339de8f3bc153e1378398d68831))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+ **Note:** Version bump only for package @refinitiv-ui/elements
20
+
21
+
22
+
23
+
24
+
6
25
  # [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
26
 
8
27
 
@@ -398,7 +398,7 @@ let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
398
398
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
399
399
  onSlotChange(event) {
400
400
  const contentSlot = this.contentSlotRef.value;
401
- const nodes = (contentSlot && contentSlot.assignedNodes()) || [];
401
+ const nodes = contentSlot?.assignedNodes() ?? [];
402
402
  this.setOpened(this.attachTargetFocused && this.hasContent);
403
403
  // make a brave assumption that suggestions are populated as well
404
404
  const suggestions = this.suggestions;
@@ -897,8 +897,8 @@ let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
897
897
  */
898
898
  suggestionsChange() {
899
899
  const contentSlot = this.contentSlotRef.value;
900
- contentSlot && contentSlot.assignedNodes().forEach((node) => {
901
- node.parentNode && node.parentNode.removeChild(node);
900
+ contentSlot?.assignedNodes().forEach((node) => {
901
+ node.parentNode?.removeChild(node);
902
902
  });
903
903
  this.appendChild(this.suggestions.reduce((fragment, suggestion) => this.generateSuggestionsFragment(fragment, suggestion), document.createDocumentFragment()));
904
904
  }
@@ -1026,7 +1026,7 @@ let Autosuggest = Autosuggest_1 = class Autosuggest extends Overlay {
1026
1026
  }
1027
1027
  // Space characters (e.g. space, tab, EOL) don't count as having content
1028
1028
  const contentSlot = this.contentSlotRef.value;
1029
- const nodes = contentSlot && contentSlot.assignedNodes() || [];
1029
+ const nodes = contentSlot?.assignedNodes() ?? [];
1030
1030
  return nodes.some(({ nodeType, textContent }) => nodeType === Node.ELEMENT_NODE || (textContent && textContent.search(/\S/) >= 0)); // If node is element always return true
1031
1031
  }
1032
1032
  /**
@@ -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: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
187
+ protected willUpdate(changedProperties: PropertyValues): void;
189
188
  /**
190
189
  * Updates the element
191
190
  * @param changedProperties Properties that has 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';
@@ -1129,10 +1128,12 @@ let Calendar = class Calendar extends ControlElement {
1129
1128
  renderCell(cell) {
1130
1129
  const isSelection = cell.value !== undefined;
1131
1130
  const isSelectable = isSelection && !cell.disabled;
1131
+ const isSelected = cell.selected ? 'true' : 'false';
1132
+ const isActive = cell.active ? 0 : -1;
1132
1133
  return html `<div
1133
1134
  role="gridcell"
1134
1135
  part="cell ${cell.view}"
1135
- aria-selected="${ifDefined(isSelectable ? (cell.selected ? 'true' : 'false') : undefined)}"
1136
+ aria-selected="${isSelectable ? isSelected : nothing}"
1136
1137
  ?active=${cell.active}
1137
1138
  ?disabled=${cell.disabled}
1138
1139
  ?idle=${cell.idle}
@@ -1143,13 +1144,13 @@ let Calendar = class Calendar extends ControlElement {
1143
1144
  ?range=${cell.range}
1144
1145
  ?range-from=${cell.rangeFrom}
1145
1146
  ?range-to=${cell.rangeTo}>
1146
- <div role="${ifDefined(cell.value ? 'button' : undefined)}"
1147
- tabindex=${ifDefined(isSelectable ? (cell.active ? 0 : -1) : undefined)}
1148
- aria-label="${ifDefined(isSelectable && !isIE ? this.t(this.getCellLabelKey(cell), {
1147
+ <div role="${cell.value ? 'button' : nothing}"
1148
+ tabindex=${isSelectable ? isActive : nothing}
1149
+ aria-label="${isSelectable && !isIE ? this.t(this.getCellLabelKey(cell), {
1149
1150
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1150
1151
  value: parse(cell.value),
1151
1152
  view: this.renderView
1152
- }) : undefined)}"
1153
+ }) : nothing}"
1153
1154
  part="cell-content${isSelection ? ' selection' : ''}${isSelectable ? ' selectable' : ''}"
1154
1155
  .value=${cell.value}
1155
1156
  .index=${cell.index}>${cell.text}</div>
@@ -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.
@@ -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 part="header" level="${this.level}">
184
- <div part="heading" role="heading" aria-level="${ifDefined(this.headingLevel || undefined)}">
185
- <div id="header-toggle"
186
- part="header-toggle"
187
- role="button"
188
- tabindex="0"
189
- aria-expanded="${this.expanded}"
190
- aria-controls="content"
191
- @tap=${this.toggle}>${this.header}</div>
192
- </div>
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-toggle">
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-toggle]{touch-action:manipulation;cursor:pointer;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;cursor:pointer;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}' }}));
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-toggle]{touch-action:manipulation;cursor:pointer;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;cursor:pointer;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}' }}));
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-toggle]{touch-action:manipulation;cursor:pointer;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)}' }}));
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-toggle]{touch-action:manipulation;cursor:pointer;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)}' }}));
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=${ifDefined(this.lang || undefined)}
249
+ .lang=${this.lang || nothing}
251
250
  .value=${this.value}
252
251
  .focusBoundary=${this}
253
252
  .positionTarget=${this}
@@ -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=${ifDefined(selectionLength > 999 ? selectionLength.toLocaleString() : undefined)} max="999"></ef-counter>
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
  }
@@ -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(index: number | undefined, parts: DateTimeFormatPart[]): void;
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, parts) {
446
- const { selectionStart, selectionEnd } = selectPart(index, parts);
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(selectedPartIndex, parts);
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(selectedPartIndex, this.formatToParts(newValue));
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 nextPartIdx = getNextSelectedPartIndex(selection, parts, this.inputValue, key === 'ArrowLeft' ? Direction.Down : Direction.Up);
530
+ const nextPartIndex = getNextSelectedPartIndex(selection, parts, this.inputValue, key === 'ArrowLeft' ? Direction.Down : Direction.Up);
531
531
  this.selectPartFrame.schedule(() => {
532
- this.selectPart(nextPartIdx, parts);
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: (index: number | undefined, parts: DateTimeFormatPart[]) => InputSelection;
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, parts) => {
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=${ifDefined(this.lang || undefined)}
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=${ifDefined(this.firstDayOfWeek)}
948
+ .firstDayOfWeek=${this.firstDayOfWeek || nothing}
950
949
  .values=${this.calendarValues}
951
950
  .filter=${this.filter}
952
951
  .view=${view}
@@ -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="${ifDefined(this.maxLength || undefined)}"
415
- minlength="${ifDefined(this.minLength || undefined)}"
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(undefined, direction);
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, direction) {
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(stepIncrement, Direction.Up);
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(stepIncrement, Direction.Down);
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=${ifDefined(tooltip || undefined)}
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=${ifDefined(forMenu ? true : undefined)}
890
- aria-expanded=${ifDefined(forMenu ? false : undefined)}
891
- title=${ifDefined(tooltip || undefined)}
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=${ifDefined(value || undefined)}
900
- .for=${ifDefined(forMenu || undefined)}>
898
+ .value=${value || nothing}
899
+ .for=${forMenu || nothing}>
901
900
  </ef-item>`;
902
901
  }
903
902
  /**
@@ -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=${ifDefined(this.max || undefined)}
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="${ifDefined(this.iconHasAction ? 'button' : undefined)}"
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="${ifDefined(this.sidebarWidth || undefined)}">
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>
@@ -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 === ' ' || event.key === 'Spacebar' || event.key === 'Enter') {
665
+ if (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {
667
666
  event.target.blur();
668
667
  }
669
668
  }
@@ -1109,16 +1108,27 @@ let Slider = class Slider extends ControlElement {
1109
1108
  thumbTemplate(value, thumbPosition, name) {
1110
1109
  const isActive = this.activeThumb?.getAttribute('name') === name;
1111
1110
  const isChanged = this.changedThumb?.getAttribute('name') === name;
1112
- const valueNow = this.range ? name === SliderDataName.from ? this.from : this.to : this.value;
1113
- const valueMin = this.range ? name === SliderDataName.from ? this.min : this.fromNumber + this.minRangeNumber : this.min;
1114
- const valueMax = this.range ? name === SliderDataName.from ? this.toNumber - this.minRangeNumber : this.max : this.max;
1115
- const thumbStyle = { left: `${thumbPosition}%`, zIndex: this.range ? isChanged ? '4' : '3' : null };
1111
+ let valueNow = this.value;
1112
+ let valueMin = this.min;
1113
+ let valueMax = this.max;
1114
+ if (this.range) {
1115
+ if (name === SliderDataName.from) {
1116
+ valueNow = this.from;
1117
+ valueMax = String(this.toNumber - this.minRangeNumber);
1118
+ }
1119
+ else {
1120
+ valueNow = this.to;
1121
+ valueMin = String(this.fromNumber + this.minRangeNumber);
1122
+ }
1123
+ }
1124
+ const thumbZIndex = this.range ? (isChanged ? '4' : '3') : null;
1125
+ const thumbStyle = { left: `${thumbPosition}%`, zIndex: thumbZIndex };
1116
1126
  return html `
1117
1127
  <div
1118
1128
  ${ref(this[`${name}ThumbRef`])}
1119
1129
  @focus=${this.onThumbFocus}
1120
1130
  @blur=${this.onThumbBlur}
1121
- active=${ifDefined(isActive || undefined)}
1131
+ active=${isActive || nothing}
1122
1132
  name="${name}"
1123
1133
  role="slider"
1124
1134
  aria-label="${this.t(name.toUpperCase())}"
@@ -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="${ifDefined(this.iconHasAction ? 'button' : undefined)}"
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
  }
@@ -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="${ifDefined(!isIE ? this.t('SELECT_HOURS', { value: this.periodHours }) : undefined)}"
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="${ifDefined(hours ? undefined : Placeholder.HOURS)}"
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="${ifDefined(!isIE ? this.t('SELECT_MINUTES', { value: this.minutes }) : undefined)}"
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="${ifDefined(minutes ? undefined : Placeholder.MINUTES)}"
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="${ifDefined(!isIE ? this.t('SELECT_SECONDS', { value: this.seconds }) : undefined)}"
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="${ifDefined(seconds ? undefined : Placeholder.SECONDS)}"
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="${ifDefined(hasHours ? this.isAM() ? 'toggle-am' : 'toggle-pm' : undefined)}"
772
+ aria-activedescendant="${hasHours ? this.isAM() ? 'toggle-am' : 'toggle-pm' : nothing}"
774
773
  id="toggle"
775
774
  part="toggle"
776
775
  @tap=${this.toggle}
@@ -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
@@ -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 TooltipPositionMap = {
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 TooltipPositionMap[this.position];
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="${ifDefined(this.labelLayoutSize)}">
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="${ifDefined(this.primaryLayoutFlexBasis)}">
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="${ifDefined(this.primaryLabel || undefined)}"
170
- value="${ifDefined(this.primaryValue || undefined)}">
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="${ifDefined(this.secondaryLayoutFlexBasis)}">
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="${ifDefined(this.secondaryLabel || undefined)}"
179
- value="${ifDefined(this.secondaryValue || undefined)}">
177
+ label="${this.secondaryLabel || nothing}"
178
+ value="${this.secondaryValue || nothing}">
180
179
  </ef-progress-bar>
181
180
  </ef-layout>
182
181
  </ef-layout>
@@ -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="${ifDefined(this.hasActiveSelection ? 0 : undefined)}"
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.8.0';
1
+ export const VERSION = '6.8.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refinitiv-ui/elements",
3
- "version": "6.8.0",
3
+ "version": "6.8.2",
4
4
  "description": "Element Framework Elements",
5
5
  "author": "LSEG",
6
6
  "license": "Apache-2.0",
@@ -337,8 +337,8 @@
337
337
  },
338
338
  "dependencies": {
339
339
  "@refinitiv-ui/browser-sparkline": "1.1.8",
340
- "@refinitiv-ui/halo-theme": "^6.5.0",
341
- "@refinitiv-ui/solar-theme": "^6.3.2",
340
+ "@refinitiv-ui/halo-theme": "^6.5.1",
341
+ "@refinitiv-ui/solar-theme": "^6.3.3",
342
342
  "@types/chart.js": "^2.9.31",
343
343
  "chart.js": "~2.9.4",
344
344
  "d3-interpolate": "^3.0.1",
@@ -347,24 +347,24 @@
347
347
  "tslib": "^2.3.1"
348
348
  },
349
349
  "devDependencies": {
350
- "@refinitiv-ui/core": "^6.4.0",
351
- "@refinitiv-ui/demo-block": "^6.1.0",
352
- "@refinitiv-ui/i18n": "^6.0.11",
350
+ "@refinitiv-ui/core": "^6.4.1",
351
+ "@refinitiv-ui/demo-block": "^6.1.2",
352
+ "@refinitiv-ui/i18n": "^6.0.12",
353
353
  "@refinitiv-ui/phrasebook": "^6.3.1",
354
- "@refinitiv-ui/test-helpers": "^6.0.8",
355
- "@refinitiv-ui/translate": "^6.0.18",
354
+ "@refinitiv-ui/test-helpers": "^6.0.9",
355
+ "@refinitiv-ui/translate": "^6.0.19",
356
356
  "@refinitiv-ui/utils": "^6.2.3",
357
357
  "@types/d3-interpolate": "^3.0.1"
358
358
  },
359
359
  "peerDependencies": {
360
- "@refinitiv-ui/core": "^6.4.0",
361
- "@refinitiv-ui/i18n": "^6.0.11",
360
+ "@refinitiv-ui/core": "^6.4.1",
361
+ "@refinitiv-ui/i18n": "^6.0.12",
362
362
  "@refinitiv-ui/phrasebook": "^6.3.1",
363
- "@refinitiv-ui/translate": "^6.0.18",
363
+ "@refinitiv-ui/translate": "^6.0.19",
364
364
  "@refinitiv-ui/utils": "^6.2.3"
365
365
  },
366
366
  "publishConfig": {
367
367
  "access": "public"
368
368
  },
369
- "gitHead": "ab834dca0543f2272f3568e79d8acac1730bf165"
369
+ "gitHead": "d67968e7ef1db2fe559c48f4c76be5302041c237"
370
370
  }