@progress/kendo-vue-layout 2.6.3 → 2.6.4
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/dist/cdn/js/kendo-vue-layout.js +1 -1
- package/dist/es/drawer/Drawer.d.ts +47 -0
- package/dist/es/drawer/Drawer.js +186 -0
- package/dist/es/drawer/DrawerContent.d.ts +36 -0
- package/dist/es/drawer/DrawerContent.js +26 -0
- package/dist/es/drawer/DrawerItem.d.ts +38 -0
- package/dist/es/drawer/DrawerItem.js +108 -0
- package/dist/es/drawer/DrawerNavigation.d.ts +45 -0
- package/dist/es/drawer/DrawerNavigation.js +182 -0
- package/dist/es/drawer/context/DrawerContext.d.ts +17 -0
- package/dist/es/drawer/context/DrawerContext.js +13 -0
- package/dist/es/drawer/interfaces/DrawerAnimation.d.ts +14 -0
- package/dist/es/drawer/interfaces/DrawerAnimation.js +0 -0
- package/dist/es/drawer/interfaces/DrawerContentProps.d.ts +5 -0
- package/dist/es/drawer/interfaces/DrawerContentProps.js +0 -0
- package/dist/es/drawer/interfaces/DrawerItemHandle.d.ts +17 -0
- package/dist/es/drawer/interfaces/DrawerItemHandle.js +0 -0
- package/dist/es/drawer/interfaces/DrawerItemProps.d.ts +43 -0
- package/dist/es/drawer/interfaces/DrawerItemProps.js +0 -0
- package/dist/es/drawer/interfaces/DrawerNavigationProps.d.ts +5 -0
- package/dist/es/drawer/interfaces/DrawerNavigationProps.js +0 -0
- package/dist/es/drawer/interfaces/DrawerProps.d.ts +69 -0
- package/dist/es/drawer/interfaces/DrawerProps.js +0 -0
- package/dist/es/drawer/interfaces/DrawerSelectEvent.d.ts +13 -0
- package/dist/es/drawer/interfaces/DrawerSelectEvent.js +0 -0
- package/dist/es/main.d.ts +21 -0
- package/dist/es/main.js +21 -0
- package/dist/es/menu/MenuProps.d.ts +2 -2
- package/dist/es/menu/components/Menu.js +5 -1
- package/dist/es/menu/models/BaseMenuItem.d.ts +3 -3
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/stepper/Step.d.ts +38 -0
- package/dist/es/stepper/Step.js +197 -0
- package/dist/es/stepper/Stepper.d.ts +39 -0
- package/dist/es/stepper/Stepper.js +351 -0
- package/dist/es/stepper/contants.d.ts +8 -0
- package/dist/es/stepper/contants.js +8 -0
- package/dist/es/stepper/context/StepperContext.d.ts +16 -0
- package/dist/es/stepper/context/StepperContext.js +8 -0
- package/dist/es/stepper/interfaces/StepChangeEvent.d.ts +9 -0
- package/dist/es/stepper/interfaces/StepChangeEvent.js +0 -0
- package/dist/es/stepper/interfaces/StepFocusEvent.d.ts +5 -0
- package/dist/es/stepper/interfaces/StepFocusEvent.js +0 -0
- package/dist/es/stepper/interfaces/StepHandle.d.ts +13 -0
- package/dist/es/stepper/interfaces/StepHandle.js +3 -0
- package/dist/es/stepper/interfaces/StepProps.d.ts +67 -0
- package/dist/es/stepper/interfaces/StepProps.js +0 -0
- package/dist/es/stepper/interfaces/StepperChangeEvent.d.ts +9 -0
- package/dist/es/stepper/interfaces/StepperChangeEvent.js +0 -0
- package/dist/es/stepper/interfaces/StepperFocusEvent.d.ts +5 -0
- package/dist/es/stepper/interfaces/StepperFocusEvent.js +0 -0
- package/dist/es/stepper/interfaces/StepperHandle.d.ts +13 -0
- package/dist/es/stepper/interfaces/StepperHandle.js +3 -0
- package/dist/es/stepper/interfaces/StepperOnNavigateEvent.d.ts +23 -0
- package/dist/es/stepper/interfaces/StepperOnNavigateEvent.js +15 -0
- package/dist/es/stepper/interfaces/StepperProps.d.ts +80 -0
- package/dist/es/stepper/interfaces/StepperProps.js +0 -0
- package/dist/es/stepper/messages/index.d.ts +10 -0
- package/dist/es/stepper/messages/index.js +11 -0
- package/dist/npm/drawer/Drawer.d.ts +47 -0
- package/dist/npm/drawer/Drawer.js +198 -0
- package/dist/npm/drawer/DrawerContent.d.ts +36 -0
- package/dist/npm/drawer/DrawerContent.js +36 -0
- package/dist/npm/drawer/DrawerItem.d.ts +38 -0
- package/dist/npm/drawer/DrawerItem.js +118 -0
- package/dist/npm/drawer/DrawerNavigation.d.ts +45 -0
- package/dist/npm/drawer/DrawerNavigation.js +193 -0
- package/dist/npm/drawer/context/DrawerContext.d.ts +17 -0
- package/dist/npm/drawer/context/DrawerContext.js +15 -0
- package/dist/npm/drawer/interfaces/DrawerAnimation.d.ts +14 -0
- package/dist/npm/drawer/interfaces/DrawerAnimation.js +2 -0
- package/dist/npm/drawer/interfaces/DrawerContentProps.d.ts +5 -0
- package/dist/npm/drawer/interfaces/DrawerContentProps.js +2 -0
- package/dist/npm/drawer/interfaces/DrawerItemHandle.d.ts +17 -0
- package/dist/npm/drawer/interfaces/DrawerItemHandle.js +2 -0
- package/dist/npm/drawer/interfaces/DrawerItemProps.d.ts +43 -0
- package/dist/npm/drawer/interfaces/DrawerItemProps.js +2 -0
- package/dist/npm/drawer/interfaces/DrawerNavigationProps.d.ts +5 -0
- package/dist/npm/drawer/interfaces/DrawerNavigationProps.js +2 -0
- package/dist/npm/drawer/interfaces/DrawerProps.d.ts +69 -0
- package/dist/npm/drawer/interfaces/DrawerProps.js +2 -0
- package/dist/npm/drawer/interfaces/DrawerSelectEvent.d.ts +13 -0
- package/dist/npm/drawer/interfaces/DrawerSelectEvent.js +2 -0
- package/dist/npm/main.d.ts +21 -0
- package/dist/npm/main.js +21 -0
- package/dist/npm/menu/MenuProps.d.ts +2 -2
- package/dist/npm/menu/components/Menu.js +5 -1
- package/dist/npm/menu/models/BaseMenuItem.d.ts +3 -3
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/stepper/Step.d.ts +38 -0
- package/dist/npm/stepper/Step.js +210 -0
- package/dist/npm/stepper/Stepper.d.ts +39 -0
- package/dist/npm/stepper/Stepper.js +366 -0
- package/dist/npm/stepper/contants.d.ts +8 -0
- package/dist/npm/stepper/contants.js +11 -0
- package/dist/npm/stepper/context/StepperContext.d.ts +16 -0
- package/dist/npm/stepper/context/StepperContext.js +10 -0
- package/dist/npm/stepper/interfaces/StepChangeEvent.d.ts +9 -0
- package/dist/npm/stepper/interfaces/StepChangeEvent.js +2 -0
- package/dist/npm/stepper/interfaces/StepFocusEvent.d.ts +5 -0
- package/dist/npm/stepper/interfaces/StepFocusEvent.js +2 -0
- package/dist/npm/stepper/interfaces/StepHandle.d.ts +13 -0
- package/dist/npm/stepper/interfaces/StepHandle.js +5 -0
- package/dist/npm/stepper/interfaces/StepProps.d.ts +67 -0
- package/dist/npm/stepper/interfaces/StepProps.js +2 -0
- package/dist/npm/stepper/interfaces/StepperChangeEvent.d.ts +9 -0
- package/dist/npm/stepper/interfaces/StepperChangeEvent.js +2 -0
- package/dist/npm/stepper/interfaces/StepperFocusEvent.d.ts +5 -0
- package/dist/npm/stepper/interfaces/StepperFocusEvent.js +2 -0
- package/dist/npm/stepper/interfaces/StepperHandle.d.ts +13 -0
- package/dist/npm/stepper/interfaces/StepperHandle.js +5 -0
- package/dist/npm/stepper/interfaces/StepperOnNavigateEvent.d.ts +23 -0
- package/dist/npm/stepper/interfaces/StepperOnNavigateEvent.js +18 -0
- package/dist/npm/stepper/interfaces/StepperProps.d.ts +80 -0
- package/dist/npm/stepper/interfaces/StepperProps.js +2 -0
- package/dist/npm/stepper/messages/index.d.ts +10 -0
- package/dist/npm/stepper/messages/index.js +14 -0
- package/package.json +11 -9
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StepVue3 = exports.Step = void 0; // @ts-ignore
|
|
7
|
+
|
|
8
|
+
var Vue = require("vue");
|
|
9
|
+
|
|
10
|
+
var allVue = Vue;
|
|
11
|
+
var gh = allVue.h;
|
|
12
|
+
var inject = allVue.inject;
|
|
13
|
+
|
|
14
|
+
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
15
|
+
|
|
16
|
+
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
|
|
17
|
+
|
|
18
|
+
var contants_1 = require("./contants");
|
|
19
|
+
|
|
20
|
+
var messages_1 = require("./messages"); // tslint:enable:max-line-length
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var Step = {
|
|
24
|
+
name: 'KendoStep',
|
|
25
|
+
props: {
|
|
26
|
+
current: Boolean,
|
|
27
|
+
disabled: Boolean,
|
|
28
|
+
icon: String,
|
|
29
|
+
index: Number,
|
|
30
|
+
isValid: Boolean,
|
|
31
|
+
focused: Boolean,
|
|
32
|
+
label: String,
|
|
33
|
+
optional: Boolean,
|
|
34
|
+
tabIndex: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 0
|
|
37
|
+
},
|
|
38
|
+
text: String,
|
|
39
|
+
animationDuration: [Boolean, Number],
|
|
40
|
+
isVertical: Boolean,
|
|
41
|
+
item: [String, Object, Boolean, Function],
|
|
42
|
+
linear: Boolean,
|
|
43
|
+
mode: String,
|
|
44
|
+
numOfSteps: Number,
|
|
45
|
+
value: Number,
|
|
46
|
+
successIcon: String,
|
|
47
|
+
errorIcon: String
|
|
48
|
+
},
|
|
49
|
+
inject: {
|
|
50
|
+
kendoLocalizationService: {
|
|
51
|
+
default: null
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
itemClassNames: function itemClassNames() {
|
|
56
|
+
var _a = this.$props,
|
|
57
|
+
current = _a.current,
|
|
58
|
+
disabled = _a.disabled,
|
|
59
|
+
focused = _a.focused,
|
|
60
|
+
index = _a.index,
|
|
61
|
+
isValid = _a.isValid,
|
|
62
|
+
optional = _a.optional;
|
|
63
|
+
return {
|
|
64
|
+
'k-step': true,
|
|
65
|
+
'k-step-first': index === 0,
|
|
66
|
+
'k-step-last': this.numOfSteps && index === this.numOfSteps - 1,
|
|
67
|
+
'k-step-done': index < this.value,
|
|
68
|
+
'k-step-current': current,
|
|
69
|
+
'k-step-optional': optional,
|
|
70
|
+
'k-step-disabled': disabled,
|
|
71
|
+
'k-step-focus': focused,
|
|
72
|
+
'k-step-error': isValid !== undefined && !isValid,
|
|
73
|
+
'k-step-success': isValid
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
itemStyles: function itemStyles() {
|
|
77
|
+
var index = this.$props.index;
|
|
78
|
+
var allowClick = !this.linear || index === this.value - 1 || index === this.value || index === this.value + 1;
|
|
79
|
+
return {
|
|
80
|
+
maxWidth: !this.isVertical ? "calc(100% / " + this.numOfSteps + ")" : undefined,
|
|
81
|
+
pointerEvents: !allowClick ? 'none' : undefined
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
setup: !gh ? undefined : function () {
|
|
87
|
+
var v3 = !!gh;
|
|
88
|
+
var kendoLocalizationService = inject('kendoLocalizationService', {});
|
|
89
|
+
return {
|
|
90
|
+
v3: v3,
|
|
91
|
+
kendoLocalizationService: kendoLocalizationService
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
render: function render(createElement) {
|
|
96
|
+
var h = gh || createElement;
|
|
97
|
+
var defaultSlots = kendo_vue_common_1.getDefaultSlots(this);
|
|
98
|
+
var _a = this.$props,
|
|
99
|
+
current = _a.current,
|
|
100
|
+
disabled = _a.disabled,
|
|
101
|
+
focused = _a.focused,
|
|
102
|
+
icon = _a.icon,
|
|
103
|
+
index = _a.index,
|
|
104
|
+
isValid = _a.isValid,
|
|
105
|
+
label = _a.label,
|
|
106
|
+
optional = _a.optional,
|
|
107
|
+
tabIndex = _a.tabIndex,
|
|
108
|
+
text = _a.text,
|
|
109
|
+
animationDuration = _a.animationDuration,
|
|
110
|
+
item = _a.item,
|
|
111
|
+
linear = _a.linear,
|
|
112
|
+
mode = _a.mode,
|
|
113
|
+
value = _a.value,
|
|
114
|
+
successIcon = _a.successIcon,
|
|
115
|
+
errorIcon = _a.errorIcon;
|
|
116
|
+
var allowClick = !linear || index === value - 1 || index === value || index === value + 1;
|
|
117
|
+
var isInLabel = mode === 'labels' || Boolean(icon) && Boolean(label);
|
|
118
|
+
var localizationService = kendo_vue_intl_1.provideLocalizationService(this);
|
|
119
|
+
|
|
120
|
+
var localizeMessage = function localizeMessage(message) {
|
|
121
|
+
return localizationService.toLanguageString(message, messages_1.messages[message]);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
var optionalMessage = localizeMessage(messages_1.optionalText);
|
|
125
|
+
var progressAnimation = typeof animationDuration === 'number' ? animationDuration : animationDuration !== false ? contants_1.DEFAULT_ANIMATION_DURATION : contants_1.NO_ANIMATION;
|
|
126
|
+
var validationIconClasses = isValid ? successIcon ? "" + successIcon : 'k-icon k-i-check' : errorIcon ? "" + errorIcon : 'k-icon k-i-warning';
|
|
127
|
+
var validationIcons = h("span", {
|
|
128
|
+
"class": 'k-step-indicator-icon ' + validationIconClasses,
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
attrs: this.v3 ? undefined : {
|
|
131
|
+
"aria-hidden": "true"
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
var stepIndicator = function stepIndicator() {
|
|
136
|
+
return mode !== 'labels' ? h("span", {
|
|
137
|
+
"class": "k-step-indicator",
|
|
138
|
+
"aria-hidden": true,
|
|
139
|
+
attrs: this.v3 ? undefined : {
|
|
140
|
+
"aria-hidden": true
|
|
141
|
+
},
|
|
142
|
+
style: {
|
|
143
|
+
transitionDuration: progressAnimation + 'ms'
|
|
144
|
+
}
|
|
145
|
+
}, [icon ? !isInLabel && isValid !== undefined ? validationIcons : h("span", {
|
|
146
|
+
"class": "k-step-indicator-icon k-icon " + icon
|
|
147
|
+
}) : isValid !== undefined ? validationIcons : h("span", {
|
|
148
|
+
"class": "k-step-indicator-text"
|
|
149
|
+
}, [text ? text : index + 1])]) : null;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var stepLabel = function stepLabel() {
|
|
153
|
+
return h("span", {
|
|
154
|
+
"class": "k-step-label"
|
|
155
|
+
}, [label && h("span", {
|
|
156
|
+
"class": "k-step-text"
|
|
157
|
+
}, [label]), isInLabel && isValid !== undefined && validationIcons, optional && h("span", {
|
|
158
|
+
"class": "k-step-label-optional"
|
|
159
|
+
}, [optionalMessage])]);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
return h("li", {
|
|
163
|
+
"class": this.itemClassNames,
|
|
164
|
+
style: this.itemStyles
|
|
165
|
+
}, [h("a", {
|
|
166
|
+
"class": "k-step-link",
|
|
167
|
+
title: label ? label : undefined,
|
|
168
|
+
attrs: this.v3 ? undefined : {
|
|
169
|
+
title: label ? label : undefined,
|
|
170
|
+
tabIndex: tabIndex ? tabIndex : focused ? 0 : -1,
|
|
171
|
+
"aria-current": current ? 'step' : undefined,
|
|
172
|
+
"aria-disabled": disabled || !allowClick || undefined,
|
|
173
|
+
"aria-invalid": isValid !== undefined && !isValid || undefined
|
|
174
|
+
},
|
|
175
|
+
onClick: this.handleClick,
|
|
176
|
+
on: this.v3 ? undefined : {
|
|
177
|
+
"click": this.handleClick,
|
|
178
|
+
"focusin": this.handleFocus
|
|
179
|
+
},
|
|
180
|
+
onFocusin: this.handleFocus,
|
|
181
|
+
tabIndex: tabIndex ? tabIndex : focused ? 0 : -1,
|
|
182
|
+
"aria-current": current ? 'step' : undefined,
|
|
183
|
+
"aria-disabled": disabled || !allowClick || undefined,
|
|
184
|
+
"aria-invalid": isValid !== undefined && !isValid || undefined
|
|
185
|
+
}, [!item ? [stepIndicator.call(this), stepLabel.call(this)] : defaultSlots])]);
|
|
186
|
+
},
|
|
187
|
+
methods: {
|
|
188
|
+
focus: function focus() {
|
|
189
|
+
if (this.$el) {
|
|
190
|
+
kendo_vue_common_1.focusFirstFocusableChild(this.$el);
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
handleClick: function handleClick(event) {
|
|
194
|
+
if (!this.disabled) {
|
|
195
|
+
this.$emit('change', {
|
|
196
|
+
event: event,
|
|
197
|
+
value: this.index
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
handleFocus: function handleFocus(event) {
|
|
202
|
+
if (!this.disabled) {
|
|
203
|
+
this.$emit('focus', event);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
exports.Step = Step;
|
|
209
|
+
var StepVue3 = Step;
|
|
210
|
+
exports.StepVue3 = StepVue3;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DefineComponent } from '../additionalTypes';
|
|
2
|
+
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
3
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
4
|
+
declare type DefaultMethods<V> = {
|
|
5
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
6
|
+
};
|
|
7
|
+
import { StepperProps } from './interfaces/StepperProps';
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
export interface StepperState {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export interface StepperComputed {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @hidden
|
|
20
|
+
*/
|
|
21
|
+
export interface StepperMethods {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
setStepper: () => void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export interface StepperData {
|
|
29
|
+
focusedIdx: number;
|
|
30
|
+
currentDir: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
export interface StepperAll extends Vue, StepperMethods, StepperData, StepperComputed, StepperState {
|
|
36
|
+
}
|
|
37
|
+
declare let Stepper: ComponentOptions<StepperAll, DefaultData<StepperData>, DefaultMethods<StepperAll>, StepperComputed, RecordPropsDefinition<StepperProps>>;
|
|
38
|
+
declare const StepperVue3: DefineComponent<StepperProps, any, StepperData, StepperComputed, StepperMethods, {}, {}, {}, string, StepperProps, StepperProps, {}>;
|
|
39
|
+
export { Stepper, StepperVue3 };
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StepperVue3 = exports.Stepper = void 0; // @ts-ignore
|
|
7
|
+
|
|
8
|
+
var Vue = require("vue");
|
|
9
|
+
|
|
10
|
+
var allVue = Vue;
|
|
11
|
+
var gh = allVue.h;
|
|
12
|
+
|
|
13
|
+
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
14
|
+
|
|
15
|
+
var Step_1 = require("./Step");
|
|
16
|
+
|
|
17
|
+
var kendo_vue_progressbars_1 = require("@progress/kendo-vue-progressbars");
|
|
18
|
+
|
|
19
|
+
var contants_1 = require("./contants");
|
|
20
|
+
|
|
21
|
+
var kendo_vue_common_2 = require("@progress/kendo-vue-common");
|
|
22
|
+
|
|
23
|
+
var package_metadata_1 = require("../package-metadata"); // tslint:enable:max-line-length
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
var Stepper = {
|
|
27
|
+
name: 'KendoStepper',
|
|
28
|
+
props: {
|
|
29
|
+
animationDuration: {
|
|
30
|
+
type: [Boolean, Number],
|
|
31
|
+
default: 400
|
|
32
|
+
},
|
|
33
|
+
dir: String,
|
|
34
|
+
disabled: Boolean,
|
|
35
|
+
item: {
|
|
36
|
+
type: [String, Object, Function, Boolean],
|
|
37
|
+
default: undefined
|
|
38
|
+
},
|
|
39
|
+
items: Array,
|
|
40
|
+
linear: Boolean,
|
|
41
|
+
mode: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'steps',
|
|
44
|
+
validator: function validator(value) {
|
|
45
|
+
return ['steps', 'labels'].includes(value);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
orientation: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'horizontal',
|
|
51
|
+
validator: function validator(value) {
|
|
52
|
+
return ['horizontal', 'vertical'].includes(value);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
value: {
|
|
56
|
+
type: Number,
|
|
57
|
+
required: true,
|
|
58
|
+
default: 0
|
|
59
|
+
},
|
|
60
|
+
successIcon: String,
|
|
61
|
+
errorIcon: String
|
|
62
|
+
},
|
|
63
|
+
created: function created() {
|
|
64
|
+
kendo_vue_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
65
|
+
this.focusedIdx = this.$props.value;
|
|
66
|
+
},
|
|
67
|
+
mounted: function mounted() {
|
|
68
|
+
this.currentDir = this.$props.dir !== undefined ? this.$props.dir : kendo_vue_common_2.isRtl(this.$el) ? 'rtl' : 'ltr';
|
|
69
|
+
},
|
|
70
|
+
data: function data() {
|
|
71
|
+
return {
|
|
72
|
+
currentDir: 'ltr',
|
|
73
|
+
focusedIdx: 0,
|
|
74
|
+
stepper: {}
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
isVertical: function isVertical() {
|
|
79
|
+
return this.$props.orientation === 'vertical';
|
|
80
|
+
},
|
|
81
|
+
numOfSteps: function numOfSteps() {
|
|
82
|
+
var items = this.$props.items;
|
|
83
|
+
return items ? items.length : 0;
|
|
84
|
+
},
|
|
85
|
+
stepperClasses: function stepperClasses() {
|
|
86
|
+
return {
|
|
87
|
+
'k-stepper': true,
|
|
88
|
+
'k-stepper-linear': this.$props.linear
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
stepperStyles: function stepperStyles() {
|
|
92
|
+
return {
|
|
93
|
+
display: 'grid',
|
|
94
|
+
gridTemplateColumns: !this.isVertical ? 'repeat(' + this.numOfSteps * 2 + ', 1fr)' : undefined,
|
|
95
|
+
gridTemplateRows: this.isVertical ? 'repeat(' + this.numOfSteps * 4 + ', 1fr)' : undefined
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
listClasses: function listClasses() {
|
|
99
|
+
return {
|
|
100
|
+
'k-step-list': true,
|
|
101
|
+
'k-step-list-horizontal': !this.isVertical,
|
|
102
|
+
'k-step-list-vertical': this.isVertical
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
listStyles: function listStyles() {
|
|
106
|
+
return {
|
|
107
|
+
gridColumnStart: !this.isVertical ? 1 : undefined,
|
|
108
|
+
gridColumnEnd: !this.isVertical ? -1 : undefined,
|
|
109
|
+
gridRowStart: this.isVertical ? 1 : undefined,
|
|
110
|
+
gridRowEnd: this.isVertical ? -1 : undefined
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
progressbarStyles: function progressbarStyles() {
|
|
114
|
+
return {
|
|
115
|
+
gridColumnStart: !this.isVertical ? 2 : undefined,
|
|
116
|
+
gridColumnEnd: !this.isVertical ? this.numOfSteps * 2 : undefined,
|
|
117
|
+
gridRowStart: this.isVertical ? 2 : undefined,
|
|
118
|
+
gridRowEnd: this.isVertical ? this.numOfSteps * 4 - 2 : undefined
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
setup: !gh ? undefined : function () {
|
|
124
|
+
var v3 = !!gh;
|
|
125
|
+
return {
|
|
126
|
+
v3: v3
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
// @ts-ignore
|
|
130
|
+
render: function render(createElement) {
|
|
131
|
+
var h = gh || createElement;
|
|
132
|
+
var _a = this.$props,
|
|
133
|
+
animationDuration = _a.animationDuration,
|
|
134
|
+
children = _a.children,
|
|
135
|
+
disabled = _a.disabled,
|
|
136
|
+
items = _a.items,
|
|
137
|
+
orientation = _a.orientation;
|
|
138
|
+
var value = this.$props.value;
|
|
139
|
+
var animation = typeof animationDuration === 'number' ? animationDuration : animationDuration !== false ? contants_1.DEFAULT_ANIMATION_DURATION : contants_1.NO_ANIMATION;
|
|
140
|
+
var steps = items && items.map(function (element, index) {
|
|
141
|
+
var step = this.$props.item ? kendo_vue_common_2.templateRendering.call(this, this.$props.item, kendo_vue_common_2.getListeners.call(this)) : undefined;
|
|
142
|
+
var stepDefaultRendering = // @ts-ignore
|
|
143
|
+
h(Step_1.Step, {
|
|
144
|
+
key: index,
|
|
145
|
+
index: index,
|
|
146
|
+
attrs: this.v3 ? undefined : {
|
|
147
|
+
index: index,
|
|
148
|
+
disabled: disabled || element.disabled,
|
|
149
|
+
focused: index === this.focusedIdx,
|
|
150
|
+
current: index === value,
|
|
151
|
+
icon: element.icon,
|
|
152
|
+
label: element.label,
|
|
153
|
+
optional: element.optional,
|
|
154
|
+
text: element.text,
|
|
155
|
+
isValid: element.isValid,
|
|
156
|
+
tabIndex: element.tabIndex,
|
|
157
|
+
animationDuration: this.animationDuration,
|
|
158
|
+
isVertical: this.isVertical,
|
|
159
|
+
item: this.item,
|
|
160
|
+
linear: this.linear,
|
|
161
|
+
mode: this.mode,
|
|
162
|
+
numOfSteps: this.numOfSteps,
|
|
163
|
+
value: this.value,
|
|
164
|
+
successIcon: this.successIcon,
|
|
165
|
+
errorIcon: this.errorIcon
|
|
166
|
+
},
|
|
167
|
+
disabled: disabled || element.disabled,
|
|
168
|
+
focused: index === this.focusedIdx,
|
|
169
|
+
current: index === value,
|
|
170
|
+
onChange: this.handleChange,
|
|
171
|
+
on: this.v3 ? undefined : {
|
|
172
|
+
"change": this.handleChange,
|
|
173
|
+
"focus": this.handleFocus
|
|
174
|
+
},
|
|
175
|
+
onFocus: this.handleFocus,
|
|
176
|
+
"class": element.class,
|
|
177
|
+
style: element.style,
|
|
178
|
+
icon: element.icon,
|
|
179
|
+
label: element.label,
|
|
180
|
+
optional: element.optional,
|
|
181
|
+
text: element.text,
|
|
182
|
+
isValid: element.isValid,
|
|
183
|
+
tabIndex: element.tabIndex,
|
|
184
|
+
animationDuration: this.animationDuration,
|
|
185
|
+
isVertical: this.isVertical,
|
|
186
|
+
item: this.item,
|
|
187
|
+
linear: this.linear,
|
|
188
|
+
mode: this.mode,
|
|
189
|
+
numOfSteps: this.numOfSteps,
|
|
190
|
+
value: this.value,
|
|
191
|
+
successIcon: this.successIcon,
|
|
192
|
+
errorIcon: this.errorIcon
|
|
193
|
+
});
|
|
194
|
+
var stepRendering = kendo_vue_common_2.getTemplate.call(this, {
|
|
195
|
+
h: h,
|
|
196
|
+
template: step,
|
|
197
|
+
defaultRendering: stepDefaultRendering,
|
|
198
|
+
additionalProps: element,
|
|
199
|
+
additionalListeners: {
|
|
200
|
+
change: this.handleChange,
|
|
201
|
+
focus: this.handleFocus
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return stepRendering;
|
|
205
|
+
}, this);
|
|
206
|
+
return h("nav", {
|
|
207
|
+
"class": this.stepperClasses,
|
|
208
|
+
style: this.stepperStyles,
|
|
209
|
+
dir: this.currentDir,
|
|
210
|
+
attrs: this.v3 ? undefined : {
|
|
211
|
+
dir: this.currentDir
|
|
212
|
+
},
|
|
213
|
+
onKeydown: this.handleKeyDown,
|
|
214
|
+
on: this.v3 ? undefined : {
|
|
215
|
+
"keydown": this.handleKeyDown
|
|
216
|
+
}
|
|
217
|
+
}, [h("ol", {
|
|
218
|
+
"class": this.listClasses,
|
|
219
|
+
style: this.listStyles
|
|
220
|
+
}, [steps ? steps : children]), // @ts-ignore
|
|
221
|
+
h(kendo_vue_progressbars_1.ProgressBar, {
|
|
222
|
+
style: this.progressbarStyles,
|
|
223
|
+
animation: {
|
|
224
|
+
duration: animation
|
|
225
|
+
},
|
|
226
|
+
attrs: this.v3 ? undefined : {
|
|
227
|
+
animation: {
|
|
228
|
+
duration: animation
|
|
229
|
+
},
|
|
230
|
+
"aria-hidden": true,
|
|
231
|
+
max: this.numOfSteps - 1,
|
|
232
|
+
labelVisible: false,
|
|
233
|
+
orientation: orientation,
|
|
234
|
+
reverse: orientation === 'vertical',
|
|
235
|
+
value: value,
|
|
236
|
+
disabled: disabled,
|
|
237
|
+
tabIndex: -1
|
|
238
|
+
},
|
|
239
|
+
"aria-hidden": true,
|
|
240
|
+
max: this.numOfSteps - 1,
|
|
241
|
+
labelVisible: false,
|
|
242
|
+
orientation: orientation,
|
|
243
|
+
reverse: orientation === 'vertical',
|
|
244
|
+
value: value,
|
|
245
|
+
disabled: disabled,
|
|
246
|
+
tabIndex: -1
|
|
247
|
+
})]);
|
|
248
|
+
},
|
|
249
|
+
methods: {
|
|
250
|
+
focus: function focus() {
|
|
251
|
+
if (this.$el) {
|
|
252
|
+
kendo_vue_common_1.focusFirstFocusableChild(this.$el);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
dispatchChangeEvent: function dispatchChangeEvent(event, val) {
|
|
256
|
+
var prevIdx = val === this.value - 1;
|
|
257
|
+
var currIdx = val === this.value;
|
|
258
|
+
var nextIdx = val === this.value + 1;
|
|
259
|
+
var allowClick = !this.linear || prevIdx || currIdx || nextIdx;
|
|
260
|
+
|
|
261
|
+
if (this.value !== val && !this.disabled && allowClick) {
|
|
262
|
+
this.focusedIdx = val;
|
|
263
|
+
this.$emit('change', {
|
|
264
|
+
event: event,
|
|
265
|
+
value: val
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
handleChange: function handleChange(event) {
|
|
270
|
+
var currentValue = event.value;
|
|
271
|
+
this.dispatchChangeEvent(event, currentValue);
|
|
272
|
+
},
|
|
273
|
+
handleFocus: function handleFocus(event) {
|
|
274
|
+
if (!this.disabled) {
|
|
275
|
+
this.$emit('focus', event, undefined);
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
handleEnter: function handleEnter(event) {
|
|
279
|
+
this.dispatchChangeEvent(event, this.focusedIdx);
|
|
280
|
+
},
|
|
281
|
+
handleKeyDown: function handleKeyDown(event) {
|
|
282
|
+
var isCurrentRtl = this.currentDir === 'rtl';
|
|
283
|
+
var currIndex = this.focusedIdx;
|
|
284
|
+
var maxNavIndex = this.items.length - 1;
|
|
285
|
+
|
|
286
|
+
switch (event.keyCode) {
|
|
287
|
+
case kendo_vue_common_1.Keys.left:
|
|
288
|
+
event.preventDefault();
|
|
289
|
+
|
|
290
|
+
if (!isCurrentRtl && currIndex > 0) {
|
|
291
|
+
this.focusedIdx = currIndex - 1;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (isCurrentRtl && currIndex < maxNavIndex) {
|
|
295
|
+
this.focusedIdx = currIndex + 1;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
break;
|
|
299
|
+
|
|
300
|
+
case kendo_vue_common_1.Keys.right:
|
|
301
|
+
event.preventDefault();
|
|
302
|
+
|
|
303
|
+
if (!isCurrentRtl && currIndex < maxNavIndex) {
|
|
304
|
+
this.focusedIdx = currIndex + 1;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
if (isCurrentRtl && currIndex > 0) {
|
|
308
|
+
this.focusedIdx = currIndex - 1;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
break;
|
|
312
|
+
|
|
313
|
+
case kendo_vue_common_1.Keys.up:
|
|
314
|
+
event.preventDefault();
|
|
315
|
+
|
|
316
|
+
if (!isCurrentRtl && currIndex > 0) {
|
|
317
|
+
this.focusedIdx = currIndex - 1;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (isCurrentRtl && currIndex > 0) {
|
|
321
|
+
this.focusedIdx = currIndex - 1;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
break;
|
|
325
|
+
|
|
326
|
+
case kendo_vue_common_1.Keys.down:
|
|
327
|
+
event.preventDefault();
|
|
328
|
+
|
|
329
|
+
if (!isCurrentRtl && currIndex < maxNavIndex) {
|
|
330
|
+
this.focusedIdx = currIndex + 1;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (isCurrentRtl && currIndex < maxNavIndex) {
|
|
334
|
+
this.focusedIdx = currIndex + 1;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
break;
|
|
338
|
+
|
|
339
|
+
case kendo_vue_common_1.Keys.home:
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
this.focusedIdx = 0;
|
|
342
|
+
break;
|
|
343
|
+
|
|
344
|
+
case kendo_vue_common_1.Keys.end:
|
|
345
|
+
event.preventDefault();
|
|
346
|
+
this.focusedIdx = maxNavIndex;
|
|
347
|
+
break;
|
|
348
|
+
|
|
349
|
+
case kendo_vue_common_1.Keys.space:
|
|
350
|
+
case kendo_vue_common_1.Keys.enter:
|
|
351
|
+
event.preventDefault();
|
|
352
|
+
|
|
353
|
+
if (!this.items[currIndex].disabled) {
|
|
354
|
+
this.handleEnter(event);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
break;
|
|
358
|
+
|
|
359
|
+
default:
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
exports.Stepper = Stepper;
|
|
365
|
+
var StepperVue3 = Stepper;
|
|
366
|
+
exports.StepperVue3 = StepperVue3;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NO_ANIMATION = exports.DEFAULT_ANIMATION_DURATION = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @hidden
|
|
6
|
+
*/
|
|
7
|
+
exports.DEFAULT_ANIMATION_DURATION = 400;
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
exports.NO_ANIMATION = 0;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StepChangeEvent } from '../interfaces/StepChangeEvent';
|
|
2
|
+
import { StepFocusEvent } from '../interfaces/StepFocusEvent';
|
|
3
|
+
/** @hidden */
|
|
4
|
+
export declare type StepperContextType = {
|
|
5
|
+
animationDuration?: number | boolean;
|
|
6
|
+
isVertical?: boolean;
|
|
7
|
+
item?: any;
|
|
8
|
+
linear?: boolean;
|
|
9
|
+
mode?: 'steps' | 'labels';
|
|
10
|
+
numOfSteps?: number;
|
|
11
|
+
value: number;
|
|
12
|
+
successIcon?: string;
|
|
13
|
+
errorIcon?: string;
|
|
14
|
+
onChange?: (event: StepChangeEvent) => void;
|
|
15
|
+
onFocus?: (event: StepFocusEvent) => void;
|
|
16
|
+
};
|