@progress/kendo-vue-buttons 3.6.4-dev.202210071340 → 3.6.5-dev.202210181442
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-buttons.js +1 -1
- package/dist/es/Button.js +15 -22
- package/dist/es/ButtonGroup.js +2 -10
- package/dist/es/ButtonWrap.js +0 -2
- package/dist/es/Chip/Chip.js +6 -23
- package/dist/es/Chip/ChipList.js +4 -10
- package/dist/es/Chip/data-reducer.js +0 -6
- package/dist/es/Chip/focus-reducer.js +0 -8
- package/dist/es/Chip/selection-reducer.js +0 -19
- package/dist/es/FloatingActionButton/FloatingActionButton.js +20 -47
- package/dist/es/FloatingActionButton/FloatingActionButtonItem.js +6 -8
- package/dist/es/ListButton/ButtonItem.js +5 -9
- package/dist/es/ListButton/DropDownButton.js +20 -36
- package/dist/es/ListButton/SplitButton.js +22 -47
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/toolbar/Toolbar.js +2 -21
- package/dist/es/toolbar/tools/ToolbarItem.js +0 -2
- package/dist/es/toolbar/tools/ToolbarSeparator.js +2 -3
- package/dist/es/toolbar/tools/ToolbarSpacer.js +0 -2
- package/dist/esm/Button.js +15 -22
- package/dist/esm/ButtonGroup.js +2 -10
- package/dist/esm/ButtonWrap.js +0 -2
- package/dist/esm/Chip/Chip.js +6 -23
- package/dist/esm/Chip/ChipList.js +4 -10
- package/dist/esm/Chip/data-reducer.js +0 -6
- package/dist/esm/Chip/focus-reducer.js +0 -8
- package/dist/esm/Chip/selection-reducer.js +0 -19
- package/dist/esm/FloatingActionButton/FloatingActionButton.js +20 -47
- package/dist/esm/FloatingActionButton/FloatingActionButtonItem.js +6 -8
- package/dist/esm/ListButton/ButtonItem.js +5 -9
- package/dist/esm/ListButton/DropDownButton.js +20 -36
- package/dist/esm/ListButton/SplitButton.js +22 -47
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/toolbar/Toolbar.js +2 -21
- package/dist/esm/toolbar/tools/ToolbarItem.js +0 -2
- package/dist/esm/toolbar/tools/ToolbarSeparator.js +2 -3
- package/dist/esm/toolbar/tools/ToolbarSpacer.js +0 -2
- package/dist/npm/Button.js +17 -29
- package/dist/npm/ButtonGroup.js +4 -18
- package/dist/npm/ButtonWrap.js +2 -7
- package/dist/npm/Chip/Chip.js +8 -32
- package/dist/npm/Chip/ChipList.js +4 -18
- package/dist/npm/Chip/data-reducer.js +0 -8
- package/dist/npm/Chip/focus-reducer.js +0 -10
- package/dist/npm/Chip/selection-reducer.js +0 -20
- package/dist/npm/FloatingActionButton/FloatingActionButton.js +22 -56
- package/dist/npm/FloatingActionButton/FloatingActionButtonItem.js +8 -13
- package/dist/npm/ListButton/ButtonItem.js +7 -14
- package/dist/npm/ListButton/DropDownButton.js +20 -46
- package/dist/npm/ListButton/SplitButton.js +22 -57
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/toolbar/Toolbar.js +2 -26
- package/dist/npm/toolbar/tools/ToolbarItem.js +2 -7
- package/dist/npm/toolbar/tools/ToolbarSeparator.js +4 -8
- package/dist/npm/toolbar/tools/ToolbarSpacer.js +2 -5
- package/package.json +5 -5
package/dist/es/Button.js
CHANGED
|
@@ -10,7 +10,6 @@ var styles = util.styles;
|
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
13
|
var ButtonVue2 = {
|
|
15
14
|
name: 'KendoButton',
|
|
16
15
|
// @ts-ignore
|
|
@@ -96,18 +95,17 @@ var ButtonVue2 = {
|
|
|
96
95
|
},
|
|
97
96
|
buttonClasses: function buttonClasses() {
|
|
98
97
|
var _a;
|
|
99
|
-
|
|
100
98
|
var _b = this.$props,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
disabled = _b.disabled,
|
|
100
|
+
icon = _b.icon,
|
|
101
|
+
iconClass = _b.iconClass,
|
|
102
|
+
imageUrl = _b.imageUrl,
|
|
103
|
+
dir = _b.dir,
|
|
104
|
+
size = _b.size,
|
|
105
|
+
shape = _b.shape,
|
|
106
|
+
rounded = _b.rounded,
|
|
107
|
+
fillMode = _b.fillMode,
|
|
108
|
+
themeColor = _b.themeColor;
|
|
111
109
|
var hasIcon = icon !== undefined || iconClass !== undefined || imageUrl !== undefined;
|
|
112
110
|
var defaultSlot = getDefaultSlots(this);
|
|
113
111
|
var hasChildren = defaultSlot;
|
|
@@ -133,7 +131,6 @@ var ButtonVue2 = {
|
|
|
133
131
|
},
|
|
134
132
|
handleClick: function handleClick(event) {
|
|
135
133
|
this.toggleIfApplicable();
|
|
136
|
-
|
|
137
134
|
if (!this.disabled) {
|
|
138
135
|
this.$emit('click', event);
|
|
139
136
|
}
|
|
@@ -195,13 +192,12 @@ var ButtonVue2 = {
|
|
|
195
192
|
render: function render(createElement) {
|
|
196
193
|
var h = gh || createElement;
|
|
197
194
|
var _a = this.$props,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
195
|
+
togglable = _a.togglable,
|
|
196
|
+
icon = _a.icon,
|
|
197
|
+
iconClass = _a.iconClass,
|
|
198
|
+
imageUrl = _a.imageUrl,
|
|
199
|
+
imageAlt = _a.imageAlt;
|
|
203
200
|
var defaultSlot = getDefaultSlots(this);
|
|
204
|
-
|
|
205
201
|
var iconElement = function iconElement() {
|
|
206
202
|
if (imageUrl) {
|
|
207
203
|
return h("img", {
|
|
@@ -233,10 +229,8 @@ var ButtonVue2 = {
|
|
|
233
229
|
"class": iconClass
|
|
234
230
|
});
|
|
235
231
|
}
|
|
236
|
-
|
|
237
232
|
return null;
|
|
238
233
|
};
|
|
239
|
-
|
|
240
234
|
return h("button", {
|
|
241
235
|
"class": this.buttonClasses,
|
|
242
236
|
onClick: this.handleClick,
|
|
@@ -277,6 +271,5 @@ var ButtonVue2 = {
|
|
|
277
271
|
/**
|
|
278
272
|
* @hidden
|
|
279
273
|
*/
|
|
280
|
-
|
|
281
274
|
var Button = ButtonVue2;
|
|
282
275
|
export { Button, ButtonVue2 };
|
package/dist/es/ButtonGroup.js
CHANGED
|
@@ -11,7 +11,6 @@ var styles = util.styles;
|
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
var ButtonGroupVue2 = {
|
|
16
15
|
name: 'KendoButtonGroup',
|
|
17
16
|
props: {
|
|
@@ -40,13 +39,10 @@ var ButtonGroupVue2 = {
|
|
|
40
39
|
// @ts-ignore
|
|
41
40
|
render: function render(createElement) {
|
|
42
41
|
var _a;
|
|
43
|
-
|
|
44
42
|
var h = gh || createElement;
|
|
45
43
|
var defaultSlot = getDefaultSlots(this);
|
|
46
|
-
|
|
47
44
|
var renderButton = function renderButton(child, index, isLast, isRtl) {
|
|
48
45
|
var _a;
|
|
49
|
-
|
|
50
46
|
var className = classNames((_a = {}, _a[styles['state-disabled']] = this.$props.disabled, _a[styles['group-start']] = isRtl ? isLast : index === 0, _a[styles['group-end']] = isRtl ? index === 0 : isLast, _a));
|
|
51
47
|
return h(ButtonWrap, {
|
|
52
48
|
class: className,
|
|
@@ -58,27 +54,24 @@ var ButtonGroupVue2 = {
|
|
|
58
54
|
return [child];
|
|
59
55
|
} : [child]);
|
|
60
56
|
};
|
|
61
|
-
|
|
62
57
|
var mapButtons = function mapButtons(children) {
|
|
63
58
|
var _this = this;
|
|
64
|
-
|
|
65
59
|
var count = children.length;
|
|
66
60
|
var rtl = this.$props.dir !== undefined ? this.$props.dir === 'rtl' : this.$el && getComputedStyle(this.$el).direction === 'rtl' || false;
|
|
67
61
|
return children.map(function (child, index) {
|
|
68
62
|
if (_this.isValidButton(child)) {
|
|
69
63
|
return renderButton.call(_this, child, index, index === count - 1, rtl);
|
|
70
64
|
}
|
|
71
|
-
|
|
72
65
|
return child;
|
|
73
66
|
});
|
|
74
67
|
};
|
|
75
|
-
|
|
76
68
|
var groupClasses = classNames([styles['button-group']], (_a = {}, _a['k-disabled'] = this.$props.disabled, _a[styles['button-group-stretched']] = !!this.$props.width, _a));
|
|
77
69
|
return h("div", {
|
|
78
70
|
style: {
|
|
79
71
|
width: this.width
|
|
80
72
|
},
|
|
81
|
-
dir: this.$props.dir
|
|
73
|
+
dir: this.$props.dir
|
|
74
|
+
// Accessibility properties
|
|
82
75
|
,
|
|
83
76
|
attrs: this.v3 ? undefined : {
|
|
84
77
|
dir: this.$props.dir,
|
|
@@ -99,6 +92,5 @@ var ButtonGroupVue2 = {
|
|
|
99
92
|
/**
|
|
100
93
|
* @hidden
|
|
101
94
|
*/
|
|
102
|
-
|
|
103
95
|
var ButtonGroup = ButtonGroupVue2;
|
|
104
96
|
export { ButtonGroup, ButtonGroupVue2 };
|
package/dist/es/ButtonWrap.js
CHANGED
|
@@ -7,7 +7,6 @@ import { getDefaultSlots } from '@progress/kendo-vue-common';
|
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
var ButtonWrapVue2 = {
|
|
12
11
|
name: 'KendoButtonWrap',
|
|
13
12
|
props: {},
|
|
@@ -28,6 +27,5 @@ var ButtonWrapVue2 = {
|
|
|
28
27
|
/**
|
|
29
28
|
* @hidden
|
|
30
29
|
*/
|
|
31
|
-
|
|
32
30
|
var ButtonWrap = ButtonWrapVue2;
|
|
33
31
|
export { ButtonWrap, ButtonWrapVue2 };
|
package/dist/es/Chip/Chip.js
CHANGED
|
@@ -12,7 +12,6 @@ import { packageMetadata } from '../package-metadata';
|
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
var ChipVue2 = {
|
|
17
16
|
name: 'KendoVueChip',
|
|
18
17
|
props: {
|
|
@@ -128,7 +127,6 @@ var ChipVue2 = {
|
|
|
128
127
|
computed: {
|
|
129
128
|
currentSelected: function currentSelected() {
|
|
130
129
|
var _this = this;
|
|
131
|
-
|
|
132
130
|
return this.$props.selected || (Array.isArray(this.kendoSelection.value) ? this.kendoSelection.value.some(function (i) {
|
|
133
131
|
return i === _this.$props.value;
|
|
134
132
|
}) : this.kendoSelection.value === this.$props.value);
|
|
@@ -146,7 +144,6 @@ var ChipVue2 = {
|
|
|
146
144
|
event: event
|
|
147
145
|
});
|
|
148
146
|
}
|
|
149
|
-
|
|
150
147
|
this.$emit('click', {
|
|
151
148
|
target: this.target,
|
|
152
149
|
event: event
|
|
@@ -154,11 +151,9 @@ var ChipVue2 = {
|
|
|
154
151
|
},
|
|
155
152
|
handleRemove: function handleRemove(event) {
|
|
156
153
|
event.stopPropagation();
|
|
157
|
-
|
|
158
154
|
if (!this.$props.removable) {
|
|
159
155
|
return;
|
|
160
156
|
}
|
|
161
|
-
|
|
162
157
|
if (this.handleDispatchFocus) {
|
|
163
158
|
this.handleDispatchDataItems({
|
|
164
159
|
type: DATA_ACTION.remove,
|
|
@@ -176,7 +171,6 @@ var ChipVue2 = {
|
|
|
176
171
|
event: event
|
|
177
172
|
});
|
|
178
173
|
}
|
|
179
|
-
|
|
180
174
|
this.$emit('remove', {
|
|
181
175
|
target: this.target,
|
|
182
176
|
event: event
|
|
@@ -192,9 +186,7 @@ var ChipVue2 = {
|
|
|
192
186
|
event: event
|
|
193
187
|
});
|
|
194
188
|
}
|
|
195
|
-
|
|
196
189
|
break;
|
|
197
|
-
|
|
198
190
|
case Keys.right:
|
|
199
191
|
if (this.handleDispatchFocus) {
|
|
200
192
|
this.handleDispatchFocus({
|
|
@@ -203,9 +195,7 @@ var ChipVue2 = {
|
|
|
203
195
|
event: event
|
|
204
196
|
});
|
|
205
197
|
}
|
|
206
|
-
|
|
207
198
|
break;
|
|
208
|
-
|
|
209
199
|
case Keys.enter:
|
|
210
200
|
if (this.handleDispatchFocus) {
|
|
211
201
|
this.handleDispatchSelection({
|
|
@@ -214,17 +204,13 @@ var ChipVue2 = {
|
|
|
214
204
|
event: event
|
|
215
205
|
});
|
|
216
206
|
}
|
|
217
|
-
|
|
218
207
|
break;
|
|
219
|
-
|
|
220
208
|
case Keys.delete:
|
|
221
209
|
this.handleRemove(event);
|
|
222
210
|
break;
|
|
223
|
-
|
|
224
211
|
default:
|
|
225
212
|
break;
|
|
226
213
|
}
|
|
227
|
-
|
|
228
214
|
this.$emit('keydown', {
|
|
229
215
|
target: this.target,
|
|
230
216
|
event: event
|
|
@@ -238,7 +224,6 @@ var ChipVue2 = {
|
|
|
238
224
|
event: event
|
|
239
225
|
});
|
|
240
226
|
}
|
|
241
|
-
|
|
242
227
|
this.$emit('focus', {
|
|
243
228
|
target: this.target,
|
|
244
229
|
event: event
|
|
@@ -262,15 +247,14 @@ var ChipVue2 = {
|
|
|
262
247
|
},
|
|
263
248
|
render: function render(createElement) {
|
|
264
249
|
var _a;
|
|
265
|
-
|
|
266
250
|
var h = gh || createElement;
|
|
267
251
|
var _b = this.$props,
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
252
|
+
size = _b.size,
|
|
253
|
+
rounded = _b.rounded,
|
|
254
|
+
themeColor = _b.themeColor,
|
|
255
|
+
fillMode = _b.fillMode,
|
|
256
|
+
look = _b.look,
|
|
257
|
+
type = _b.type;
|
|
274
258
|
return h("div", {
|
|
275
259
|
role: this.$props.role,
|
|
276
260
|
attrs: this.v3 ? undefined : {
|
|
@@ -333,6 +317,5 @@ var ChipVue2 = {
|
|
|
333
317
|
/**
|
|
334
318
|
* @hidden
|
|
335
319
|
*/
|
|
336
|
-
|
|
337
320
|
var Chip = ChipVue2;
|
|
338
321
|
export { Chip, ChipVue2 };
|
package/dist/es/Chip/ChipList.js
CHANGED
|
@@ -2,19 +2,15 @@ var __assign = this && this.__assign || function () {
|
|
|
2
2
|
__assign = Object.assign || function (t) {
|
|
3
3
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
4
|
s = arguments[i];
|
|
5
|
-
|
|
6
5
|
for (var p in s) {
|
|
7
6
|
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
7
|
}
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return t;
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
};
|
|
13
|
+
// @ts-ignore
|
|
18
14
|
import * as Vue from 'vue';
|
|
19
15
|
var allVue = Vue;
|
|
20
16
|
var gh = allVue.h;
|
|
@@ -29,7 +25,6 @@ import { packageMetadata } from '../package-metadata';
|
|
|
29
25
|
/**
|
|
30
26
|
* @hidden
|
|
31
27
|
*/
|
|
32
|
-
|
|
33
28
|
var ChipListVue2 = {
|
|
34
29
|
name: 'KendoVueChipList',
|
|
35
30
|
props: {
|
|
@@ -197,7 +192,6 @@ var ChipListVue2 = {
|
|
|
197
192
|
},
|
|
198
193
|
render: function render(createElement) {
|
|
199
194
|
var _a;
|
|
200
|
-
|
|
201
195
|
var h = gh || createElement;
|
|
202
196
|
var size = this.$props.size;
|
|
203
197
|
return h("div", {
|
|
@@ -220,7 +214,8 @@ var ChipListVue2 = {
|
|
|
220
214
|
"aria-describedby": this.$props.ariaDescribedBy
|
|
221
215
|
}, [this.computedDataItems.map(function (item) {
|
|
222
216
|
var chipTemplate = templateRendering.call(this, this.$props.chip, getListeners.call(this));
|
|
223
|
-
var chipDefaultRendering =
|
|
217
|
+
var chipDefaultRendering =
|
|
218
|
+
// @ts-ignore function children
|
|
224
219
|
h(Chip, {
|
|
225
220
|
role: 'option',
|
|
226
221
|
attrs: this.v3 ? undefined : {
|
|
@@ -258,6 +253,5 @@ var ChipListVue2 = {
|
|
|
258
253
|
/**
|
|
259
254
|
* @hidden
|
|
260
255
|
*/
|
|
261
|
-
|
|
262
256
|
var ChipList = ChipListVue2;
|
|
263
257
|
export { ChipList, ChipListVue2 };
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* @hidden
|
|
3
3
|
*/
|
|
4
4
|
export var DATA_ACTION;
|
|
5
|
-
|
|
6
5
|
(function (DATA_ACTION) {
|
|
7
6
|
DATA_ACTION["remove"] = "remove";
|
|
8
7
|
DATA_ACTION["add"] = "add";
|
|
@@ -11,23 +10,18 @@ export var DATA_ACTION;
|
|
|
11
10
|
/**
|
|
12
11
|
* @hidden
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
13
|
export var dataReducer = function dataReducer(state, action) {
|
|
17
14
|
switch (action.type) {
|
|
18
15
|
case DATA_ACTION.add:
|
|
19
16
|
// TODO v2
|
|
20
17
|
break;
|
|
21
|
-
|
|
22
18
|
case DATA_ACTION.remove:
|
|
23
19
|
return state.filter(function (i) {
|
|
24
20
|
return i[action.valueField] !== action.payload;
|
|
25
21
|
});
|
|
26
|
-
|
|
27
22
|
case DATA_ACTION.reorder:
|
|
28
23
|
// TODO v2
|
|
29
24
|
break;
|
|
30
|
-
|
|
31
25
|
default:
|
|
32
26
|
return state;
|
|
33
27
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* @hidden
|
|
3
3
|
*/
|
|
4
4
|
export var FOCUS_ACTION;
|
|
5
|
-
|
|
6
5
|
(function (FOCUS_ACTION) {
|
|
7
6
|
FOCUS_ACTION["next"] = "next";
|
|
8
7
|
FOCUS_ACTION["prev"] = "prev";
|
|
@@ -12,26 +11,19 @@ export var FOCUS_ACTION;
|
|
|
12
11
|
/**
|
|
13
12
|
* @hidden
|
|
14
13
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
14
|
export var focusReducer = function focusReducer(state, action) {
|
|
18
15
|
var currentIndex = action.items.findIndex(function (i) {
|
|
19
16
|
return i === state;
|
|
20
17
|
});
|
|
21
|
-
|
|
22
18
|
switch (action.type) {
|
|
23
19
|
case FOCUS_ACTION.next:
|
|
24
20
|
return currentIndex === action.items.length - 1 ? state : action.items[currentIndex + 1];
|
|
25
|
-
|
|
26
21
|
case FOCUS_ACTION.prev:
|
|
27
22
|
return currentIndex === 0 ? state : action.items[currentIndex - 1];
|
|
28
|
-
|
|
29
23
|
case FOCUS_ACTION.current:
|
|
30
24
|
return action.payload;
|
|
31
|
-
|
|
32
25
|
case FOCUS_ACTION.reset:
|
|
33
26
|
return null;
|
|
34
|
-
|
|
35
27
|
default:
|
|
36
28
|
return state;
|
|
37
29
|
}
|
|
@@ -10,10 +10,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
10
10
|
/**
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
13
|
export var SELECTION_TYPE;
|
|
16
|
-
|
|
17
14
|
(function (SELECTION_TYPE) {
|
|
18
15
|
SELECTION_TYPE["single"] = "single";
|
|
19
16
|
SELECTION_TYPE["multiple"] = "multiple";
|
|
@@ -22,10 +19,7 @@ export var SELECTION_TYPE;
|
|
|
22
19
|
/**
|
|
23
20
|
* @hidden
|
|
24
21
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
22
|
export var SELECTION_ACTION;
|
|
28
|
-
|
|
29
23
|
(function (SELECTION_ACTION) {
|
|
30
24
|
SELECTION_ACTION["toggle"] = "toggle";
|
|
31
25
|
SELECTION_ACTION["remove"] = "remove";
|
|
@@ -33,8 +27,6 @@ export var SELECTION_ACTION;
|
|
|
33
27
|
/**
|
|
34
28
|
* @hidden
|
|
35
29
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
30
|
export var selectionReducer = function selectionReducer(state, action) {
|
|
39
31
|
switch (action.selection) {
|
|
40
32
|
case SELECTION_TYPE.single:
|
|
@@ -44,19 +36,15 @@ export var selectionReducer = function selectionReducer(state, action) {
|
|
|
44
36
|
if (!Array.isArray(state) || state === null) {
|
|
45
37
|
return action.payload === state ? null : action.payload;
|
|
46
38
|
}
|
|
47
|
-
|
|
48
39
|
throw new Error('State cannot be an array in single selection');
|
|
49
40
|
}
|
|
50
|
-
|
|
51
41
|
case SELECTION_ACTION.remove:
|
|
52
42
|
{
|
|
53
43
|
return action.payload === state ? null : state;
|
|
54
44
|
}
|
|
55
|
-
|
|
56
45
|
default:
|
|
57
46
|
return state;
|
|
58
47
|
}
|
|
59
|
-
|
|
60
48
|
case SELECTION_TYPE.multiple:
|
|
61
49
|
switch (action.type) {
|
|
62
50
|
case SELECTION_ACTION.toggle:
|
|
@@ -68,14 +56,11 @@ export var selectionReducer = function selectionReducer(state, action) {
|
|
|
68
56
|
return i !== action.payload;
|
|
69
57
|
}) : __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
70
58
|
}
|
|
71
|
-
|
|
72
59
|
if (state === null) {
|
|
73
60
|
return [action.payload];
|
|
74
61
|
}
|
|
75
|
-
|
|
76
62
|
throw new Error('State cannot be non-array in multiple selection');
|
|
77
63
|
}
|
|
78
|
-
|
|
79
64
|
case SELECTION_ACTION.remove:
|
|
80
65
|
{
|
|
81
66
|
if (Array.isArray(state)) {
|
|
@@ -85,17 +70,13 @@ export var selectionReducer = function selectionReducer(state, action) {
|
|
|
85
70
|
return i !== action.payload;
|
|
86
71
|
}) : __spreadArray(__spreadArray([], state, true), [action.payload], false);
|
|
87
72
|
}
|
|
88
|
-
|
|
89
73
|
return state;
|
|
90
74
|
}
|
|
91
|
-
|
|
92
75
|
default:
|
|
93
76
|
return state;
|
|
94
77
|
}
|
|
95
|
-
|
|
96
78
|
case SELECTION_TYPE.none:
|
|
97
79
|
return null;
|
|
98
|
-
|
|
99
80
|
default:
|
|
100
81
|
return state;
|
|
101
82
|
}
|
|
@@ -12,7 +12,6 @@ import { Popup } from '@progress/kendo-vue-popup';
|
|
|
12
12
|
/**
|
|
13
13
|
* @hidden
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
var FloatingActionButtonVue2 = {
|
|
17
16
|
name: 'KendoVueFloatingActionButton',
|
|
18
17
|
props: {
|
|
@@ -116,14 +115,12 @@ var FloatingActionButtonVue2 = {
|
|
|
116
115
|
this.popup = getRef(this, 'popup');
|
|
117
116
|
this.currentDir = this.$props.dir !== undefined ? this.$props.dir : this.$el && getComputedStyle(this.$el).direction === 'rtl' || false;
|
|
118
117
|
this.isRtl = this.currentDir === 'rtl';
|
|
119
|
-
|
|
120
118
|
if (this.opened !== undefined) {
|
|
121
119
|
position(this.$el, this.$props.align, this.$props.alignOffset, this.isRtl);
|
|
122
120
|
}
|
|
123
121
|
},
|
|
124
122
|
updated: function updated() {
|
|
125
123
|
position(this.$el, this.$props.align, this.$props.alignOffset, this.isRtl);
|
|
126
|
-
|
|
127
124
|
if (this.currentFocused && this.element) {
|
|
128
125
|
this.element.focus();
|
|
129
126
|
}
|
|
@@ -131,14 +128,13 @@ var FloatingActionButtonVue2 = {
|
|
|
131
128
|
computed: {
|
|
132
129
|
buttonClassNames: function buttonClassNames() {
|
|
133
130
|
var _a;
|
|
134
|
-
|
|
135
131
|
var _b = this.$props,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
132
|
+
size = _b.size,
|
|
133
|
+
icon = _b.icon,
|
|
134
|
+
shape = _b.shape,
|
|
135
|
+
themeColor = _b.themeColor,
|
|
136
|
+
fillMode = _b.fillMode,
|
|
137
|
+
rounded = _b.rounded;
|
|
142
138
|
return _a = {
|
|
143
139
|
'k-fab': true
|
|
144
140
|
}, _a["k-fab-".concat(shape || 'rectangle')] = shape !== null, _a["k-fab-".concat(kendoThemeMaps.sizeMap[size] || size)] = size, _a["k-rounded-".concat(kendoThemeMaps.roundedMap[rounded] || rounded)] = rounded, _a["k-fab-".concat(fillMode)] = fillMode, _a["k-fab-".concat(fillMode, "-").concat(themeColor)] = fillMode && themeColor, _a['k-disabled'] = this.$props.disabled, _a['k-focus'] = this.currentFocused, _a["k-".concat(this.$props.align.vertical, "-").concat(this.$props.align.horizontal)] = true, _a;
|
|
@@ -158,7 +154,6 @@ var FloatingActionButtonVue2 = {
|
|
|
158
154
|
if (!this.$props.items) {
|
|
159
155
|
return;
|
|
160
156
|
}
|
|
161
|
-
|
|
162
157
|
this.$emit(isOpen ? 'open' : 'close', {
|
|
163
158
|
event: dispatchedEvent,
|
|
164
159
|
isOpened: !isOpen
|
|
@@ -168,7 +163,6 @@ var FloatingActionButtonVue2 = {
|
|
|
168
163
|
if (!event.target || this.$props.disabled) {
|
|
169
164
|
return;
|
|
170
165
|
}
|
|
171
|
-
|
|
172
166
|
if (!this.$props.items) {
|
|
173
167
|
this.$emit('click', event, undefined);
|
|
174
168
|
} else {
|
|
@@ -190,7 +184,6 @@ var FloatingActionButtonVue2 = {
|
|
|
190
184
|
this.focusedIndex = -1;
|
|
191
185
|
this.$emit('blur', event, undefined);
|
|
192
186
|
var fireCloseEvent = this.computedOpened;
|
|
193
|
-
|
|
194
187
|
if (fireCloseEvent) {
|
|
195
188
|
this.dispatchPopupEvent(event, false);
|
|
196
189
|
}
|
|
@@ -206,7 +199,6 @@ var FloatingActionButtonVue2 = {
|
|
|
206
199
|
if (!this.$props.items) {
|
|
207
200
|
return;
|
|
208
201
|
}
|
|
209
|
-
|
|
210
202
|
if (!this.$props.items[index].disabled) {
|
|
211
203
|
this.$emit('itemclick', dispatchedEvent, {
|
|
212
204
|
itemProps: this.$props.items[index],
|
|
@@ -218,7 +210,6 @@ var FloatingActionButtonVue2 = {
|
|
|
218
210
|
if (!event.target || !this.$props.items) {
|
|
219
211
|
return;
|
|
220
212
|
}
|
|
221
|
-
|
|
222
213
|
this.focusedIndex = clickedItemIndex;
|
|
223
214
|
this.currentOpened = false;
|
|
224
215
|
this.dispatchItemClickEvent(event, clickedItemIndex);
|
|
@@ -233,67 +224,52 @@ var FloatingActionButtonVue2 = {
|
|
|
233
224
|
var currIndex = this.focusedIndex;
|
|
234
225
|
var maxNavIndex = this.$props.items ? this.$props.items.length - 1 : -1;
|
|
235
226
|
var isAtBottom = this.$props.align.vertical === 'bottom';
|
|
236
|
-
|
|
237
227
|
switch (event.keyCode) {
|
|
238
228
|
case Keys.enter:
|
|
239
229
|
case Keys.space:
|
|
240
230
|
if (currIndex >= 0) {
|
|
241
231
|
this.dispatchItemClickEvent(event, currIndex);
|
|
242
232
|
}
|
|
243
|
-
|
|
244
233
|
event.preventDefault();
|
|
245
234
|
this.currentOpened = !this.currentOpened;
|
|
246
235
|
this.focusedIndex = !this.currentOpened ? 0 : -1;
|
|
247
236
|
break;
|
|
248
|
-
|
|
249
237
|
case Keys.esc:
|
|
250
238
|
event.preventDefault();
|
|
251
239
|
this.currentOpened = false;
|
|
252
240
|
this.focusedIndex = -1;
|
|
253
241
|
break;
|
|
254
|
-
|
|
255
242
|
case Keys.home:
|
|
256
243
|
event.preventDefault();
|
|
257
244
|
this.focusedIndex = 0;
|
|
258
245
|
break;
|
|
259
|
-
|
|
260
246
|
case Keys.end:
|
|
261
247
|
event.preventDefault();
|
|
262
248
|
this.focusedIndex = maxNavIndex;
|
|
263
249
|
break;
|
|
264
|
-
|
|
265
250
|
case Keys.down:
|
|
266
251
|
case Keys.right:
|
|
267
252
|
event.preventDefault();
|
|
268
|
-
|
|
269
253
|
if (currIndex < maxNavIndex && !isAtBottom) {
|
|
270
254
|
this.focusedIndex = currIndex + 1;
|
|
271
255
|
}
|
|
272
|
-
|
|
273
256
|
if (currIndex > 0 && isAtBottom) {
|
|
274
257
|
this.focusedIndex = currIndex - 1;
|
|
275
258
|
}
|
|
276
|
-
|
|
277
259
|
break;
|
|
278
|
-
|
|
279
260
|
case Keys.up:
|
|
280
261
|
case Keys.left:
|
|
281
262
|
event.preventDefault();
|
|
282
|
-
|
|
283
263
|
if (currIndex > 0 && !isAtBottom) {
|
|
284
264
|
this.focusedIndex = currIndex - 1;
|
|
285
265
|
}
|
|
286
|
-
|
|
287
266
|
if (currIndex < maxNavIndex && isAtBottom) {
|
|
288
267
|
this.focusedIndex = currIndex + 1;
|
|
289
268
|
}
|
|
290
|
-
|
|
291
269
|
break;
|
|
292
|
-
|
|
293
270
|
default:
|
|
294
271
|
break;
|
|
295
272
|
}
|
|
296
|
-
|
|
297
273
|
this.$emit('keydown', event, undefined);
|
|
298
274
|
}
|
|
299
275
|
},
|
|
@@ -310,26 +286,24 @@ var FloatingActionButtonVue2 = {
|
|
|
310
286
|
},
|
|
311
287
|
render: function render(createElement) {
|
|
312
288
|
var _this2 = this;
|
|
313
|
-
|
|
314
289
|
var _this = this;
|
|
315
|
-
|
|
316
290
|
var h = gh || createElement;
|
|
317
291
|
var _a = this.$props,
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
292
|
+
align = _a.align,
|
|
293
|
+
disabled = _a.disabled,
|
|
294
|
+
icon = _a.icon,
|
|
295
|
+
iconClass = _a.iconClass,
|
|
296
|
+
id = _a.id,
|
|
297
|
+
items = _a.items,
|
|
298
|
+
text = _a.text,
|
|
299
|
+
tabIndex = _a.tabIndex,
|
|
300
|
+
accessKey = _a.accessKey,
|
|
301
|
+
popupSettings = _a.popupSettings;
|
|
328
302
|
var item = templateRendering.call(this, this.$props.item, getListeners.call(this));
|
|
329
|
-
|
|
330
303
|
var fabItems = function fabItems() {
|
|
331
304
|
return items && items.map(function (element, index) {
|
|
332
|
-
return (
|
|
305
|
+
return (
|
|
306
|
+
// @ts-ignore function children
|
|
333
307
|
h(FloatingActionButtonItem, {
|
|
334
308
|
key: index,
|
|
335
309
|
index: index,
|
|
@@ -357,7 +331,6 @@ var FloatingActionButtonVue2 = {
|
|
|
357
331
|
);
|
|
358
332
|
}, this);
|
|
359
333
|
};
|
|
360
|
-
|
|
361
334
|
var isIconFab = icon && !text;
|
|
362
335
|
var fabWidth = this.element ? this.element.offsetWidth : 0;
|
|
363
336
|
var iconWidth = 32;
|
|
@@ -425,7 +398,8 @@ var FloatingActionButtonVue2 = {
|
|
|
425
398
|
"class": iconClass
|
|
426
399
|
}) : null, text && h("span", {
|
|
427
400
|
"class": "k-fab-text"
|
|
428
|
-
}, [text])]),
|
|
401
|
+
}, [text])]),
|
|
402
|
+
// @ts-ignore function children
|
|
429
403
|
h(Popup, {
|
|
430
404
|
ref: setRef(this, 'popup'),
|
|
431
405
|
show: this.computedOpened,
|
|
@@ -489,6 +463,5 @@ var FloatingActionButtonVue2 = {
|
|
|
489
463
|
/**
|
|
490
464
|
* @hidden
|
|
491
465
|
*/
|
|
492
|
-
|
|
493
466
|
var FloatingActionButton = FloatingActionButtonVue2;
|
|
494
467
|
export { FloatingActionButton, FloatingActionButtonVue2 };
|