@refinitiv-ui/elements 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +195 -449
- package/LICENSE +2 -2
- package/README.md +12 -10
- 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 +14 -13
- package/lib/notification/helpers/status.js +1 -1
- package/lib/notification/themes/halo/dark/index.js +1 -1
- package/lib/notification/themes/halo/light/index.js +1 -1
- package/lib/notification/themes/solar/charcoal/index.js +1 -1
- package/lib/notification/themes/solar/pearl/index.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/toggle/themes/halo/dark/index.js +1 -1
- package/lib/toggle/themes/halo/light/index.js +1 -1
- package/lib/toggle/themes/solar/charcoal/index.js +1 -1
- package/lib/toggle/themes/solar/pearl/index.js +1 -1
- 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 +17 -17
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
2
2
|
import { getOverlays } from './zindex-manager.js';
|
|
3
3
|
/**
|
|
4
|
-
* Check if two arrays are shallow equal
|
|
5
|
-
* @param left Left side array
|
|
6
|
-
* @param right Right side array
|
|
7
|
-
* @returns true if arrays are equal
|
|
8
|
-
*/
|
|
4
|
+
* Check if two arrays are shallow equal
|
|
5
|
+
* @param left Left side array
|
|
6
|
+
* @param right Right side array
|
|
7
|
+
* @returns true if arrays are equal
|
|
8
|
+
*/
|
|
9
9
|
const equal = (left, right) => {
|
|
10
10
|
const length = left.length;
|
|
11
11
|
if (length !== right.length) {
|
|
@@ -61,6 +61,7 @@ export class ScrollLockManager {
|
|
|
61
61
|
*/
|
|
62
62
|
this.removeScrollLock = () => {
|
|
63
63
|
this.scrollThrottler.schedule(() => {
|
|
64
|
+
/* must be the delayed task, otherwise scroll might happen in rare scenarios after mouseup */
|
|
64
65
|
this.lockScroll = false;
|
|
65
66
|
});
|
|
66
67
|
};
|
|
@@ -82,7 +83,8 @@ export class ScrollLockManager {
|
|
|
82
83
|
* @returns {void}
|
|
83
84
|
*/
|
|
84
85
|
this.onTouchScroll = (event) => {
|
|
85
|
-
if (event.cancelable && this.shouldCancelTouch(event)) {
|
|
86
|
+
if (event.cancelable && this.shouldCancelTouch(event)) {
|
|
87
|
+
/* Not all touch events can be cancelled */
|
|
86
88
|
event.preventDefault();
|
|
87
89
|
}
|
|
88
90
|
};
|
|
@@ -111,7 +113,7 @@ export class ScrollLockManager {
|
|
|
111
113
|
* in lock management
|
|
112
114
|
*/
|
|
113
115
|
get overlays() {
|
|
114
|
-
return getOverlays().filter(overlay => !overlay.noInteractionLock);
|
|
116
|
+
return getOverlays().filter((overlay) => !overlay.noInteractionLock);
|
|
115
117
|
}
|
|
116
118
|
/**
|
|
117
119
|
* Lock the screen and make top most overlay
|
|
@@ -337,21 +339,27 @@ export class ScrollLockManager {
|
|
|
337
339
|
return true;
|
|
338
340
|
}
|
|
339
341
|
const checkSlice = path.slice(0, idx + 1);
|
|
340
|
-
const canScroll = isVerticalScroll
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
// delta < 0 is scroll left, delta > 0 is scroll right.
|
|
351
|
-
return deltaX < 0 ? element.scrollLeft > 0 : element.scrollLeft < element.scrollWidth - element.clientWidth;
|
|
342
|
+
const canScroll = isVerticalScroll
|
|
343
|
+
? (element) => {
|
|
344
|
+
const style = window.getComputedStyle(element);
|
|
345
|
+
if (style.overflowY === 'scroll' || style.overflowY === 'auto') {
|
|
346
|
+
// delta < 0 is scroll up, delta > 0 is scroll down.
|
|
347
|
+
return deltaY < 0
|
|
348
|
+
? element.scrollTop > 0
|
|
349
|
+
: element.scrollTop < element.scrollHeight - element.clientHeight;
|
|
350
|
+
}
|
|
351
|
+
return false;
|
|
352
352
|
}
|
|
353
|
-
|
|
354
|
-
|
|
353
|
+
: (element) => {
|
|
354
|
+
const style = window.getComputedStyle(element);
|
|
355
|
+
if (style.overflowX === 'scroll' || style.overflowX === 'auto') {
|
|
356
|
+
// delta < 0 is scroll left, delta > 0 is scroll right.
|
|
357
|
+
return deltaX < 0
|
|
358
|
+
? element.scrollLeft > 0
|
|
359
|
+
: element.scrollLeft < element.scrollWidth - element.clientWidth;
|
|
360
|
+
}
|
|
361
|
+
return false;
|
|
362
|
+
};
|
|
355
363
|
while (checkSlice.length) {
|
|
356
364
|
const node = checkSlice.shift();
|
|
357
365
|
if (node && node.nodeType !== Node.ELEMENT_NODE) {
|
|
@@ -366,10 +374,10 @@ export class ScrollLockManager {
|
|
|
366
374
|
}
|
|
367
375
|
const locker = new ScrollLockManager(); /* Locker is a singleton */
|
|
368
376
|
/**
|
|
369
|
-
* Lock the screen and make top most overlay
|
|
370
|
-
* and its position target interactive
|
|
371
|
-
* @returns {void}
|
|
372
|
-
*/
|
|
377
|
+
* Lock the screen and make top most overlay
|
|
378
|
+
* and its position target interactive
|
|
379
|
+
* @returns {void}
|
|
380
|
+
*/
|
|
373
381
|
export const applyLock = () => {
|
|
374
382
|
locker.applyLock();
|
|
375
383
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ViewAreaInfo } from '../helpers/types';
|
|
2
|
-
import type { Overlay } from '../elements/overlay';
|
|
3
1
|
import '../elements/overlay-viewport.js';
|
|
2
|
+
import type { Overlay } from '../elements/overlay';
|
|
3
|
+
import type { ViewAreaInfo } from '../helpers/types';
|
|
4
4
|
/**
|
|
5
5
|
* Viewport manager singleton is responsible for getting
|
|
6
6
|
* viewport sizes and reacting on viewport changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
2
2
|
import '../elements/overlay-viewport.js';
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
*/
|
|
4
|
+
* Default values for area info
|
|
5
|
+
*/
|
|
6
6
|
const viewAreaInfo = {
|
|
7
7
|
viewHeight: 0,
|
|
8
8
|
viewWidth: 0,
|
|
@@ -32,6 +32,7 @@ export class ViewportManager {
|
|
|
32
32
|
*/
|
|
33
33
|
this.callRefit = () => {
|
|
34
34
|
this.refitFrame.schedule(() => {
|
|
35
|
+
/* must be in animation frame because of weird mobile behaviour */
|
|
35
36
|
this.registry.forEach((viewport, overlay) => {
|
|
36
37
|
this.resetViewportSizing(viewport);
|
|
37
38
|
overlay.fit();
|
|
@@ -76,7 +76,8 @@ export class ZIndexManager {
|
|
|
76
76
|
if (!topOverlay) {
|
|
77
77
|
return ZIndex;
|
|
78
78
|
}
|
|
79
|
-
if (topOverlay.overlay === overlay) {
|
|
79
|
+
if (topOverlay.overlay === overlay) {
|
|
80
|
+
/* do not increase z-index for self */
|
|
80
81
|
return topOverlay.zIndex;
|
|
81
82
|
}
|
|
82
83
|
return topOverlay.zIndex + 2; /* give space for backdrop z-index */
|
|
@@ -103,7 +104,8 @@ export class ZIndexManager {
|
|
|
103
104
|
this.setZIndex(overlay, zIndex);
|
|
104
105
|
overlay.addEventListener('focus', this.onFocus);
|
|
105
106
|
}
|
|
106
|
-
else if (typeof overlay.zIndex === 'number') {
|
|
107
|
+
else if (typeof overlay.zIndex === 'number') {
|
|
108
|
+
/* z-index has set manually. If it is removed, do nothing */
|
|
107
109
|
this.setZIndex(overlay, overlay.zIndex);
|
|
108
110
|
}
|
|
109
111
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
2
|
-
import type { OverlayMenu } from '../index';
|
|
3
1
|
import type { Item, ItemData } from '../../item';
|
|
2
|
+
import type { OverlayMenu } from '../index';
|
|
3
|
+
import type { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
4
4
|
export type NestedMenu = {
|
|
5
5
|
menu: OverlayMenu;
|
|
6
6
|
item: Item;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import '../icon/index.js';
|
|
4
4
|
import '../item/index.js';
|
|
5
5
|
import { Overlay } from '../overlay/index.js';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
var OverlayMenu_1;
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
|
-
import {
|
|
3
|
+
import { WarningNotice, css, html, nothing } from '@refinitiv-ui/core';
|
|
4
4
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
5
5
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
6
|
-
import { VERSION } from '../version.js';
|
|
7
6
|
import { AnimationTaskRunner } from '@refinitiv-ui/utils/async.js';
|
|
8
7
|
import { CollectionComposer } from '@refinitiv-ui/utils/collection.js';
|
|
9
8
|
import { uuid } from '@refinitiv-ui/utils/uuid.js';
|
|
@@ -12,8 +11,9 @@ import '../item/index.js';
|
|
|
12
11
|
import { Item } from '../item/index.js';
|
|
13
12
|
import { Overlay } from '../overlay/index.js';
|
|
14
13
|
import { applyLock } from '../overlay/managers/interaction-lock-manager.js';
|
|
15
|
-
import {
|
|
14
|
+
import { VERSION } from '../version.js';
|
|
16
15
|
import { Navigation } from './helpers/constants.js';
|
|
16
|
+
import { OpenedMenusManager } from './managers/menu-manager.js';
|
|
17
17
|
/**
|
|
18
18
|
* Overlay that supports single-level and multi-level menus
|
|
19
19
|
* @fires item-trigger - Fired when the user taps on item.
|
|
@@ -81,7 +81,8 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
81
81
|
overflow-y: auto;
|
|
82
82
|
overflow-x: hidden;
|
|
83
83
|
}
|
|
84
|
-
:host([compact]:not([active])) {
|
|
84
|
+
:host([compact]:not([active])) {
|
|
85
|
+
/* active is set in menu-manager */
|
|
85
86
|
opacity: 0;
|
|
86
87
|
}
|
|
87
88
|
`
|
|
@@ -108,28 +109,28 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
108
109
|
*/
|
|
109
110
|
this.nested = false;
|
|
110
111
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
* @ignore
|
|
113
|
+
*/
|
|
113
114
|
this.withShadow = true;
|
|
114
115
|
/**
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
* @ignore
|
|
117
|
+
*/
|
|
117
118
|
this.lockPositionTarget = true;
|
|
118
119
|
/**
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
* @ignore
|
|
121
|
+
*/
|
|
121
122
|
this.focusBoundary = null;
|
|
122
123
|
/**
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
* @ignore
|
|
125
|
+
*/
|
|
125
126
|
this.position = ['bottom-start', 'top-start'];
|
|
126
127
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
* @ignore
|
|
129
|
+
*/
|
|
129
130
|
this.toItem = this.toItem.bind(this);
|
|
130
131
|
/**
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
* @ignore
|
|
133
|
+
*/
|
|
133
134
|
this.modificationUpdate = this.modificationUpdate.bind(this);
|
|
134
135
|
}
|
|
135
136
|
/**
|
|
@@ -198,8 +199,8 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
198
199
|
*/
|
|
199
200
|
getDataValues() {
|
|
200
201
|
const items = this.getDataDescendants();
|
|
201
|
-
const selected = items.filter(item => this.composer.getItemPropertyValue(item, 'selected') === true);
|
|
202
|
-
return selected.map(item => this.composer.getItemPropertyValue(item, 'value') || '');
|
|
202
|
+
const selected = items.filter((item) => this.composer.getItemPropertyValue(item, 'selected') === true);
|
|
203
|
+
return selected.map((item) => this.composer.getItemPropertyValue(item, 'value') || '');
|
|
203
204
|
}
|
|
204
205
|
/**
|
|
205
206
|
* Set values to data collection
|
|
@@ -208,9 +209,9 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
208
209
|
*/
|
|
209
210
|
setDataValues(values) {
|
|
210
211
|
const items = this.getDataDescendants();
|
|
211
|
-
items.forEach(item => {
|
|
212
|
+
items.forEach((item) => {
|
|
212
213
|
const value = this.composer.getItemPropertyValue(item, 'value') || '';
|
|
213
|
-
const found = values.some(userValue => String(userValue) === value);
|
|
214
|
+
const found = values.some((userValue) => String(userValue) === value);
|
|
214
215
|
this.composer.setItemPropertyValue(item, 'selected', found);
|
|
215
216
|
});
|
|
216
217
|
}
|
|
@@ -220,8 +221,8 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
220
221
|
*/
|
|
221
222
|
getSlottedValues() {
|
|
222
223
|
const items = this.getSlottedDescendants();
|
|
223
|
-
const selected = items.filter(item => item.selected === true);
|
|
224
|
-
return selected.map(item => item.value);
|
|
224
|
+
const selected = items.filter((item) => item.selected === true);
|
|
225
|
+
return selected.map((item) => item.value);
|
|
225
226
|
}
|
|
226
227
|
/**
|
|
227
228
|
* Set values to slotted elements
|
|
@@ -230,7 +231,7 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
230
231
|
*/
|
|
231
232
|
setSlottedValues(values) {
|
|
232
233
|
const items = this.getSlottedDescendants();
|
|
233
|
-
items.forEach(item => {
|
|
234
|
+
items.forEach((item) => {
|
|
234
235
|
item.selected = values.includes(item.value);
|
|
235
236
|
});
|
|
236
237
|
}
|
|
@@ -310,12 +311,12 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
310
311
|
*/
|
|
311
312
|
shouldUpdate(changedProperties) {
|
|
312
313
|
const shouldUpdate = super.shouldUpdate(changedProperties);
|
|
313
|
-
return shouldUpdate
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
314
|
+
return (shouldUpdate ||
|
|
315
|
+
changedProperties.size === 0 /* this is to support empty requestUpdate() */ ||
|
|
316
|
+
changedProperties.has('values') ||
|
|
317
|
+
changedProperties.has('data') ||
|
|
318
|
+
(this.opened && changedProperties.has('compact')) ||
|
|
319
|
+
(this.opened && changedProperties.has('modification')));
|
|
319
320
|
}
|
|
320
321
|
/**
|
|
321
322
|
* Compute property values that depend on other properties
|
|
@@ -739,7 +740,9 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
739
740
|
* @return {void}
|
|
740
741
|
*/
|
|
741
742
|
setOpenedMenu(menuItem) {
|
|
742
|
-
const menu = menuItem && menuItem.for && this.menuIndex[menuItem.for]
|
|
743
|
+
const menu = menuItem && menuItem.for && this.menuIndex[menuItem.for]
|
|
744
|
+
? this.menuIndex[menuItem.for].menu
|
|
745
|
+
: undefined;
|
|
743
746
|
menu && this.insertNestedMenu(menu);
|
|
744
747
|
OpenedMenusManager.toggleNestedMenuFor(this, menuItem);
|
|
745
748
|
}
|
|
@@ -868,7 +871,8 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
868
871
|
type="header"
|
|
869
872
|
title=${tooltip || nothing}
|
|
870
873
|
.label=${label}
|
|
871
|
-
.icon=${icon}
|
|
874
|
+
.icon=${icon}
|
|
875
|
+
></ef-item>`;
|
|
872
876
|
}
|
|
873
877
|
const disabled = composer.getItemPropertyValue(item, 'disabled');
|
|
874
878
|
const selected = composer.getItemPropertyValue(item, 'selected');
|
|
@@ -891,7 +895,8 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
891
895
|
.subLabel=${subLabel}
|
|
892
896
|
.icon=${icon}
|
|
893
897
|
.value=${value || nothing}
|
|
894
|
-
.for=${forMenu || nothing}
|
|
898
|
+
.for=${forMenu || nothing}
|
|
899
|
+
>
|
|
895
900
|
</ef-item>`;
|
|
896
901
|
}
|
|
897
902
|
/**
|
|
@@ -913,7 +918,13 @@ let OverlayMenu = OverlayMenu_1 = class OverlayMenu extends Overlay {
|
|
|
913
918
|
return undefined;
|
|
914
919
|
}
|
|
915
920
|
return html `
|
|
916
|
-
<ef-item
|
|
921
|
+
<ef-item
|
|
922
|
+
part="menu-back"
|
|
923
|
+
id="back"
|
|
924
|
+
label="Back"
|
|
925
|
+
@tap=${this.onBackItemTap}
|
|
926
|
+
@mousemove=${this.onBackItemMouseMove}
|
|
927
|
+
>
|
|
917
928
|
<ef-icon slot="left" icon="left"></ef-icon>
|
|
918
929
|
</ef-item>
|
|
919
930
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Item } from '../../item';
|
|
2
1
|
import { OverlayMenu } from '../index.js';
|
|
2
|
+
import type { Item } from '../../item';
|
|
3
3
|
/**
|
|
4
4
|
* Overlay menu manager monitors menu nesting and ensures
|
|
5
5
|
* that only a single menu tree can be opened
|
|
@@ -45,17 +45,17 @@ declare abstract class OpenedMenusManager {
|
|
|
45
45
|
*/
|
|
46
46
|
private static setOpened;
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
* Register the menu
|
|
49
|
+
* Can be called multiple times if menu items collection has changed
|
|
50
|
+
* @param menu Menu
|
|
51
|
+
* @returns {void}
|
|
52
|
+
*/
|
|
53
53
|
static register(menu: OverlayMenu): void;
|
|
54
54
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
* Deregister the menu
|
|
56
|
+
* @param menu Menu
|
|
57
|
+
* @returns {void}
|
|
58
|
+
*/
|
|
59
59
|
static deregister(menu: OverlayMenu): void;
|
|
60
60
|
/**
|
|
61
61
|
* Try to open nested menu for provided item. If no item provided, close nested menu
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OverlayMenu } from '../index.js';
|
|
2
1
|
import { getOverlays } from '../../overlay/managers/zindex-manager.js';
|
|
2
|
+
import { OverlayMenu } from '../index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Overlay menu manager monitors menu nesting and ensures
|
|
5
5
|
* that only a single menu tree can be opened
|
|
@@ -11,7 +11,7 @@ class OpenedMenusManager {
|
|
|
11
11
|
static get overlays() {
|
|
12
12
|
const openedMenus = [];
|
|
13
13
|
const overlayLayers = getOverlays();
|
|
14
|
-
overlayLayers.forEach(overlay => {
|
|
14
|
+
overlayLayers.forEach((overlay) => {
|
|
15
15
|
if (overlay instanceof OverlayMenu && this.registry.has(overlay)) {
|
|
16
16
|
openedMenus.push(overlay);
|
|
17
17
|
}
|
|
@@ -106,11 +106,11 @@ class OpenedMenusManager {
|
|
|
106
106
|
return true;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
109
|
+
* Register the menu
|
|
110
|
+
* Can be called multiple times if menu items collection has changed
|
|
111
|
+
* @param menu Menu
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
114
|
static register(menu) {
|
|
115
115
|
if (!this.registry.size) {
|
|
116
116
|
document.addEventListener('tapstart', this.closeOnOutsideOfMenuTap, {
|
|
@@ -123,10 +123,10 @@ class OpenedMenusManager {
|
|
|
123
123
|
this.setActiveMenu();
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
* Deregister the menu
|
|
127
|
+
* @param menu Menu
|
|
128
|
+
* @returns {void}
|
|
129
|
+
*/
|
|
130
130
|
static deregister(menu) {
|
|
131
131
|
const parentMenu = this.getParentMenu(menu);
|
|
132
132
|
if (!this.closeMenuFor(parentMenu || menu)) {
|
|
@@ -153,7 +153,8 @@ class OpenedMenusManager {
|
|
|
153
153
|
static toggleNestedMenuFor(parentMenu, item) {
|
|
154
154
|
const crossMenu = this.crossMenu.get(parentMenu);
|
|
155
155
|
if (crossMenu) {
|
|
156
|
-
if (crossMenu.item === item) {
|
|
156
|
+
if (crossMenu.item === item) {
|
|
157
|
+
/* same menu */
|
|
157
158
|
return;
|
|
158
159
|
}
|
|
159
160
|
if (!this.closeMenuFor(parentMenu)) {
|
|
@@ -228,7 +229,7 @@ class OpenedMenusManager {
|
|
|
228
229
|
* @returns {void}
|
|
229
230
|
*/
|
|
230
231
|
static clear() {
|
|
231
|
-
this.registry.forEach(menu => this.deregister(menu));
|
|
232
|
+
this.registry.forEach((menu) => this.deregister(menu));
|
|
232
233
|
}
|
|
233
234
|
}
|
|
234
235
|
OpenedMenusManager.registry = new Set();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { BasicElement, PropertyValues, TemplateResult
|
|
2
|
+
import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import { Ref } from '@refinitiv-ui/core/directives/ref.js';
|
|
4
|
-
import '../button/index.js';
|
|
5
|
-
import '../button-bar/index.js';
|
|
6
|
-
import '../layout/index.js';
|
|
7
4
|
import '@refinitiv-ui/phrasebook/locale/en/pagination.js';
|
|
8
5
|
import { Translate, TranslateDirectiveResult } from '@refinitiv-ui/translate';
|
|
6
|
+
import '../button-bar/index.js';
|
|
7
|
+
import '../button/index.js';
|
|
8
|
+
import '../layout/index.js';
|
|
9
9
|
declare enum Direction {
|
|
10
10
|
increment = "increment",
|
|
11
11
|
decrement = "decrement"
|
package/lib/pagination/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement,
|
|
2
|
+
import { BasicElement, WarningNotice, css, html, nothing } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { property } from '@refinitiv-ui/core/decorators/property.js';
|
|
5
5
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
6
|
-
import {
|
|
7
|
-
import { VERSION } from '../version.js';
|
|
8
|
-
import '../button/index.js';
|
|
9
|
-
import '../button-bar/index.js';
|
|
10
|
-
import '../layout/index.js';
|
|
6
|
+
import { createRef, ref } from '@refinitiv-ui/core/directives/ref.js';
|
|
11
7
|
import '@refinitiv-ui/phrasebook/locale/en/pagination.js';
|
|
12
8
|
import { translate } from '@refinitiv-ui/translate';
|
|
9
|
+
import '../button-bar/index.js';
|
|
10
|
+
import '../button/index.js';
|
|
11
|
+
import '../layout/index.js';
|
|
12
|
+
import { VERSION } from '../version.js';
|
|
13
13
|
var Direction;
|
|
14
14
|
(function (Direction) {
|
|
15
15
|
Direction["increment"] = "increment";
|
|
@@ -195,7 +195,7 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
195
195
|
* @returns result of validation
|
|
196
196
|
*/
|
|
197
197
|
validatePage(value, warning = false, propName = '') {
|
|
198
|
-
if (
|
|
198
|
+
if (/^[1-9]([0-9]+)?$/.test(value)) {
|
|
199
199
|
return true;
|
|
200
200
|
}
|
|
201
201
|
else {
|
|
@@ -400,7 +400,8 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
400
400
|
if (inputValue.startsWith('0')) {
|
|
401
401
|
this.inputElement.value = inputValue.substring(1);
|
|
402
402
|
}
|
|
403
|
-
else if (currentInput !== inputValue) {
|
|
403
|
+
else if (currentInput !== inputValue) {
|
|
404
|
+
// update if found new value
|
|
404
405
|
this.inputElement.value = inputValue;
|
|
405
406
|
}
|
|
406
407
|
}
|
|
@@ -420,12 +421,16 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
420
421
|
event.preventDefault();
|
|
421
422
|
break;
|
|
422
423
|
case 'ArrowUp':
|
|
423
|
-
this.inputElement &&
|
|
424
|
+
this.inputElement &&
|
|
425
|
+
this.hasNextPage(Number(this.inputElement.value || 1)) &&
|
|
426
|
+
this.updateInputValue(1, Direction.increment);
|
|
424
427
|
this.inputElement?.select();
|
|
425
428
|
event.preventDefault();
|
|
426
429
|
break;
|
|
427
430
|
case 'ArrowDown':
|
|
428
|
-
this.inputElement &&
|
|
431
|
+
this.inputElement &&
|
|
432
|
+
this.hasPreviousPage(Number(this.inputElement.value || 1)) &&
|
|
433
|
+
this.updateInputValue(1, Direction.decrement);
|
|
429
434
|
this.inputElement?.select();
|
|
430
435
|
event.preventDefault();
|
|
431
436
|
break;
|
|
@@ -464,8 +469,18 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
464
469
|
return html `
|
|
465
470
|
<ef-layout part="container" flex nowrap>
|
|
466
471
|
<ef-button-bar part="buttons" aria-hidden="true" tabindex="-1">
|
|
467
|
-
<ef-button
|
|
468
|
-
|
|
472
|
+
<ef-button
|
|
473
|
+
id="first"
|
|
474
|
+
icon="skip-to-start"
|
|
475
|
+
@tap="${this.onFirstTap}"
|
|
476
|
+
.disabled=${!this.useFirstButton}
|
|
477
|
+
></ef-button>
|
|
478
|
+
<ef-button
|
|
479
|
+
id="previous"
|
|
480
|
+
icon="left"
|
|
481
|
+
@tap="${this.onPreviousTap}"
|
|
482
|
+
.disabled=${!this.usePreviousButton}
|
|
483
|
+
></ef-button>
|
|
469
484
|
</ef-button-bar>
|
|
470
485
|
<label part="label" for="input">${this.inputTextFormat}</label>
|
|
471
486
|
<input
|
|
@@ -484,8 +499,18 @@ let Pagination = class Pagination extends BasicElement {
|
|
|
484
499
|
${ref(this.inputRef)}
|
|
485
500
|
/>
|
|
486
501
|
<ef-button-bar part="buttons" aria-hidden="true" tabindex="-1">
|
|
487
|
-
<ef-button
|
|
488
|
-
|
|
502
|
+
<ef-button
|
|
503
|
+
id="next"
|
|
504
|
+
icon="right"
|
|
505
|
+
@tap="${this.onNextTap}"
|
|
506
|
+
.disabled=${!this.useNextButton}
|
|
507
|
+
></ef-button>
|
|
508
|
+
<ef-button
|
|
509
|
+
id="last"
|
|
510
|
+
icon="skip-to-end"
|
|
511
|
+
@tap="${this.onLastTap}"
|
|
512
|
+
.disabled=${!this.useLastButton}
|
|
513
|
+
></ef-button>
|
|
489
514
|
</ef-button-bar>
|
|
490
515
|
</ef-layout>
|
|
491
516
|
`;
|
package/lib/panel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { BasicElement,
|
|
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 { VERSION } from '../version.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
import { PropertyValues, TemplateResult } from '@refinitiv-ui/core';
|
|
3
3
|
import { TemplateMap } from '@refinitiv-ui/core/directives/template-map.js';
|
|
4
|
-
import { TextField } from '../text-field/index.js';
|
|
5
|
-
import '../icon/index.js';
|
|
6
4
|
import '@refinitiv-ui/phrasebook/locale/en/password-field.js';
|
|
7
5
|
import { Translate } from '@refinitiv-ui/translate';
|
|
6
|
+
import '../icon/index.js';
|
|
7
|
+
import { TextField } from '../text-field/index.js';
|
|
8
8
|
/**
|
|
9
9
|
* A form control element for password.
|
|
10
10
|
*
|
|
@@ -2,10 +2,10 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { html } from '@refinitiv-ui/core';
|
|
3
3
|
import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
|
|
4
4
|
import { state } from '@refinitiv-ui/core/decorators/state.js';
|
|
5
|
-
import { TextField } from '../text-field/index.js';
|
|
6
|
-
import '../icon/index.js';
|
|
7
5
|
import '@refinitiv-ui/phrasebook/locale/en/password-field.js';
|
|
8
6
|
import { translate } from '@refinitiv-ui/translate';
|
|
7
|
+
import '../icon/index.js';
|
|
8
|
+
import { TextField } from '../text-field/index.js';
|
|
9
9
|
import { deregisterOverflowTooltip } from '../tooltip/index.js';
|
|
10
10
|
/**
|
|
11
11
|
* A form control element for password.
|
|
@@ -68,7 +68,7 @@ let PasswordField = class PasswordField extends TextField {
|
|
|
68
68
|
get decorateInputMap() {
|
|
69
69
|
return {
|
|
70
70
|
...super.decorateInputMap,
|
|
71
|
-
|
|
71
|
+
type: this.isPasswordVisible ? 'text' : 'password'
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
/**
|
package/lib/pill/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
|
/**
|
|
5
5
|
* A small button style component
|