@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/swing-gauge/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { ResponsiveElement, css, html
|
|
2
|
+
import { ResponsiveElement, WarningNotice, 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
6
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
7
7
|
import { styleMap } from '@refinitiv-ui/core/directives/style-map.js';
|
|
8
|
-
import { VERSION } from '../version.js';
|
|
9
8
|
import '../canvas/index.js';
|
|
10
9
|
import '../label/index.js';
|
|
11
|
-
import {
|
|
10
|
+
import { VERSION } from '../version.js';
|
|
12
11
|
import { DefaultStyle, Segment, TextType } from './const.js';
|
|
12
|
+
import { helpers as canvasHelper } from './helpers.js';
|
|
13
13
|
/**
|
|
14
14
|
* Constants from swing-gauge default specs
|
|
15
15
|
*/
|
|
@@ -53,12 +53,12 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
53
53
|
*/
|
|
54
54
|
this.duration = 1000;
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
* Primary value legend
|
|
57
|
+
*/
|
|
58
58
|
this.primaryLegend = '';
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
* Secondary value legend
|
|
61
|
+
*/
|
|
62
62
|
this.secondaryLegend = '';
|
|
63
63
|
/**
|
|
64
64
|
* Custom value formatter
|
|
@@ -80,28 +80,28 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
80
80
|
this.primaryLineRadian = PRIMARY_RADIAN;
|
|
81
81
|
this.secondaryLineRadian = SECONDARY_RADIAN;
|
|
82
82
|
/**
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
* Data requires to draw swing gauge
|
|
84
|
+
*/
|
|
85
85
|
this.data = null;
|
|
86
86
|
/**
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
* Internal sizes and scales
|
|
88
|
+
*/
|
|
89
89
|
this.width = 0;
|
|
90
90
|
this.height = 0;
|
|
91
91
|
this.size = 0;
|
|
92
92
|
this.lineLength = 60;
|
|
93
93
|
this.scale = 1;
|
|
94
94
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
* Current fill percentage
|
|
96
|
+
*/
|
|
97
97
|
this.fillPercentage = 0;
|
|
98
98
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
* Keeps previous percentage calculation to avoid re-rendering the same value
|
|
100
|
+
*/
|
|
101
101
|
this.previousFillPercentage = 0;
|
|
102
102
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
* This for keep line number of label for calculate new radius
|
|
104
|
+
*/
|
|
105
105
|
this.labelLineNumber = 1;
|
|
106
106
|
/**
|
|
107
107
|
* Style for primary container
|
|
@@ -139,46 +139,50 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
139
139
|
display: block;
|
|
140
140
|
height: 200px;
|
|
141
141
|
}
|
|
142
|
-
:host [part=container] {
|
|
142
|
+
:host [part='container'] {
|
|
143
143
|
display: flex;
|
|
144
144
|
flex-direction: column;
|
|
145
145
|
height: 100%;
|
|
146
146
|
}
|
|
147
|
-
:host [part=canvas-container] {
|
|
147
|
+
:host [part='canvas-container'] {
|
|
148
148
|
position: relative;
|
|
149
149
|
flex: 1;
|
|
150
150
|
}
|
|
151
|
-
:host [part=canvas] {
|
|
151
|
+
:host [part='canvas'] {
|
|
152
152
|
height: 100%;
|
|
153
153
|
}
|
|
154
|
-
:host [part=primary-legend],
|
|
154
|
+
:host [part='primary-legend'],
|
|
155
|
+
[part='secondary-legend'] {
|
|
155
156
|
text-align: left;
|
|
156
157
|
display: flex;
|
|
157
158
|
}
|
|
158
|
-
:host [part=primary-label],
|
|
159
|
+
:host [part='primary-label'],
|
|
160
|
+
[part='primary-value'] {
|
|
159
161
|
text-align: left;
|
|
160
162
|
}
|
|
161
|
-
:host [part=secondary-label],
|
|
163
|
+
:host [part='secondary-label'],
|
|
164
|
+
[part='secondary-value'] {
|
|
162
165
|
text-align: right;
|
|
163
166
|
}
|
|
164
|
-
:host [part=legend-container-outer] {
|
|
167
|
+
:host [part='legend-container-outer'] {
|
|
165
168
|
width: 60%;
|
|
166
169
|
margin: 0 auto;
|
|
167
170
|
text-align: center;
|
|
168
171
|
}
|
|
169
|
-
:host [part=legend-container-inner] {
|
|
172
|
+
:host [part='legend-container-inner'] {
|
|
170
173
|
max-width: 100%;
|
|
171
174
|
display: inline-block;
|
|
172
175
|
}
|
|
173
|
-
:host [part=primary-legend-symbol],
|
|
176
|
+
:host [part='primary-legend-symbol'],
|
|
177
|
+
[part='secondary-legend-symbol'] {
|
|
174
178
|
display: inline-block;
|
|
175
179
|
flex-shrink: 0;
|
|
176
180
|
}
|
|
177
|
-
:host [part=primary-container] {
|
|
181
|
+
:host [part='primary-container'] {
|
|
178
182
|
position: absolute;
|
|
179
183
|
text-align: left;
|
|
180
184
|
}
|
|
181
|
-
:host [part=secondary-container] {
|
|
185
|
+
:host [part='secondary-container'] {
|
|
182
186
|
position: absolute;
|
|
183
187
|
text-align: right;
|
|
184
188
|
}
|
|
@@ -215,14 +219,14 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
215
219
|
return this._secondaryValue;
|
|
216
220
|
}
|
|
217
221
|
/**
|
|
218
|
-
|
|
219
|
-
|
|
222
|
+
* Get primary percentage
|
|
223
|
+
*/
|
|
220
224
|
get primaryPercentage() {
|
|
221
225
|
return this.getPercentage(this.primaryValue);
|
|
222
226
|
}
|
|
223
227
|
/**
|
|
224
|
-
|
|
225
|
-
|
|
228
|
+
* Get secondary percentage
|
|
229
|
+
*/
|
|
226
230
|
get secondaryPercentage() {
|
|
227
231
|
return this.getPercentage(this.secondaryValue);
|
|
228
232
|
}
|
|
@@ -273,8 +277,9 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
273
277
|
*/
|
|
274
278
|
update(changedProperties) {
|
|
275
279
|
super.update(changedProperties);
|
|
276
|
-
if (changedProperties.has('primaryValue') ||
|
|
277
|
-
|
|
280
|
+
if (changedProperties.has('primaryValue') ||
|
|
281
|
+
changedProperties.has('secondaryValue') ||
|
|
282
|
+
(this.primaryValue === 0 && this.secondaryValue === 0)) {
|
|
278
283
|
this.canvas.autoloop = true;
|
|
279
284
|
this.renderCanvas('frame');
|
|
280
285
|
this.animateCanvas();
|
|
@@ -285,9 +290,11 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
285
290
|
if (changedProperties.has('valueFormatter')) {
|
|
286
291
|
this.calculateValueFontSize();
|
|
287
292
|
}
|
|
288
|
-
if (changedProperties.has('primaryValue') ||
|
|
289
|
-
|
|
290
|
-
|
|
293
|
+
if (changedProperties.has('primaryValue') ||
|
|
294
|
+
changedProperties.has('secondaryValue') ||
|
|
295
|
+
changedProperties.has('primaryLabel') ||
|
|
296
|
+
changedProperties.has('secondaryLabel') ||
|
|
297
|
+
changedProperties.has('valueFormatter')) {
|
|
291
298
|
this.updateGaugePositions();
|
|
292
299
|
}
|
|
293
300
|
}
|
|
@@ -328,7 +335,8 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
328
335
|
*/
|
|
329
336
|
easeTo(to, from, time) {
|
|
330
337
|
const diff = (this.duration - (time - performance.now())) / this.duration;
|
|
331
|
-
this.fillPercentage =
|
|
338
|
+
this.fillPercentage =
|
|
339
|
+
from + (to - from) * canvasHelper.elasticOut(diff > 1 ? 1 : diff < 0 ? 0 : diff) || 0;
|
|
332
340
|
if (this.fillPercentage !== to) {
|
|
333
341
|
this.cancelFrame(this.requestedAnimationID);
|
|
334
342
|
this.requestedAnimationID = this.onFrame(() => this.easeTo(to, from, time));
|
|
@@ -408,7 +416,7 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
408
416
|
const reverseScale = 1 - this.scale;
|
|
409
417
|
// increase the offset by 25%, this for buffer to make label have some space from bottom
|
|
410
418
|
this.linePointerOffset = (containerHeight / gaugeHeight) * reverseScale * 1.25;
|
|
411
|
-
this.primaryLineRadian = PRIMARY_RADIAN + DEFAULT_OFFSET +
|
|
419
|
+
this.primaryLineRadian = PRIMARY_RADIAN + DEFAULT_OFFSET + OVERFLOW_OFFSET * reverseScale;
|
|
412
420
|
this.secondaryLineRadian = 3 - this.primaryLineRadian;
|
|
413
421
|
}
|
|
414
422
|
const primaryPosLine = this.getPositionStyle(Segment.PRIMARY, this.primaryLineRadian, this.linePointerOffset, 0);
|
|
@@ -528,7 +536,7 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
528
536
|
const offset = DEFAULT_OFFSET * reverseScale;
|
|
529
537
|
this.primaryLineRadian = PRIMARY_RADIAN + offset;
|
|
530
538
|
this.secondaryLineRadian = SECONDARY_RADIAN - offset;
|
|
531
|
-
this.linePointerOffset = LINE_POINTER_OFFSET +
|
|
539
|
+
this.linePointerOffset = LINE_POINTER_OFFSET + 0.4 * (1 - this.scale);
|
|
532
540
|
}
|
|
533
541
|
this.primaryLineRadian = this.primaryLineRadian > 1.3 ? 1.3 : this.primaryLineRadian;
|
|
534
542
|
this.secondaryLineRadian = this.primaryLineRadian > 1.7 ? 1.7 : this.secondaryLineRadian;
|
|
@@ -558,7 +566,8 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
558
566
|
minFontSize = MIN_LABEL_FONT_SIZE;
|
|
559
567
|
// buffer for word wrap
|
|
560
568
|
widthScale = 1.1;
|
|
561
|
-
longerLabel =
|
|
569
|
+
longerLabel =
|
|
570
|
+
this.primaryLabel.length > this.secondaryLabel.length ? this.primaryLabel : this.secondaryLabel;
|
|
562
571
|
fontSize = Math.ceil(this.scale * this.canvas.height * GAUGE_LABEL_FONT_SCALE);
|
|
563
572
|
}
|
|
564
573
|
else {
|
|
@@ -596,7 +605,10 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
596
605
|
if (!this.canvas.ctx) {
|
|
597
606
|
return;
|
|
598
607
|
}
|
|
599
|
-
this.labelStyle = {
|
|
608
|
+
this.labelStyle = {
|
|
609
|
+
maxWidth: `${this.lineLength}px`,
|
|
610
|
+
fontSize: `${this.calculateFontSize(this.canvas.ctx, TextType.LABEL)}px`
|
|
611
|
+
};
|
|
600
612
|
}
|
|
601
613
|
/**
|
|
602
614
|
* Update value font size
|
|
@@ -606,7 +618,10 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
606
618
|
if (!this.canvas.ctx) {
|
|
607
619
|
return;
|
|
608
620
|
}
|
|
609
|
-
this.valueStyle = {
|
|
621
|
+
this.valueStyle = {
|
|
622
|
+
maxWidth: `${this.lineLength}px`,
|
|
623
|
+
fontSize: `${this.calculateFontSize(this.canvas.ctx, TextType.VALUE)}px`
|
|
624
|
+
};
|
|
610
625
|
}
|
|
611
626
|
/**
|
|
612
627
|
* Compute percentage of value
|
|
@@ -617,7 +632,7 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
617
632
|
if (value === 0) {
|
|
618
633
|
return 0;
|
|
619
634
|
}
|
|
620
|
-
return 100 * value / (this.primaryValue + this.secondaryValue);
|
|
635
|
+
return (100 * value) / (this.primaryValue + this.secondaryValue);
|
|
621
636
|
}
|
|
622
637
|
/**
|
|
623
638
|
* Handles canvas resize
|
|
@@ -636,11 +651,10 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
636
651
|
get legendTemplate() {
|
|
637
652
|
return this.primaryLegend.length > 0 || this.secondaryLegend.length > 0
|
|
638
653
|
? html `<div part="legend-container-outer">
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
</div>`
|
|
654
|
+
<div part="legend-container-inner">
|
|
655
|
+
${this.primaryLegendTemplate} ${this.secondaryLegendTemplate}
|
|
656
|
+
</div>
|
|
657
|
+
</div>`
|
|
644
658
|
: null;
|
|
645
659
|
}
|
|
646
660
|
/**
|
|
@@ -650,9 +664,11 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
650
664
|
get primaryLegendTemplate() {
|
|
651
665
|
return this.primaryLegend
|
|
652
666
|
? html `<div part="primary-legend">
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
</
|
|
667
|
+
<span part="primary-legend-symbol"></span>
|
|
668
|
+
<ef-label max-line="${MAX_LEGEND_LINE}" line-clamp="${MAX_LEGEND_LINE}"
|
|
669
|
+
>${this.primaryLegend}</ef-label
|
|
670
|
+
>
|
|
671
|
+
</div>`
|
|
656
672
|
: null;
|
|
657
673
|
}
|
|
658
674
|
/**
|
|
@@ -662,9 +678,11 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
662
678
|
get secondaryLegendTemplate() {
|
|
663
679
|
return this.secondaryLegend
|
|
664
680
|
? html `<div part="secondary-legend">
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
</
|
|
681
|
+
<span part="secondary-legend-symbol"></span>
|
|
682
|
+
<ef-label max-line="${MAX_LEGEND_LINE}" line-clamp="${MAX_LEGEND_LINE}"
|
|
683
|
+
>${this.secondaryLegend}</ef-label
|
|
684
|
+
>
|
|
685
|
+
</div>`
|
|
668
686
|
: null;
|
|
669
687
|
}
|
|
670
688
|
render() {
|
|
@@ -674,38 +692,30 @@ let SwingGauge = class SwingGauge extends ResponsiveElement {
|
|
|
674
692
|
<div part="canvas-container">
|
|
675
693
|
<ef-canvas part="canvas" @resize=${this.onCanvasResize}></ef-canvas>
|
|
676
694
|
<div part="primary-container" style=${styleMap(this.primaryContainerStyle)}>
|
|
677
|
-
${this.primaryLabel
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
695
|
+
${this.primaryLabel
|
|
696
|
+
? html ` <ef-label
|
|
697
|
+
part="primary-label"
|
|
698
|
+
max-line="${MAX_LABEL_LINE}"
|
|
699
|
+
line-clamp="${MAX_LABEL_LINE}"
|
|
700
|
+
style=${styleMap(this.labelStyle)}
|
|
701
|
+
>${this.primaryLabel} </ef-label
|
|
702
|
+
><br />`
|
|
685
703
|
: null}
|
|
686
|
-
<ef-label
|
|
687
|
-
part="primary-value"
|
|
688
|
-
truncate=""
|
|
689
|
-
line-clamp="1"
|
|
690
|
-
style=${styleMap(this.valueStyle)}
|
|
704
|
+
<ef-label part="primary-value" truncate="" line-clamp="1" style=${styleMap(this.valueStyle)}
|
|
691
705
|
>${this.valueFormatter(this.primaryPercentage, this.primaryValue)}</ef-label
|
|
692
706
|
>
|
|
693
707
|
</div>
|
|
694
708
|
<div part="secondary-container" style=${styleMap(this.secondaryContainerStyle)}>
|
|
695
|
-
${this.secondaryLabel
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
709
|
+
${this.secondaryLabel
|
|
710
|
+
? html ` <ef-label
|
|
711
|
+
part="secondary-label"
|
|
712
|
+
max-line="${MAX_LABEL_LINE}"
|
|
713
|
+
line-clamp="${MAX_LABEL_LINE}"
|
|
714
|
+
style=${styleMap(this.labelStyle)}
|
|
715
|
+
>${this.secondaryLabel} </ef-label
|
|
716
|
+
><br />`
|
|
703
717
|
: null}
|
|
704
|
-
<ef-label
|
|
705
|
-
part="secondary-value"
|
|
706
|
-
truncate=""
|
|
707
|
-
line-clamp="1"
|
|
708
|
-
style=${styleMap(this.valueStyle)}
|
|
718
|
+
<ef-label part="secondary-value" truncate="" line-clamp="1" style=${styleMap(this.valueStyle)}
|
|
709
719
|
>${this.valueFormatter(this.secondaryPercentage, this.secondaryValue)}</ef-label
|
|
710
720
|
>
|
|
711
721
|
</div>
|
package/lib/tab/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
|
import '../icon/index.js';
|
|
4
4
|
import '../label/index.js';
|
|
5
5
|
/**
|
package/lib/tab/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import {
|
|
2
|
+
import { ControlElement, css, html } from '@refinitiv-ui/core';
|
|
3
|
+
import { triggerResize } from '@refinitiv-ui/core';
|
|
3
4
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
5
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
6
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
6
7
|
import { isSlotEmpty } from '@refinitiv-ui/utils/is-slot-empty.js';
|
|
7
|
-
import { triggerResize } from '@refinitiv-ui/core';
|
|
8
|
-
import { VERSION } from '../version.js';
|
|
9
8
|
import '../icon/index.js';
|
|
10
9
|
import '../label/index.js';
|
|
10
|
+
import { VERSION } from '../version.js';
|
|
11
11
|
/**
|
|
12
12
|
* A building block for individual tab
|
|
13
13
|
* @attr {boolean} disabled - Set disabled state
|
|
@@ -153,11 +153,13 @@ let Tab = class Tab extends ControlElement {
|
|
|
153
153
|
* @returns close button template
|
|
154
154
|
*/
|
|
155
155
|
get CloseTemplate() {
|
|
156
|
-
return this.clears || this.clearsOnHover
|
|
157
|
-
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
return this.clears || this.clearsOnHover
|
|
157
|
+
? html `
|
|
158
|
+
<div part="close-container">
|
|
159
|
+
<ef-icon part="close" icon="cross" @tap="${this.handleClickClear}"></ef-icon>
|
|
160
|
+
</div>
|
|
161
|
+
`
|
|
162
|
+
: null;
|
|
161
163
|
}
|
|
162
164
|
/**
|
|
163
165
|
* Create ef-label template when label is true
|
|
@@ -167,13 +169,7 @@ let Tab = class Tab extends ControlElement {
|
|
|
167
169
|
if (!this.label || this.isSlotHasContent) {
|
|
168
170
|
return null;
|
|
169
171
|
}
|
|
170
|
-
return html `
|
|
171
|
-
<ef-label
|
|
172
|
-
part="label"
|
|
173
|
-
.lineClamp=${this.getLineClamp()}>
|
|
174
|
-
${this.label}
|
|
175
|
-
</ef-label>
|
|
176
|
-
`;
|
|
172
|
+
return html ` <ef-label part="label" .lineClamp=${this.getLineClamp()}> ${this.label} </ef-label> `;
|
|
177
173
|
}
|
|
178
174
|
/**
|
|
179
175
|
* Create ef-label template when subLabel is true
|
|
@@ -183,13 +179,7 @@ let Tab = class Tab extends ControlElement {
|
|
|
183
179
|
if (!this.subLabel || this.isSlotHasContent) {
|
|
184
180
|
return null;
|
|
185
181
|
}
|
|
186
|
-
return html `
|
|
187
|
-
<ef-label
|
|
188
|
-
part="sub-label"
|
|
189
|
-
.lineClamp=${this.getLineClamp()}>
|
|
190
|
-
${this.subLabel}
|
|
191
|
-
</ef-label>
|
|
192
|
-
`;
|
|
182
|
+
return html ` <ef-label part="sub-label" .lineClamp=${this.getLineClamp()}> ${this.subLabel} </ef-label> `;
|
|
193
183
|
}
|
|
194
184
|
/**
|
|
195
185
|
* A `TemplateResult` that will be used
|
|
@@ -199,11 +189,10 @@ let Tab = class Tab extends ControlElement {
|
|
|
199
189
|
render() {
|
|
200
190
|
return html `
|
|
201
191
|
${this.icon ? html `<ef-icon icon=${this.icon} part="icon"></ef-icon>` : null}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
</div>
|
|
192
|
+
<div part="label-container">
|
|
193
|
+
${this.LabelTemplate} ${this.SubLabelTemplate}
|
|
194
|
+
<slot @slotchange="${this.onSlotChange}"></slot>
|
|
195
|
+
</div>
|
|
207
196
|
${this.CloseTemplate}
|
|
208
197
|
`;
|
|
209
198
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/dark';
|
|
2
2
|
import '@refinitiv-ui/elements/label/themes/halo/dark';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#404040;color:#ccc;height:36px;padding:9px 12px;outline:0;font-size:12px;font-weight:500;transition:120ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation}:host [part=icon]{min-width:1em;font-size:1.5em}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:46px}:host([sub-label]) [part=icon]{font-size:1.8em}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#404040;color:#ccc;height:36px;padding:9px 12px;outline:0;font-size:12px;font-weight:500;transition:120ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation}:host [part=icon]{min-width:1em;font-size:1.5em}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:46px}:host([sub-label]) [part=icon]{font-size:1.8em}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp=\'2\']),:host([line-clamp=\'3\']){height:46px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#fff}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:120ms;background:#1429bd;box-shadow:-1em 0 .75em -.5em #1429bd}:host([active]){color:#fff;background-color:#334bff}:host([active]:hover){background-color:#1429bd}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#1429bd;box-shadow:-1em 0 .75em -.5em #1429bd}:host([active]:active){background-color:#0f1e8a}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([active][disabled]){color:rgba(255,255,255,.5);background-color:rgba(51,75,255,.5)}:host([disabled]){pointer-events:none;color:rgba(204,204,204,.5);background-color:rgba(64,64,64,.5)}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#1429bd}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#6678ff;background-color:#404040}:host(:hover){color:#fff;box-shadow:0 0 0 0 rgba(0,0,0,.8);background-color:#1429bd}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#fff;background-color:#0f1e8a}:host(:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([level=\'1\']){border-right:1px solid #0d0d0d}:host([level=\'2\']:not(:last-child)){border-right:none}:host([level=\'2\']:not(:last-child)) [part=label-container]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#404040;height:70%;right:0;top:0;bottom:0;z-index:1}:host([level=\'2\']:not(:active):not([active]):not(:hover)){background-color:#262626}:host([level=\'2\'][active]:not(:active):not(:hover)){color:#6678ff;background-color:#0d0d0d}:host([level=\'2\'][active]:focus:not([focused])),:host([level=\'2\'][focused=visible]:not(:active):not(:hover)){color:#6678ff}:host([level=\'3\']){border-bottom:2px solid transparent;color:#ccc;background-color:#0d0d0d}:host([level=\'3\'][clears-on-hover]) [part=close-container]{background:#0d0d0d;box-shadow:-1em 0 .75em -.5em #0d0d0d}:host([level=\'3\']:focus:not([focused])),:host([level=\'3\'][focused=visible]){color:#fff;background-color:#262626}:host([level=\'3\']:active),:host([level=\'3\']:hover),:host([level=\'3\'][active]){color:#fff;background-color:#0d0d0d;border-color:#334bff}:host([level=\'3\']:active[clears-on-hover]) [part=close-container],:host([level=\'3\']:hover[clears-on-hover]) [part=close-container],:host([level=\'3\'][active][clears-on-hover]) [part=close-container]{background:#0d0d0d;box-shadow:-1em 0 .75em -.5em #0d0d0d}:host([level=\'3\']:active) [part=close],:host([level=\'3\']:hover) [part=close],:host([level=\'3\'][active]) [part=close]{color:#fff}:host([level=\'3\']:hover){border-color:#1429bd}:host([level=\'3\']:active){border-color:#0f1e8a}' }}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/halo/light';
|
|
2
2
|
import '@refinitiv-ui/elements/label/themes/halo/light';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#e6e6e6;color:#0d0d0d;height:36px;padding:9px 12px;outline:0;font-size:12px;font-weight:500;transition:120ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation}:host [part=icon]{min-width:1em;font-size:1.5em}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:46px}:host([sub-label]) [part=icon]{font-size:1.8em}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#e6e6e6;color:#0d0d0d;height:36px;padding:9px 12px;outline:0;font-size:12px;font-weight:500;transition:120ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation}:host [part=icon]{min-width:1em;font-size:1.5em}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:46px}:host([sub-label]) [part=icon]{font-size:1.8em}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp=\'2\']),:host([line-clamp=\'3\']){height:46px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#fff}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:120ms;background:#1429bd;box-shadow:-1em 0 .75em -.5em #1429bd}:host([active]){color:#fff;background-color:#334bff}:host([active]:hover){background-color:#1429bd}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#1429bd;box-shadow:-1em 0 .75em -.5em #1429bd}:host([active]:active){background-color:#0f1e8a}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([active][disabled]){color:rgba(255,255,255,.5);background-color:rgba(51,75,255,.5)}:host([disabled]){pointer-events:none;color:rgba(13,13,13,.5);background-color:rgba(230,230,230,.5)}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#1429bd}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#6678ff;background-color:#e6e6e6}:host(:hover){color:#fff;box-shadow:0 0 0 0 rgba(0,0,0,.55);background-color:#1429bd}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#fff;background-color:#0f1e8a}:host(:active[clears-on-hover]) [part=close-container]{background-color:#0f1e8a;box-shadow:-1em 0 .75em -.5em #0f1e8a}:host([level=\'1\']){border-right:1px solid #fff}:host([level=\'2\']:not(:last-child)){border-right:none}:host([level=\'2\']:not(:last-child)) [part=label-container]::after{content:\'\';position:absolute;margin:auto;width:1px;background:#d9d9d9;height:70%;right:0;top:0;bottom:0;z-index:1}:host([level=\'2\']:not(:active):not([active]):not(:hover)){background-color:#f2f2f2}:host([level=\'2\'][active]:not(:active):not(:hover)){color:#334bff;background-color:#fff}:host([level=\'2\'][active]:focus:not([focused])),:host([level=\'2\'][focused=visible]:not(:active):not(:hover)){color:#6678ff}:host([level=\'3\']){border-bottom:2px solid transparent;color:#404040;background-color:#fff}:host([level=\'3\'][clears-on-hover]) [part=close-container]{background:#fff;box-shadow:-1em 0 .75em -.5em #fff}:host([level=\'3\']:focus:not([focused])),:host([level=\'3\'][focused=visible]){color:#0d0d0d;background-color:#f2f2f2}:host([level=\'3\']:active),:host([level=\'3\']:hover),:host([level=\'3\'][active]){color:#0d0d0d;background-color:#fff;border-color:#334bff}:host([level=\'3\']:active[clears-on-hover]) [part=close-container],:host([level=\'3\']:hover[clears-on-hover]) [part=close-container],:host([level=\'3\'][active][clears-on-hover]) [part=close-container]{background:#fff;box-shadow:-1em 0 .75em -.5em #fff}:host([level=\'3\']:active) [part=close],:host([level=\'3\']:hover) [part=close],:host([level=\'3\'][active]) [part=close]{color:#0d0d0d}:host([level=\'3\']:hover){border-color:#1429bd}:host([level=\'3\']:active){border-color:#0f1e8a}' }}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/charcoal';
|
|
2
2
|
import '@refinitiv-ui/elements/label/themes/solar/charcoal';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#3c3c42;color:#c2c2c2;height:23px;padding:7px 15px;outline:0;font-size:13px;font-weight:500;transition:70ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation;border:1px solid #000;border-left:none}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:33px}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#3c3c42;color:#c2c2c2;height:23px;padding:7px 15px;outline:0;font-size:13px;font-weight:500;transition:70ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation;border:1px solid #000;border-left:none}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:33px}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp=\'2\']),:host([line-clamp=\'3\']){height:33px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#e2e2e2}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:70ms;background:#4a4a4f;box-shadow:-1em 0 .75em -.5em #4a4a4f}:host([active]){color:#0a0a0a;background-color:#f93}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#ffa041;box-shadow:-1em 0 .75em -.5em #ffa041}:host([active]:active){background-color:#ed8e2f}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#ed8e2f;box-shadow:-1em 0 .75em -.5em #ed8e2f}:host([active][disabled]){background-color:#ffad5c;color:rgba(10,10,10,.7)}:host([disabled]){pointer-events:none;color:#c2c2c2;background-color:#636368}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#ffa041}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#e2e2e2;background-color:#3c3c42}:host(:hover){color:#e2e2e2;box-shadow:0 0 0 0 rgba(0,0,0,.9);background-color:#4a4a4f}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#c2c2c2;background-color:#38383d}:host(:active[clears-on-hover]) [part=close-container]{background-color:#38383d;box-shadow:-1em 0 .75em -.5em #38383d}:host [part=icon]{min-width:1em;font-size:1em}:host([sub-label]) [part=icon]{font-size:1.2em}:host([active]:hover){color:#0a0a0a;background-color:#ffb366}' }}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@refinitiv-ui/elements/icon/themes/solar/pearl';
|
|
2
2
|
import '@refinitiv-ui/elements/label/themes/solar/pearl';
|
|
3
|
-
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#fafbfc;color:#505050;height:23px;padding:7px 15px;outline:0;font-size:13px;font-weight:500;transition:70ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation;border:1px solid #a9afba;border-left:none}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:33px}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp
|
|
3
|
+
dispatchEvent(new CustomEvent('ef.customStyles.define', { detail: { name: 'ef-tab', styles: ':host{cursor:pointer;background-color:#fafbfc;color:#505050;height:23px;padding:7px 15px;outline:0;font-size:13px;font-weight:500;transition:70ms;position:relative;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;align-items:center;justify-content:center;touch-action:manipulation;border:1px solid #a9afba;border-left:none}:host [part=label-container]{display:flex;align-items:flex-start;flex-direction:column;width:100%;min-width:0}:host(:not([sub-label])) [part=label-container]{align-items:center}:host([icon]) [part=label-container]{padding-left:.3em}:host [part=sub-label]{font-weight:400;font-size:.875em}:host(:not([active]):not(:active):not(:hover)) [part=sub-label]{opacity:.7}:host([sub-label]){height:33px}:host([sub-label]) [part=close]{font-size:1.25em}:host([sub-label][clears]){padding-right:2.5em}:host([line-clamp=\'2\']),:host([line-clamp=\'3\']){height:33px}:host([icon][sub-label]) [part=label-container]{padding-left:.5em}:host([clears]){padding-right:2em}:host [part=close-container]{position:absolute;top:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}:host [part=close]{margin-right:.5em;min-width:1em;font-size:1em}:host([clears-on-hover]) [part=close]{color:#1d1d1d}:host([clears-on-hover]) [part=close-container]{width:2em;opacity:0;transition:70ms;background:#fafbfc;box-shadow:-1em 0 .75em -.5em #fafbfc}:host([active]){color:#505050;background-color:#ffb266}:host([active]:hover[clears-on-hover]) [part=close-container]{background-color:#ffb771;box-shadow:-1em 0 .75em -.5em #ffb771}:host([active]:active){background-color:#eda65f}:host([active]:active[clears-on-hover]) [part=close-container]{background-color:#eda65f;box-shadow:-1em 0 .75em -.5em #eda65f}:host([active][disabled]){color:#a8896a;background-color:#ffc185}:host([disabled]){pointer-events:none;color:#505050;background-color:#fbfcfd}:host(:focus:not([focused])),:host([focused=visible]){box-shadow:none;background-color:#ffb771}:host(:focus:not([focused]):not([active]):not(:hover)),:host([focused=visible]:not([active]):not(:hover)){color:#1d1d1d;background-color:#fafbfc}:host(:hover){color:#1d1d1d;box-shadow:0 0 0 0 rgba(0,0,0,.6);background-color:#fafbfc}:host(:hover[clears-on-hover]) [part=close-container]{opacity:1}:host(:active){color:#505050;background-color:#e8e9ea}:host(:active[clears-on-hover]) [part=close-container]{background-color:#e8e9ea;box-shadow:-1em 0 .75em -.5em #e8e9ea}:host [part=icon]{min-width:1em;font-size:1em}:host([sub-label]) [part=icon]{font-size:1.2em}:host([active]:hover){color:#505050;background-color:#fc9}' }}));
|
|
@@ -34,7 +34,7 @@ const tweenAnimate = (configs) => {
|
|
|
34
34
|
const delta = endPosition - startPosition;
|
|
35
35
|
const tweenLoop = () => {
|
|
36
36
|
const currentTime = 'now' in window.performance ? performance.now() : new Date().getTime();
|
|
37
|
-
const step = Math.min(1, (
|
|
37
|
+
const step = Math.min(1, (currentTime - startTime) / duration);
|
|
38
38
|
const factor = functionEasings[easing](step); // factor can be a decimal
|
|
39
39
|
configs.target.scrollLeft = startPosition + delta * factor;
|
|
40
40
|
if (step < 1 && configs.target.scrollLeft !== endPosition) {
|
package/lib/tab-bar/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import '../button/index.js';
|
|
4
4
|
import '../layout/index.js';
|
|
5
5
|
/**
|