@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/calendar/locales.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Phrasebook } from '@refinitiv-ui/phrasebook';
|
|
2
|
-
import { DEFAULT_LOCALE, resolveLocale } from '@refinitiv-ui/i18n';
|
|
3
|
-
import { utcParse } from '@refinitiv-ui/utils';
|
|
4
2
|
// While Intl can support literally all world languages
|
|
5
3
|
// for safety still limit the number of locales, for the following reasons
|
|
6
4
|
// 1) different browsers and OS support different locales, and the result might be different.
|
|
@@ -40,105 +38,3 @@ Phrasebook.define('ru', scope, ru);
|
|
|
40
38
|
Phrasebook.define('th', scope, th);
|
|
41
39
|
Phrasebook.define('zh', scope, zh);
|
|
42
40
|
Phrasebook.define('ar', scope, ar);
|
|
43
|
-
const calendar = {
|
|
44
|
-
// calendar property is not part of TypeScript Intl.DateTimeFormatOptions,
|
|
45
|
-
// but is supported by all modern browsers and is required by Intl.DateTimeFormat polyfill
|
|
46
|
-
calendar: 'gregory',
|
|
47
|
-
timeZone: 'UTC'
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Custom formats for date formatting
|
|
51
|
-
*/
|
|
52
|
-
const DateMessageFormats = {
|
|
53
|
-
date: {
|
|
54
|
-
calendarMonthEra: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric', era: 'short' }),
|
|
55
|
-
calendarMonth: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric' }),
|
|
56
|
-
calendarYearEra: Object.assign(Object.assign({}, calendar), { year: 'numeric', era: 'short' }),
|
|
57
|
-
calendarYear: Object.assign(Object.assign({}, calendar), { year: 'numeric' })
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Used to format views
|
|
62
|
-
*/
|
|
63
|
-
const ViewFormatTranslateParams = {
|
|
64
|
-
unicodeExtensions: {
|
|
65
|
-
// while latest Chrome, FF and Intl.DateTimeFormat polyfill support
|
|
66
|
-
// calendar option to format date,
|
|
67
|
-
// older browsers as Safari and IE11 need this to be provided as
|
|
68
|
-
// unicode extension, e.g. lang="th-u-ca-gregory"
|
|
69
|
-
ca: 'gregory'
|
|
70
|
-
},
|
|
71
|
-
formats: DateMessageFormats
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Get locale based on provided locale and Phrasebook available locales
|
|
75
|
-
* @param locale locale tag
|
|
76
|
-
* @returns resolved locale
|
|
77
|
-
*/
|
|
78
|
-
const getLocale = (locale) => {
|
|
79
|
-
return resolveLocale(scope, locale) || DEFAULT_LOCALE;
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Get a list of weekday abbreviations based on locale
|
|
83
|
-
* @param locale Locale
|
|
84
|
-
* @param [width='short'] Day width
|
|
85
|
-
* @returns The list of weekdays starting from Sunday
|
|
86
|
-
*/
|
|
87
|
-
const weekdaysNames = (locale, width = 'narrow') => {
|
|
88
|
-
locale = getLocale(locale);
|
|
89
|
-
// we know that Jan 04 1970 is Sunday
|
|
90
|
-
let day = 4;
|
|
91
|
-
const date = utcParse({
|
|
92
|
-
year: 1970,
|
|
93
|
-
month: 0,
|
|
94
|
-
day: day
|
|
95
|
-
});
|
|
96
|
-
const weekdays = [];
|
|
97
|
-
while (day < 11) {
|
|
98
|
-
weekdays.push(date.toLocaleDateString(locale, { weekday: width, timeZone: 'UTC' }));
|
|
99
|
-
day += 1;
|
|
100
|
-
date.setUTCDate(day);
|
|
101
|
-
}
|
|
102
|
-
return weekdays;
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Get a list of months based on locale
|
|
106
|
-
* @param locale Locale
|
|
107
|
-
* @param [width='short'] Month width
|
|
108
|
-
* @returns The list of months starting from January
|
|
109
|
-
*/
|
|
110
|
-
const monthsNames = (locale, width = 'short') => {
|
|
111
|
-
locale = getLocale(locale);
|
|
112
|
-
let month = 0;
|
|
113
|
-
const date = utcParse({
|
|
114
|
-
year: 1970,
|
|
115
|
-
month,
|
|
116
|
-
day: 1
|
|
117
|
-
});
|
|
118
|
-
const months = [];
|
|
119
|
-
while (month < 12) {
|
|
120
|
-
months.push(date.toLocaleDateString(locale, { month: width, timeZone: 'UTC' }));
|
|
121
|
-
month += 1;
|
|
122
|
-
date.setUTCMonth(month);
|
|
123
|
-
}
|
|
124
|
-
return months;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* @deprecated
|
|
128
|
-
* Some old browsers (as IE11) do not support formatting of old dates before BC
|
|
129
|
-
* Instead simply convert the date manually to match Translate function
|
|
130
|
-
* @param date Date
|
|
131
|
-
* @param locale locale
|
|
132
|
-
* @param [includeMonth=false] true to include month
|
|
133
|
-
* @param [includeEra=false] tru to include era descriptor
|
|
134
|
-
* @returns formatted dates
|
|
135
|
-
*/
|
|
136
|
-
const formatLocaleDate = (date, locale, includeMonth = false, includeEra = false) => {
|
|
137
|
-
const monthNames = monthsNames(locale, 'long');
|
|
138
|
-
locale = getLocale(locale);
|
|
139
|
-
const year = date.getUTCFullYear();
|
|
140
|
-
const month = date.getUTCMonth();
|
|
141
|
-
// BC flags are not supported. Always use English
|
|
142
|
-
return `${includeMonth ? `${monthNames[month]} ` : ''} ${year > 0 ? year : year === 0 ? '1' : Math.abs(year - 1)}${includeEra ? year <= 0 ? ' BC' : ' AD' : ''}`;
|
|
143
|
-
};
|
|
144
|
-
export { weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams };
|
package/lib/calendar/types.d.ts
CHANGED
package/lib/calendar/types.js
CHANGED
package/lib/calendar/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TranslateParams } from '@refinitiv-ui/i18n';
|
|
1
2
|
export declare type MonthInfo = {
|
|
2
3
|
days: number;
|
|
3
4
|
month: number;
|
|
@@ -9,4 +10,33 @@ export declare type MonthInfo = {
|
|
|
9
10
|
* @returns Month information object
|
|
10
11
|
*/
|
|
11
12
|
declare const monthInfo: (value: string) => MonthInfo;
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Get a list of weekday abbreviations based on locale
|
|
15
|
+
* @param locale Locale
|
|
16
|
+
* @param [width='short'] Day width
|
|
17
|
+
* @returns The list of weekdays starting from Sunday
|
|
18
|
+
*/
|
|
19
|
+
declare const weekdaysNames: (locale: string, width?: Intl.DateTimeFormatOptions['weekday']) => string[];
|
|
20
|
+
/**
|
|
21
|
+
* Get a list of months based on locale
|
|
22
|
+
* @param locale Locale
|
|
23
|
+
* @param [width='short'] Month width
|
|
24
|
+
* @returns The list of months starting from January
|
|
25
|
+
*/
|
|
26
|
+
declare const monthsNames: (locale: string, width?: Intl.DateTimeFormatOptions['month']) => string[];
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated
|
|
29
|
+
* Some old browsers (as IE11) do not support formatting of old dates before BC
|
|
30
|
+
* Instead simply convert the date manually to match Translate function
|
|
31
|
+
* @param date Date
|
|
32
|
+
* @param locale locale
|
|
33
|
+
* @param [includeMonth=false] true to include month
|
|
34
|
+
* @param [includeEra=false] tru to include era descriptor
|
|
35
|
+
* @returns formatted dates
|
|
36
|
+
*/
|
|
37
|
+
declare const formatLocaleDate: (date: Date, locale: string, includeMonth?: boolean, includeEra?: boolean) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Used to format views
|
|
40
|
+
*/
|
|
41
|
+
declare const ViewFormatTranslateParams: TranslateParams;
|
|
42
|
+
export { monthInfo, weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams };
|
package/lib/calendar/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { toDateSegment, getDaysInMonth } from '@refinitiv-ui/utils';
|
|
1
|
+
import { toDateSegment, getDaysInMonth, utcParse } from '@refinitiv-ui/utils/lib/date.js';
|
|
2
|
+
import { DEFAULT_LOCALE, resolveLocale } from '@refinitiv-ui/i18n';
|
|
2
3
|
/**
|
|
3
4
|
* Get information about number of days, month number and year from date object
|
|
4
5
|
* @param value Date string
|
|
@@ -14,4 +15,105 @@ const monthInfo = (value) => {
|
|
|
14
15
|
year
|
|
15
16
|
};
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
+
const calendar = {
|
|
19
|
+
// calendar property is not part of TypeScript Intl.DateTimeFormatOptions,
|
|
20
|
+
// but is supported by all modern browsers and is required by Intl.DateTimeFormat polyfill
|
|
21
|
+
calendar: 'gregory',
|
|
22
|
+
timeZone: 'UTC'
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Custom formats for date formatting
|
|
26
|
+
*/
|
|
27
|
+
const DateMessageFormats = {
|
|
28
|
+
date: {
|
|
29
|
+
calendarMonthEra: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric', era: 'short' }),
|
|
30
|
+
calendarMonth: Object.assign(Object.assign({}, calendar), { month: 'long', year: 'numeric' }),
|
|
31
|
+
calendarYearEra: Object.assign(Object.assign({}, calendar), { year: 'numeric', era: 'short' }),
|
|
32
|
+
calendarYear: Object.assign(Object.assign({}, calendar), { year: 'numeric' })
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Get locale based on provided locale and Phrasebook available locales
|
|
37
|
+
* @param locale locale tag
|
|
38
|
+
* @returns resolved locale
|
|
39
|
+
*/
|
|
40
|
+
const getLocale = (locale) => {
|
|
41
|
+
return resolveLocale('ef-calendar', locale) || DEFAULT_LOCALE;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Get a list of weekday abbreviations based on locale
|
|
45
|
+
* @param locale Locale
|
|
46
|
+
* @param [width='short'] Day width
|
|
47
|
+
* @returns The list of weekdays starting from Sunday
|
|
48
|
+
*/
|
|
49
|
+
const weekdaysNames = (locale, width = 'narrow') => {
|
|
50
|
+
locale = getLocale(locale);
|
|
51
|
+
// we know that Jan 04 1970 is Sunday
|
|
52
|
+
let day = 4;
|
|
53
|
+
const date = utcParse({
|
|
54
|
+
year: 1970,
|
|
55
|
+
month: 0,
|
|
56
|
+
day: day
|
|
57
|
+
});
|
|
58
|
+
const weekdays = [];
|
|
59
|
+
while (day < 11) {
|
|
60
|
+
weekdays.push(date.toLocaleDateString(locale, { weekday: width, timeZone: 'UTC' }));
|
|
61
|
+
day += 1;
|
|
62
|
+
date.setUTCDate(day);
|
|
63
|
+
}
|
|
64
|
+
return weekdays;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Get a list of months based on locale
|
|
68
|
+
* @param locale Locale
|
|
69
|
+
* @param [width='short'] Month width
|
|
70
|
+
* @returns The list of months starting from January
|
|
71
|
+
*/
|
|
72
|
+
const monthsNames = (locale, width = 'short') => {
|
|
73
|
+
locale = getLocale(locale);
|
|
74
|
+
let month = 0;
|
|
75
|
+
const date = utcParse({
|
|
76
|
+
year: 1970,
|
|
77
|
+
month,
|
|
78
|
+
day: 1
|
|
79
|
+
});
|
|
80
|
+
const months = [];
|
|
81
|
+
while (month < 12) {
|
|
82
|
+
months.push(date.toLocaleDateString(locale, { month: width, timeZone: 'UTC' }));
|
|
83
|
+
month += 1;
|
|
84
|
+
date.setUTCMonth(month);
|
|
85
|
+
}
|
|
86
|
+
return months;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* @deprecated
|
|
90
|
+
* Some old browsers (as IE11) do not support formatting of old dates before BC
|
|
91
|
+
* Instead simply convert the date manually to match Translate function
|
|
92
|
+
* @param date Date
|
|
93
|
+
* @param locale locale
|
|
94
|
+
* @param [includeMonth=false] true to include month
|
|
95
|
+
* @param [includeEra=false] tru to include era descriptor
|
|
96
|
+
* @returns formatted dates
|
|
97
|
+
*/
|
|
98
|
+
const formatLocaleDate = (date, locale, includeMonth = false, includeEra = false) => {
|
|
99
|
+
locale = getLocale(locale);
|
|
100
|
+
const monthNames = monthsNames(locale, 'long');
|
|
101
|
+
const year = date.getUTCFullYear();
|
|
102
|
+
const month = date.getUTCMonth();
|
|
103
|
+
// BC flags are not supported. Always use English
|
|
104
|
+
return `${includeMonth ? `${monthNames[month]} ` : ''} ${year > 0 ? year : year === 0 ? '1' : Math.abs(year - 1)}${includeEra ? year <= 0 ? ' BC' : ' AD' : ''}`;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Used to format views
|
|
108
|
+
*/
|
|
109
|
+
const ViewFormatTranslateParams = {
|
|
110
|
+
unicodeExtensions: {
|
|
111
|
+
// while latest Chrome, FF and Intl.DateTimeFormat polyfill support
|
|
112
|
+
// calendar option to format date,
|
|
113
|
+
// older browsers as Safari and IE11 need this to be provided as
|
|
114
|
+
// unicode extension, e.g. lang="th-u-ca-gregory"
|
|
115
|
+
ca: 'gregory'
|
|
116
|
+
},
|
|
117
|
+
formats: DateMessageFormats
|
|
118
|
+
};
|
|
119
|
+
export { monthInfo, weekdaysNames, monthsNames, formatLocaleDate, ViewFormatTranslateParams };
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
{
|
|
9
9
|
"name": "autoloop",
|
|
10
10
|
"description": "Starts an automatic animation loop.\nEnabling the frame event.",
|
|
11
|
-
"type": "boolean"
|
|
11
|
+
"type": "boolean",
|
|
12
|
+
"default": "false"
|
|
12
13
|
}
|
|
13
14
|
],
|
|
14
15
|
"properties": [
|
|
@@ -16,20 +17,21 @@
|
|
|
16
17
|
"name": "autoloop",
|
|
17
18
|
"attribute": "autoloop",
|
|
18
19
|
"description": "Starts an automatic animation loop.\nEnabling the frame event.",
|
|
19
|
-
"type": "boolean"
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": "false"
|
|
20
22
|
},
|
|
21
23
|
{
|
|
22
|
-
"name": "canvas",
|
|
24
|
+
"name": "canvas (readonly)",
|
|
23
25
|
"description": "Html canvas element",
|
|
24
26
|
"type": "HTMLCanvasElement"
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
|
-
"name": "ctx",
|
|
29
|
+
"name": "ctx (readonly)",
|
|
28
30
|
"description": "Alias of context",
|
|
29
31
|
"type": "CanvasRenderingContext2D | null"
|
|
30
32
|
},
|
|
31
33
|
{
|
|
32
|
-
"name": "context",
|
|
34
|
+
"name": "context (readonly)",
|
|
33
35
|
"description": "The 2 dimensional context of the canvas, used for drawing",
|
|
34
36
|
"type": "CanvasRenderingContext2D | null"
|
|
35
37
|
},
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# ef-canvas
|
|
2
|
+
|
|
3
|
+
A Component uses to draw graphics on a web page,
|
|
4
|
+
it works similarly to the normal HTML5 Canvas element.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
| Property | Attribute | Type | Default | Description |
|
|
9
|
+
|----------------------|------------|------------------------------------|---------|--------------------------------------------------|
|
|
10
|
+
| `autoloop` | `autoloop` | `boolean` | false | Starts an automatic animation loop.<br />Enabling the frame event. |
|
|
11
|
+
| `canvas (readonly)` | | `HTMLCanvasElement` | | Html canvas element |
|
|
12
|
+
| `context (readonly)` | | `CanvasRenderingContext2D \| null` | | The 2 dimensional context of the canvas, used for drawing |
|
|
13
|
+
| `ctx (readonly)` | | `CanvasRenderingContext2D \| null` | | Alias of context |
|
|
14
|
+
| `height` | | `number` | 0 | Height of canvas |
|
|
15
|
+
| `width` | | `number` | 0 | Width of canvas |
|
|
16
|
+
|
|
17
|
+
## Methods
|
|
18
|
+
|
|
19
|
+
| Method | Type | Description |
|
|
20
|
+
|--------------|--------------------------|--------------------------------------------------|
|
|
21
|
+
| `getContext` | `(mode: string): string` | Return context of canvas,<br />support only 2D mode<br /><br />**mode**: mode of canvas's context |
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
|
|
25
|
+
| Event | Description |
|
|
26
|
+
|---------|--------------------------------------------------|
|
|
27
|
+
| `frame` | dispatched when next Frame event occurs when autoloop is set to true |
|
package/lib/canvas/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { ResponsiveElement, TemplateResult,
|
|
2
|
+
import { ResponsiveElement, TemplateResult, CSSResultGroup, ElementSize } from '@refinitiv-ui/core';
|
|
3
3
|
/**
|
|
4
4
|
* A Component uses to draw graphics on a web page,
|
|
5
5
|
* it works similarly to the normal HTML5 Canvas element.
|
|
@@ -12,12 +12,12 @@ export declare class Canvas extends ResponsiveElement {
|
|
|
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
18
|
* @return CSS template
|
|
19
19
|
*/
|
|
20
|
-
static get styles():
|
|
20
|
+
static get styles(): CSSResultGroup;
|
|
21
21
|
width: number;
|
|
22
22
|
height: number;
|
|
23
23
|
private frameId;
|
|
@@ -26,6 +26,7 @@ export declare class Canvas extends ResponsiveElement {
|
|
|
26
26
|
/**
|
|
27
27
|
* Starts an automatic animation loop.
|
|
28
28
|
* Enabling the frame event.
|
|
29
|
+
* @default false
|
|
29
30
|
*/
|
|
30
31
|
get autoloop(): boolean;
|
|
31
32
|
set autoloop(val: boolean);
|
package/lib/canvas/index.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import { ResponsiveElement, html, css, customElement, property } from '@refinitiv-ui/core';
|
|
8
|
-
import { VERSION } from '../';
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { ResponsiveElement, 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 { VERSION } from '../version.js';
|
|
9
6
|
/**
|
|
10
7
|
* A Component uses to draw graphics on a web page,
|
|
11
8
|
* it works similarly to the normal HTML5 Canvas element.
|
|
@@ -27,7 +24,7 @@ let Canvas = class Canvas extends ResponsiveElement {
|
|
|
27
24
|
return VERSION;
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
|
-
* A `
|
|
27
|
+
* A `CSSResultGroup` that will be used
|
|
31
28
|
* to style the host, slotted children
|
|
32
29
|
* and the internal template of the element.
|
|
33
30
|
* @return CSS template
|
|
@@ -51,6 +48,7 @@ let Canvas = class Canvas extends ResponsiveElement {
|
|
|
51
48
|
/**
|
|
52
49
|
* Starts an automatic animation loop.
|
|
53
50
|
* Enabling the frame event.
|
|
51
|
+
* @default false
|
|
54
52
|
*/
|
|
55
53
|
get autoloop() {
|
|
56
54
|
return this._autoloop;
|
|
@@ -58,7 +56,7 @@ let Canvas = class Canvas extends ResponsiveElement {
|
|
|
58
56
|
set autoloop(val) {
|
|
59
57
|
const oldValue = this._autoloop;
|
|
60
58
|
this._autoloop = val;
|
|
61
|
-
|
|
59
|
+
this.requestUpdate('autoloop', oldValue);
|
|
62
60
|
this.loop();
|
|
63
61
|
}
|
|
64
62
|
/**
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# ef-card
|
|
2
|
+
|
|
3
|
+
A card frame component.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|----------|-----------|--------------|---------|-------------------------|
|
|
9
|
+
| `config` | | `CardConfig` | {} | Set card configurations |
|
|
10
|
+
| `footer` | `footer` | `string` | "" | Set text on the footer |
|
|
11
|
+
| `header` | `header` | `string` | "" | Set text on the header |
|
|
12
|
+
|
|
13
|
+
## Events
|
|
14
|
+
|
|
15
|
+
| Event | Description |
|
|
16
|
+
|----------------|-----------------------------------|
|
|
17
|
+
| `item-trigger` | Fired when card menu is selected. |
|
|
18
|
+
|
|
19
|
+
## Slots
|
|
20
|
+
|
|
21
|
+
| Name | Description |
|
|
22
|
+
|----------|--------------------------------------------------|
|
|
23
|
+
| `footer` | Adds slotted content into the footer of the card. |
|
|
24
|
+
| `header` | Adds slotted content into the header of the card. |
|
package/lib/card/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
|
-
import { BasicElement, TemplateResult,
|
|
3
|
-
import '
|
|
4
|
-
import '../
|
|
5
|
-
import '../
|
|
6
|
-
import
|
|
7
|
-
export { CardConfig };
|
|
2
|
+
import { BasicElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
|
|
3
|
+
import type { CardConfig } from './helpers/types';
|
|
4
|
+
import '../label/index.js';
|
|
5
|
+
import '../button/index.js';
|
|
6
|
+
import '../overlay-menu/index.js';
|
|
7
|
+
export type { CardConfig };
|
|
8
8
|
/**
|
|
9
9
|
* A card frame component.
|
|
10
10
|
*
|
|
@@ -20,12 +20,12 @@ export declare class Card extends BasicElement {
|
|
|
20
20
|
*/
|
|
21
21
|
static get version(): string;
|
|
22
22
|
/**
|
|
23
|
-
* A `
|
|
23
|
+
* A `CSSResultGroup` that will be used
|
|
24
24
|
* to style the host, slotted children
|
|
25
25
|
* and the internal template of the element.
|
|
26
26
|
* @returns CSS template
|
|
27
27
|
*/
|
|
28
|
-
static get styles():
|
|
28
|
+
static get styles(): CSSResultGroup;
|
|
29
29
|
private _config;
|
|
30
30
|
/**
|
|
31
31
|
* Set text on the header
|
|
@@ -37,6 +37,8 @@ export declare class Card extends BasicElement {
|
|
|
37
37
|
footer: string;
|
|
38
38
|
/**
|
|
39
39
|
* Set card configurations
|
|
40
|
+
* @type {CardConfig}
|
|
41
|
+
* @default {}
|
|
40
42
|
*/
|
|
41
43
|
get config(): CardConfig;
|
|
42
44
|
set config(config: CardConfig);
|
package/lib/card/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
import {
|
|
8
|
-
import { isSlotEmpty } from '@refinitiv-ui/utils';
|
|
9
|
-
import '../label';
|
|
10
|
-
import '../button';
|
|
11
|
-
import '../overlay-menu';
|
|
12
|
-
import { VERSION } from '../';
|
|
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 { state } from '@refinitiv-ui/core/lib/decorators/state.js';
|
|
7
|
+
import { VERSION } from '../version.js';
|
|
8
|
+
import { isSlotEmpty } from '@refinitiv-ui/utils/lib/is-slot-empty.js';
|
|
9
|
+
import '../label/index.js';
|
|
10
|
+
import '../button/index.js';
|
|
11
|
+
import '../overlay-menu/index.js';
|
|
13
12
|
/**
|
|
14
13
|
* A card frame component.
|
|
15
14
|
*
|
|
@@ -47,7 +46,7 @@ let Card = class Card extends BasicElement {
|
|
|
47
46
|
return VERSION;
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
50
|
-
* A `
|
|
49
|
+
* A `CSSResultGroup` that will be used
|
|
51
50
|
* to style the host, slotted children
|
|
52
51
|
* and the internal template of the element.
|
|
53
52
|
* @returns CSS template
|
|
@@ -72,6 +71,8 @@ let Card = class Card extends BasicElement {
|
|
|
72
71
|
}
|
|
73
72
|
/**
|
|
74
73
|
* Set card configurations
|
|
74
|
+
* @type {CardConfig}
|
|
75
|
+
* @default {}
|
|
75
76
|
*/
|
|
76
77
|
get config() {
|
|
77
78
|
return this._config;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# ef-chart
|
|
2
|
+
|
|
3
|
+
Charting component that use ChartJS library
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
| Property | Attribute | Type | Default | Description |
|
|
8
|
+
|---------------------|-----------|---------------|---------|--------------------------------------------------|
|
|
9
|
+
| `colors (readonly)` | | `string[]` | | List of available chart colors |
|
|
10
|
+
| `config` | `config` | `ChartConfig` | null | Chart configurations. Same configuration as ChartJS |
|
|
11
|
+
|
|
12
|
+
## Methods
|
|
13
|
+
|
|
14
|
+
| Method | Type | Description |
|
|
15
|
+
|---------------|--------------------------------------|--------------------------------------------------|
|
|
16
|
+
| `updateChart` | `(config?: ChartUpdateProps=): void` | Update all data, title, scales, legends and re-render the chart based on its config<br /><br />**config**: Additional configuration for control an animation in the update process. |
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './legend';
|
|
2
|
-
export * from './merge';
|
|
1
|
+
export * from './legend.js';
|
|
2
|
+
export * from './merge.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './legend';
|
|
2
|
-
export * from './merge';
|
|
1
|
+
export * from './legend.js';
|
|
2
|
+
export * from './merge.js';
|
package/lib/chart/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSXInterface } from '../jsx';
|
|
2
2
|
/// <reference types="chart.js" />
|
|
3
|
-
import { BasicElement, PropertyValues, TemplateResult,
|
|
3
|
+
import { BasicElement, PropertyValues, TemplateResult, CSSResultGroup } from '@refinitiv-ui/core';
|
|
4
4
|
import 'chart.js/dist/Chart.bundle.min.js';
|
|
5
|
-
import { Header } from '../header';
|
|
6
|
-
import '../header';
|
|
7
|
-
import '../layout';
|
|
8
5
|
import type { ChartJS, ChartConfig, ChartUpdateProps, DatasetColors } from './helpers/types';
|
|
6
|
+
import type { Header } from '../header';
|
|
7
|
+
import '../header/index.js';
|
|
8
|
+
import '../layout/index.js';
|
|
9
9
|
declare global {
|
|
10
10
|
interface Window {
|
|
11
11
|
Chart: ChartJS;
|
|
@@ -153,12 +153,12 @@ export declare class Chart extends BasicElement {
|
|
|
153
153
|
*/
|
|
154
154
|
updateChart(config?: ChartUpdateProps): void;
|
|
155
155
|
/**
|
|
156
|
-
* A `
|
|
156
|
+
* A `CSSResultGroup` that will be used
|
|
157
157
|
* to style the host, slotted children
|
|
158
158
|
* and the internal template of the element.
|
|
159
159
|
* @return CSS template
|
|
160
160
|
*/
|
|
161
|
-
static get styles():
|
|
161
|
+
static get styles(): CSSResultGroup;
|
|
162
162
|
/**
|
|
163
163
|
* Handles resize event of the chart region
|
|
164
164
|
* @returns {void}
|