@refinitiv-ui/elements 6.8.7 → 6.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +180 -433
- package/LICENSE +1 -1
- package/README.md +13 -11
- package/lib/accordion/index.d.ts +1 -1
- package/lib/accordion/index.js +4 -7
- package/lib/appstate-bar/index.d.ts +2 -2
- package/lib/appstate-bar/index.js +10 -4
- package/lib/autosuggest/index.d.ts +7 -7
- package/lib/autosuggest/index.js +85 -80
- package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
- package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
- package/lib/button/index.js +7 -10
- package/lib/button-bar/index.d.ts +1 -1
- package/lib/button-bar/index.js +12 -12
- package/lib/calendar/index.d.ts +39 -39
- package/lib/calendar/index.js +160 -125
- package/lib/calendar/utils.js +2 -2
- package/lib/canvas/index.d.ts +1 -1
- package/lib/canvas/index.js +2 -4
- package/lib/card/helpers/types.d.ts +2 -2
- package/lib/card/index.d.ts +5 -5
- package/lib/card/index.js +34 -28
- package/lib/chart/helpers/legend.js +10 -8
- package/lib/chart/index.d.ts +3 -3
- package/lib/chart/index.js +17 -17
- package/lib/chart/plugins/doughnut-center-label.js +6 -5
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +12 -13
- package/lib/clock/index.d.ts +55 -55
- package/lib/clock/index.js +84 -95
- package/lib/clock/themes/halo/dark/index.js +1 -1
- package/lib/clock/themes/halo/light/index.js +1 -1
- package/lib/clock/themes/solar/charcoal/index.js +1 -1
- package/lib/clock/themes/solar/pearl/index.js +1 -1
- package/lib/collapse/index.d.ts +1 -1
- package/lib/collapse/index.js +28 -19
- package/lib/collapse/themes/halo/dark/index.js +1 -1
- package/lib/collapse/themes/halo/light/index.js +1 -1
- package/lib/color-dialog/elements/color-palettes.d.ts +1 -1
- package/lib/color-dialog/elements/color-palettes.js +5 -6
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +1 -1
- package/lib/color-dialog/elements/grayscale-palettes.js +9 -9
- package/lib/color-dialog/elements/palettes.js +5 -4
- package/lib/color-dialog/helpers/value-model.js +7 -9
- package/lib/color-dialog/index.d.ts +6 -6
- package/lib/color-dialog/index.js +53 -37
- package/lib/color-picker/index.d.ts +2 -2
- package/lib/color-picker/index.js +40 -34
- package/lib/combo-box/helpers/filter.d.ts +2 -2
- package/lib/combo-box/helpers/types.d.ts +1 -1
- package/lib/combo-box/index.d.ts +9 -9
- package/lib/combo-box/index.js +61 -55
- package/lib/configuration/elements/configuration.d.ts +1 -1
- package/lib/configuration/elements/configuration.js +2 -2
- package/lib/counter/index.d.ts +4 -4
- package/lib/counter/index.js +9 -7
- package/lib/datetime-field/index.d.ts +4 -5
- package/lib/datetime-field/index.js +32 -23
- package/lib/datetime-field/utils.js +11 -1
- package/lib/datetime-picker/index.d.ts +75 -75
- package/lib/datetime-picker/index.js +151 -132
- package/lib/datetime-picker/locales.js +5 -5
- package/lib/datetime-picker/utils.js +9 -9
- package/lib/dialog/draggable-element.js +1 -2
- package/lib/dialog/index.d.ts +6 -6
- package/lib/dialog/index.js +48 -38
- package/lib/email-field/index.d.ts +1 -1
- package/lib/email-field/index.js +6 -6
- package/lib/events.d.ts +1 -1
- package/lib/flag/index.d.ts +1 -1
- package/lib/flag/index.js +6 -5
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/index.d.ts +1 -1
- package/lib/header/index.js +2 -2
- package/lib/header/themes/halo/dark/index.js +1 -1
- package/lib/header/themes/halo/light/index.js +1 -1
- package/lib/header/themes/solar/charcoal/index.js +1 -1
- package/lib/header/themes/solar/pearl/index.js +1 -1
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +11 -5
- package/lib/heatmap/helpers/track.js +3 -3
- package/lib/heatmap/index.d.ts +9 -9
- package/lib/heatmap/index.js +51 -42
- package/lib/icon/index.d.ts +2 -2
- package/lib/icon/index.js +6 -8
- package/lib/icon/utils/IconLoader.d.ts +1 -0
- package/lib/icon/utils/IconLoader.js +9 -1
- package/lib/interactive-chart/helpers/types.d.ts +3 -3
- package/lib/interactive-chart/index.d.ts +34 -34
- package/lib/interactive-chart/index.js +72 -57
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +3 -3
- package/lib/item/index.js +24 -20
- package/lib/jsx.d.ts +6 -4
- package/lib/label/index.d.ts +1 -1
- package/lib/label/index.js +11 -8
- package/lib/layout/index.d.ts +7 -7
- package/lib/layout/index.js +7 -7
- package/lib/led-gauge/index.d.ts +1 -1
- package/lib/led-gauge/index.js +10 -10
- package/lib/list/elements/list.d.ts +3 -3
- package/lib/list/elements/list.js +10 -12
- package/lib/list/helpers/renderer.js +2 -2
- package/lib/list/helpers/types.d.ts +1 -1
- package/lib/list/index.d.ts +1 -1
- package/lib/list/renderer.d.ts +7 -7
- package/lib/loader/index.js +7 -8
- package/lib/multi-input/index.d.ts +6 -6
- package/lib/multi-input/index.js +39 -45
- package/lib/notification/elements/notification-tray.d.ts +2 -2
- package/lib/notification/elements/notification-tray.js +3 -3
- package/lib/notification/elements/notification.d.ts +2 -2
- package/lib/notification/elements/notification.js +22 -14
- package/lib/notification/helpers/status.js +1 -1
- package/lib/number-field/index.d.ts +5 -6
- package/lib/number-field/index.js +37 -47
- package/lib/overlay/elements/overlay-viewport.d.ts +1 -1
- package/lib/overlay/elements/overlay.d.ts +2 -2
- package/lib/overlay/elements/overlay.js +154 -98
- package/lib/overlay/helpers/types.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
- package/lib/overlay/managers/backdrop-manager.js +2 -2
- package/lib/overlay/managers/close-manager.js +2 -1
- package/lib/overlay/managers/focus-manager.js +23 -13
- package/lib/overlay/managers/interaction-lock-manager.d.ts +4 -4
- package/lib/overlay/managers/interaction-lock-manager.js +33 -25
- package/lib/overlay/managers/viewport-manager.d.ts +2 -2
- package/lib/overlay/managers/viewport-manager.js +3 -2
- package/lib/overlay/managers/zindex-manager.js +4 -2
- package/lib/overlay-menu/helpers/types.d.ts +2 -2
- package/lib/overlay-menu/index.d.ts +1 -1
- package/lib/overlay-menu/index.js +44 -33
- package/lib/overlay-menu/managers/menu-manager.d.ts +10 -10
- package/lib/overlay-menu/managers/menu-manager.js +15 -13
- package/lib/pagination/index.d.ts +4 -4
- package/lib/pagination/index.js +39 -14
- package/lib/panel/index.js +1 -1
- package/lib/password-field/index.d.ts +2 -2
- package/lib/password-field/index.js +4 -4
- package/lib/pill/index.d.ts +1 -1
- package/lib/pill/index.js +22 -19
- package/lib/progress-bar/index.d.ts +1 -1
- package/lib/progress-bar/index.js +38 -37
- package/lib/radio-button/index.d.ts +2 -2
- package/lib/radio-button/index.js +17 -12
- package/lib/radio-button/radio-button-registry.js +8 -5
- package/lib/rating/index.d.ts +1 -1
- package/lib/rating/index.js +2 -5
- package/lib/rating/utils.d.ts +6 -6
- package/lib/rating/utils.js +6 -6
- package/lib/search-field/index.d.ts +2 -2
- package/lib/search-field/index.js +4 -4
- package/lib/select/index.d.ts +34 -34
- package/lib/select/index.js +70 -83
- package/lib/sidebar-layout/index.d.ts +2 -2
- package/lib/sidebar-layout/index.js +7 -9
- package/lib/slider/index.d.ts +2 -2
- package/lib/slider/index.js +57 -45
- package/lib/slider/utils.d.ts +10 -10
- package/lib/slider/utils.js +10 -10
- package/lib/sparkline/index.d.ts +1 -1
- package/lib/sparkline/index.js +7 -8
- package/lib/swing-gauge/helpers.js +2 -2
- package/lib/swing-gauge/index.d.ts +19 -19
- package/lib/swing-gauge/index.js +91 -81
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/index.js +16 -27
- package/lib/tab/themes/halo/dark/index.js +1 -1
- package/lib/tab/themes/halo/light/index.js +1 -1
- package/lib/tab/themes/solar/charcoal/index.js +1 -1
- package/lib/tab/themes/solar/pearl/index.js +1 -1
- package/lib/tab-bar/helpers/animate.js +1 -1
- package/lib/tab-bar/index.d.ts +1 -1
- package/lib/tab-bar/index.js +34 -18
- package/lib/tab-bar/themes/halo/dark/index.js +1 -1
- package/lib/tab-bar/themes/halo/light/index.js +1 -1
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/index.js +36 -33
- package/lib/time-picker/index.d.ts +6 -6
- package/lib/time-picker/index.js +104 -90
- package/lib/toggle/index.d.ts +1 -1
- package/lib/toggle/index.js +4 -3
- package/lib/tooltip/elements/title-tooltip.js +2 -2
- package/lib/tooltip/index.d.ts +27 -27
- package/lib/tooltip/index.js +42 -38
- package/lib/tooltip/managers/tooltip-manager.d.ts +1 -1
- package/lib/tornado-chart/elements/tornado-chart.d.ts +1 -1
- package/lib/tornado-chart/elements/tornado-chart.js +1 -1
- package/lib/tornado-chart/elements/tornado-item.d.ts +2 -2
- package/lib/tornado-chart/elements/tornado-item.js +12 -10
- package/lib/tree/elements/tree-item.d.ts +3 -3
- package/lib/tree/elements/tree-item.js +21 -19
- package/lib/tree/elements/tree.d.ts +1 -1
- package/lib/tree/elements/tree.js +12 -11
- package/lib/tree/helpers/renderer.js +4 -3
- package/lib/tree/index.d.ts +1 -1
- package/lib/tree/managers/tree-manager.d.ts +1 -1
- package/lib/tree/managers/tree-manager.js +17 -18
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/index.d.ts +9 -9
- package/lib/tree-select/index.js +91 -82
- package/lib/tree-select/themes/halo/dark/index.js +1 -1
- package/lib/tree-select/themes/halo/light/index.js +1 -1
- package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
- package/lib/tree-select/themes/solar/pearl/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +16 -16
- package/tsconfig.tsbuildinfo +1 -1
package/lib/tab-bar/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { BasicElement, css, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
6
|
-
import { VERSION } from '../version.js';
|
|
7
|
-
import { tweenAnimate } from './helpers/animate.js';
|
|
8
|
-
import { Tab } from '../tab/index.js';
|
|
9
6
|
import '../button/index.js';
|
|
10
7
|
import '../layout/index.js';
|
|
8
|
+
import { Tab } from '../tab/index.js';
|
|
9
|
+
import { VERSION } from '../version.js';
|
|
10
|
+
import { tweenAnimate } from './helpers/animate.js';
|
|
11
11
|
const BAR_TRAVEL_DISTANCE = 150; // scroll distance
|
|
12
12
|
/**
|
|
13
13
|
* Container for tabs
|
|
@@ -54,13 +54,13 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
54
54
|
:host {
|
|
55
55
|
display: flex;
|
|
56
56
|
}
|
|
57
|
-
:host([alignment=center]) {
|
|
57
|
+
:host([alignment='center']) {
|
|
58
58
|
justify-content: center;
|
|
59
59
|
}
|
|
60
|
-
:host([alignment=right]) {
|
|
60
|
+
:host([alignment='right']) {
|
|
61
61
|
justify-content: flex-end;
|
|
62
62
|
}
|
|
63
|
-
:host [part=content] {
|
|
63
|
+
:host [part='content'] {
|
|
64
64
|
flex-grow: 0;
|
|
65
65
|
}
|
|
66
66
|
`;
|
|
@@ -129,7 +129,7 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
129
129
|
*/
|
|
130
130
|
isValidValue(value) {
|
|
131
131
|
const tabList = this.getFocusableTabs();
|
|
132
|
-
return tabList.some(tab => this.getTabValue(tab) === value);
|
|
132
|
+
return tabList.some((tab) => this.getTabValue(tab) === value);
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
135
|
* On *user-interaction* set the value and notify.
|
|
@@ -153,7 +153,7 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
153
153
|
}
|
|
154
154
|
this.setLevel();
|
|
155
155
|
// get tab value from active tab
|
|
156
|
-
const activeTab = tabList.find(tab => tab.active) || tabList[0];
|
|
156
|
+
const activeTab = tabList.find((tab) => tab.active) || tabList[0];
|
|
157
157
|
if (activeTab) {
|
|
158
158
|
this.value = this.getTabValue(activeTab);
|
|
159
159
|
}
|
|
@@ -170,7 +170,7 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
170
170
|
}
|
|
171
171
|
let hasActiveTab = false;
|
|
172
172
|
const tabList = this.getTabElements(); // get all tab elements include disabled tab
|
|
173
|
-
tabList.forEach(tab => {
|
|
173
|
+
tabList.forEach((tab) => {
|
|
174
174
|
const tabValue = this.getTabValue(tab);
|
|
175
175
|
// only mark tab as active once
|
|
176
176
|
if (tabValue === value && !hasActiveTab && !tab.disabled) {
|
|
@@ -231,7 +231,7 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
231
231
|
* @returns the array of focusable tab
|
|
232
232
|
*/
|
|
233
233
|
getFocusableTabs() {
|
|
234
|
-
return this.getTabElements().filter(tab => !tab.disabled);
|
|
234
|
+
return this.getTabElements().filter((tab) => !tab.disabled);
|
|
235
235
|
}
|
|
236
236
|
/**
|
|
237
237
|
* Set tab level attribute accordingly
|
|
@@ -332,7 +332,7 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
332
332
|
if (tabList.length <= 0) {
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
|
-
const focusedTabIndex = tabList.findIndex(tab => tab === document.activeElement);
|
|
335
|
+
const focusedTabIndex = tabList.findIndex((tab) => tab === document.activeElement);
|
|
336
336
|
const nextTab = direction === 'next'
|
|
337
337
|
? tabList[focusedTabIndex + 1] || tabList[0]
|
|
338
338
|
: tabList[focusedTabIndex - 1] || tabList[tabList.length - 1];
|
|
@@ -391,7 +391,7 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
391
391
|
manageTabIndex() {
|
|
392
392
|
const tabList = this.getFocusableTabs();
|
|
393
393
|
if (tabList && tabList.length > 0) {
|
|
394
|
-
const focusedTabIndex = tabList.findIndex(tab => tab.active);
|
|
394
|
+
const focusedTabIndex = tabList.findIndex((tab) => tab.active);
|
|
395
395
|
this.rovingTabIndex(tabList[focusedTabIndex], tabList);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
@@ -402,11 +402,27 @@ let TabBar = class TabBar extends BasicElement {
|
|
|
402
402
|
*/
|
|
403
403
|
render() {
|
|
404
404
|
return html `
|
|
405
|
-
${!this.vertical
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
405
|
+
${!this.vertical
|
|
406
|
+
? html `<ef-button
|
|
407
|
+
tabIndex="-1"
|
|
408
|
+
aria-hidden="true"
|
|
409
|
+
icon="left"
|
|
410
|
+
part="left-btn"
|
|
411
|
+
@tap=${this.handleScrollLeft}
|
|
412
|
+
></ef-button>`
|
|
413
|
+
: null}
|
|
414
|
+
<ef-layout part="content" @resize=${this.handleResize}>
|
|
415
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
416
|
+
</ef-layout>
|
|
417
|
+
${!this.vertical
|
|
418
|
+
? html `<ef-button
|
|
419
|
+
tabIndex="-1"
|
|
420
|
+
aria-hidden="true"
|
|
421
|
+
icon="right"
|
|
422
|
+
part="right-btn"
|
|
423
|
+
@tap=${this.handleScrollRight}
|
|
424
|
+
></ef-button>`
|
|
425
|
+
: null}
|
|
410
426
|
`;
|
|
411
427
|
}
|
|
412
428
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/tab/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/button/themes/halo/dark';
|
|
3
3
|
import '@refinitiv-ui/elements/layout/themes/halo/dark';
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab-bar', styles: ':host{position:relative;background-color:#1a1a1a}:host [part=content]{display:flex;overflow:hidden}:host [part=left-btn],:host [part=right-btn]{display:none;position:absolute;height:auto;margin:auto;z-index:2;top:0;bottom:0;background-color:#404040;width:36px;border:none}:host [part=left-btn]:hover,:host [part=right-btn]:hover{background-color:#1429bd}:host [part=left-btn]:active,:host [part=right-btn]:active{background-color:#0f1e8a}:host [part=left-btn]:focus:not([focused]),:host [part=left-btn][focused=visible],:host [part=right-btn]:focus:not([focused]),:host [part=right-btn][focused=visible]{background-color:#1429bd}:host [part=left-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=left-btn][focused=visible]:not([active]):not(:hover),:host [part=right-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=right-btn][focused=visible]:not([active]):not(:hover){color:#6678ff;background-color:#404040}:host [part=left-btn]{left:0}:host [part=right-btn]{right:0}:host([vertical]){width:180px;flex-shrink:0}:host([vertical]) [part=content]{flex-direction:column}:host([vertical]) [part=content] ::slotted(ef-tab){justify-content:flex-start;border-bottom:1px solid #404040}:host [part=left-btn]::after,:host [part=right-btn]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#404040;height:70%;top:0;bottom:0}:host([level
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab-bar', styles: ':host{position:relative;background-color:#1a1a1a}:host [part=content]{display:flex;overflow:hidden}:host [part=left-btn],:host [part=right-btn]{display:none;position:absolute;height:auto;margin:auto;z-index:2;top:0;bottom:0;background-color:#404040;width:36px;border:none}:host [part=left-btn]:hover,:host [part=right-btn]:hover{background-color:#1429bd}:host [part=left-btn]:active,:host [part=right-btn]:active{background-color:#0f1e8a}:host [part=left-btn]:focus:not([focused]),:host [part=left-btn][focused=visible],:host [part=right-btn]:focus:not([focused]),:host [part=right-btn][focused=visible]{background-color:#1429bd}:host [part=left-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=left-btn][focused=visible]:not([active]):not(:hover),:host [part=right-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=right-btn][focused=visible]:not([active]):not(:hover){color:#6678ff;background-color:#404040}:host [part=left-btn]{left:0}:host [part=right-btn]{right:0}:host([vertical]){width:180px;flex-shrink:0}:host([vertical]) [part=content]{flex-direction:column}:host([vertical]) [part=content] ::slotted(ef-tab){justify-content:flex-start;border-bottom:1px solid #404040}:host [part=left-btn]::after,:host [part=right-btn]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#404040;height:70%;top:0;bottom:0}:host([level=\'1\']) [part=left-btn]::after,:host([level=\'1\']) [part=right-btn]::after{content:none}:host([level=\'1\']) [part=left-btn]{border-right:1px solid #0d0d0d}:host([level=\'1\']) [part=right-btn]{border-left:1px solid #0d0d0d}:host([level=\'2\']) [part=left-btn]::after,:host([level=\'3\']) [part=left-btn]::after{right:0}:host([level=\'2\']) [part=right-btn]::after,:host([level=\'3\']) [part=right-btn]::after{left:0}:host([level=\'2\']) [part=left-btn]:not(:active):not(:hover),:host([level=\'2\']) [part=right-btn]:not(:active):not(:hover){background-color:#262626}:host([level=\'2\']) [part=left-btn]::after,:host([level=\'2\']) [part=right-btn]::after{height:70%}:host([level=\'3\']) [part=left-btn],:host([level=\'3\']) [part=right-btn]{border-color:transparent}:host([level=\'3\']) [part=left-btn]:not(:active):not(:hover),:host([level=\'3\']) [part=right-btn]:not(:active):not(:hover){background-color:#0d0d0d}:host([level=\'3\']) [part=left-btn]::after,:host([level=\'3\']) [part=right-btn]::after{height:30%}:host([vertical]) [part=content] ::slotted(ef-tab){border-bottom-color:transparent;border-right:none!important;background:linear-gradient(#1a1a1a,#1a1a1a) left calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#1a1a1a,#1a1a1a) right calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#404040,#404040) center calc(100% + 1px)/100% 1px no-repeat}:host([vertical]) [part=content] ::slotted(ef-tab[active]:not(:active):not(:hover)){background:linear-gradient(#0d0d0d,#0d0d0d) left calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#0d0d0d,#0d0d0d) right calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#404040,#404040) center calc(100% + 1px)/100% 1px no-repeat}:host([vertical]) [part=content] ::slotted(ef-tab:not([active]):not(:active):not(:hover)){background-color:#1a1a1a}:host([vertical]) [part=content] ::slotted(ef-tab:hover){color:#fff;background-color:#1429bd}:host([vertical]) [part=content] ::slotted(ef-tab:active){background-color:#0f1e8a}:host([vertical][level=\'1\']) [part=content] ::slotted(ef-tab[active]:not(:active):not(:hover)),:host([vertical][level=\'3\']) [part=content] ::slotted(ef-tab[active]:not(:active):not(:hover)){color:#6678ff;background-color:#0d0d0d}' }}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/tab/themes/halo/light';
|
|
2
2
|
import '@refinitiv-ui/elements/button/themes/halo/light';
|
|
3
3
|
import '@refinitiv-ui/elements/layout/themes/halo/light';
|
|
4
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab-bar', styles: ':host{position:relative;background-color:#f2f2f2}:host [part=content]{display:flex;overflow:hidden}:host [part=left-btn],:host [part=right-btn]{display:none;position:absolute;height:auto;margin:auto;z-index:2;top:0;bottom:0;background-color:#e6e6e6;width:36px;border:none}:host [part=left-btn]:hover,:host [part=right-btn]:hover{background-color:#1429bd}:host [part=left-btn]:active,:host [part=right-btn]:active{background-color:#0f1e8a}:host [part=left-btn]:focus:not([focused]),:host [part=left-btn][focused=visible],:host [part=right-btn]:focus:not([focused]),:host [part=right-btn][focused=visible]{background-color:#1429bd}:host [part=left-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=left-btn][focused=visible]:not([active]):not(:hover),:host [part=right-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=right-btn][focused=visible]:not([active]):not(:hover){color:#6678ff;background-color:#e6e6e6}:host [part=left-btn]{left:0}:host [part=right-btn]{right:0}:host([vertical]){width:180px;flex-shrink:0}:host([vertical]) [part=content]{flex-direction:column}:host([vertical]) [part=content] ::slotted(ef-tab){justify-content:flex-start;border-bottom:1px solid #d9d9d9}:host [part=left-btn]::after,:host [part=right-btn]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#d9d9d9;height:70%;top:0;bottom:0}:host([level
|
|
4
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab-bar', styles: ':host{position:relative;background-color:#f2f2f2}:host [part=content]{display:flex;overflow:hidden}:host [part=left-btn],:host [part=right-btn]{display:none;position:absolute;height:auto;margin:auto;z-index:2;top:0;bottom:0;background-color:#e6e6e6;width:36px;border:none}:host [part=left-btn]:hover,:host [part=right-btn]:hover{background-color:#1429bd}:host [part=left-btn]:active,:host [part=right-btn]:active{background-color:#0f1e8a}:host [part=left-btn]:focus:not([focused]),:host [part=left-btn][focused=visible],:host [part=right-btn]:focus:not([focused]),:host [part=right-btn][focused=visible]{background-color:#1429bd}:host [part=left-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=left-btn][focused=visible]:not([active]):not(:hover),:host [part=right-btn]:focus:not([focused]):not([active]):not(:hover),:host [part=right-btn][focused=visible]:not([active]):not(:hover){color:#6678ff;background-color:#e6e6e6}:host [part=left-btn]{left:0}:host [part=right-btn]{right:0}:host([vertical]){width:180px;flex-shrink:0}:host([vertical]) [part=content]{flex-direction:column}:host([vertical]) [part=content] ::slotted(ef-tab){justify-content:flex-start;border-bottom:1px solid #d9d9d9}:host [part=left-btn]::after,:host [part=right-btn]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#d9d9d9;height:70%;top:0;bottom:0}:host([level=\'1\']) [part=left-btn]::after,:host([level=\'1\']) [part=right-btn]::after{content:none}:host([level=\'1\']) [part=left-btn]{border-right:1px solid #fff}:host([level=\'1\']) [part=right-btn]{border-left:1px solid #fff}:host([level=\'2\']) [part=left-btn]::after,:host([level=\'3\']) [part=left-btn]::after{right:0}:host([level=\'2\']) [part=right-btn]::after,:host([level=\'3\']) [part=right-btn]::after{left:0}:host([level=\'2\']) [part=left-btn]:not(:active):not(:hover),:host([level=\'2\']) [part=right-btn]:not(:active):not(:hover){background-color:#f2f2f2}:host([level=\'2\']) [part=left-btn]::after,:host([level=\'2\']) [part=right-btn]::after{height:70%}:host([level=\'3\']) [part=left-btn],:host([level=\'3\']) [part=right-btn]{border-color:transparent}:host([level=\'3\']) [part=left-btn]:not(:active):not(:hover),:host([level=\'3\']) [part=right-btn]:not(:active):not(:hover){background-color:#fff}:host([level=\'3\']) [part=left-btn]::after,:host([level=\'3\']) [part=right-btn]::after{height:30%}:host([vertical]) [part=content] ::slotted(ef-tab){border-bottom-color:transparent;border-right:none!important;background:linear-gradient(#f2f2f2,#f2f2f2) left calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#f2f2f2,#f2f2f2) right calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#d9d9d9,#d9d9d9) center calc(100% + 1px)/100% 1px no-repeat}:host([vertical]) [part=content] ::slotted(ef-tab[active]:not(:active):not(:hover)){background:linear-gradient(#fff,#fff) left calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#fff,#fff) right calc(100% + 1px)/2% 1px no-repeat,linear-gradient(#d9d9d9,#d9d9d9) center calc(100% + 1px)/100% 1px no-repeat}:host([vertical]) [part=content] ::slotted(ef-tab:not([active]):not(:active):not(:hover)){background-color:#f2f2f2}:host([vertical]) [part=content] ::slotted(ef-tab:hover){color:#fff;background-color:#1429bd}:host([vertical]) [part=content] ::slotted(ef-tab:active){background-color:#0f1e8a}:host([vertical][level=\'1\']) [part=content] ::slotted(ef-tab[active]:not(:active):not(:hover)),:host([vertical][level=\'3\']) [part=content] ::slotted(ef-tab[active]:not(:active):not(:hover)){color:#334bff;background-color:#fff}' }}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSResultGroup, FormFieldElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
|
|
4
4
|
import '../icon/index.js';
|
|
5
5
|
/**
|
package/lib/text-field/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { FormFieldElement, css,
|
|
2
|
+
import { FormFieldElement, 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
|
-
import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
|
|
6
|
-
import { VERSION } from '../version.js';
|
|
7
5
|
import { isIE } from '@refinitiv-ui/utils/browser.js';
|
|
6
|
+
import { isElementOverflown } from '@refinitiv-ui/utils/element.js';
|
|
8
7
|
import '../icon/index.js';
|
|
9
8
|
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
9
|
+
import { VERSION } from '../version.js';
|
|
10
10
|
const hasChanged = (newVal, oldVal) => oldVal === undefined ? false : newVal !== oldVal;
|
|
11
11
|
/**
|
|
12
12
|
* Form control element for text.
|
|
@@ -78,24 +78,25 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
78
78
|
display: inline-block;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
:host(:focus),
|
|
81
|
+
:host(:focus),
|
|
82
|
+
:host input:focus {
|
|
82
83
|
outline: none;
|
|
83
84
|
}
|
|
84
|
-
[part=input] {
|
|
85
|
+
[part='input'] {
|
|
85
86
|
font: inherit;
|
|
86
87
|
background: none;
|
|
87
88
|
color: currentColor;
|
|
88
89
|
border: none;
|
|
89
90
|
text-align: inherit;
|
|
90
91
|
}
|
|
91
|
-
:host([icon]) [part=icon]{
|
|
92
|
+
:host([icon]) [part='icon'] {
|
|
92
93
|
display: flex;
|
|
93
94
|
}
|
|
94
95
|
:host([transparent]) {
|
|
95
96
|
background: none !important;
|
|
96
97
|
border: none !important;
|
|
97
98
|
}
|
|
98
|
-
:host([icon][icon-has-action]) [part=icon] {
|
|
99
|
+
:host([icon][icon-has-action]) [part='icon'] {
|
|
99
100
|
cursor: pointer;
|
|
100
101
|
}
|
|
101
102
|
`;
|
|
@@ -107,7 +108,7 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
107
108
|
*/
|
|
108
109
|
firstUpdated(changedProperties) {
|
|
109
110
|
super.firstUpdated(changedProperties);
|
|
110
|
-
registerOverflowTooltip(this, () => this.inputValue, () => this.inputElement ? isElementOverflown(this.inputElement) : false);
|
|
111
|
+
registerOverflowTooltip(this, () => this.inputValue, () => (this.inputElement ? isElementOverflown(this.inputElement) : false));
|
|
111
112
|
}
|
|
112
113
|
/**
|
|
113
114
|
* Called when the element’s DOM has been updated and rendered
|
|
@@ -150,9 +151,12 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
150
151
|
/* istanbul ignore next */
|
|
151
152
|
shouldValidateInput(changedProperties) {
|
|
152
153
|
// TODO: This validation should be refactored
|
|
153
|
-
return (changedProperties.has('pattern') ||
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
return (changedProperties.has('pattern') ||
|
|
155
|
+
!!(this.pattern && changedProperties.has('value')) ||
|
|
156
|
+
changedProperties.has('minLength') ||
|
|
157
|
+
!!(this.minLength && changedProperties.has('value')) ||
|
|
158
|
+
changedProperties.has('maxLength') ||
|
|
159
|
+
!!(this.maxLength && changedProperties.has('value')));
|
|
156
160
|
}
|
|
157
161
|
/**
|
|
158
162
|
* Runs on input element `input` event
|
|
@@ -188,7 +192,7 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
188
192
|
let error = !this.inputElement?.checkValidity();
|
|
189
193
|
/* istanbul ignore next */
|
|
190
194
|
if (this.shouldValidateForMinLength(error)) {
|
|
191
|
-
error = !!this.minLength &&
|
|
195
|
+
error = !!this.minLength && this.minLength > this.value.length;
|
|
192
196
|
}
|
|
193
197
|
this.notifyErrorChange(error);
|
|
194
198
|
}
|
|
@@ -221,11 +225,11 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
221
225
|
get decorateInputMap() {
|
|
222
226
|
return {
|
|
223
227
|
...super.decorateInputMap,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
type: 'text',
|
|
229
|
+
part: 'input',
|
|
230
|
+
maxlength: this.maxLength,
|
|
231
|
+
minlength: this.minLength,
|
|
232
|
+
pattern: this.pattern || null
|
|
229
233
|
};
|
|
230
234
|
}
|
|
231
235
|
/**
|
|
@@ -233,18 +237,20 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
233
237
|
* @returns {void}
|
|
234
238
|
*/
|
|
235
239
|
renderIcon() {
|
|
236
|
-
return this.icon
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
240
|
+
return this.icon
|
|
241
|
+
? html `
|
|
242
|
+
<ef-icon
|
|
243
|
+
role="${this.iconHasAction ? 'button' : nothing}"
|
|
244
|
+
tabindex="${this.iconHasAction ? '0' : nothing}"
|
|
245
|
+
aria-label="${this.iconHasAction ? this.icon : nothing}"
|
|
246
|
+
part="icon"
|
|
247
|
+
icon="${this.icon}"
|
|
248
|
+
?readonly="${this.readonly}"
|
|
249
|
+
?disabled="${this.disabled}"
|
|
250
|
+
@tap="${this.iconClick}"
|
|
251
|
+
></ef-icon>
|
|
252
|
+
`
|
|
253
|
+
: null;
|
|
248
254
|
}
|
|
249
255
|
/**
|
|
250
256
|
* A `TemplateResult` that will be used
|
|
@@ -252,10 +258,7 @@ let TextField = class TextField extends FormFieldElement {
|
|
|
252
258
|
* @return Render template
|
|
253
259
|
*/
|
|
254
260
|
render() {
|
|
255
|
-
return html `
|
|
256
|
-
${super.render()}
|
|
257
|
-
${this.renderIcon()}
|
|
258
|
-
`;
|
|
261
|
+
return html ` ${super.render()} ${this.renderIcon()} `;
|
|
259
262
|
}
|
|
260
263
|
};
|
|
261
264
|
__decorate([
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import '../number-field/index.js';
|
|
4
|
-
import { TranslateDirective } from '@refinitiv-ui/translate';
|
|
2
|
+
import { CSSResultGroup, ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
5
3
|
import '@refinitiv-ui/phrasebook/locale/en/time-picker.js';
|
|
4
|
+
import { TranslateDirective } from '@refinitiv-ui/translate';
|
|
5
|
+
import '../number-field/index.js';
|
|
6
6
|
declare enum Segment {
|
|
7
7
|
HOURS = "hours",
|
|
8
8
|
MINUTES = "minutes",
|
|
@@ -90,9 +90,9 @@ export declare class TimePicker extends ControlElement {
|
|
|
90
90
|
*/
|
|
91
91
|
showSeconds: boolean;
|
|
92
92
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
* Value of the element
|
|
94
|
+
* @param value Element value
|
|
95
|
+
*/
|
|
96
96
|
set value(value: string);
|
|
97
97
|
get value(): string;
|
|
98
98
|
/**
|
package/lib/time-picker/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var TimePicker_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { ControlElement,
|
|
4
|
-
import { guard } from '@refinitiv-ui/core/directives/guard.js';
|
|
3
|
+
import { ControlElement, css, html, nothing } from '@refinitiv-ui/core';
|
|
5
4
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
6
5
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
7
|
-
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
8
6
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
8
|
+
import { guard } from '@refinitiv-ui/core/directives/guard.js';
|
|
9
|
+
import '@refinitiv-ui/phrasebook/locale/en/time-picker.js';
|
|
10
|
+
import { translate } from '@refinitiv-ui/translate';
|
|
11
11
|
import { isIE } from '@refinitiv-ui/utils/browser.js';
|
|
12
|
+
import { MILLISECONDS_IN_HOUR, MILLISECONDS_IN_MINUTE, MILLISECONDS_IN_SECOND, TimeFormat, addOffset, format, getFormat, isAM, isPM, isValidTime, padNumber, parse, toTimeSegment } from '@refinitiv-ui/utils/date.js';
|
|
12
13
|
import '../number-field/index.js';
|
|
13
|
-
import {
|
|
14
|
-
import '@refinitiv-ui/phrasebook/locale/en/time-picker.js';
|
|
14
|
+
import { VERSION } from '../version.js';
|
|
15
15
|
var Segment;
|
|
16
16
|
(function (Segment) {
|
|
17
17
|
Segment["HOURS"] = "hours";
|
|
@@ -163,9 +163,9 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
163
163
|
return this._seconds;
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
* Value of the element
|
|
167
|
+
* @param value Element value
|
|
168
|
+
*/
|
|
169
169
|
set value(value) {
|
|
170
170
|
const oldValue = this.value;
|
|
171
171
|
value = this.castValue(value);
|
|
@@ -181,7 +181,8 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
181
181
|
this.seconds = null;
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
|
-
if (oldValue !== value) {
|
|
184
|
+
if (oldValue !== value) {
|
|
185
|
+
/** never store actual value, instead operate with hours/minutes/seconds */
|
|
185
186
|
const info = toTimeSegment(value);
|
|
186
187
|
const format = getFormat(value);
|
|
187
188
|
this.valueWithSeconds = format === TimeFormat.HHmmss || format === TimeFormat.HHmmssSSS;
|
|
@@ -234,8 +235,12 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
234
235
|
const _hours = this.hours;
|
|
235
236
|
let hours = _hours;
|
|
236
237
|
if (_hours !== null) {
|
|
237
|
-
hours =
|
|
238
|
-
|
|
238
|
+
hours =
|
|
239
|
+
this.amPm && _hours > HOURS_OF_NOON
|
|
240
|
+
? _hours - HOURS_OF_NOON
|
|
241
|
+
: this.amPm && !_hours
|
|
242
|
+
? HOURS_OF_NOON
|
|
243
|
+
: _hours;
|
|
239
244
|
}
|
|
240
245
|
return hours;
|
|
241
246
|
}
|
|
@@ -355,7 +360,9 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
355
360
|
if (segment === Segment.HOURS && this.minutes === null) {
|
|
356
361
|
this.minutes = 0;
|
|
357
362
|
}
|
|
358
|
-
if (this.isShowSeconds &&
|
|
363
|
+
if (this.isShowSeconds &&
|
|
364
|
+
this.seconds === null &&
|
|
365
|
+
(segment === Segment.HOURS || segment === Segment.MINUTES)) {
|
|
359
366
|
this.seconds = 0;
|
|
360
367
|
}
|
|
361
368
|
}
|
|
@@ -371,9 +378,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
371
378
|
* @returns True if changed
|
|
372
379
|
*/
|
|
373
380
|
static hasTimeChanged(changedProperties) {
|
|
374
|
-
return changedProperties.has('hours')
|
|
375
|
-
|| changedProperties.has('minutes')
|
|
376
|
-
|| changedProperties.has('seconds');
|
|
381
|
+
return (changedProperties.has('hours') || changedProperties.has('minutes') || changedProperties.has('seconds'));
|
|
377
382
|
}
|
|
378
383
|
/**
|
|
379
384
|
* Validates a given unit against a min and max value, returning a fallback if invalid.
|
|
@@ -683,7 +688,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
683
688
|
flex-flow: row nowrap;
|
|
684
689
|
align-items: center;
|
|
685
690
|
justify-content: center;
|
|
686
|
-
user-select:none;
|
|
691
|
+
user-select: none;
|
|
687
692
|
position: relative;
|
|
688
693
|
}
|
|
689
694
|
input {
|
|
@@ -703,19 +708,20 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
703
708
|
get hoursTemplate() {
|
|
704
709
|
const hours = this.formattedHours;
|
|
705
710
|
return html `<ef-number-field
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
711
|
+
id="hours"
|
|
712
|
+
part="input"
|
|
713
|
+
aria-label="${!isIE ? this.t('SELECT_HOURS', { value: this.periodHours }) : nothing}"
|
|
714
|
+
no-spinner
|
|
715
|
+
transparent
|
|
716
|
+
min="${this.amPm ? 1 : MIN_UNIT}"
|
|
717
|
+
max="${this.amPm ? HOURS_OF_NOON : MAX_HOURS}"
|
|
718
|
+
.value="${hours}"
|
|
719
|
+
placeholder="${hours ? nothing : Placeholder.HOURS}"
|
|
720
|
+
?disabled="${this.disabled}"
|
|
721
|
+
?readonly="${this.readonly}"
|
|
722
|
+
@value-changed="${this.onInputValueChanged}"
|
|
723
|
+
@focused-changed=${this.onInputFocusedChanged}
|
|
724
|
+
></ef-number-field>`;
|
|
719
725
|
}
|
|
720
726
|
/**
|
|
721
727
|
* Template for Minutes Segment
|
|
@@ -724,19 +730,20 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
724
730
|
get minutesTemplate() {
|
|
725
731
|
const minutes = this.formattedMinutes;
|
|
726
732
|
return html `<ef-number-field
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
733
|
+
id="minutes"
|
|
734
|
+
aria-label="${!isIE ? this.t('SELECT_MINUTES', { value: this.minutes }) : nothing}"
|
|
735
|
+
part="input"
|
|
736
|
+
no-spinner
|
|
737
|
+
min="${MIN_UNIT}"
|
|
738
|
+
max="${MAX_MINUTES}"
|
|
739
|
+
.value="${minutes}"
|
|
740
|
+
placeholder="${minutes ? nothing : Placeholder.MINUTES}"
|
|
741
|
+
?readonly="${this.readonly}"
|
|
742
|
+
?disabled="${this.disabled}"
|
|
743
|
+
transparent
|
|
744
|
+
@value-changed="${this.onInputValueChanged}"
|
|
745
|
+
@focused-changed=${this.onInputFocusedChanged}
|
|
746
|
+
></ef-number-field>`;
|
|
740
747
|
}
|
|
741
748
|
/**
|
|
742
749
|
* Template for Seconds Segment
|
|
@@ -744,21 +751,21 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
744
751
|
*/
|
|
745
752
|
get secondsTemplate() {
|
|
746
753
|
const seconds = this.formattedSeconds;
|
|
747
|
-
return html `
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
754
|
+
return html ` <ef-number-field
|
|
755
|
+
id="seconds"
|
|
756
|
+
part="input"
|
|
757
|
+
aria-label="${!isIE ? this.t('SELECT_SECONDS', { value: this.seconds }) : nothing}"
|
|
758
|
+
no-spinner
|
|
759
|
+
min="${MIN_UNIT}"
|
|
760
|
+
max="${MAX_SECONDS}"
|
|
761
|
+
.value="${seconds}"
|
|
762
|
+
placeholder="${seconds ? nothing : Placeholder.SECONDS}"
|
|
763
|
+
?readonly="${this.readonly}"
|
|
764
|
+
?disabled="${this.disabled}"
|
|
765
|
+
transparent
|
|
766
|
+
@value-changed="${this.onInputValueChanged}"
|
|
767
|
+
@focused-changed=${this.onInputFocusedChanged}
|
|
768
|
+
></ef-number-field>`;
|
|
762
769
|
}
|
|
763
770
|
/**
|
|
764
771
|
* Template for AmPm Segment
|
|
@@ -766,35 +773,45 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
766
773
|
*/
|
|
767
774
|
get getAmPmHtml() {
|
|
768
775
|
const hasHours = this.hours !== null;
|
|
769
|
-
return this.amPm
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
776
|
+
return this.amPm
|
|
777
|
+
? html `
|
|
778
|
+
<div
|
|
779
|
+
role="listbox"
|
|
780
|
+
aria-label="${this.t('TOGGLE_TIME_PERIOD')}"
|
|
781
|
+
aria-activedescendant="${hasHours ? (this.isAM() ? 'toggle-am' : 'toggle-pm') : nothing}"
|
|
782
|
+
id="toggle"
|
|
783
|
+
part="toggle"
|
|
784
|
+
@tap=${this.toggle}
|
|
785
|
+
tabindex="0"
|
|
786
|
+
>
|
|
787
|
+
<div
|
|
788
|
+
aria-label="${this.t('BEFORE_MIDDAY')}"
|
|
789
|
+
role="option"
|
|
790
|
+
id="toggle-am"
|
|
791
|
+
part="toggle-item"
|
|
792
|
+
?active=${hasHours && this.isAM()}
|
|
793
|
+
>
|
|
794
|
+
AM
|
|
795
|
+
</div>
|
|
796
|
+
<div
|
|
797
|
+
aria-label="${this.t('AFTER_MIDDAY')}"
|
|
798
|
+
role="option"
|
|
799
|
+
id="toggle-pm"
|
|
800
|
+
part="toggle-item"
|
|
801
|
+
?active=${hasHours && this.isPM()}
|
|
802
|
+
>
|
|
803
|
+
PM
|
|
804
|
+
</div>
|
|
805
|
+
</div>
|
|
806
|
+
`
|
|
807
|
+
: null;
|
|
791
808
|
}
|
|
792
809
|
/**
|
|
793
810
|
* Native input's template for mobile
|
|
794
811
|
* @returns input
|
|
795
812
|
*/
|
|
796
813
|
get nativeInputForMobile() {
|
|
797
|
-
return this.isMobile ? html `<input id="mtp" type="time" @change=${this.onMobileTimeChange}
|
|
814
|
+
return this.isMobile ? html `<input id="mtp" type="time" @change=${this.onMobileTimeChange} />` : null;
|
|
798
815
|
}
|
|
799
816
|
/**
|
|
800
817
|
* A template used to notify currently selected value for screen readers
|
|
@@ -815,18 +832,16 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
815
832
|
value: value ? parse(value) : null,
|
|
816
833
|
showSeconds,
|
|
817
834
|
amPm
|
|
818
|
-
})}"
|
|
835
|
+
})}"
|
|
836
|
+
></div>`;
|
|
819
837
|
}
|
|
820
838
|
/**
|
|
821
839
|
* Get time input template
|
|
822
840
|
* @returns template result
|
|
823
841
|
*/
|
|
824
842
|
get inputTemplate() {
|
|
825
|
-
return html `
|
|
826
|
-
|
|
827
|
-
${TimePicker_1.dividerTemplate}
|
|
828
|
-
${this.minutesTemplate}
|
|
829
|
-
${this.isShowSeconds ? html `${TimePicker_1.dividerTemplate}${this.secondsTemplate}` : undefined}`;
|
|
843
|
+
return html ` ${this.hoursTemplate} ${TimePicker_1.dividerTemplate} ${this.minutesTemplate}
|
|
844
|
+
${this.isShowSeconds ? html `${TimePicker_1.dividerTemplate}${this.secondsTemplate}` : undefined}`;
|
|
830
845
|
}
|
|
831
846
|
/**
|
|
832
847
|
* A `TemplateResult` that will be used
|
|
@@ -835,8 +850,7 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
835
850
|
*/
|
|
836
851
|
render() {
|
|
837
852
|
return html `
|
|
838
|
-
${this.inputTemplate}
|
|
839
|
-
${guard([this.value, this.lang, this.amPm], () => this.getAmPmHtml)}
|
|
853
|
+
${this.inputTemplate} ${guard([this.value, this.lang, this.amPm], () => this.getAmPmHtml)}
|
|
840
854
|
${guard([this.isMobile], () => this.nativeInputForMobile)}
|
|
841
855
|
${guard([this.value, this.lang, this.showSeconds, this.amPm, this.announceValues], () => this.selectionTemplate)}
|
|
842
856
|
`;
|
package/lib/toggle/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSResultGroup, ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
4
|
* Form control that can toggle between 2 states
|
|
5
5
|
*
|