@progress/kendo-vue-inputs 4.3.4-dev.202405030811 → 4.4.0-dev.202405091413

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-inputs.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/rating/Rating.d.ts +61 -0
  6. package/dist/es/rating/Rating.js +400 -0
  7. package/dist/es/rating/RatingItem.d.ts +46 -0
  8. package/dist/es/rating/RatingItem.js +272 -0
  9. package/dist/es/rating/interfaces/RatingEvents.d.ts +47 -0
  10. package/dist/es/rating/interfaces/RatingEvents.js +1 -0
  11. package/dist/es/rating/interfaces/RatingItemProps.d.ts +92 -0
  12. package/dist/es/rating/interfaces/RatingItemProps.js +1 -0
  13. package/dist/es/rating/interfaces/RatingProps.d.ts +116 -0
  14. package/dist/es/rating/interfaces/RatingProps.js +1 -0
  15. package/dist/es/rating/utils/index.d.ts +24 -0
  16. package/dist/es/rating/utils/index.js +60 -0
  17. package/dist/es/rating/utils/rating-reducer.d.ts +32 -0
  18. package/dist/es/rating/utils/rating-reducer.js +63 -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/rating/Rating.d.ts +61 -0
  23. package/dist/esm/rating/Rating.js +400 -0
  24. package/dist/esm/rating/RatingItem.d.ts +46 -0
  25. package/dist/esm/rating/RatingItem.js +272 -0
  26. package/dist/esm/rating/interfaces/RatingEvents.d.ts +47 -0
  27. package/dist/esm/rating/interfaces/RatingEvents.js +1 -0
  28. package/dist/esm/rating/interfaces/RatingItemProps.d.ts +92 -0
  29. package/dist/esm/rating/interfaces/RatingItemProps.js +1 -0
  30. package/dist/esm/rating/interfaces/RatingProps.d.ts +116 -0
  31. package/dist/esm/rating/interfaces/RatingProps.js +1 -0
  32. package/dist/esm/rating/utils/index.d.ts +24 -0
  33. package/dist/esm/rating/utils/index.js +60 -0
  34. package/dist/esm/rating/utils/rating-reducer.d.ts +32 -0
  35. package/dist/esm/rating/utils/rating-reducer.js +63 -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/rating/Rating.d.ts +61 -0
  40. package/dist/npm/rating/Rating.js +407 -0
  41. package/dist/npm/rating/RatingItem.d.ts +46 -0
  42. package/dist/npm/rating/RatingItem.js +279 -0
  43. package/dist/npm/rating/interfaces/RatingEvents.d.ts +47 -0
  44. package/dist/npm/rating/interfaces/RatingEvents.js +2 -0
  45. package/dist/npm/rating/interfaces/RatingItemProps.d.ts +92 -0
  46. package/dist/npm/rating/interfaces/RatingItemProps.js +2 -0
  47. package/dist/npm/rating/interfaces/RatingProps.d.ts +116 -0
  48. package/dist/npm/rating/interfaces/RatingProps.js +2 -0
  49. package/dist/npm/rating/utils/index.d.ts +24 -0
  50. package/dist/npm/rating/utils/index.js +72 -0
  51. package/dist/npm/rating/utils/rating-reducer.d.ts +32 -0
  52. package/dist/npm/rating/utils/rating-reducer.js +67 -0
  53. package/package.json +13 -13
@@ -0,0 +1,63 @@
1
+ import { toRound } from './index.js';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export var RATING_ACTION;
6
+ (function (RATING_ACTION) {
7
+ RATING_ACTION["select"] = "select";
8
+ RATING_ACTION["deselect"] = "deselect";
9
+ RATING_ACTION["increase"] = "increase";
10
+ RATING_ACTION["decrease"] = "decrease";
11
+ RATING_ACTION["min"] = "min";
12
+ RATING_ACTION["max"] = "max";
13
+ RATING_ACTION["reset"] = "reset";
14
+ })(RATING_ACTION || (RATING_ACTION = {}));
15
+ /**
16
+ * @hidden
17
+ */
18
+ export var ratingReducer = function (state, action) {
19
+ switch (action.type) {
20
+ case RATING_ACTION.select:
21
+ if (action.payload === undefined || action.step === undefined) {
22
+ return state;
23
+ }
24
+ if (action.payload === state) {
25
+ return null;
26
+ }
27
+ return action.payload >= action.min
28
+ ? action.payload < action.max
29
+ ? toRound(action.payload, action.step)
30
+ : action.max
31
+ : action.min;
32
+ case RATING_ACTION.deselect:
33
+ return null;
34
+ case RATING_ACTION.increase:
35
+ if (action.step === undefined) {
36
+ return state;
37
+ }
38
+ if (state < action.min) {
39
+ return action.min;
40
+ }
41
+ return state + action.step < action.max
42
+ ? toRound(state + action.step, action.step)
43
+ : action.max;
44
+ case RATING_ACTION.decrease:
45
+ if (action.step === undefined) {
46
+ return state;
47
+ }
48
+ return toRound(state - action.step, action.step) >= action.min
49
+ ? toRound(state - action.step, action.step)
50
+ : action.min;
51
+ case RATING_ACTION.min:
52
+ if (action.step === undefined) {
53
+ return state;
54
+ }
55
+ return action.min;
56
+ case RATING_ACTION.max:
57
+ return action.max;
58
+ case RATING_ACTION.reset:
59
+ return null;
60
+ default:
61
+ return state;
62
+ }
63
+ };
@@ -41,3 +41,4 @@ export * from './textarea/interfaces/TextAreaChangeEvent';
41
41
  export * from './textarea/interfaces/TextAreaFocusEvent';
42
42
  export * from './signature/Signature';
43
43
  export * from './signature/interfaces/main';
44
+ export * from './rating/Rating';
package/dist/npm/main.js CHANGED
@@ -60,3 +60,4 @@ __exportStar(require("./textarea/interfaces/TextAreaChangeEvent"), exports);
60
60
  __exportStar(require("./textarea/interfaces/TextAreaFocusEvent"), exports);
61
61
  __exportStar(require("./signature/Signature"), exports);
62
62
  __exportStar(require("./signature/interfaces/main"), exports);
63
+ __exportStar(require("./rating/Rating"), exports);
@@ -8,7 +8,7 @@ exports.packageMetadata = {
8
8
  name: '@progress/kendo-vue-inputs',
9
9
  productName: 'Kendo UI for Vue',
10
10
  productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
11
- publishDate: 1714723247,
11
+ publishDate: 1715263381,
12
12
  version: '',
13
13
  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'
14
14
  };
@@ -0,0 +1,61 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ import { RatingItemMouseEvent } from './interfaces/RatingEvents';
3
+ import { RatingProps } from './interfaces/RatingProps';
4
+ import { RatingActionDispatch } from './utils/rating-reducer';
5
+ declare type DefaultData<V> = object | ((this: V) => RatingData);
6
+ declare type DefaultMethods<V> = {
7
+ [key: string]: (this: V, ...args: any[]) => any;
8
+ };
9
+ /**
10
+ * @hidden
11
+ */
12
+ export interface RatingData {
13
+ defaultValue: number;
14
+ }
15
+ /**
16
+ * @hidden
17
+ */
18
+ export interface RatingState {
19
+ inputRef: any;
20
+ }
21
+ /**
22
+ * @hidden
23
+ */
24
+ export interface RatingMethods {
25
+ [key: string]: any;
26
+ handleChange: (newValue: number, e: PointerEvent) => void;
27
+ handleKeyDown: (e: KeyboardEvent) => void;
28
+ handleFocus: (e: FocusEvent) => void;
29
+ handleBlur: (e: FocusEvent) => void;
30
+ handleItemClick: (eventData: RatingItemMouseEvent) => void;
31
+ handleMouseLeave: (eventData: RatingItemMouseEvent) => void;
32
+ handleMouseMove: (eventData: RatingItemMouseEvent) => void;
33
+ dispatchValue: (action: RatingActionDispatch) => void;
34
+ dispatchHover: (action: RatingActionDispatch) => void;
35
+ }
36
+ /**
37
+ * @hidden
38
+ */
39
+ export interface RatingComputed {
40
+ [key: string]: any;
41
+ base: number;
42
+ }
43
+ /**
44
+ * @hidden
45
+ */
46
+ export interface RatingHandle {
47
+ }
48
+ /**
49
+ * @hidden
50
+ */
51
+ export interface RatingAllMethods extends Vue2type, RatingMethods, RatingComputed, RatingState {
52
+ }
53
+ /**
54
+ * @hidden
55
+ */
56
+ declare let RatingVue2: ComponentOptions<RatingAllMethods, DefaultData<RatingData>, DefaultMethods<RatingAllMethods>, RatingComputed, RecordPropsDefinition<RatingProps>>;
57
+ /**
58
+ * @hidden
59
+ */
60
+ declare const Rating: DefineComponent<RatingProps, any, RatingData, RatingComputed, RatingMethods, {}, {}, {}, string, RatingProps, RatingProps, {}>;
61
+ export { Rating, RatingVue2 };
@@ -0,0 +1,407 @@
1
+ "use strict";
2
+
3
+ var __assign = undefined && undefined.__assign || function () {
4
+ __assign = Object.assign || function (t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) {
8
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
+ }
10
+ }
11
+ return t;
12
+ };
13
+ return __assign.apply(this, arguments);
14
+ };
15
+ Object.defineProperty(exports, "__esModule", {
16
+ value: true
17
+ });
18
+ exports.RatingVue2 = exports.Rating = void 0;
19
+ // @ts-ignore
20
+ var Vue = require("vue");
21
+ var allVue = Vue;
22
+ var gh = allVue.h;
23
+ var isV3 = allVue.version && allVue.version[0] === '3';
24
+ var ref = allVue.ref;
25
+ var kendo_vue_common_1 = require("@progress/kendo-vue-common");
26
+ var package_metadata_1 = require("../package-metadata");
27
+ var RatingItem_1 = require("./RatingItem");
28
+ var utils_1 = require("./utils");
29
+ var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
30
+ var main_1 = require("../messages/main");
31
+ var rating_reducer_1 = require("./utils/rating-reducer");
32
+ /**
33
+ * @hidden
34
+ */
35
+ var RatingVue2 = {
36
+ name: 'Rating',
37
+ // @ts-ignore
38
+ emits: {
39
+ 'change': null,
40
+ 'keydown': null,
41
+ 'focus': null,
42
+ 'blur': null,
43
+ 'click': null,
44
+ 'mouseleave': null,
45
+ 'mousemove': null
46
+ },
47
+ props: {
48
+ min: {
49
+ type: Number,
50
+ default: 1
51
+ },
52
+ max: {
53
+ type: Number,
54
+ default: 5
55
+ },
56
+ step: {
57
+ type: Number,
58
+ default: 1
59
+ },
60
+ item: {
61
+ type: [String, Object, Function]
62
+ },
63
+ precision: {
64
+ default: 'item',
65
+ validator: function validator(value) {
66
+ return ['item', 'half'].includes(value);
67
+ }
68
+ },
69
+ selection: {
70
+ default: 'continues',
71
+ validator: function validator(value) {
72
+ return ['continues', 'single'].includes(value);
73
+ }
74
+ },
75
+ value: Number,
76
+ icon: String,
77
+ svgIconOutline: Object,
78
+ svgIcon: Object,
79
+ tabIndex: Number,
80
+ disabled: Boolean,
81
+ readonly: Boolean,
82
+ id: String,
83
+ half: Boolean,
84
+ defaultValue: Number,
85
+ label: String
86
+ },
87
+ created: function created() {
88
+ (0, kendo_vue_common_1.validatePackage)(package_metadata_1.packageMetadata);
89
+ },
90
+ inject: {
91
+ kendoLocalizationService: {
92
+ default: null
93
+ }
94
+ },
95
+ data: function data() {
96
+ return {
97
+ focused: false,
98
+ currentValue: this.defaultValue || null,
99
+ currentHovered: null
100
+ };
101
+ },
102
+ // @ts-ignore
103
+ setup: !isV3 ? undefined : function () {
104
+ var v3 = !!isV3;
105
+ var inputRef = ref(null);
106
+ return {
107
+ v3: v3,
108
+ inputRef: inputRef
109
+ };
110
+ },
111
+ computed: {
112
+ base: function base() {
113
+ return this.$props.step / (this.$props.precision === 'half' ? 2 : 1);
114
+ },
115
+ computedValue: function computedValue() {
116
+ return this.$props.value !== undefined ? this.$props.value : this.$data.currentValue;
117
+ }
118
+ },
119
+ render: function render(createElement) {
120
+ var _this = this;
121
+ var h = gh || createElement;
122
+ var ls = (0, kendo_vue_intl_1.provideLocalizationService)(this);
123
+ var _a = this.$props,
124
+ min = _a.min,
125
+ max = _a.max,
126
+ step = _a.step,
127
+ id = _a.id,
128
+ dir = _a.dir,
129
+ label = _a.label,
130
+ selection = _a.selection,
131
+ precision = _a.precision,
132
+ svgIcon = _a.svgIcon,
133
+ icon = _a.icon,
134
+ item = _a.item,
135
+ value = _a.value,
136
+ tabIndex = _a.tabIndex,
137
+ disabled = _a.disabled,
138
+ readonly = _a.readonly,
139
+ ariaLabelledBy = _a.ariaLabelledBy,
140
+ ariaDescribedBy = _a.ariaDescribedBy,
141
+ svgIconOutline = _a.svgIconOutline;
142
+ var items = Array.from({
143
+ length: max - min + 1
144
+ }, function (_, i) {
145
+ return min + i;
146
+ });
147
+ var remainder = (0, utils_1.getRemainder)((0, utils_1.toRound)(max - min, this.base), step);
148
+ var stateValue = this.computedValue;
149
+ var stateHover = this.$data.currentHovered;
150
+ return h("span", {
151
+ id: id,
152
+ attrs: this.v3 ? undefined : {
153
+ id: id,
154
+ role: "slider",
155
+ dir: dir,
156
+ tabIndex: (0, kendo_vue_common_1.getTabIndex)(tabIndex, disabled, undefined),
157
+ "aria-valuemin": min,
158
+ "aria-valuemax": max,
159
+ "aria-valuenow": value !== null ? value : undefined,
160
+ "aria-disabled": disabled ? 'true' : undefined,
161
+ "aria-label": ls.toLanguageString(main_1.ratingAriaLabel, main_1.messages[main_1.ratingAriaLabel]),
162
+ "aria-labelledby": ariaLabelledBy,
163
+ "aria-describedby": ariaDescribedBy
164
+ },
165
+ ref: 'ratingRef',
166
+ role: "slider",
167
+ dir: dir,
168
+ tabIndex: (0, kendo_vue_common_1.getTabIndex)(tabIndex, disabled, undefined),
169
+ "class": (0, kendo_vue_common_1.classNames)('k-rating', {
170
+ 'k-rtl': dir === 'rtl',
171
+ 'k-readonly': readonly,
172
+ 'k-disabled': disabled
173
+ }),
174
+ onKeydown: this.handleKeyDown,
175
+ on: this.v3 ? undefined : {
176
+ "keydown": this.handleKeyDown,
177
+ "focus": this.handleFocus,
178
+ "blur": this.handleBlur,
179
+ "click": function click() {
180
+ return _this.$data.focused = true;
181
+ }
182
+ },
183
+ onFocus: this.handleFocus,
184
+ onBlur: this.handleBlur,
185
+ onClick: function click() {
186
+ return _this.$data.focused = true;
187
+ },
188
+ "aria-valuemin": min,
189
+ "aria-valuemax": max,
190
+ "aria-valuenow": value !== null ? value : undefined,
191
+ "aria-disabled": disabled ? 'true' : undefined,
192
+ "aria-label": ls.toLanguageString(main_1.ratingAriaLabel, main_1.messages[main_1.ratingAriaLabel]),
193
+ "aria-labelledby": ariaLabelledBy,
194
+ "aria-describedby": ariaDescribedBy
195
+ }, [h("input", {
196
+ id: 'rating',
197
+ attrs: this.v3 ? undefined : {
198
+ id: 'rating',
199
+ readOnly: readonly,
200
+ disabled: disabled
201
+ },
202
+ "class": 'k-hidden',
203
+ readOnly: readonly,
204
+ disabled: disabled
205
+ }), h("span", {
206
+ "class": 'k-rating-container'
207
+ }, [items.map(function (_itemRating) {
208
+ var itemValue = (0, utils_1.toRound)(_itemRating + remainder, this.base);
209
+ var half = precision === 'half' ? (0, utils_1.isHalf)(itemValue, stateHover !== null ? stateHover : stateValue !== null ? stateValue : 0, step) : false;
210
+ var haveSelectedValue = (0, utils_1.isSelected)(itemValue, stateValue, step, selection);
211
+ var selected = (0, utils_1.isSelected)(itemValue, stateHover !== null ? stateHover : stateValue, step, selection);
212
+ var hovered = (0, utils_1.isSelected)(itemValue, stateHover, step, selection);
213
+ var itemTemplate = kendo_vue_common_1.templateRendering.call(this, item, kendo_vue_common_1.getListeners.call(this));
214
+ var defaultItemTemplate = h(RatingItem_1.RatingItem, {
215
+ afterHovered: stateHover,
216
+ attrs: this.v3 ? undefined : {
217
+ afterHovered: stateHover,
218
+ value: itemValue,
219
+ dir: dir,
220
+ title: String(half ? (0, utils_1.toRound)(itemValue - step / 2, this.base) : itemValue),
221
+ icon: icon,
222
+ svgIcon: svgIcon,
223
+ svgIconOutline: svgIconOutline,
224
+ haveSelectedValue: haveSelectedValue,
225
+ half: half,
226
+ selected: selected,
227
+ hovered: hovered,
228
+ item: item,
229
+ itemTemplate: itemTemplate
230
+ },
231
+ key: itemValue,
232
+ value: itemValue,
233
+ dir: dir,
234
+ title: String(half ? (0, utils_1.toRound)(itemValue - step / 2, this.base) : itemValue),
235
+ icon: icon,
236
+ svgIcon: svgIcon,
237
+ svgIconOutline: svgIconOutline,
238
+ haveSelectedValue: haveSelectedValue,
239
+ half: half,
240
+ selected: selected,
241
+ hovered: hovered,
242
+ item: item,
243
+ itemTemplate: itemTemplate,
244
+ onClick: this.handleItemClick,
245
+ on: this.v3 ? undefined : {
246
+ "click": this.handleItemClick,
247
+ "mousemove": this.handleMouseMove,
248
+ "mouseleave": this.handleMouseLeave
249
+ },
250
+ onMousemove: this.handleMouseMove,
251
+ onMouseleave: this.handleMouseLeave
252
+ });
253
+ return defaultItemTemplate;
254
+ }, this)]), label && h("span", {
255
+ "class": 'k-rating-label'
256
+ }, [label])]);
257
+ },
258
+ methods: {
259
+ handleFocus: function handleFocus(event) {
260
+ this.$emit('focus', event);
261
+ },
262
+ handleBlur: function handleBlur(event) {
263
+ this.$emit('blur', event);
264
+ },
265
+ handleChange: function handleChange(newValue, event) {
266
+ this.$emit('change', {
267
+ value: newValue,
268
+ target: this.$refs.ratingRef,
269
+ event: event
270
+ });
271
+ },
272
+ handleKeyDown: function handleKeyDown(event) {
273
+ if (this.$props.readonly || this.$props.disabled) {
274
+ return;
275
+ }
276
+ switch (event.keyCode) {
277
+ case kendo_vue_common_1.Keys.right:
278
+ event.preventDefault();
279
+ this.dispatchValue({
280
+ type: this.$props.dir === 'rtl' ? rating_reducer_1.RATING_ACTION.decrease : rating_reducer_1.RATING_ACTION.increase,
281
+ event: event
282
+ });
283
+ break;
284
+ case kendo_vue_common_1.Keys.left:
285
+ event.preventDefault();
286
+ this.dispatchValue({
287
+ type: this.$props.dir === 'rtl' ? rating_reducer_1.RATING_ACTION.increase : rating_reducer_1.RATING_ACTION.decrease,
288
+ event: event
289
+ });
290
+ break;
291
+ case kendo_vue_common_1.Keys.home:
292
+ event.preventDefault();
293
+ this.dispatchValue({
294
+ type: this.$props.dir === 'rtl' ? rating_reducer_1.RATING_ACTION.min : rating_reducer_1.RATING_ACTION.max,
295
+ event: event
296
+ });
297
+ break;
298
+ case kendo_vue_common_1.Keys.end:
299
+ event.preventDefault();
300
+ this.dispatchValue({
301
+ type: this.$props.dir === 'rtl' ? rating_reducer_1.RATING_ACTION.max : rating_reducer_1.RATING_ACTION.min,
302
+ event: event
303
+ });
304
+ break;
305
+ case kendo_vue_common_1.Keys.esc:
306
+ event.preventDefault();
307
+ this.dispatchValue({
308
+ type: rating_reducer_1.RATING_ACTION.deselect,
309
+ event: event
310
+ });
311
+ break;
312
+ default:
313
+ break;
314
+ }
315
+ this.$emit('keydown', {
316
+ value: this.$data.currentValue,
317
+ event: event
318
+ });
319
+ },
320
+ handleItemClick: function handleItemClick(eventData) {
321
+ var event = eventData.event,
322
+ value = eventData.value,
323
+ target = eventData.target;
324
+ if (!target || !value || this.$props.readonly || this.$props.disabled) {
325
+ return;
326
+ }
327
+ if (this.$props.precision === 'half') {
328
+ var rect = target.getBoundingClientRect();
329
+ var isFirstHalf = (0, utils_1.calcIsFirstHalf)(this.$props.dir ? this.$props.dir : 'ltr', rect, eventData.event.clientX);
330
+ var payload = isFirstHalf ? (0, utils_1.toRound)(value - this.$props.step / 2, this.base) : value;
331
+ this.dispatchValue({
332
+ type: rating_reducer_1.RATING_ACTION.select,
333
+ payload: payload,
334
+ event: event
335
+ });
336
+ } else {
337
+ this.dispatchValue({
338
+ type: rating_reducer_1.RATING_ACTION.select,
339
+ payload: value,
340
+ event: event
341
+ });
342
+ }
343
+ this.$emit('click', event);
344
+ },
345
+ handleMouseMove: function handleMouseMove(eventData) {
346
+ var event = eventData.event,
347
+ value = eventData.value,
348
+ target = eventData.target;
349
+ if (!target || !value) {
350
+ return;
351
+ }
352
+ if (this.$props.precision === 'half') {
353
+ var rect = target.getBoundingClientRect();
354
+ var isFirstHalf = (0, utils_1.calcIsFirstHalf)(this.$props.dir ? this.$props.dir : 'ltr', rect, event.clientX);
355
+ var payload = isFirstHalf ? value - this.$props.step / 2 : value;
356
+ this.dispatchHover({
357
+ type: rating_reducer_1.RATING_ACTION.select,
358
+ payload: payload,
359
+ event: event
360
+ });
361
+ } else {
362
+ this.dispatchHover({
363
+ type: rating_reducer_1.RATING_ACTION.select,
364
+ payload: value,
365
+ event: event
366
+ });
367
+ }
368
+ },
369
+ handleMouseLeave: function handleMouseLeave(eventData) {
370
+ this.dispatchHover({
371
+ type: rating_reducer_1.RATING_ACTION.reset,
372
+ event: eventData.event
373
+ });
374
+ },
375
+ dispatchValue: function dispatchValue(action) {
376
+ var args = {
377
+ state: this.$props.value,
378
+ min: this.$props.min,
379
+ max: this.$props.max,
380
+ step: this.base
381
+ };
382
+ var state = args.state || this.$data.currentValue;
383
+ var newState = (0, rating_reducer_1.ratingReducer)(state, __assign(__assign({}, action), args));
384
+ var event = action.event;
385
+ this.handleChange(newState, event);
386
+ this.$data.currentValue = newState;
387
+ },
388
+ dispatchHover: function dispatchHover(action) {
389
+ var args = {
390
+ state: this.$props.value,
391
+ min: this.$props.min,
392
+ max: this.$props.max,
393
+ step: this.base,
394
+ precision: this.$props.precision
395
+ };
396
+ var state = args.state;
397
+ var newState = (0, rating_reducer_1.ratingReducer)(state, __assign(__assign({}, action), args));
398
+ this.$data.currentHovered = newState;
399
+ }
400
+ }
401
+ };
402
+ exports.RatingVue2 = RatingVue2;
403
+ /**
404
+ * @hidden
405
+ */
406
+ var Rating = RatingVue2;
407
+ exports.Rating = Rating;
@@ -0,0 +1,46 @@
1
+ import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from '../additionalTypes';
2
+ import { RatingItemProps } from './interfaces/RatingItemProps';
3
+ declare type DefaultData<V> = object | ((this: V) => {});
4
+ declare type DefaultMethods<V> = {
5
+ [key: string]: (this: V, ...args: any[]) => any;
6
+ };
7
+ /**
8
+ * @hidden
9
+ */
10
+ export interface RatingItemState {
11
+ }
12
+ /**
13
+ * @hidden
14
+ */
15
+ export interface RatingItemComputed {
16
+ [key: string]: any;
17
+ }
18
+ /**
19
+ * @hidden
20
+ */
21
+ export interface RatingItemMethods {
22
+ [key: string]: any;
23
+ handleClick: (e: MouseEvent) => void;
24
+ handleKeyDown: (e: KeyboardEvent) => void;
25
+ handleFocus: (e: FocusEvent) => void;
26
+ handleBlur: (e: FocusEvent) => void;
27
+ handleMouseEnter: (e: MouseEvent) => void;
28
+ handleMouseLeave: (e: MouseEvent) => void;
29
+ handleMouseMove: (e: MouseEvent) => void;
30
+ }
31
+ /**
32
+ * @hidden
33
+ */
34
+ export interface RatingItemData {
35
+ }
36
+ /**
37
+ * @hidden
38
+ */
39
+ export interface RatingItemAll extends Vue2type, RatingItemMethods, RatingItemData, RatingItemComputed, RatingItemState {
40
+ }
41
+ /**
42
+ * @hidden
43
+ */
44
+ declare let RatingItemVue2: ComponentOptions<RatingItemAll, DefaultData<RatingItemData>, DefaultMethods<RatingItemAll>, RatingItemComputed, RecordPropsDefinition<RatingItemProps>>;
45
+ declare const RatingItem: DefineComponent<RatingItemProps, any, RatingItemData, RatingItemComputed, RatingItemMethods, {}, {}, {}, string, RatingItemProps, RatingItemProps, {}>;
46
+ export { RatingItem, RatingItemVue2 };