@progress/kendo-vue-progressbars 5.3.0-dev.202410141143 → 5.3.0-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/README.md +26 -32
  2. package/chunkprogressbar/ChunkProgressBar.js +8 -0
  3. package/chunkprogressbar/ChunkProgressBar.mjs +127 -0
  4. package/common/constants.js +8 -0
  5. package/common/constants.mjs +14 -0
  6. package/common/utils.js +8 -0
  7. package/common/utils.mjs +24 -0
  8. package/dist/cdn/js/kendo-vue-progressbars.js +8 -1
  9. package/index.d.mts +397 -0
  10. package/index.d.ts +397 -0
  11. package/index.js +8 -0
  12. package/index.mjs +13 -0
  13. package/package-metadata.js +8 -0
  14. package/package-metadata.mjs +18 -0
  15. package/package.json +25 -47
  16. package/progressbar/ProgressBar.js +8 -0
  17. package/progressbar/ProgressBar.mjs +204 -0
  18. package/dist/es/additionalTypes.ts +0 -21
  19. package/dist/es/chunkprogressbar/ChunkProgressBar.d.ts +0 -44
  20. package/dist/es/chunkprogressbar/ChunkProgressBar.js +0 -172
  21. package/dist/es/chunkprogressbar/interfaces/ChunkProgressBarProps.d.ts +0 -10
  22. package/dist/es/chunkprogressbar/interfaces/ChunkProgressBarProps.js +0 -1
  23. package/dist/es/common/BaseProps.d.ts +0 -78
  24. package/dist/es/common/BaseProps.js +0 -1
  25. package/dist/es/common/constants.d.ts +0 -16
  26. package/dist/es/common/constants.js +0 -16
  27. package/dist/es/common/utils.d.ts +0 -16
  28. package/dist/es/common/utils.js +0 -34
  29. package/dist/es/main.d.ts +0 -7
  30. package/dist/es/main.js +0 -7
  31. package/dist/es/package-metadata.d.ts +0 -5
  32. package/dist/es/package-metadata.js +0 -11
  33. package/dist/es/progressbar/ProgressBar.d.ts +0 -54
  34. package/dist/es/progressbar/ProgressBar.js +0 -244
  35. package/dist/es/progressbar/interfaces/LabelProps.d.ts +0 -9
  36. package/dist/es/progressbar/interfaces/LabelProps.js +0 -1
  37. package/dist/es/progressbar/interfaces/ProgressBarAnimation.d.ts +0 -9
  38. package/dist/es/progressbar/interfaces/ProgressBarAnimation.js +0 -1
  39. package/dist/es/progressbar/interfaces/ProgressBarHandle.d.ts +0 -21
  40. package/dist/es/progressbar/interfaces/ProgressBarHandle.js +0 -4
  41. package/dist/es/progressbar/interfaces/ProgressBarProps.d.ts +0 -29
  42. package/dist/es/progressbar/interfaces/ProgressBarProps.js +0 -1
  43. package/dist/esm/additionalTypes.ts +0 -21
  44. package/dist/esm/chunkprogressbar/ChunkProgressBar.d.ts +0 -44
  45. package/dist/esm/chunkprogressbar/ChunkProgressBar.js +0 -172
  46. package/dist/esm/chunkprogressbar/interfaces/ChunkProgressBarProps.d.ts +0 -10
  47. package/dist/esm/chunkprogressbar/interfaces/ChunkProgressBarProps.js +0 -1
  48. package/dist/esm/common/BaseProps.d.ts +0 -78
  49. package/dist/esm/common/BaseProps.js +0 -1
  50. package/dist/esm/common/constants.d.ts +0 -16
  51. package/dist/esm/common/constants.js +0 -16
  52. package/dist/esm/common/utils.d.ts +0 -16
  53. package/dist/esm/common/utils.js +0 -34
  54. package/dist/esm/main.d.ts +0 -7
  55. package/dist/esm/main.js +0 -7
  56. package/dist/esm/package-metadata.d.ts +0 -5
  57. package/dist/esm/package-metadata.js +0 -11
  58. package/dist/esm/package.json +0 -3
  59. package/dist/esm/progressbar/ProgressBar.d.ts +0 -54
  60. package/dist/esm/progressbar/ProgressBar.js +0 -244
  61. package/dist/esm/progressbar/interfaces/LabelProps.d.ts +0 -9
  62. package/dist/esm/progressbar/interfaces/LabelProps.js +0 -1
  63. package/dist/esm/progressbar/interfaces/ProgressBarAnimation.d.ts +0 -9
  64. package/dist/esm/progressbar/interfaces/ProgressBarAnimation.js +0 -1
  65. package/dist/esm/progressbar/interfaces/ProgressBarHandle.d.ts +0 -21
  66. package/dist/esm/progressbar/interfaces/ProgressBarHandle.js +0 -4
  67. package/dist/esm/progressbar/interfaces/ProgressBarProps.d.ts +0 -29
  68. package/dist/esm/progressbar/interfaces/ProgressBarProps.js +0 -1
  69. package/dist/npm/additionalTypes.ts +0 -21
  70. package/dist/npm/chunkprogressbar/ChunkProgressBar.d.ts +0 -44
  71. package/dist/npm/chunkprogressbar/ChunkProgressBar.js +0 -179
  72. package/dist/npm/chunkprogressbar/interfaces/ChunkProgressBarProps.d.ts +0 -10
  73. package/dist/npm/chunkprogressbar/interfaces/ChunkProgressBarProps.js +0 -2
  74. package/dist/npm/common/BaseProps.d.ts +0 -78
  75. package/dist/npm/common/BaseProps.js +0 -2
  76. package/dist/npm/common/constants.d.ts +0 -16
  77. package/dist/npm/common/constants.js +0 -19
  78. package/dist/npm/common/utils.d.ts +0 -16
  79. package/dist/npm/common/utils.js +0 -41
  80. package/dist/npm/main.d.ts +0 -7
  81. package/dist/npm/main.js +0 -23
  82. package/dist/npm/package-metadata.d.ts +0 -5
  83. package/dist/npm/package-metadata.js +0 -14
  84. package/dist/npm/progressbar/ProgressBar.d.ts +0 -54
  85. package/dist/npm/progressbar/ProgressBar.js +0 -251
  86. package/dist/npm/progressbar/interfaces/LabelProps.d.ts +0 -9
  87. package/dist/npm/progressbar/interfaces/LabelProps.js +0 -2
  88. package/dist/npm/progressbar/interfaces/ProgressBarAnimation.d.ts +0 -9
  89. package/dist/npm/progressbar/interfaces/ProgressBarAnimation.js +0 -2
  90. package/dist/npm/progressbar/interfaces/ProgressBarHandle.d.ts +0 -21
  91. package/dist/npm/progressbar/interfaces/ProgressBarHandle.js +0 -5
  92. package/dist/npm/progressbar/interfaces/ProgressBarProps.d.ts +0 -29
  93. package/dist/npm/progressbar/interfaces/ProgressBarProps.js +0 -2
@@ -1,251 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ProgressBarVue2 = exports.ProgressBar = void 0;
7
- // @ts-ignore
8
- var Vue = require("vue");
9
- var allVue = Vue;
10
- var gh = allVue.h;
11
- var isV3 = allVue.version && allVue.version[0] === '3';
12
- var kendo_vue_animation_1 = require("@progress/kendo-vue-animation");
13
- var kendo_vue_common_1 = require("@progress/kendo-vue-common");
14
- var utils_1 = require("../common/utils");
15
- var constants_1 = require("../common/constants");
16
- var kendo_vue_common_2 = require("@progress/kendo-vue-common");
17
- var package_metadata_1 = require("../package-metadata");
18
- /**
19
- * @hidden
20
- */
21
- var ProgressBarVue2 = {
22
- name: 'KendoProgressBar',
23
- props: {
24
- animation: {
25
- type: [Boolean, Object],
26
- default: false
27
- },
28
- disabled: {
29
- type: Boolean,
30
- default: false
31
- },
32
- reverse: {
33
- type: Boolean,
34
- default: false
35
- },
36
- label: String,
37
- labelRender: [String, Object, Function],
38
- labelVisible: {
39
- type: Boolean,
40
- default: true
41
- },
42
- labelPlacement: {
43
- type: String,
44
- default: undefined,
45
- validator: function validator(value) {
46
- return ['start', 'center', 'end'].includes(value);
47
- }
48
- },
49
- dir: {
50
- type: String,
51
- default: undefined
52
- },
53
- max: {
54
- type: Number,
55
- default: 100
56
- },
57
- min: {
58
- type: Number,
59
- default: 0
60
- },
61
- value: {
62
- type: Number,
63
- default: 0
64
- },
65
- orientation: {
66
- type: String,
67
- default: 'horizontal',
68
- validator: function validator(value) {
69
- return ['horizontal', 'vertical'].includes(value);
70
- }
71
- },
72
- tabIndex: Number,
73
- emptyStyle: Object,
74
- emptyClassName: String,
75
- progressStyle: Object,
76
- progressClassName: String,
77
- ariaLabel: String
78
- },
79
- created: function created() {
80
- (0, kendo_vue_common_2.validatePackage)(package_metadata_1.packageMetadata);
81
- this.currentDir = this.$props.dir;
82
- },
83
- mounted: function mounted() {
84
- this._progressStatus = (0, kendo_vue_common_1.getRef)(this, 'progressStatus');
85
- this._progressStatusWrap = (0, kendo_vue_common_1.getRef)(this, 'progressStatusWrap');
86
- this.currentDir = this.$props.dir !== undefined ? this.$props.dir : (0, kendo_vue_common_1.isRtl)(this.$el) ? 'rtl' : 'ltr';
87
- this.animationFrame = (0, kendo_vue_animation_1.animate)({
88
- duration: this.animationDuration,
89
- onStart: this.handleStart,
90
- onUpdate: this.handleUpdate,
91
- onEnd: this.handleEnd
92
- });
93
- },
94
- destroyed: !!isV3 ? undefined : function () {
95
- (0, kendo_vue_animation_1.cancelAnimation)(this.animationFrame);
96
- },
97
- // @ts-ignore
98
- unmounted: function unmounted() {
99
- (0, kendo_vue_animation_1.cancelAnimation)(this.animationFrame);
100
- },
101
- data: function data() {
102
- return {
103
- currentDir: undefined
104
- };
105
- },
106
- watch: {
107
- value: function value(_newValue, oldValue) {
108
- this.prevValue = oldValue;
109
- this.animationFrame = (0, kendo_vue_animation_1.animate)({
110
- duration: this.animationDuration,
111
- onStart: this.handleStart,
112
- onUpdate: this.handleUpdate,
113
- onEnd: this.handleEnd
114
- });
115
- }
116
- },
117
- computed: {
118
- wrapperClass: function wrapperClass() {
119
- var _a = this.$props,
120
- disabled = _a.disabled,
121
- reverse = _a.reverse,
122
- orientation = _a.orientation,
123
- value = _a.value;
124
- var isVertical = orientation === 'vertical';
125
- var indeterminateProp = value === null;
126
- return {
127
- 'k-progressbar': true,
128
- 'k-progressbar-horizontal': !isVertical,
129
- 'k-progressbar-vertical': isVertical,
130
- 'k-progressbar-reverse': reverse,
131
- 'k-progressbar-indeterminate': indeterminateProp,
132
- 'k-disabled': disabled
133
- };
134
- },
135
- isVertical: function isVertical() {
136
- return this.orientation === 'vertical';
137
- },
138
- animationDuration: function animationDuration() {
139
- var animation = this.$props.animation;
140
- return typeof animation !== 'boolean' && animation !== undefined ? animation.duration : animation ? constants_1.DEFAULT_ANIMATION_DURATION : constants_1.NO_ANIMATION;
141
- }
142
- },
143
- // @ts-ignore
144
- setup: !isV3 ? undefined : function () {
145
- var v3 = !!isV3;
146
- return {
147
- v3: v3
148
- };
149
- },
150
- // @ts-ignore
151
- render: function render(createElement) {
152
- var h = gh || createElement;
153
- var _a = this.$props,
154
- disabled = _a.disabled,
155
- labelVisible = _a.labelVisible,
156
- labelPlacement = _a.labelPlacement,
157
- max = _a.max,
158
- min = _a.min,
159
- tabIndex = _a.tabIndex,
160
- emptyStyle = _a.emptyStyle,
161
- emptyClassName = _a.emptyClassName,
162
- progressStyle = _a.progressStyle,
163
- progressClassName = _a.progressClassName;
164
- var value = this.$props.value || 0;
165
- var indeterminateProp = this.$props.value === null;
166
- var formattedLabel = (0, utils_1.truncateNumber)(value);
167
- var labelProps = {
168
- value: value
169
- };
170
- var label = this.$props.labelRender ? kendo_vue_common_1.templateRendering.call(this, this.$props.labelRender, kendo_vue_common_1.getListeners.call(this)) : undefined;
171
- var labelDefaultRendering = h('span', {
172
- 'class': 'k-progress-status'
173
- }, formattedLabel);
174
- var toggleButtonRendering = kendo_vue_common_1.getTemplate.call(this, {
175
- h: h,
176
- template: label,
177
- defaultRendering: labelDefaultRendering,
178
- additionalProps: labelProps
179
- });
180
- var renderLabel = labelVisible ? this.$props.label ? h("span", {
181
- "class": 'k-progress-status'
182
- }, [this.$props.label]) : toggleButtonRendering : undefined;
183
- var positionClasses = (0, kendo_vue_common_1.classNames)('k-progress-status-wrap', {
184
- 'k-progress-start': labelPlacement === 'start',
185
- 'k-progress-center': labelPlacement === 'center',
186
- 'k-progress-end': labelPlacement === 'end' || labelPlacement === undefined
187
- });
188
- return h("div", {
189
- "class": this.wrapperClass,
190
- dir: this.currentDir,
191
- attrs: this.v3 ? undefined : {
192
- dir: this.currentDir,
193
- tabindex: (0, kendo_vue_common_1.getTabIndex)(tabIndex, disabled),
194
- role: 'progressbar',
195
- "aria-valuemin": min,
196
- "aria-valuemax": max,
197
- "aria-valuenow": indeterminateProp ? undefined : value,
198
- "aria-disabled": disabled,
199
- "aria-label": this.$props.ariaLabel
200
- },
201
- tabindex: (0, kendo_vue_common_1.getTabIndex)(tabIndex, disabled),
202
- role: 'progressbar',
203
- "aria-valuemin": min,
204
- "aria-valuemax": max,
205
- "aria-valuenow": indeterminateProp ? undefined : value,
206
- "aria-disabled": disabled,
207
- "aria-label": this.$props.ariaLabel
208
- }, [h("span", {
209
- "class": positionClasses + (emptyClassName ? ' ' + emptyClassName : ''),
210
- style: emptyStyle
211
- }, [renderLabel]), h("div", {
212
- "class": 'k-progressbar-value k-selected',
213
- style: progressStyle,
214
- ref: (0, kendo_vue_common_1.setRef)(this, 'progressStatus')
215
- }, [h("span", {
216
- "class": positionClasses + (progressClassName ? ' ' + progressClassName : ''),
217
- ref: (0, kendo_vue_common_1.setRef)(this, 'progressStatusWrap')
218
- }, [renderLabel])])]);
219
- },
220
- methods: {
221
- focus: function focus() {
222
- if (this.$el) {
223
- this.$el.focus();
224
- }
225
- },
226
- progressStatusElement: function progressStatusElement() {
227
- return this._progressStatus;
228
- },
229
- progressStatusWrapElement: function progressStatusWrapElement() {
230
- return this._progressStatusWrap;
231
- },
232
- handleStart: function handleStart() {
233
- var percentage = (0, utils_1.calculatePercentage)(this.min, this.max, this.prevValue);
234
- (0, utils_1.updateProgress)(this._progressStatus, this._progressStatusWrap, percentage, this.isVertical);
235
- },
236
- handleUpdate: function handleUpdate(progress) {
237
- var percentage = (0, utils_1.calculatePercentage)(this.min, this.max, this.prevValue + (this.value - this.prevValue) * progress);
238
- (0, utils_1.updateProgress)(this._progressStatus, this._progressStatusWrap, percentage, this.isVertical);
239
- },
240
- handleEnd: function handleEnd() {
241
- var percentage = (0, utils_1.calculatePercentage)(this.min, this.max, this.value);
242
- (0, utils_1.updateProgress)(this._progressStatus, this._progressStatusWrap, percentage, this.isVertical);
243
- }
244
- }
245
- };
246
- exports.ProgressBarVue2 = ProgressBarVue2;
247
- /**
248
- * @hidden
249
- */
250
- var ProgressBar = ProgressBarVue2;
251
- exports.ProgressBar = ProgressBar;
@@ -1,9 +0,0 @@
1
- /**
2
- * An interface for the ProgressBar label.
3
- */
4
- export interface LabelProps {
5
- /**
6
- * Represents the current value of the ProgressBar.
7
- */
8
- value?: number | null;
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- /**
2
- * Specifies the animation settings of the ProgressBar.
3
- */
4
- export interface ProgressBarAnimation {
5
- /**
6
- * Specifies the duration of the ProgressBar animation. Defaults to `400`.
7
- */
8
- duration: number;
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,21 +0,0 @@
1
- /**
2
- * The ProgressBar ref.
3
- */
4
- export interface ProgressBarHandle {
5
- /**
6
- * The ProgressBar element.
7
- */
8
- element: HTMLDivElement | null;
9
- /**
10
- * The progress status element.
11
- */
12
- progressStatusElement: HTMLDivElement | null;
13
- /**
14
- * The progress status wrap element.
15
- */
16
- progressStatusWrapElement: HTMLSpanElement | null;
17
- /**
18
- * Focus the ProgressBar.
19
- */
20
- focus: () => void;
21
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
- /**
3
- * The ProgressBar ref.
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,29 +0,0 @@
1
- import { BaseProps } from '../../common/BaseProps';
2
- import { ProgressBarAnimation } from './ProgressBarAnimation';
3
- /**
4
- * Represents the props of the [Kendo UI for Vue ProgressBar component]({% slug overview_progressbar %}).
5
- */
6
- export interface ProgressBarProps extends BaseProps {
7
- /**
8
- * Specifies the animation settings of the ProgressBar. Defaults to `false`.
9
- * If boolean, enables or disables the default animation.
10
- * Use ProgressBarAnimation to set slide animation with customizable duration option. Accepts a number in milliseconds.
11
- */
12
- animation?: boolean | ProgressBarAnimation;
13
- /**
14
- * Overrides the default label ([see example]({% slug progressbar_label %})).
15
- */
16
- label?: any;
17
- /**
18
- * Overrides the default label template ([see example]({% slug progressbar_label %})).
19
- */
20
- labelRender?: any;
21
- /**
22
- * Sets the visibility of the progress status label. Defaults to `true`.
23
- */
24
- labelVisible?: boolean;
25
- /**
26
- * Sets the position of the progress status label. Defaults to `end` ([see example]({% slug progressbar_label %})).
27
- */
28
- labelPlacement?: 'start' | 'center' | 'end' | any;
29
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });