@refinitiv-ui/elements 5.5.0 → 5.8.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 +65 -8
- package/lib/accordion/custom-elements.md +18 -0
- package/lib/accordion/index.d.ts +5 -5
- package/lib/accordion/index.js +8 -11
- package/lib/appstate-bar/custom-elements.md +22 -0
- package/lib/appstate-bar/index.d.ts +5 -5
- package/lib/appstate-bar/index.js +8 -11
- package/lib/autosuggest/custom-elements.json +24 -4
- package/lib/autosuggest/custom-elements.md +54 -0
- package/lib/autosuggest/helpers/types.d.ts +1 -1
- package/lib/autosuggest/helpers/utils.d.ts +2 -2
- package/lib/autosuggest/helpers/utils.js +1 -2
- package/lib/autosuggest/index.d.ts +13 -8
- package/lib/autosuggest/index.js +38 -31
- package/lib/button/custom-elements.json +2 -2
- package/lib/button/custom-elements.md +23 -0
- package/lib/button/index.d.ts +13 -13
- package/lib/button/index.js +41 -31
- package/lib/button-bar/custom-elements.md +9 -0
- package/lib/button-bar/index.d.ts +3 -3
- package/lib/button-bar/index.js +8 -10
- package/lib/calendar/constants.d.ts +22 -0
- package/lib/calendar/constants.js +23 -0
- package/lib/calendar/custom-elements.json +8 -6
- package/lib/calendar/custom-elements.md +35 -0
- package/lib/calendar/index.d.ts +9 -7
- package/lib/calendar/index.js +20 -38
- package/lib/calendar/locales.d.ts +1 -31
- package/lib/calendar/locales.js +0 -104
- package/lib/calendar/types.d.ts +1 -5
- package/lib/calendar/types.js +1 -6
- package/lib/calendar/utils.d.ts +31 -1
- package/lib/calendar/utils.js +104 -2
- package/lib/canvas/custom-elements.json +7 -5
- package/lib/canvas/custom-elements.md +27 -0
- package/lib/canvas/index.d.ts +4 -3
- package/lib/canvas/index.js +8 -10
- package/lib/card/custom-elements.json +3 -1
- package/lib/card/custom-elements.md +24 -0
- package/lib/card/helpers/types.d.ts +1 -1
- package/lib/card/index.d.ts +10 -8
- package/lib/card/index.js +14 -13
- package/lib/chart/custom-elements.json +1 -1
- package/lib/chart/custom-elements.md +16 -0
- package/lib/chart/helpers/index.d.ts +2 -2
- package/lib/chart/helpers/index.js +2 -2
- package/lib/chart/index.d.ts +6 -6
- package/lib/chart/index.js +12 -14
- package/lib/checkbox/custom-elements.json +4 -4
- package/lib/checkbox/custom-elements.md +18 -0
- package/lib/checkbox/index.d.ts +21 -13
- package/lib/checkbox/index.js +56 -31
- package/lib/clock/custom-elements.json +21 -4
- package/lib/clock/custom-elements.md +28 -0
- package/lib/clock/index.d.ts +17 -5
- package/lib/clock/index.js +37 -18
- 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/clock/utils/TickManager.js +2 -2
- package/lib/collapse/custom-elements.md +27 -0
- package/lib/collapse/index.d.ts +7 -7
- package/lib/collapse/index.js +11 -13
- package/lib/color-dialog/custom-elements.json +29 -16
- package/lib/color-dialog/custom-elements.md +39 -0
- package/lib/color-dialog/elements/color-palettes.d.ts +5 -5
- package/lib/color-dialog/elements/color-palettes.js +8 -12
- package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -5
- package/lib/color-dialog/elements/grayscale-palettes.js +9 -12
- package/lib/color-dialog/elements/palettes.d.ts +3 -3
- package/lib/color-dialog/elements/palettes.js +49 -47
- package/lib/color-dialog/helpers/value-model.js +2 -2
- package/lib/color-dialog/index.d.ts +19 -19
- package/lib/color-dialog/index.js +36 -35
- package/lib/combo-box/custom-elements.json +28 -16
- package/lib/combo-box/custom-elements.md +35 -0
- package/lib/combo-box/helpers/filter.d.ts +4 -4
- package/lib/combo-box/helpers/types.d.ts +2 -2
- package/lib/combo-box/index.d.ts +26 -18
- package/lib/combo-box/index.js +36 -27
- package/lib/combo-box/themes/halo/dark/index.js +1 -1
- package/lib/combo-box/themes/halo/light/index.js +1 -1
- package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
- package/lib/combo-box/themes/solar/pearl/index.js +1 -1
- package/lib/counter/custom-elements.json +8 -4
- package/lib/counter/custom-elements.md +11 -0
- package/lib/counter/index.d.ts +5 -3
- package/lib/counter/index.js +11 -12
- package/lib/datetime-picker/custom-elements.json +52 -23
- package/lib/datetime-picker/custom-elements.md +57 -0
- package/lib/datetime-picker/index.d.ts +25 -14
- package/lib/datetime-picker/index.js +46 -35
- package/lib/datetime-picker/locales.d.ts +1 -1
- package/lib/datetime-picker/locales.js +12 -1
- package/lib/datetime-picker/types.d.ts +1 -1
- package/lib/datetime-picker/utils.js +1 -1
- package/lib/dialog/custom-elements.json +34 -12
- package/lib/dialog/custom-elements.md +47 -0
- package/lib/dialog/index.d.ts +17 -20
- package/lib/dialog/index.js +28 -31
- package/lib/email-field/custom-elements.json +81 -94
- package/lib/email-field/custom-elements.md +37 -0
- package/lib/email-field/index.d.ts +44 -116
- package/lib/email-field/index.js +48 -249
- package/lib/events.d.ts +2 -2
- package/lib/events.js +1 -2
- package/lib/flag/custom-elements.md +10 -0
- package/lib/flag/index.d.ts +6 -4
- package/lib/flag/index.js +12 -12
- package/lib/flag/utils/FlagLoader.d.ts +1 -1
- package/lib/flag/utils/FlagLoader.js +1 -1
- package/lib/header/custom-elements.md +18 -0
- package/lib/header/index.d.ts +2 -2
- package/lib/header/index.js +5 -8
- package/lib/heatmap/custom-elements.md +26 -0
- package/lib/heatmap/helpers/color.d.ts +1 -1
- package/lib/heatmap/helpers/color.js +1 -1
- package/lib/heatmap/helpers/text.d.ts +1 -1
- package/lib/heatmap/index.d.ts +7 -7
- package/lib/heatmap/index.js +15 -16
- package/lib/icon/custom-elements.json +6 -4
- package/lib/icon/custom-elements.md +8 -0
- package/lib/icon/index.d.ts +9 -6
- package/lib/icon/index.js +28 -18
- package/lib/icon/utils/IconLoader.d.ts +6 -1
- package/lib/icon/utils/IconLoader.js +24 -17
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/interactive-chart/custom-elements.json +6 -10
- package/lib/interactive-chart/custom-elements.md +31 -0
- package/lib/interactive-chart/helpers/types.d.ts +2 -2
- package/lib/interactive-chart/index.d.ts +11 -8
- package/lib/interactive-chart/index.js +17 -17
- package/lib/item/custom-elements.json +4 -4
- package/lib/item/custom-elements.md +29 -0
- package/lib/item/helpers/types.d.ts +1 -1
- package/lib/item/index.d.ts +18 -8
- package/lib/item/index.js +36 -16
- package/lib/label/custom-elements.md +11 -0
- package/lib/label/index.d.ts +3 -3
- package/lib/label/index.js +12 -20
- package/lib/layout/custom-elements.md +26 -0
- package/lib/layout/index.d.ts +3 -3
- package/lib/layout/index.js +6 -9
- package/lib/led-gauge/custom-elements.json +4 -4
- package/lib/led-gauge/custom-elements.md +17 -0
- package/lib/led-gauge/index.d.ts +5 -4
- package/lib/led-gauge/index.js +9 -11
- package/lib/list/custom-elements.json +18 -5
- package/lib/list/custom-elements.md +32 -0
- package/lib/list/helpers/list-renderer.d.ts +2 -2
- package/lib/list/helpers/list-renderer.js +4 -2
- package/lib/list/helpers/types.d.ts +2 -2
- package/lib/list/index.d.ts +27 -10
- package/lib/list/index.js +54 -25
- package/lib/list/renderer.d.ts +2 -2
- package/lib/list/renderer.js +1 -1
- package/lib/loader/custom-elements.md +5 -0
- package/lib/loader/index.js +4 -8
- package/lib/multi-input/custom-elements.json +7 -6
- package/lib/multi-input/custom-elements.md +43 -0
- package/lib/multi-input/helpers/types.d.ts +1 -1
- package/lib/multi-input/index.d.ts +11 -7
- package/lib/multi-input/index.js +20 -17
- package/lib/notification/custom-elements.md +26 -0
- package/lib/notification/elements/notification-tray.d.ts +2 -2
- package/lib/notification/elements/notification-tray.js +6 -9
- package/lib/notification/elements/notification.d.ts +5 -5
- package/lib/notification/elements/notification.js +8 -11
- package/lib/notification/helpers/status.d.ts +1 -1
- package/lib/notification/helpers/status.js +1 -1
- package/lib/notification/helpers/types.d.ts +1 -1
- package/lib/notification/index.d.ts +2 -2
- package/lib/notification/index.js +2 -2
- package/lib/number-field/custom-elements.json +99 -54
- package/lib/number-field/custom-elements.md +42 -0
- package/lib/number-field/index.d.ts +96 -51
- package/lib/number-field/index.js +121 -89
- package/lib/overlay/custom-elements.json +26 -13
- package/lib/overlay/custom-elements.md +54 -0
- package/lib/overlay/elements/overlay-backdrop.d.ts +4 -4
- package/lib/overlay/elements/overlay-backdrop.js +6 -9
- package/lib/overlay/elements/overlay-viewport.d.ts +3 -3
- package/lib/overlay/elements/overlay-viewport.js +5 -9
- package/lib/overlay/elements/overlay.d.ts +10 -5
- package/lib/overlay/elements/overlay.js +18 -23
- package/lib/overlay/index.d.ts +2 -2
- package/lib/overlay/index.js +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 +1 -1
- package/lib/overlay/managers/focus-manager.js +2 -2
- package/lib/overlay/managers/interaction-lock-manager.js +2 -2
- package/lib/overlay/managers/viewport-manager.d.ts +2 -2
- package/lib/overlay/managers/viewport-manager.js +6 -2
- package/lib/overlay/managers/zindex-manager.js +1 -1
- package/lib/overlay-menu/custom-elements.json +70 -20
- package/lib/overlay-menu/custom-elements.md +44 -0
- package/lib/overlay-menu/helpers/types.d.ts +3 -3
- package/lib/overlay-menu/index.d.ts +21 -19
- package/lib/overlay-menu/index.js +32 -31
- package/lib/overlay-menu/managers/menu-manager.d.ts +2 -2
- package/lib/overlay-menu/managers/menu-manager.js +3 -3
- package/lib/pagination/custom-elements.md +27 -0
- package/lib/pagination/index.d.ts +8 -8
- package/lib/pagination/index.js +13 -15
- package/lib/panel/custom-elements.md +11 -0
- package/lib/panel/index.d.ts +3 -3
- package/lib/panel/index.js +6 -9
- package/lib/password-field/custom-elements.json +62 -67
- package/lib/password-field/custom-elements.md +39 -0
- package/lib/password-field/index.d.ts +43 -94
- package/lib/password-field/index.js +52 -198
- package/lib/pill/custom-elements.json +8 -6
- package/lib/pill/custom-elements.md +22 -0
- package/lib/pill/index.d.ts +5 -5
- package/lib/pill/index.js +9 -11
- package/lib/progress-bar/custom-elements.md +18 -0
- package/lib/progress-bar/index.d.ts +3 -3
- package/lib/progress-bar/index.js +7 -9
- package/lib/radio-button/custom-elements.json +4 -4
- package/lib/radio-button/custom-elements.md +19 -0
- package/lib/radio-button/index.d.ts +25 -8
- package/lib/radio-button/index.js +84 -21
- package/lib/radio-button/radio-button-registry.d.ts +3 -2
- package/lib/radio-button/radio-button-registry.js +57 -4
- package/lib/rating/custom-elements.md +17 -0
- package/lib/rating/index.d.ts +3 -3
- package/lib/rating/index.js +9 -10
- package/lib/search-field/custom-elements.json +70 -74
- package/lib/search-field/custom-elements.md +41 -0
- package/lib/search-field/index.d.ts +44 -101
- package/lib/search-field/index.js +50 -220
- package/lib/select/custom-elements.json +5 -4
- package/lib/select/custom-elements.md +24 -0
- package/lib/select/helpers/types.d.ts +1 -1
- package/lib/select/index.d.ts +18 -10
- package/lib/select/index.js +84 -45
- package/lib/sidebar-layout/custom-elements.json +2 -6
- package/lib/sidebar-layout/custom-elements.md +21 -0
- package/lib/sidebar-layout/index.d.ts +7 -6
- package/lib/sidebar-layout/index.js +9 -10
- package/lib/slider/custom-elements.json +4 -4
- package/lib/slider/custom-elements.md +28 -0
- package/lib/slider/index.d.ts +4 -4
- package/lib/slider/index.js +9 -10
- package/lib/sparkline/custom-elements.json +4 -4
- package/lib/sparkline/custom-elements.md +16 -0
- package/lib/sparkline/index.d.ts +6 -4
- package/lib/sparkline/index.js +10 -10
- package/lib/swing-gauge/custom-elements.json +5 -3
- package/lib/swing-gauge/custom-elements.md +17 -0
- package/lib/swing-gauge/helpers.d.ts +1 -1
- package/lib/swing-gauge/helpers.js +1 -1
- package/lib/swing-gauge/index.d.ts +9 -7
- package/lib/swing-gauge/index.js +17 -15
- package/lib/tab/custom-elements.json +2 -2
- package/lib/tab/custom-elements.md +22 -0
- package/lib/tab/index.d.ts +5 -5
- package/lib/tab/index.js +9 -12
- package/lib/tab-bar/custom-elements.md +11 -0
- package/lib/tab-bar/index.d.ts +4 -4
- package/lib/tab-bar/index.js +9 -11
- package/lib/text-field/custom-elements.json +78 -89
- package/lib/text-field/custom-elements.md +35 -0
- package/lib/text-field/index.d.ts +59 -79
- package/lib/text-field/index.js +99 -158
- package/lib/time-picker/custom-elements.json +4 -4
- package/lib/time-picker/custom-elements.md +28 -0
- package/lib/time-picker/index.d.ts +7 -4
- package/lib/time-picker/index.js +15 -14
- package/lib/toggle/custom-elements.json +4 -4
- package/lib/toggle/custom-elements.md +19 -0
- package/lib/toggle/index.d.ts +14 -4
- package/lib/toggle/index.js +31 -12
- package/lib/tooltip/custom-elements.md +14 -0
- package/lib/tooltip/elements/title-tooltip.js +2 -2
- package/lib/tooltip/elements/tooltip-element.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.d.ts +1 -1
- package/lib/tooltip/helpers/overflow-tooltip.js +1 -1
- package/lib/tooltip/helpers/renderer.d.ts +1 -1
- package/lib/tooltip/helpers/types.d.ts +1 -1
- package/lib/tooltip/index.d.ts +9 -9
- package/lib/tooltip/index.js +18 -20
- package/lib/tooltip/managers/tooltip-manager.d.ts +2 -2
- package/lib/tooltip/managers/tooltip-manager.js +3 -7
- package/lib/tornado-chart/custom-elements.md +18 -0
- package/lib/tornado-chart/elements/tornado-chart.d.ts +4 -4
- package/lib/tornado-chart/elements/tornado-chart.js +8 -11
- package/lib/tornado-chart/elements/tornado-item.d.ts +5 -5
- package/lib/tornado-chart/elements/tornado-item.js +10 -12
- package/lib/tornado-chart/index.d.ts +2 -2
- package/lib/tornado-chart/index.js +2 -2
- package/lib/tree/custom-elements.json +4 -3
- package/lib/tree/custom-elements.md +32 -0
- package/lib/tree/elements/tree-item.d.ts +4 -4
- package/lib/tree/elements/tree-item.js +10 -13
- package/lib/tree/elements/tree.d.ts +6 -5
- package/lib/tree/elements/tree.js +9 -12
- package/lib/tree/helpers/filter.d.ts +2 -2
- package/lib/tree/helpers/renderer.d.ts +2 -2
- package/lib/tree/helpers/renderer.js +3 -3
- package/lib/tree/helpers/types.d.ts +1 -1
- package/lib/tree/index.d.ts +4 -4
- package/lib/tree/index.js +3 -3
- package/lib/tree/managers/tree-manager.d.ts +22 -10
- package/lib/tree/managers/tree-manager.js +56 -40
- package/lib/tree/themes/halo/dark/index.js +1 -1
- package/lib/tree/themes/halo/light/index.js +1 -1
- package/lib/tree/themes/solar/charcoal/index.js +1 -1
- package/lib/tree/themes/solar/pearl/index.js +1 -1
- package/lib/tree-select/custom-elements.json +10 -6
- package/lib/tree-select/custom-elements.md +26 -0
- package/lib/tree-select/helpers/types.d.ts +2 -2
- package/lib/tree-select/index.d.ts +28 -20
- package/lib/tree-select/index.js +44 -31
- 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.d.ts +1 -0
- package/lib/version.js +1 -0
- package/package.json +298 -15
- package/lib/autosuggest/helpers/const.d.ts +0 -2
- package/lib/autosuggest/helpers/const.js +0 -3
- package/lib/overlay-menu/helpers/uuid.d.ts +0 -7
- package/lib/overlay-menu/helpers/uuid.js +0 -13
package/lib/chart/index.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import { color as parseColor } from '@refinitiv-ui/utils';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { BasicElement, html, css } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
+
import { VERSION } from '../version.js';
|
|
7
|
+
import { color as parseColor } from '@refinitiv-ui/utils/lib/color.js';
|
|
9
8
|
import 'chart.js/dist/Chart.bundle.min.js';
|
|
10
|
-
import '
|
|
11
|
-
import '../
|
|
12
|
-
import
|
|
9
|
+
import { legendHelper, merge } from './helpers/index.js';
|
|
10
|
+
import '../header/index.js';
|
|
11
|
+
import '../layout/index.js';
|
|
13
12
|
// Register plugins
|
|
14
|
-
import doughnutCenterPlugin from './plugins/doughnut-center-label';
|
|
15
|
-
import { VERSION } from '../';
|
|
13
|
+
import doughnutCenterPlugin from './plugins/doughnut-center-label.js';
|
|
16
14
|
window.Chart.pluginService.register(doughnutCenterPlugin);
|
|
17
15
|
const CSS_COLOR_PREFIX = '--chart-color-';
|
|
18
16
|
const CHART_TYPE_OPAQUE = ['line', 'bubble', 'radar', 'polarArea'];
|
|
@@ -415,7 +413,7 @@ let Chart = class Chart extends BasicElement {
|
|
|
415
413
|
this.renderChart(config);
|
|
416
414
|
}
|
|
417
415
|
/**
|
|
418
|
-
* A `
|
|
416
|
+
* A `CSSResultGroup` that will be used
|
|
419
417
|
* to style the host, slotted children
|
|
420
418
|
* and the internal template of the element.
|
|
421
419
|
* @return CSS template
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"name": "readonly",
|
|
22
22
|
"description": "Set readonly state",
|
|
23
23
|
"type": "boolean",
|
|
24
|
-
"default": "
|
|
24
|
+
"default": "false"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"name": "disabled",
|
|
28
28
|
"description": "Set disabled state",
|
|
29
29
|
"type": "boolean",
|
|
30
|
-
"default": "
|
|
30
|
+
"default": "false"
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
33
|
"properties": [
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"attribute": "readonly",
|
|
51
51
|
"description": "Set readonly state",
|
|
52
52
|
"type": "boolean",
|
|
53
|
-
"default": "
|
|
53
|
+
"default": "false"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"name": "disabled",
|
|
57
57
|
"attribute": "disabled",
|
|
58
58
|
"description": "Set disabled state",
|
|
59
59
|
"type": "boolean",
|
|
60
|
-
"default": "
|
|
60
|
+
"default": "false"
|
|
61
61
|
}
|
|
62
62
|
],
|
|
63
63
|
"events": [
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# ef-checkbox
|
|
2
|
+
|
|
3
|
+
Form control for selecting one or several options
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|-----------------|-----------------|-----------|---------|----------------------------|
|
|
9
|
+
| `checked` | `checked` | `boolean` | false | Value of checkbox |
|
|
10
|
+
| `disabled` | `disabled` | `boolean` | false | Set disabled state |
|
|
11
|
+
| `indeterminate` | `indeterminate` | `boolean` | false | Set state to indeterminate |
|
|
12
|
+
| `readonly` | `readonly` | `boolean` | false | Set readonly state |
|
|
13
|
+
|
|
14
|
+
## Events
|
|
15
|
+
|
|
16
|
+
| Event | Description |
|
|
17
|
+
|-------------------|--------------------------------------------|
|
|
18
|
+
| `checked-changed` | Fired when the `checked` property changes. |
|
package/lib/checkbox/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ControlElement, TemplateResult,
|
|
3
|
-
import '../icon';
|
|
2
|
+
import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
|
|
3
|
+
import '../icon/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Form control for selecting one or several options
|
|
6
6
|
* @fires checked-changed - Fired when the `checked` property changes.
|
|
@@ -17,31 +17,39 @@ export declare class Checkbox extends ControlElement {
|
|
|
17
17
|
* @returns version number
|
|
18
18
|
*/
|
|
19
19
|
static get version(): string;
|
|
20
|
+
protected readonly defaultRole: string | null;
|
|
20
21
|
/**
|
|
21
|
-
* A `
|
|
22
|
+
* A `CSSResultGroup` that will be used
|
|
22
23
|
* to style the host, slotted children
|
|
23
24
|
* and the internal template of the element.
|
|
24
|
-
* @return
|
|
25
|
+
* @return CSS template
|
|
25
26
|
*/
|
|
26
|
-
static get styles():
|
|
27
|
+
static get styles(): CSSResultGroup;
|
|
28
|
+
private _checked;
|
|
27
29
|
/**
|
|
28
30
|
* Value of checkbox
|
|
31
|
+
* @param value new checked value
|
|
32
|
+
* @default false
|
|
29
33
|
*/
|
|
30
|
-
checked: boolean;
|
|
34
|
+
set checked(value: boolean);
|
|
35
|
+
get checked(): boolean;
|
|
36
|
+
private _indeterminate;
|
|
31
37
|
/**
|
|
32
38
|
* Set state to indeterminate
|
|
39
|
+
* @param value new indeterminate value
|
|
40
|
+
* @default false
|
|
33
41
|
*/
|
|
34
|
-
indeterminate: boolean;
|
|
42
|
+
set indeterminate(value: boolean);
|
|
43
|
+
get indeterminate(): boolean;
|
|
35
44
|
/**
|
|
36
|
-
*
|
|
45
|
+
* Indicates current state of checkbox
|
|
46
|
+
* @ignore
|
|
37
47
|
*/
|
|
38
|
-
|
|
48
|
+
ariaChecked: string;
|
|
39
49
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param changedProperties Properties that has changed
|
|
42
|
-
* @returns {void}
|
|
50
|
+
* Getter for label
|
|
43
51
|
*/
|
|
44
|
-
|
|
52
|
+
private labelEl;
|
|
45
53
|
/**
|
|
46
54
|
* Called once after the component is first rendered
|
|
47
55
|
* @param changedProperties map of changed properties with old values
|
package/lib/checkbox/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import '../icon';
|
|
10
|
-
import { registerOverflowTooltip } from '../tooltip';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { ControlElement, html, css } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
+
import { VERSION } from '../version.js';
|
|
7
|
+
import { registerOverflowTooltip } from '../tooltip/index.js';
|
|
8
|
+
import '../icon/index.js';
|
|
11
9
|
/**
|
|
12
10
|
* Form control for selecting one or several options
|
|
13
11
|
* @fires checked-changed - Fired when the `checked` property changes.
|
|
@@ -21,14 +19,14 @@ import { registerOverflowTooltip } from '../tooltip';
|
|
|
21
19
|
let Checkbox = class Checkbox extends ControlElement {
|
|
22
20
|
constructor() {
|
|
23
21
|
super(...arguments);
|
|
22
|
+
this.defaultRole = 'checkbox';
|
|
23
|
+
this._checked = false;
|
|
24
|
+
this._indeterminate = false;
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
this.checked = false;
|
|
28
|
-
/**
|
|
29
|
-
* Set state to indeterminate
|
|
26
|
+
* Indicates current state of checkbox
|
|
27
|
+
* @ignore
|
|
30
28
|
*/
|
|
31
|
-
this.
|
|
29
|
+
this.ariaChecked = String(this.checked);
|
|
32
30
|
}
|
|
33
31
|
/**
|
|
34
32
|
* Element version number
|
|
@@ -38,10 +36,10 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
38
36
|
return VERSION;
|
|
39
37
|
}
|
|
40
38
|
/**
|
|
41
|
-
* A `
|
|
39
|
+
* A `CSSResultGroup` that will be used
|
|
42
40
|
* to style the host, slotted children
|
|
43
41
|
* and the internal template of the element.
|
|
44
|
-
* @return
|
|
42
|
+
* @return CSS template
|
|
45
43
|
*/
|
|
46
44
|
static get styles() {
|
|
47
45
|
return css `
|
|
@@ -71,20 +69,44 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
71
69
|
`;
|
|
72
70
|
}
|
|
73
71
|
/**
|
|
74
|
-
*
|
|
75
|
-
* @param
|
|
76
|
-
* @
|
|
72
|
+
* Value of checkbox
|
|
73
|
+
* @param value new checked value
|
|
74
|
+
* @default false
|
|
77
75
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (
|
|
81
|
-
this.
|
|
76
|
+
set checked(value) {
|
|
77
|
+
const oldValue = this._checked;
|
|
78
|
+
if (oldValue !== value) {
|
|
79
|
+
this._checked = value;
|
|
80
|
+
// remove indeterminate if change state to checked
|
|
81
|
+
if (this._checked) {
|
|
82
|
+
this.indeterminate = false;
|
|
83
|
+
}
|
|
84
|
+
this.ariaChecked = String(value);
|
|
85
|
+
void this.requestUpdate('checked', oldValue);
|
|
82
86
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
}
|
|
88
|
+
get checked() {
|
|
89
|
+
return this._checked;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Set state to indeterminate
|
|
93
|
+
* @param value new indeterminate value
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
set indeterminate(value) {
|
|
97
|
+
const oldValue = this._indeterminate;
|
|
98
|
+
if (oldValue !== value) {
|
|
99
|
+
this._indeterminate = value;
|
|
100
|
+
// remove checked if change state to indeterminate
|
|
101
|
+
if (value) {
|
|
102
|
+
this.checked = false;
|
|
103
|
+
}
|
|
104
|
+
this.ariaChecked = value ? 'mixed' : String(this.checked);
|
|
105
|
+
void this.requestUpdate('indeterminate', oldValue);
|
|
86
106
|
}
|
|
87
|
-
|
|
107
|
+
}
|
|
108
|
+
get indeterminate() {
|
|
109
|
+
return this._indeterminate;
|
|
88
110
|
}
|
|
89
111
|
/**
|
|
90
112
|
* Called once after the component is first rendered
|
|
@@ -155,10 +177,13 @@ let Checkbox = class Checkbox extends ControlElement {
|
|
|
155
177
|
};
|
|
156
178
|
__decorate([
|
|
157
179
|
property({ type: Boolean, reflect: true })
|
|
158
|
-
], Checkbox.prototype, "checked",
|
|
180
|
+
], Checkbox.prototype, "checked", null);
|
|
159
181
|
__decorate([
|
|
160
182
|
property({ type: Boolean, reflect: true })
|
|
161
|
-
], Checkbox.prototype, "indeterminate",
|
|
183
|
+
], Checkbox.prototype, "indeterminate", null);
|
|
184
|
+
__decorate([
|
|
185
|
+
property({ type: String, reflect: true, attribute: 'aria-checked' })
|
|
186
|
+
], Checkbox.prototype, "ariaChecked", void 0);
|
|
162
187
|
__decorate([
|
|
163
188
|
query('[part=label]', true)
|
|
164
189
|
], Checkbox.prototype, "labelEl", void 0);
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "value",
|
|
10
10
|
"description": "Get time value in format `hh:mm:ss`",
|
|
11
|
-
"type": "string"
|
|
11
|
+
"type": "string",
|
|
12
|
+
"default": "\"00:00:00\""
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
15
|
"name": "offset",
|
|
@@ -18,7 +19,8 @@
|
|
|
18
19
|
{
|
|
19
20
|
"name": "tick",
|
|
20
21
|
"description": "Toggles clock ticking function.",
|
|
21
|
-
"type": "boolean"
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"default": "false"
|
|
22
24
|
},
|
|
23
25
|
{
|
|
24
26
|
"name": "am-pm",
|
|
@@ -50,7 +52,8 @@
|
|
|
50
52
|
"name": "value",
|
|
51
53
|
"attribute": "value",
|
|
52
54
|
"description": "Get time value in format `hh:mm:ss`",
|
|
53
|
-
"type": "string"
|
|
55
|
+
"type": "string",
|
|
56
|
+
"default": "\"00:00:00\""
|
|
54
57
|
},
|
|
55
58
|
{
|
|
56
59
|
"name": "offset",
|
|
@@ -62,7 +65,8 @@
|
|
|
62
65
|
"name": "tick",
|
|
63
66
|
"attribute": "tick",
|
|
64
67
|
"description": "Toggles clock ticking function.",
|
|
65
|
-
"type": "boolean"
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"default": "false"
|
|
66
70
|
},
|
|
67
71
|
{
|
|
68
72
|
"name": "amPm",
|
|
@@ -102,6 +106,19 @@
|
|
|
102
106
|
"name": "offset-changed",
|
|
103
107
|
"description": "Fired when the the user offsets the clock in `interactive` mode."
|
|
104
108
|
}
|
|
109
|
+
],
|
|
110
|
+
"methods": [
|
|
111
|
+
{
|
|
112
|
+
"name": "resizedCallback",
|
|
113
|
+
"description": "Called when the element's dimension have changed",
|
|
114
|
+
"params": [
|
|
115
|
+
{
|
|
116
|
+
"name": "size",
|
|
117
|
+
"description": "Element size",
|
|
118
|
+
"type": "ElementSize"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
105
122
|
]
|
|
106
123
|
}
|
|
107
124
|
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# ef-clock
|
|
2
|
+
|
|
3
|
+
Display hours, minutes and seconds as clock interface
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|---------------|----------------|-----------|------------|--------------------------------------------------|
|
|
9
|
+
| `amPm` | `am-pm` | `boolean` | false | Display the digital clock in 12hr format. |
|
|
10
|
+
| `analogue` | `analogue` | `boolean` | false | Display clock in analogue style. |
|
|
11
|
+
| `interactive` | `interactive` | `boolean` | false | Enabled interactive mode. Allowing the user to offset the value. |
|
|
12
|
+
| `offset` | `offset` | `number` | | Get offset value |
|
|
13
|
+
| `showSeconds` | `show-seconds` | `boolean` | false | Display the seconds segment. |
|
|
14
|
+
| `tick` | `tick` | `boolean` | false | Toggles clock ticking function. |
|
|
15
|
+
| `value` | `value` | `string` | "00:00:00" | Get time value in format `hh:mm:ss` |
|
|
16
|
+
|
|
17
|
+
## Methods
|
|
18
|
+
|
|
19
|
+
| Method | Type | Description |
|
|
20
|
+
|-------------------|---------------------|--------------------------------------------------|
|
|
21
|
+
| `resizedCallback` | `(size: any): void` | Called when the element's dimension have changed<br /><br />**size**: Element size |
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
| Event | Description |
|
|
26
|
+
|------------------|--------------------------------------------------|
|
|
27
|
+
| `offset-changed` | Fired when the the user offsets the clock in `interactive` mode. |
|
|
28
|
+
| `value-changed` | Fired when the value property changes while ticking. |
|
package/lib/clock/index.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { TemplateResult,
|
|
2
|
+
import { TemplateResult, CSSResultGroup, PropertyValues, ResponsiveElement, ElementSize } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
4
|
* Display hours, minutes and seconds as clock interface
|
|
5
5
|
* @fires value-changed - Fired when the value property changes while ticking.
|
|
6
6
|
* @fires offset-changed - Fired when the the user offsets the clock in `interactive` mode.
|
|
7
7
|
*/
|
|
8
|
-
export declare class Clock extends
|
|
8
|
+
export declare class Clock extends ResponsiveElement {
|
|
9
9
|
/**
|
|
10
10
|
* Element version number
|
|
11
11
|
* @returns version number
|
|
12
12
|
*/
|
|
13
13
|
static get version(): string;
|
|
14
14
|
/**
|
|
15
|
-
* A `
|
|
15
|
+
* A `CSSResultGroup` that will be used
|
|
16
16
|
* to style the host, slotted children
|
|
17
17
|
* and the internal template of the element.
|
|
18
|
-
* @return
|
|
18
|
+
* @return CSS template
|
|
19
19
|
*/
|
|
20
|
-
static get styles():
|
|
20
|
+
static get styles(): CSSResultGroup;
|
|
21
21
|
/**
|
|
22
22
|
* Shared internal function,
|
|
23
23
|
* used for handling notifications from tick manager.
|
|
@@ -44,6 +44,7 @@ export declare class Clock extends BasicElement {
|
|
|
44
44
|
private tickTimestamp;
|
|
45
45
|
/**
|
|
46
46
|
* Get time value in format `hh:mm:ss`
|
|
47
|
+
* @default 00:00:00
|
|
47
48
|
* @returns value
|
|
48
49
|
*/
|
|
49
50
|
get value(): string;
|
|
@@ -68,6 +69,7 @@ export declare class Clock extends BasicElement {
|
|
|
68
69
|
private _tick;
|
|
69
70
|
/**
|
|
70
71
|
* Toggles clock ticking function.
|
|
72
|
+
* @default false
|
|
71
73
|
*/
|
|
72
74
|
get tick(): boolean;
|
|
73
75
|
set tick(value: boolean);
|
|
@@ -99,6 +101,10 @@ export declare class Clock extends BasicElement {
|
|
|
99
101
|
* Getter for seconds part.
|
|
100
102
|
*/
|
|
101
103
|
private secondsPart;
|
|
104
|
+
/**
|
|
105
|
+
* Size of the clock.
|
|
106
|
+
*/
|
|
107
|
+
private size;
|
|
102
108
|
/**
|
|
103
109
|
* Get the display time in seconds.
|
|
104
110
|
* This value includes any offsets applied.
|
|
@@ -260,6 +266,12 @@ export declare class Clock extends BasicElement {
|
|
|
260
266
|
* @returns {TemplateResult} template
|
|
261
267
|
*/
|
|
262
268
|
private get secondsSegmentTemplate();
|
|
269
|
+
/**
|
|
270
|
+
* Called when the element's dimension have changed
|
|
271
|
+
* @param size Element size
|
|
272
|
+
* @returns {void}
|
|
273
|
+
*/
|
|
274
|
+
resizedCallback(size: ElementSize): void;
|
|
263
275
|
/**
|
|
264
276
|
* Called when the element has been appended to the DOM
|
|
265
277
|
* @returns {void}
|
package/lib/clock/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css, WarningNotice, ResponsiveElement } from '@refinitiv-ui/core';
|
|
3
|
+
import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
|
|
4
|
+
import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
|
|
5
|
+
import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
|
|
6
|
+
import { state } from '@refinitiv-ui/core/lib/decorators/state.js';
|
|
7
|
+
import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
|
|
8
|
+
import { VERSION } from '../version.js';
|
|
9
|
+
import { MILLISECONDS_IN_SECOND, HOURS_OF_NOON, isValidTime, toTimeSegment, TimeFormat, format, padNumber } from '@refinitiv-ui/utils/lib/date.js';
|
|
10
|
+
import { HOURS_IN_DAY, MINUTES_IN_HOUR, SECONDS_IN_DAY, SECONDS_IN_HOUR, SECONDS_IN_MINUTE } from './utils/timestamps.js';
|
|
11
|
+
import { register, deRegister } from './utils/TickManager.js';
|
|
12
12
|
const UP = 'Up';
|
|
13
13
|
const DOWN = 'Down';
|
|
14
|
+
const SMALL_SIZE = 130; // Break point for small size clock face.
|
|
14
15
|
/**
|
|
15
16
|
* Display hours, minutes and seconds as clock interface
|
|
16
17
|
* @fires value-changed - Fired when the value property changes while ticking.
|
|
17
18
|
* @fires offset-changed - Fired when the the user offsets the clock in `interactive` mode.
|
|
18
19
|
*/
|
|
19
|
-
let Clock = class Clock extends
|
|
20
|
+
let Clock = class Clock extends ResponsiveElement {
|
|
20
21
|
constructor() {
|
|
21
22
|
super(...arguments);
|
|
22
23
|
/**
|
|
@@ -60,6 +61,10 @@ let Clock = class Clock extends BasicElement {
|
|
|
60
61
|
* Display clock in analogue style.
|
|
61
62
|
*/
|
|
62
63
|
this.analogue = false;
|
|
64
|
+
/**
|
|
65
|
+
* Size of the clock.
|
|
66
|
+
*/
|
|
67
|
+
this.size = null;
|
|
63
68
|
}
|
|
64
69
|
/**
|
|
65
70
|
* Element version number
|
|
@@ -69,10 +74,10 @@ let Clock = class Clock extends BasicElement {
|
|
|
69
74
|
return VERSION;
|
|
70
75
|
}
|
|
71
76
|
/**
|
|
72
|
-
* A `
|
|
77
|
+
* A `CSSResultGroup` that will be used
|
|
73
78
|
* to style the host, slotted children
|
|
74
79
|
* and the internal template of the element.
|
|
75
|
-
* @return
|
|
80
|
+
* @return CSS template
|
|
76
81
|
*/
|
|
77
82
|
static get styles() {
|
|
78
83
|
return css `
|
|
@@ -105,6 +110,7 @@ let Clock = class Clock extends BasicElement {
|
|
|
105
110
|
}
|
|
106
111
|
/**
|
|
107
112
|
* Get time value in format `hh:mm:ss`
|
|
113
|
+
* @default 00:00:00
|
|
108
114
|
* @returns value
|
|
109
115
|
*/
|
|
110
116
|
get value() {
|
|
@@ -130,7 +136,7 @@ let Clock = class Clock extends BasicElement {
|
|
|
130
136
|
this.synchronise(); // Required to reset any tick session
|
|
131
137
|
const { hours, minutes, seconds } = toTimeSegment(value);
|
|
132
138
|
this.baseTime = hours * SECONDS_IN_HOUR + minutes * SECONDS_IN_MINUTE + seconds;
|
|
133
|
-
|
|
139
|
+
this.requestUpdate('value', oldValue);
|
|
134
140
|
}
|
|
135
141
|
}
|
|
136
142
|
/**
|
|
@@ -154,11 +160,12 @@ let Clock = class Clock extends BasicElement {
|
|
|
154
160
|
const newOffset = Math.round(offset % SECONDS_IN_DAY) || 0;
|
|
155
161
|
if (oldOffset !== newOffset) {
|
|
156
162
|
this._offset = newOffset;
|
|
157
|
-
|
|
163
|
+
this.requestUpdate('offset', oldOffset);
|
|
158
164
|
}
|
|
159
165
|
}
|
|
160
166
|
/**
|
|
161
167
|
* Toggles clock ticking function.
|
|
168
|
+
* @default false
|
|
162
169
|
*/
|
|
163
170
|
get tick() {
|
|
164
171
|
return this._tick;
|
|
@@ -170,7 +177,7 @@ let Clock = class Clock extends BasicElement {
|
|
|
170
177
|
this._tick = newValue;
|
|
171
178
|
this.synchronise();
|
|
172
179
|
this.configureTickManager();
|
|
173
|
-
|
|
180
|
+
this.requestUpdate('tick', oldValue);
|
|
174
181
|
}
|
|
175
182
|
}
|
|
176
183
|
/**
|
|
@@ -446,6 +453,15 @@ let Clock = class Clock extends BasicElement {
|
|
|
446
453
|
get secondsSegmentTemplate() {
|
|
447
454
|
return this.generateSegmentTemplate('seconds', this.displaySeconds);
|
|
448
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* Called when the element's dimension have changed
|
|
458
|
+
* @param size Element size
|
|
459
|
+
* @returns {void}
|
|
460
|
+
*/
|
|
461
|
+
resizedCallback(size) {
|
|
462
|
+
// size should be set to small only if it's analog clock and it's smaller than defined break point
|
|
463
|
+
this.size = this.analogue && Math.min(size.width, size.height) < SMALL_SIZE ? 'small' : null;
|
|
464
|
+
}
|
|
449
465
|
/**
|
|
450
466
|
* Called when the element has been appended to the DOM
|
|
451
467
|
* @returns {void}
|
|
@@ -498,7 +514,7 @@ let Clock = class Clock extends BasicElement {
|
|
|
498
514
|
const hourAngle = Number((30 * (this.displayHours24 + (1 / 60) * this.displayMinutes)).toFixed(2));
|
|
499
515
|
return html `
|
|
500
516
|
<div part="hands">
|
|
501
|
-
|
|
517
|
+
${this.size === 'small' ? html `${this.amPm ? this.amPmTemplate : undefined}` : html `<div part="digital">${this.digitalClockTemplate}</div>`}
|
|
502
518
|
<div part="hand hour" style="transform: rotate(${hourAngle}deg)"></div>
|
|
503
519
|
<div part="hand minute" style="transform: rotate(${minAngle}deg)"></div>
|
|
504
520
|
${this.showSeconds ? html `<div part="hand second" style="transform: rotate(${secAngle}deg)"></div>` : undefined}
|
|
@@ -556,6 +572,9 @@ __decorate([
|
|
|
556
572
|
__decorate([
|
|
557
573
|
query('[part~=seconds]', true)
|
|
558
574
|
], Clock.prototype, "secondsPart", void 0);
|
|
575
|
+
__decorate([
|
|
576
|
+
property({ type: String, attribute: 'size', reflect: true })
|
|
577
|
+
], Clock.prototype, "size", void 0);
|
|
559
578
|
Clock = __decorate([
|
|
560
579
|
customElement('ef-clock', {
|
|
561
580
|
alias: 'sapphire-clock'
|