@progress/kendo-vue-charts 4.3.3 → 4.4.0-dev.202405071452

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.
Files changed (53) hide show
  1. package/dist/cdn/js/kendo-vue-charts.js +1 -1
  2. package/dist/es/main.d.ts +1 -0
  3. package/dist/es/main.js +1 -0
  4. package/dist/es/package-metadata.js +1 -1
  5. package/dist/es/sankey/Sankey.d.ts +61 -0
  6. package/dist/es/sankey/Sankey.js +243 -0
  7. package/dist/es/sankey/main.d.ts +4 -0
  8. package/dist/es/sankey/main.js +3 -0
  9. package/dist/es/sankey/messages.d.ts +10 -0
  10. package/dist/es/sankey/messages.js +11 -0
  11. package/dist/es/sankey/theme-service.d.ts +5 -0
  12. package/dist/es/sankey/theme-service.js +101 -0
  13. package/dist/es/sankey/tooltip.d.ts +61 -0
  14. package/dist/es/sankey/tooltip.js +311 -0
  15. package/dist/es/sankey/types.d.ts +159 -0
  16. package/dist/es/sankey/types.js +1 -0
  17. package/dist/es/sankey/utils.d.ts +5 -0
  18. package/dist/es/sankey/utils.js +5 -0
  19. package/dist/esm/main.d.ts +1 -0
  20. package/dist/esm/main.js +1 -0
  21. package/dist/esm/package-metadata.js +1 -1
  22. package/dist/esm/sankey/Sankey.d.ts +61 -0
  23. package/dist/esm/sankey/Sankey.js +243 -0
  24. package/dist/esm/sankey/main.d.ts +4 -0
  25. package/dist/esm/sankey/main.js +3 -0
  26. package/dist/esm/sankey/messages.d.ts +10 -0
  27. package/dist/esm/sankey/messages.js +11 -0
  28. package/dist/esm/sankey/theme-service.d.ts +5 -0
  29. package/dist/esm/sankey/theme-service.js +101 -0
  30. package/dist/esm/sankey/tooltip.d.ts +61 -0
  31. package/dist/esm/sankey/tooltip.js +311 -0
  32. package/dist/esm/sankey/types.d.ts +159 -0
  33. package/dist/esm/sankey/types.js +1 -0
  34. package/dist/esm/sankey/utils.d.ts +5 -0
  35. package/dist/esm/sankey/utils.js +5 -0
  36. package/dist/npm/main.d.ts +1 -0
  37. package/dist/npm/main.js +1 -0
  38. package/dist/npm/package-metadata.js +1 -1
  39. package/dist/npm/sankey/Sankey.d.ts +61 -0
  40. package/dist/npm/sankey/Sankey.js +250 -0
  41. package/dist/npm/sankey/main.d.ts +4 -0
  42. package/dist/npm/sankey/main.js +7 -0
  43. package/dist/npm/sankey/messages.d.ts +10 -0
  44. package/dist/npm/sankey/messages.js +14 -0
  45. package/dist/npm/sankey/theme-service.d.ts +5 -0
  46. package/dist/npm/sankey/theme-service.js +105 -0
  47. package/dist/npm/sankey/tooltip.d.ts +61 -0
  48. package/dist/npm/sankey/tooltip.js +318 -0
  49. package/dist/npm/sankey/types.d.ts +159 -0
  50. package/dist/npm/sankey/types.js +2 -0
  51. package/dist/npm/sankey/utils.d.ts +5 -0
  52. package/dist/npm/sankey/utils.js +8 -0
  53. package/package.json +9 -7
@@ -0,0 +1,311 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) {
6
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
7
+ }
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ // @ts-ignore
14
+ import * as Vue from 'vue';
15
+ var allVue = Vue;
16
+ var gh = allVue.h;
17
+ var isV3 = allVue.version && allVue.version[0] === '3';
18
+ import { getRef, setRef, Icon, getTemplate } from '@progress/kendo-vue-common';
19
+ import { arrowRightIcon } from '@progress/kendo-svg-icons';
20
+ import { provideLocalizationService, IntlService } from '@progress/kendo-vue-intl';
21
+ import { messages, tooltipUnitFormat } from './messages';
22
+ var space = 3;
23
+ var textMargin = "0 ".concat(space, "px");
24
+ var tooltipStyles = {
25
+ display: 'flex',
26
+ alignItems: 'center'
27
+ };
28
+ var Square = {
29
+ name: 'Square',
30
+ props: {
31
+ color: String
32
+ },
33
+ // @ts-ignore
34
+ setup: !isV3 ? undefined : function () {
35
+ var v3 = !!isV3;
36
+ return {
37
+ v3: v3
38
+ };
39
+ },
40
+ render: function render(createElement) {
41
+ var h = gh || createElement;
42
+ return h("div", {
43
+ style: {
44
+ width: '15px',
45
+ height: '15px',
46
+ 'background-color': this.$props.color,
47
+ display: 'inline-flex',
48
+ marginLeft: space
49
+ }
50
+ });
51
+ }
52
+ };
53
+ var Text = {
54
+ name: 'Text',
55
+ props: {
56
+ value: String
57
+ },
58
+ // @ts-ignore
59
+ setup: !isV3 ? undefined : function () {
60
+ var v3 = !!isV3;
61
+ return {
62
+ v3: v3
63
+ };
64
+ },
65
+ render: function render(createElement) {
66
+ var h = gh || createElement;
67
+ return h("span", {
68
+ style: {
69
+ margin: textMargin
70
+ }
71
+ }, [this.$props.value]);
72
+ }
73
+ };
74
+ var Units = {
75
+ name: 'Units',
76
+ props: {
77
+ value: Number
78
+ },
79
+ inject: {
80
+ kendoLocalizationService: {
81
+ default: null
82
+ }
83
+ },
84
+ // @ts-ignore
85
+ setup: !isV3 ? undefined : function () {
86
+ var v3 = !!isV3;
87
+ return {
88
+ v3: v3
89
+ };
90
+ },
91
+ render: function render(createElement) {
92
+ var h = gh || createElement;
93
+ var loc = provideLocalizationService(this);
94
+ var message = loc.toLanguageString(tooltipUnitFormat, messages[tooltipUnitFormat]);
95
+ var formatted = new IntlService('en').format(message, [this.$props.value || 0]);
96
+ return h(Text, {
97
+ value: formatted,
98
+ attrs: this.v3 ? undefined : {
99
+ value: formatted
100
+ }
101
+ });
102
+ }
103
+ };
104
+ var NodeTooltipContent = {
105
+ name: 'NodeTooltipContent',
106
+ props: {
107
+ dataItem: Object,
108
+ nodeValue: Number
109
+ },
110
+ // @ts-ignore
111
+ setup: !isV3 ? undefined : function () {
112
+ var v3 = !!isV3;
113
+ return {
114
+ v3: v3
115
+ };
116
+ },
117
+ render: function render(createElement) {
118
+ var h = gh || createElement;
119
+ var _a = this.$props.dataItem,
120
+ color = _a.color,
121
+ label = _a.label;
122
+ return h("div", {
123
+ style: tooltipStyles,
124
+ "class": "k-tooltip-content"
125
+ }, [h(Square, {
126
+ color: color,
127
+ attrs: this.v3 ? undefined : {
128
+ color: color
129
+ }
130
+ }), h(Text, {
131
+ value: label.text,
132
+ attrs: this.v3 ? undefined : {
133
+ value: label.text
134
+ }
135
+ }), h(Units, {
136
+ value: this.$props.nodeValue,
137
+ attrs: this.v3 ? undefined : {
138
+ value: this.$props.nodeValue
139
+ }
140
+ })]);
141
+ }
142
+ };
143
+ var LinkTooltipContent = {
144
+ name: 'LinkTooltipContent',
145
+ props: {
146
+ dataItem: Object
147
+ },
148
+ // @ts-ignore
149
+ setup: !isV3 ? undefined : function () {
150
+ var v3 = !!isV3;
151
+ return {
152
+ v3: v3
153
+ };
154
+ },
155
+ render: function render(createElement) {
156
+ var h = gh || createElement;
157
+ var _a = this.$props.dataItem,
158
+ source = _a.source,
159
+ target = _a.target,
160
+ value = _a.value;
161
+ return h("div", {
162
+ style: tooltipStyles
163
+ }, [h(Square, {
164
+ color: source.color,
165
+ attrs: this.v3 ? undefined : {
166
+ color: source.color
167
+ }
168
+ }), h(Text, {
169
+ value: source.label.text,
170
+ attrs: this.v3 ? undefined : {
171
+ value: source.label.text
172
+ }
173
+ }), h(Icon, {
174
+ icon: arrowRightIcon,
175
+ attrs: this.v3 ? undefined : {
176
+ icon: arrowRightIcon,
177
+ name: "arrow-right"
178
+ },
179
+ name: "arrow-right"
180
+ }), h(Square, {
181
+ color: target.color,
182
+ attrs: this.v3 ? undefined : {
183
+ color: target.color
184
+ }
185
+ }), h(Text, {
186
+ value: target.label.text,
187
+ attrs: this.v3 ? undefined : {
188
+ value: target.label.text
189
+ }
190
+ }), h(Units, {
191
+ value: value,
192
+ attrs: this.v3 ? undefined : {
193
+ value: value
194
+ }
195
+ })]);
196
+ }
197
+ };
198
+ /**
199
+ * @hidden
200
+ */
201
+ var TooltipVue2 = {
202
+ name: 'SankeyTooltip',
203
+ props: {
204
+ eventData: Object,
205
+ tooltipData: Object,
206
+ nodeContent: [String, Object, Function],
207
+ linkContent: [String, Object, Function],
208
+ offset: Number
209
+ },
210
+ data: function data() {
211
+ return {
212
+ top: '',
213
+ left: '',
214
+ visibility: 'hidden'
215
+ };
216
+ },
217
+ mounted: function mounted() {
218
+ this.element = getRef(this, 'element');
219
+ this.showTooltip();
220
+ },
221
+ updated: function updated() {
222
+ this.showTooltip();
223
+ },
224
+ destroyed: !!isV3 ? undefined : function () {
225
+ this.destroyTooltip();
226
+ },
227
+ // @ts-ignore
228
+ unmounted: function unmounted() {
229
+ this.destroyTooltip();
230
+ },
231
+ methods: {
232
+ destroyTooltip: function destroyTooltip() {
233
+ // no need to destroy anything
234
+ },
235
+ showTooltip: function showTooltip() {
236
+ var _a = this.$props,
237
+ offsetOption = _a.offset,
238
+ tooltipData = _a.tooltipData;
239
+ var element = this.element;
240
+ if (!tooltipData || !element) {
241
+ return;
242
+ }
243
+ var size = {
244
+ width: element.offsetWidth,
245
+ height: element.offsetHeight
246
+ };
247
+ var offset = __assign({}, tooltipData.popupOffset);
248
+ var popupAlign = tooltipData.popupAlign;
249
+ offset.left += popupAlign.horizontal === 'left' ? offsetOption : -1 * offsetOption;
250
+ if (popupAlign.horizontal === 'right') {
251
+ offset.left -= size.width;
252
+ }
253
+ if (popupAlign.vertical === 'bottom') {
254
+ offset.top -= size.height + offsetOption;
255
+ } else {
256
+ offset.top += offsetOption;
257
+ }
258
+ this.$data.top = offset.top + 'px';
259
+ this.$data.left = offset.left + 'px';
260
+ this.$data.visibility = '';
261
+ }
262
+ },
263
+ // @ts-ignore
264
+ setup: !isV3 ? undefined : function () {
265
+ var v3 = !!isV3;
266
+ return {
267
+ v3: v3
268
+ };
269
+ },
270
+ // @ts-ignore
271
+ render: function render(createElement) {
272
+ var h = gh || createElement;
273
+ var _a = this.$props,
274
+ nodeContent = _a.nodeContent,
275
+ linkContent = _a.linkContent,
276
+ _b = _a.eventData,
277
+ dataItem = _b.dataItem,
278
+ nodeValue = _b.nodeValue,
279
+ targetType = _b.targetType;
280
+ var template = targetType === 'node' ? nodeContent : linkContent;
281
+ var ContentComponent = targetType === 'node' ? NodeTooltipContent : LinkTooltipContent;
282
+ var content = getTemplate.call(this, {
283
+ h: h,
284
+ template: template,
285
+ defaultRendering: h(ContentComponent, {
286
+ dataItem: dataItem,
287
+ attrs: this.v3 ? undefined : {
288
+ dataItem: dataItem,
289
+ nodeValue: nodeValue
290
+ },
291
+ nodeValue: nodeValue
292
+ })
293
+ });
294
+ return h("div", {
295
+ ref: setRef(this, 'element'),
296
+ style: {
297
+ top: this.top,
298
+ left: this.left,
299
+ visibility: this.visibility
300
+ },
301
+ "class": "k-tooltip k-sankey-tooltip k-chart-tooltip k-chart-shared-tooltip"
302
+ }, [h("div", {
303
+ "class": "k-tooltip-content"
304
+ }, [content])]);
305
+ }
306
+ };
307
+ /**
308
+ * @hidden
309
+ */
310
+ var Tooltip = TooltipVue2;
311
+ export { Tooltip, TooltipVue2 };
@@ -0,0 +1,159 @@
1
+ import { SankeyData, SankeyExportVisualOptions, SankeyHorizontalMargin, SankeyLabel, SankeyLabelDefaults, SankeyLabelStroke, SankeyLegendItem, SankeyLink, SankeyLinkDataItem, SankeyLinkDefaults, SankeyLinkHighlight, SankeyNode, SankeyNodeDataItem, SankeyNodeDefaults, SankeyOptions, SankeyTooltipEvent, SankeyTooltip as SankeyTooltipInterface, SankeyEvent as SankeyWidgetEvent } from '@progress/kendo-charts';
2
+ import { Legend, Title } from '../common/property-types';
3
+ export { SankeyData, SankeyExportVisualOptions, SankeyHorizontalMargin, SankeyLabel, SankeyLabelDefaults, SankeyLabelStroke, SankeyLegendItem, SankeyLink, SankeyLinkDataItem, SankeyLinkDefaults, SankeyLinkHighlight, SankeyNode, SankeyNodeDataItem, SankeyNodeDefaults, SankeyOptions };
4
+ import { Sankey } from './Sankey';
5
+ /**
6
+ * The KendoReact Sankey event object.
7
+ */
8
+ export interface SankeyEvent extends SankeyWidgetEvent {
9
+ /**
10
+ * The `Sankey` component that triggered the event.
11
+ */
12
+ target: typeof Sankey;
13
+ }
14
+ /**
15
+ * Represents the Sankey title options.
16
+ */
17
+ export interface SankeyTitle extends Title {
18
+ }
19
+ /**
20
+ * Represents the Sankey legend options.
21
+ */
22
+ export interface SankeyLegend extends Omit<Legend, 'inactiveItems' | 'item'> {
23
+ /**
24
+ * The configuration of the legend items.
25
+ */
26
+ item?: SankeyLegendItem;
27
+ }
28
+ /**
29
+ * Represents the props of the Sankey tooltip content component.
30
+ */
31
+ export interface TooltipContentProps {
32
+ /**
33
+ * Represents the dataItem object of the hovered node or link element.
34
+ */
35
+ dataItem: SankeyNodeDataItem | SankeyLinkDataItem;
36
+ /**
37
+ * The value of the hovered node element.
38
+ * The value is available only when the hovered element is a node.
39
+ */
40
+ nodeValue?: number;
41
+ }
42
+ /**
43
+ * Represents the props of the Sankey tooltip component.
44
+ *
45
+ * @hidden
46
+ */
47
+ export interface SankeyTooltipProps {
48
+ /**
49
+ * The event object of the Sankey tooltip.
50
+ */
51
+ eventData: Pick<SankeyTooltipEvent, 'dataItem' | 'nodeValue' | 'targetType'>;
52
+ /**
53
+ * The distance between the tooltip and the mouse pointer in pixels.
54
+ */
55
+ offset: number;
56
+ /**
57
+ * The tooltip data of the Sankey component.
58
+ */
59
+ tooltipData: SankeyTooltipEvent['tooltipData'];
60
+ /**
61
+ * The content component of the Sankey node tooltip. Can be string that is pointing to a namedSlot or a render function;
62
+ */
63
+ nodeContent?: any;
64
+ /**
65
+ * The content component of the Sankey link tooltip. Can be string that is pointing to a namedSlot or a render function;
66
+ */
67
+ linkContent?: any;
68
+ }
69
+ /**
70
+ * Represents the Sankey tooltip configuration.
71
+ */
72
+ export interface SankeyTooltip extends SankeyTooltipInterface {
73
+ /**
74
+ * Indicates whether the Sankey tooltips will be rendered.
75
+ */
76
+ visible?: boolean;
77
+ /**
78
+ * The distance between the tooltip and the mouse pointer in pixels.
79
+ *
80
+ * @default 12
81
+ */
82
+ offset?: number;
83
+ /**
84
+ * The content component of the Sankey node tooltip. Can be string that is pointing to a namedSlot or a render function;
85
+ */
86
+ nodeContent?: any;
87
+ /**
88
+ * The content component of the Sankey link tooltip. Can be string that is pointing to a namedSlot or a render function;
89
+ */
90
+ linkContent?: any;
91
+ }
92
+ /**
93
+ * Represents the props of the KendoReact [Sankey]({% slug api_charts_sankey %}) component.
94
+ */
95
+ export interface SankeyProps {
96
+ /**
97
+ * The data of the Sankey component containing the `nodes` props.
98
+ */
99
+ dataNodes?: SankeyNode[];
100
+ /**
101
+ * The data of the Sankey component containing the `links` props.
102
+ */
103
+ dataLinks?: SankeyLink[];
104
+ /**
105
+ * The `links` default props of the Sankey component.
106
+ * The value will be applied to all links unless overridden by the `links` prop of the `data` prop.
107
+ */
108
+ links?: SankeyLinkDefaults;
109
+ /**
110
+ * The `nodes` default props of the Sankey component.
111
+ * The value will be applied to all nodes unless overridden by the `nodes` prop of the `data` prop.
112
+ */
113
+ nodes?: SankeyNodeDefaults;
114
+ /**
115
+ * The `labels` default props of the Sankey component.
116
+ * The value will be applied to all labels unless overridden by the `nodes` label prop of the `data` prop.
117
+ */
118
+ labels?: SankeyLabelDefaults;
119
+ /**
120
+ * The title configuration of the Sankey component.
121
+ */
122
+ title?: SankeyTitle;
123
+ /**
124
+ * The legend configuration of the Sankey component.
125
+ */
126
+ legend?: SankeyLegend;
127
+ /**
128
+ * The configuration of the Sankey tooltips.
129
+ */
130
+ tooltip?: SankeyTooltip;
131
+ /**
132
+ * If set to `true`, the Sankey component will not perform automatic layout.
133
+ */
134
+ disableAutoLayout?: boolean;
135
+ /**
136
+ * Fires when the mouse pointer enters a node. Similar to the `mouseenter` event.
137
+ */
138
+ onNodeenter?: (event: SankeyEvent) => void;
139
+ /**
140
+ * Fires when the mouse pointer leaves a node. Similar to the `mouseleave` event.
141
+ */
142
+ onNodeleave?: (event: SankeyEvent) => void;
143
+ /**
144
+ * Fires when the mouse pointer enters a link. Similar to the `mouseenter` event,
145
+ */
146
+ onLinkenter?: (event: SankeyEvent) => void;
147
+ /**
148
+ * Fires when the mouse pointer leaves a link. Similar to the `mouseleave` event.
149
+ */
150
+ onLinkleave?: (event: SankeyEvent) => void;
151
+ /**
152
+ * Fires when a node is clicked.
153
+ */
154
+ onNodeclick?: (event: SankeyEvent) => void;
155
+ /**
156
+ * Fires when a link is clicked.
157
+ */
158
+ onLinkclick?: (event: SankeyEvent) => void;
159
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { createSankeyData as chartsCreateSankeyData } from '@progress/kendo-charts';
2
+ /**
3
+ * Converts data objects to Sankey data.
4
+ */
5
+ export declare const createSankeyData: typeof chartsCreateSankeyData;
@@ -0,0 +1,5 @@
1
+ import { createSankeyData as chartsCreateSankeyData } from '@progress/kendo-charts';
2
+ /**
3
+ * Converts data objects to Sankey data.
4
+ */
5
+ export var createSankeyData = chartsCreateSankeyData;
@@ -10,4 +10,5 @@ export * from './common/api-types';
10
10
  export * from './common/events';
11
11
  export * from './common/charts';
12
12
  export * from './methods/main';
13
+ export * from './sankey/main';
13
14
  export { Chart, ChartVue2, ChartProps, Sparkline, SparklineVue2, SparklineProps, StockChart, StockChartVue2, StockChartProps };
package/dist/esm/main.js CHANGED
@@ -7,4 +7,5 @@ export * from './common/api-types.js';
7
7
  export * from './common/events.js';
8
8
  export * from './common/charts.js';
9
9
  export * from './methods/main.js';
10
+ export * from './sankey/main.js';
10
11
  export { Chart, ChartVue2, Sparkline, SparklineVue2, StockChart, StockChartVue2 };
@@ -5,7 +5,7 @@ export var packageMetadata = {
5
5
  name: '@progress/kendo-vue-charts',
6
6
  productName: 'Kendo UI for Vue',
7
7
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
8
- publishDate: 1714476800,
8
+ publishDate: 1715092837,
9
9
  version: '',
10
10
  licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
11
11
  };
@@ -0,0 +1,61 @@
1
+ import * as Vue from 'vue';
2
+ import { DefineComponent } from 'vue';
3
+ /**
4
+ * @hidden
5
+ */
6
+ declare type Vue2type = Vue.default;
7
+ /**
8
+ * @hidden
9
+ */
10
+ import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
11
+ declare type DefaultData<V> = object | ((this: V) => {});
12
+ declare type DefaultMethods<V> = {
13
+ [key: string]: (this: V, ...args: any[]) => any;
14
+ };
15
+ import { SankeyExportVisualOptions, SankeyProps } from './types';
16
+ import { Group } from '@progress/kendo-drawing';
17
+ import { Sankey as SankeyWidget } from '@progress/kendo-charts';
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface SankeyState {
22
+ instance: SankeyWidget | null;
23
+ element: HTMLElement | null;
24
+ }
25
+ /**
26
+ * @hidden
27
+ */
28
+ export interface SankeyComputed {
29
+ [key: string]: any;
30
+ }
31
+ /**
32
+ * @hidden
33
+ */
34
+ export interface SankeyMethods {
35
+ [key: string]: any;
36
+ exportVisual: (options?: SankeyExportVisualOptions) => Group;
37
+ }
38
+ /**
39
+ * @hidden
40
+ */
41
+ export interface SankeyComponentData {
42
+ currentTooltip: any | null;
43
+ }
44
+ /**
45
+ * @hidden
46
+ */
47
+ export interface SankeyAll extends Vue2type, SankeyMethods, SankeyComponentData, SankeyComputed, SankeyState {
48
+ }
49
+ /**
50
+ * @hidden
51
+ */
52
+ declare let SankeyVue2: ComponentOptions<SankeyAll, DefaultData<SankeyComponentData>, DefaultMethods<SankeyAll>, SankeyComputed, RecordPropsDefinition<SankeyProps>>;
53
+ /**
54
+ * @hidden
55
+ */
56
+ export declare type SankeyType = DefineComponent<SankeyProps, any, SankeyComponentData, SankeyComputed, SankeyMethods, {}, {}, {}, string, SankeyProps, SankeyProps, {}>;
57
+ /**
58
+ * @hidden
59
+ */
60
+ declare const Sankey: SankeyType;
61
+ export { Sankey, SankeyVue2 };