@refinitiv-ui/elements 7.0.0 → 7.0.1
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 +191 -456
- package/LICENSE +2 -2
- package/README.md +13 -11
- package/cli.mjs +5 -3
- 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 +80 -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 +156 -123
- package/lib/calendar/utils.js +1 -1
- 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/elements/chart.d.ts +4 -4
- package/lib/chart/elements/chart.js +39 -33
- package/lib/chart/plugins/doughnut-center-label.d.ts +3 -3
- package/lib/chart/plugins/doughnut-center-label.js +13 -9
- 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 +27 -18
- 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.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 +150 -131
- 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 +5 -5
- package/lib/dialog/index.js +51 -47
- 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 +8 -10
- package/lib/interactive-chart/helpers/types.d.ts +3 -3
- package/lib/interactive-chart/index.d.ts +29 -29
- package/lib/interactive-chart/index.js +69 -55
- 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 +10 -7
- 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 +19 -13
- 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 +152 -96
- 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 +14 -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 +3 -3
- 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 +68 -81
- 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 +34 -31
- package/lib/time-picker/index.d.ts +6 -6
- package/lib/time-picker/index.js +103 -89
- 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 +2 -2
- 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/time-picker/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
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 {
|
|
11
|
-
import '../number-field/index.js';
|
|
12
|
-
import { translate } from '@refinitiv-ui/translate';
|
|
7
|
+
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
8
|
+
import { guard } from '@refinitiv-ui/core/directives/guard.js';
|
|
13
9
|
import '@refinitiv-ui/phrasebook/locale/en/time-picker.js';
|
|
10
|
+
import { translate } from '@refinitiv-ui/translate';
|
|
11
|
+
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
|
+
import '../number-field/index.js';
|
|
13
|
+
import { VERSION } from '../version.js';
|
|
14
14
|
var Segment;
|
|
15
15
|
(function (Segment) {
|
|
16
16
|
Segment["HOURS"] = "hours";
|
|
@@ -162,9 +162,9 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
162
162
|
return this._seconds;
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
* Value of the element
|
|
166
|
+
* @param value Element value
|
|
167
|
+
*/
|
|
168
168
|
set value(value) {
|
|
169
169
|
const oldValue = this.value;
|
|
170
170
|
value = this.castValue(value);
|
|
@@ -180,7 +180,8 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
180
180
|
this.seconds = null;
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
if (oldValue !== value) {
|
|
183
|
+
if (oldValue !== value) {
|
|
184
|
+
/** never store actual value, instead operate with hours/minutes/seconds */
|
|
184
185
|
const info = toTimeSegment(value);
|
|
185
186
|
const format = getFormat(value);
|
|
186
187
|
this.valueWithSeconds = format === TimeFormat.HHmmss || format === TimeFormat.HHmmssSSS;
|
|
@@ -233,8 +234,12 @@ let TimePicker = TimePicker_1 = class TimePicker extends ControlElement {
|
|
|
233
234
|
const _hours = this.hours;
|
|
234
235
|
let hours = _hours;
|
|
235
236
|
if (_hours !== null) {
|
|
236
|
-
hours =
|
|
237
|
-
|
|
237
|
+
hours =
|
|
238
|
+
this.amPm && _hours > HOURS_OF_NOON
|
|
239
|
+
? _hours - HOURS_OF_NOON
|
|
240
|
+
: this.amPm && !_hours
|
|
241
|
+
? HOURS_OF_NOON
|
|
242
|
+
: _hours;
|
|
238
243
|
}
|
|
239
244
|
return hours;
|
|
240
245
|
}
|
|
@@ -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.
|
|
@@ -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="${this.t('SELECT_HOURS', { value: this.periodHours })}"
|
|
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="${this.t('SELECT_MINUTES', { value: this.minutes })}"
|
|
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="${this.t('SELECT_SECONDS', { value: this.seconds })}"
|
|
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
|
*
|
package/lib/toggle/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ControlElement,
|
|
2
|
+
import { ControlElement, css, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { VERSION } from '../version.js';
|
|
@@ -110,8 +110,9 @@ let Toggle = class Toggle extends ControlElement {
|
|
|
110
110
|
* @return Render template
|
|
111
111
|
*/
|
|
112
112
|
render() {
|
|
113
|
-
return html `
|
|
114
|
-
|
|
113
|
+
return html ` <div part="toggle">
|
|
114
|
+
${this.checked && this.checkedLabel ? this.checkedLabel : this.label}
|
|
115
|
+
</div>`;
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
118
|
__decorate([
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addTooltipCondition } from './tooltip-element.js';
|
|
2
1
|
import { tooltipRenderer } from '../helpers/renderer.js';
|
|
2
|
+
import { addTooltipCondition } from './tooltip-element.js';
|
|
3
3
|
// Support title attribute
|
|
4
4
|
Object.defineProperty(HTMLElement.prototype, 'title', {
|
|
5
5
|
get: function () {
|
|
@@ -14,4 +14,4 @@ Object.defineProperty(HTMLElement.prototype, 'title', {
|
|
|
14
14
|
this.setAttribute('tooltip', value);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
addTooltipCondition(element => element.matches('[title]'), tooltipRenderer);
|
|
17
|
+
addTooltipCondition((element) => element.matches('[title]'), tooltipRenderer);
|
package/lib/tooltip/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { BasicElement,
|
|
2
|
+
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import '../overlay/index.js';
|
|
4
|
-
import type { OverlayTransitionStyle as TooltipTransitionStyle } from '../overlay';
|
|
5
4
|
import './elements/title-tooltip.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { deregister as deregisterOverflowTooltip, register as registerOverflowTooltip } from './helpers/overflow-tooltip.js';
|
|
6
|
+
import { TooltipCondition, TooltipPosition, TooltipRenderer } from './helpers/types.js';
|
|
7
|
+
import type { OverlayTransitionStyle as TooltipTransitionStyle } from '../overlay';
|
|
8
8
|
/**
|
|
9
9
|
* Tooltip displays extra information when the
|
|
10
10
|
* user hovers the pointer over an item.
|
|
@@ -44,37 +44,37 @@ declare class Tooltip extends BasicElement {
|
|
|
44
44
|
*/
|
|
45
45
|
private static elementHasMoved;
|
|
46
46
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
* CSS selector to match the tooltip
|
|
48
|
+
*/
|
|
49
49
|
selector: string;
|
|
50
50
|
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
* Provide a function to test against the target.
|
|
52
|
+
* Return `true` if the target matches
|
|
53
|
+
* @type {TooltipCondition}
|
|
54
|
+
*/
|
|
55
55
|
condition: TooltipCondition | undefined;
|
|
56
56
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
* A renderer to define tooltip internal content.
|
|
58
|
+
* Return undefined, `String`, `HTMLElement` or `DocumentFragment`.
|
|
59
|
+
* If the content is not present, tooltip will not be displayed
|
|
60
|
+
* @type {TooltipRenderer}
|
|
61
|
+
*/
|
|
62
62
|
renderer: TooltipRenderer | undefined;
|
|
63
63
|
/**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
64
|
+
* The position of the tooltip. Use the following values:
|
|
65
|
+
* `auto` (default) - display based on mouse enter coordinates
|
|
66
|
+
* `above` - display above the element
|
|
67
|
+
* `right` - display to the right of the element
|
|
68
|
+
* `below` - display beneath the element
|
|
69
|
+
* `left` - display to the left of the element
|
|
70
|
+
*/
|
|
71
71
|
position: 'auto' | 'above' | 'right' | 'below' | 'left';
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
* Set the transition style.
|
|
74
|
+
* Value can be `fade`, `zoom`, `slide-down`, `slide-up`, `slide-right`,
|
|
75
|
+
* `slide-left`, `slide-right-down`, `slide-right-up`, `slide-left-down`, `slide-left-up`, or null in case of no transition
|
|
76
|
+
* @type {TooltipTransitionStyle}
|
|
77
|
+
*/
|
|
78
78
|
transitionStyle: TooltipTransitionStyle | null;
|
|
79
79
|
/**
|
|
80
80
|
* Get tooltip popup window
|
package/lib/tooltip/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
var Tooltip_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import { BasicElement,
|
|
3
|
+
import { BasicElement, css, html } 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
6
|
import { query } from '@refinitiv-ui/core/decorators/query.js';
|
|
7
|
-
import { VERSION } from '../version.js';
|
|
8
7
|
import { isSlotEmpty } from '@refinitiv-ui/utils/is-slot-empty.js';
|
|
9
8
|
import '../overlay/index.js';
|
|
9
|
+
import { VERSION } from '../version.js';
|
|
10
10
|
import './elements/title-tooltip.js';
|
|
11
|
-
import {
|
|
11
|
+
import { deregister as deregisterOverflowTooltip, register as registerOverflowTooltip } from './helpers/overflow-tooltip.js';
|
|
12
12
|
import { tooltipRenderer } from './helpers/renderer.js';
|
|
13
|
-
import {
|
|
13
|
+
import { deregister, register } from './managers/tooltip-manager.js';
|
|
14
14
|
const PositionMap = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
auto: ['bottom-start', 'top-start'],
|
|
16
|
+
above: ['top-middle'],
|
|
17
|
+
right: ['right-middle'],
|
|
18
|
+
below: ['bottom-middle'],
|
|
19
|
+
left: ['left-middle']
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Tooltip displays extra information when the
|
|
@@ -32,24 +32,24 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
32
32
|
this.clicked = false;
|
|
33
33
|
this.defaultRole = 'tooltip';
|
|
34
34
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
* CSS selector to match the tooltip
|
|
36
|
+
*/
|
|
37
37
|
this.selector = '';
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
* The position of the tooltip. Use the following values:
|
|
40
|
+
* `auto` (default) - display based on mouse enter coordinates
|
|
41
|
+
* `above` - display above the element
|
|
42
|
+
* `right` - display to the right of the element
|
|
43
|
+
* `below` - display beneath the element
|
|
44
|
+
* `left` - display to the left of the element
|
|
45
|
+
*/
|
|
46
46
|
this.position = 'auto';
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
* Set the transition style.
|
|
49
|
+
* Value can be `fade`, `zoom`, `slide-down`, `slide-up`, `slide-right`,
|
|
50
|
+
* `slide-left`, `slide-right-down`, `slide-right-up`, `slide-left-down`, `slide-left-up`, or null in case of no transition
|
|
51
|
+
* @type {TooltipTransitionStyle}
|
|
52
|
+
*/
|
|
53
53
|
this.transitionStyle = 'fade';
|
|
54
54
|
this._x = 0;
|
|
55
55
|
this._y = 0;
|
|
@@ -125,11 +125,11 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
125
125
|
flex: none;
|
|
126
126
|
visibility: hidden;
|
|
127
127
|
}
|
|
128
|
-
[part=tooltip] {
|
|
128
|
+
[part='tooltip'] {
|
|
129
129
|
visibility: visible;
|
|
130
130
|
overflow: visible;
|
|
131
131
|
}
|
|
132
|
-
[part=position-adjuster] {
|
|
132
|
+
[part='position-adjuster'] {
|
|
133
133
|
position: fixed;
|
|
134
134
|
z-index: -1;
|
|
135
135
|
top: 0;
|
|
@@ -358,7 +358,8 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
360
|
const matchTargetRect = matchTarget.getBoundingClientRect();
|
|
361
|
-
if (lastMatchTarget === matchTarget &&
|
|
361
|
+
if (lastMatchTarget === matchTarget &&
|
|
362
|
+
!Tooltip_1.elementHasMoved(matchTargetRect, this.matchTargetRect)) {
|
|
362
363
|
return;
|
|
363
364
|
}
|
|
364
365
|
this.matchTargetRect = matchTargetRect;
|
|
@@ -423,18 +424,21 @@ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
|
|
|
423
424
|
*/
|
|
424
425
|
render() {
|
|
425
426
|
return html `<ef-overlay
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
427
|
+
part="tooltip"
|
|
428
|
+
.noCancelOnEscKey=${true}
|
|
429
|
+
.noCancelOnOutsideClick=${true}
|
|
430
|
+
.withShadow=${true}
|
|
431
|
+
.noInteractionLock=${true}
|
|
432
|
+
.noFocusManagement=${true}
|
|
433
|
+
?opened=${this._opened}
|
|
434
|
+
.position=${this.tipPosition}
|
|
435
|
+
.transitionStyle=${this.transitionStyle}
|
|
436
|
+
.positionTarget=${this._positionTarget}
|
|
437
|
+
.x=${this._x}
|
|
438
|
+
.y=${this._y}
|
|
439
|
+
><slot id="contentSlot"></slot
|
|
440
|
+
></ef-overlay>
|
|
441
|
+
<div part="position-adjuster"></div>`;
|
|
438
442
|
}
|
|
439
443
|
/**
|
|
440
444
|
* true if tooltip is opened, false otherwise
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSResultGroup, ElementSize, ResponsiveElement, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import './tornado-item.js';
|
|
4
4
|
/**
|
|
5
5
|
* A data visualization that helps to
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ResponsiveElement,
|
|
2
|
+
import { ResponsiveElement, css, html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
|
-
import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
5
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
|
+
import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
6
6
|
import { VERSION } from '../../version.js';
|
|
7
7
|
import './tornado-item.js';
|
|
8
8
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSXInterface } from '../../jsx';
|
|
2
|
-
import { BasicElement,
|
|
3
|
-
import '../../progress-bar/index.js';
|
|
2
|
+
import { BasicElement, CSSResultGroup, TemplateResult } from '@refinitiv-ui/core';
|
|
4
3
|
import '../../layout/index.js';
|
|
4
|
+
import '../../progress-bar/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* A part of <ef-tornado-chart />,
|
|
7
7
|
* consists mainly of primary, secondary ef-progress-bar and labels.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement,
|
|
2
|
+
import { BasicElement, 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 { VERSION } from '../../version.js';
|
|
6
|
-
import '../../progress-bar/index.js';
|
|
7
5
|
import '../../layout/index.js';
|
|
6
|
+
import '../../progress-bar/index.js';
|
|
7
|
+
import { VERSION } from '../../version.js';
|
|
8
8
|
/**
|
|
9
9
|
* A part of <ef-tornado-chart />,
|
|
10
10
|
* consists mainly of primary, secondary ef-progress-bar and labels.
|
|
@@ -132,18 +132,18 @@ let TornadoItem = class TornadoItem extends BasicElement {
|
|
|
132
132
|
:host {
|
|
133
133
|
display: block;
|
|
134
134
|
}
|
|
135
|
-
:host([vertical]) [part=seperator] {
|
|
135
|
+
:host([vertical]) [part='seperator'] {
|
|
136
136
|
display: none;
|
|
137
137
|
}
|
|
138
|
-
:host([vertical]) [part=container] {
|
|
138
|
+
:host([vertical]) [part='container'] {
|
|
139
139
|
align-items: inherit;
|
|
140
140
|
}
|
|
141
|
-
[part=container] {
|
|
141
|
+
[part='container'] {
|
|
142
142
|
padding: 0;
|
|
143
143
|
align-items: center;
|
|
144
144
|
}
|
|
145
|
-
[part=primary-bar],
|
|
146
|
-
[part=secondary-bar] {
|
|
145
|
+
[part='primary-bar'],
|
|
146
|
+
[part='secondary-bar'] {
|
|
147
147
|
width: 100%;
|
|
148
148
|
}
|
|
149
149
|
`;
|
|
@@ -166,7 +166,8 @@ let TornadoItem = class TornadoItem extends BasicElement {
|
|
|
166
166
|
part="primary-bar"
|
|
167
167
|
alignment=${this.primaryBarAlignment}
|
|
168
168
|
label="${this.primaryLabel || nothing}"
|
|
169
|
-
value="${this.primaryValue || nothing}"
|
|
169
|
+
value="${this.primaryValue || nothing}"
|
|
170
|
+
>
|
|
170
171
|
</ef-progress-bar>
|
|
171
172
|
</ef-layout>
|
|
172
173
|
<div part="seperator"></div>
|
|
@@ -175,7 +176,8 @@ let TornadoItem = class TornadoItem extends BasicElement {
|
|
|
175
176
|
part="secondary-bar"
|
|
176
177
|
alignment="${this.secondaryBarAlignment}"
|
|
177
178
|
label="${this.secondaryLabel || nothing}"
|
|
178
|
-
value="${this.secondaryValue || nothing}"
|
|
179
|
+
value="${this.secondaryValue || nothing}"
|
|
180
|
+
>
|
|
179
181
|
</ef-progress-bar>
|
|
180
182
|
</ef-layout>
|
|
181
183
|
</ef-layout>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JSXInterface } from '../../jsx';
|
|
2
|
-
import {
|
|
3
|
-
import '../../icon/index.js';
|
|
2
|
+
import { ControlElement, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
4
3
|
import '../../checkbox/index.js';
|
|
5
|
-
import
|
|
4
|
+
import '../../icon/index.js';
|
|
6
5
|
import { CheckedState } from '../managers/tree-manager.js';
|
|
6
|
+
import type { TreeDataItem } from '../helpers/types';
|
|
7
7
|
/**
|
|
8
8
|
* Displays a tree list item.
|
|
9
9
|
* Groups display expansion arrows.
|